Merge changes from topic "wear_stem_upstream" into main
* changes:
Use status bar to launch assistant.
Add a new button behavior for STEM short press
diff --git a/AconfigFlags.bp b/AconfigFlags.bp
new file mode 100644
index 0000000..b753aab
--- /dev/null
+++ b/AconfigFlags.bp
@@ -0,0 +1,58 @@
+// 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.
+
+// Aconfig declarations and libraries for the core framework
+java_defaults {
+ name: "framework-minus-apex-aconfig-libraries",
+
+ // Add java_aconfig_libraries to here to add them to the core framework
+ srcs: [
+ ":com.android.hardware.camera2-aconfig-java{.generated_srcjars}",
+ ":com.android.window.flags.window-aconfig-java{.generated_srcjars}",
+ ],
+}
+
+// Default flags for java_aconfig_libraries that go into framework-minus-apex
+// These libraries will not work standalone
+java_defaults {
+ name: "framework-minus-apex-aconfig-java-defaults",
+ sdk_version: "core_platform",
+ libs: ["fake_device_config"],
+}
+
+// Camera
+aconfig_declarations {
+ name: "com.android.hardware.camera2-aconfig",
+ package: "com.android.hardware.camera2",
+ srcs: ["core/java/android/hardware/camera2/camera_platform.aconfig"],
+}
+
+java_aconfig_library {
+ name: "com.android.hardware.camera2-aconfig-java",
+ aconfig_declarations: "com.android.hardware.camera2-aconfig",
+ defaults: ["framework-minus-apex-aconfig-java-defaults"],
+}
+
+// Window
+aconfig_declarations {
+ name: "com.android.window.flags.window-aconfig",
+ package: "com.android.window.flags",
+ srcs: ["core/java/android/window/flags/*.aconfig"],
+}
+
+java_aconfig_library {
+ name: "com.android.window.flags.window-aconfig-java",
+ aconfig_declarations: "com.android.window.flags.window-aconfig",
+ defaults: ["framework-minus-apex-aconfig-java-defaults"],
+}
diff --git a/Android.bp b/Android.bp
index be589b2..53554bc 100644
--- a/Android.bp
+++ b/Android.bp
@@ -267,6 +267,7 @@
defaults: [
"framework-aidl-export-defaults",
"latest_android_hardware_soundtrigger3_java_static",
+ "framework-minus-apex-aconfig-libraries",
],
srcs: [
":framework-non-updatable-sources",
@@ -701,6 +702,7 @@
}
build = [
+ "AconfigFlags.bp",
"ProtoLibraries.bp",
"TestProtoLibraries.bp",
]
diff --git a/OWNERS b/OWNERS
index 8ee488d..6c25324 100644
--- a/OWNERS
+++ b/OWNERS
@@ -16,8 +16,6 @@
ogunwale@google.com #{LAST_RESORT_SUGGESTION}
roosa@google.com #{LAST_RESORT_SUGGESTION}
smoreland@google.com #{LAST_RESORT_SUGGESTION}
-svetoslavganov@android.com #{LAST_RESORT_SUGGESTION}
-svetoslavganov@google.com #{LAST_RESORT_SUGGESTION}
yamasani@google.com #{LAST_RESORT_SUGGESTION}
# API changes are already covered by API-Review+1 (http://mdb/android-api-council)
@@ -30,7 +28,7 @@
# Support bulk translation updates
per-file */res*/values*/*.xml = byi@google.com, delphij@google.com
-per-file **.bp,**.mk = hansson@google.com
+per-file **.bp,**.mk = hansson@google.com, joeo@google.com
per-file TestProtoLibraries.bp = file:platform/platform_testing:/libraries/health/OWNERS
per-file TestProtoLibraries.bp = file:platform/tools/tradefederation:/OWNERS
diff --git a/apct-tests/perftests/core/src/android/graphics/perftests/TypefaceSerializationPerfTest.java b/apct-tests/perftests/core/src/android/graphics/perftests/TypefaceSerializationPerfTest.java
index bc8fc53..2de6f36 100644
--- a/apct-tests/perftests/core/src/android/graphics/perftests/TypefaceSerializationPerfTest.java
+++ b/apct-tests/perftests/core/src/android/graphics/perftests/TypefaceSerializationPerfTest.java
@@ -147,28 +147,4 @@
out.clear();
}
}
-
- @ManualBenchmarkState.ManualBenchmarkTest(
- warmupDurationNs = WARMUP_DURATION_NS,
- targetTestDurationNs = TARGET_TEST_DURATION_NS)
- @Test
- public void testSetSystemFontMap() throws Exception {
- SharedMemory memory = null;
- ManualBenchmarkState state = mPerfManualStatusReporter.getBenchmarkState();
-
- long elapsedTime = 0;
- while (state.keepRunning(elapsedTime)) {
- // Explicitly destroy lazy-loaded typefaces, so that we don't hit the mmap limit
- // (max_map_count).
- Typeface.destroySystemFontMap();
- Typeface.loadPreinstalledSystemFontMap();
- if (memory != null) {
- memory.close();
- }
- memory = Typeface.serializeFontMap(Typeface.getSystemFontMap());
- long startTime = System.nanoTime();
- Typeface.setSystemFontMap(memory);
- elapsedTime = System.nanoTime() - startTime;
- }
- }
}
diff --git a/apex/jobscheduler/framework/java/android/app/job/JobInfo.java b/apex/jobscheduler/framework/java/android/app/job/JobInfo.java
index 3a05323..5dc994e 100644
--- a/apex/jobscheduler/framework/java/android/app/job/JobInfo.java
+++ b/apex/jobscheduler/framework/java/android/app/job/JobInfo.java
@@ -371,7 +371,7 @@
/**
* Allows this job to run despite doze restrictions as long as the app is in the foreground
- * or on the temporary whitelist
+ * or on the temporary allowlist
* @hide
*/
public static final int FLAG_IMPORTANT_WHILE_FOREGROUND = 1 << 1;
@@ -2044,13 +2044,13 @@
/**
* Setting this to true indicates that this job is important while the scheduling app
- * is in the foreground or on the temporary whitelist for background restrictions.
+ * is in the foreground or on the temporary allowlist for background restrictions.
* This means that the system will relax doze restrictions on this job during this time.
*
* Apps should use this flag only for short jobs that are essential for the app to function
* properly in the foreground.
*
- * Note that once the scheduling app is no longer whitelisted from background restrictions
+ * Note that once the scheduling app is no longer allowlisted from background restrictions
* and in the background, or the job failed due to unsatisfied constraints,
* this job should be expected to behave like other jobs without this flag.
*
diff --git a/apex/jobscheduler/framework/java/android/os/PowerWhitelistManager.java b/apex/jobscheduler/framework/java/android/os/PowerWhitelistManager.java
index 4ce31e9..20da171 100644
--- a/apex/jobscheduler/framework/java/android/os/PowerWhitelistManager.java
+++ b/apex/jobscheduler/framework/java/android/os/PowerWhitelistManager.java
@@ -29,10 +29,10 @@
import java.util.List;
/**
- * Interface to access and modify the permanent and temporary power save whitelist. The two lists
- * are kept separately. Apps placed on the permanent whitelist are only removed via an explicit
- * removeFromWhitelist call. Apps whitelisted by default by the system cannot be removed. Apps
- * placed on the temporary whitelist are removed from that whitelist after a predetermined amount of
+ * Interface to access and modify the permanent and temporary power save allowlist. The two lists
+ * are kept separately. Apps placed on the permanent allowlist are only removed via an explicit
+ * removeFromAllowlist call. Apps whitelisted by default by the system cannot be removed. Apps
+ * placed on the temporary allowlist are removed from that allowlist after a predetermined amount of
* time.
*
* @deprecated Use {@link PowerExemptionManager} instead
@@ -50,18 +50,18 @@
private final PowerExemptionManager mPowerExemptionManager;
/**
- * Indicates that an unforeseen event has occurred and the app should be whitelisted to handle
+ * Indicates that an unforeseen event has occurred and the app should be allowlisted to handle
* it.
*/
public static final int EVENT_UNSPECIFIED = PowerExemptionManager.EVENT_UNSPECIFIED;
/**
- * Indicates that an SMS event has occurred and the app should be whitelisted to handle it.
+ * Indicates that an SMS event has occurred and the app should be allowlisted to handle it.
*/
public static final int EVENT_SMS = PowerExemptionManager.EVENT_SMS;
/**
- * Indicates that an MMS event has occurred and the app should be whitelisted to handle it.
+ * Indicates that an MMS event has occurred and the app should be allowlisted to handle it.
*/
public static final int EVENT_MMS = PowerExemptionManager.EVENT_MMS;
@@ -381,7 +381,7 @@
}
/**
- * Add the specified package to the permanent power save whitelist.
+ * Add the specified package to the permanent power save allowlist.
*
* @deprecated Use {@link PowerExemptionManager#addToPermanentAllowList(String)} instead
*/
@@ -392,7 +392,7 @@
}
/**
- * Add the specified packages to the permanent power save whitelist.
+ * Add the specified packages to the permanent power save allowlist.
*
* @deprecated Use {@link PowerExemptionManager#addToPermanentAllowList(List)} instead
*/
@@ -403,10 +403,10 @@
}
/**
- * Get a list of app IDs of app that are whitelisted. This does not include temporarily
- * whitelisted apps.
+ * Get a list of app IDs of app that are allowlisted. This does not include temporarily
+ * allowlisted apps.
*
- * @param includingIdle Set to true if the app should be whitelisted from device idle as well
+ * @param includingIdle Set to true if the app should be allowlisted from device idle as well
* as other power save restrictions
* @deprecated Use {@link PowerExemptionManager#getAllowListedAppIds(boolean)} instead
* @hide
@@ -418,10 +418,10 @@
}
/**
- * Returns true if the app is whitelisted from power save restrictions. This does not include
- * temporarily whitelisted apps.
+ * Returns true if the app is allowlisted from power save restrictions. This does not include
+ * temporarily allowlisted apps.
*
- * @param includingIdle Set to true if the app should be whitelisted from device
+ * @param includingIdle Set to true if the app should be allowlisted from device
* idle as well as other power save restrictions
* @deprecated Use {@link PowerExemptionManager#isAllowListed(String, boolean)} instead
* @hide
@@ -432,11 +432,11 @@
}
/**
- * Remove an app from the permanent power save whitelist. Only apps that were added via
+ * Remove an app from the permanent power save allowlist. Only apps that were added via
* {@link #addToWhitelist(String)} or {@link #addToWhitelist(List)} will be removed. Apps
- * whitelisted by default by the system cannot be removed.
+ * allowlisted by default by the system cannot be removed.
*
- * @param packageName The app to remove from the whitelist
+ * @param packageName The app to remove from the allowlist
* @deprecated Use {@link PowerExemptionManager#removeFromPermanentAllowList(String)} instead
*/
@Deprecated
@@ -446,10 +446,10 @@
}
/**
- * Add an app to the temporary whitelist for a short amount of time.
+ * Add an app to the temporary allowlist for a short amount of time.
*
- * @param packageName The package to add to the temp whitelist
- * @param durationMs How long to keep the app on the temp whitelist for (in milliseconds)
+ * @param packageName The package to add to the temp allowlist
+ * @param durationMs How long to keep the app on the temp allowlist for (in milliseconds)
* @param reasonCode one of {@link ReasonCode}, use {@link #REASON_UNKNOWN} if not sure.
* @param reason a optional human readable reason string, could be null or empty string.
* @deprecated Use {@link PowerExemptionManager#addToTemporaryAllowList(
@@ -463,10 +463,10 @@
}
/**
- * Add an app to the temporary whitelist for a short amount of time.
+ * Add an app to the temporary allowlist for a short amount of time.
*
- * @param packageName The package to add to the temp whitelist
- * @param durationMs How long to keep the app on the temp whitelist for (in milliseconds)
+ * @param packageName The package to add to the temp allowlist
+ * @param durationMs How long to keep the app on the temp allowlist for (in milliseconds)
* @deprecated Use {@link PowerExemptionManager#addToTemporaryAllowList(
* String, int, String, long)} instead
*/
@@ -478,15 +478,15 @@
}
/**
- * Add an app to the temporary whitelist for a short amount of time for a specific reason. The
- * temporary whitelist is kept separately from the permanent whitelist and apps are
- * automatically removed from the temporary whitelist after a predetermined amount of time.
+ * Add an app to the temporary allowlist for a short amount of time for a specific reason. The
+ * temporary allowlist is kept separately from the permanent allowlist and apps are
+ * automatically removed from the temporary allowlist after a predetermined amount of time.
*
- * @param packageName The package to add to the temp whitelist
- * @param event The reason to add the app to the temp whitelist
- * @param reason A human-readable reason explaining why the app is temp whitelisted. Only
+ * @param packageName The package to add to the temp allowlist
+ * @param event The reason to add the app to the temp allowlist
+ * @param reason A human-readable reason explaining why the app is temp allowlisted. Only
* used for logging purposes. Could be null or empty string.
- * @return The duration (in milliseconds) that the app is whitelisted for
+ * @return The duration (in milliseconds) that the app is allowlisted for
* @deprecated Use {@link PowerExemptionManager#addToTemporaryAllowListForEvent(
* String, int, String, int)} instead
*/
@@ -499,16 +499,16 @@
}
/**
- * Add an app to the temporary whitelist for a short amount of time for a specific reason. The
- * temporary whitelist is kept separately from the permanent whitelist and apps are
- * automatically removed from the temporary whitelist after a predetermined amount of time.
+ * Add an app to the temporary allowlist for a short amount of time for a specific reason. The
+ * temporary allowlist is kept separately from the permanent allowlist and apps are
+ * automatically removed from the temporary allowlist after a predetermined amount of time.
*
- * @param packageName The package to add to the temp whitelist
- * @param event The reason to add the app to the temp whitelist
+ * @param packageName The package to add to the temp allowlist
+ * @param event The reason to add the app to the temp allowlist
* @param reasonCode one of {@link ReasonCode}, use {@link #REASON_UNKNOWN} if not sure.
- * @param reason A human-readable reason explaining why the app is temp whitelisted. Only
+ * @param reason A human-readable reason explaining why the app is temp allowlisted. Only
* used for logging purposes. Could be null or empty string.
- * @return The duration (in milliseconds) that the app is whitelisted for
+ * @return The duration (in milliseconds) that the app is allowlisted for
* @deprecated Use {@link PowerExemptionManager#addToTemporaryAllowListForEvent(
* String, int, String, int)} instead
*/
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 098b2fb..d48d84b 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/JobStore.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/JobStore.java
@@ -1118,6 +1118,7 @@
}
boolean needFileMigration = false;
long nowElapsed = sElapsedRealtimeClock.millis();
+ int numDuplicates = 0;
synchronized (mLock) {
for (File file : files) {
final AtomicFile aFile = createJobFile(file);
@@ -1126,6 +1127,16 @@
if (jobs != null) {
for (int i = 0; i < jobs.size(); i++) {
JobStatus js = jobs.get(i);
+ final JobStatus existingJob = this.jobSet.get(
+ js.getUid(), js.getNamespace(), js.getJobId());
+ if (existingJob != null) {
+ numDuplicates++;
+ // Jobs are meant to have unique uid-namespace-jobId
+ // combinations, but we've somehow read multiple jobs with the
+ // combination. Drop the latter one since keeping both will
+ // result in other issues.
+ continue;
+ }
js.prepareLocked();
js.enqueueTime = nowElapsed;
this.jobSet.add(js);
@@ -1174,6 +1185,10 @@
migrateJobFilesAsync();
}
+ if (numDuplicates > 0) {
+ Slog.wtf(TAG, "Encountered " + numDuplicates + " duplicate persisted jobs");
+ }
+
// Log the count immediately after loading from boot.
mCurrentJobSetSize = numJobs;
mScheduledJob30MinHighWaterMark = mCurrentJobSetSize;
diff --git a/api/Android.bp b/api/Android.bp
index c16bce5..e9cc405 100644
--- a/api/Android.bp
+++ b/api/Android.bp
@@ -83,6 +83,7 @@
"framework-configinfrastructure",
"framework-connectivity",
"framework-connectivity-t",
+ "framework-crashrecovery",
"framework-devicelock",
"framework-graphics",
"framework-healthfitness",
@@ -104,6 +105,7 @@
system_server_classpath: [
"service-art",
"service-configinfrastructure",
+ "service-crashrecovery",
"service-healthfitness",
"service-media-s",
"service-permission",
diff --git a/api/StubLibraries.bp b/api/StubLibraries.bp
index 22cc059..c37ff97 100644
--- a/api/StubLibraries.bp
+++ b/api/StubLibraries.bp
@@ -588,6 +588,170 @@
},
}
+//
+// Java API defaults and libraries for single tree build
+//
+
+java_defaults {
+ name: "stub-annotation-defaults",
+ libs: [
+ "stub-annotations",
+ ],
+ static_libs: [
+ // stub annotations do not contribute to the API surfaces but are statically
+ // linked in the stubs for API surfaces (see frameworks/base/StubLibraries.bp).
+ // This is because annotation processors insist on loading the classes for any
+ // annotations found, thus should exist inside android.jar.
+ "private-stub-annotations-jar",
+ ],
+}
+
+// Listing of API domains contribution and dependencies per API surfaces
+java_defaults {
+ name: "android_test_stubs_current_contributions",
+ api_surface: "test",
+ api_contributions: [
+ "test-api-stubs-docs-non-updatable.api.contribution",
+ "framework-virtualization.stubs.source.test.api.contribution",
+ ],
+}
+
+java_defaults {
+ name: "android_test_frameworks_core_stubs_current_contributions",
+ api_surface: "test",
+ api_contributions: [
+ "test-api-stubs-docs-non-updatable.api.contribution",
+ ],
+}
+
+java_defaults {
+ name: "android_module_lib_stubs_current_contributions",
+ api_surface: "module-lib",
+ api_contributions: [
+ "api-stubs-docs-non-updatable.api.contribution",
+ "system-api-stubs-docs-non-updatable.api.contribution",
+ "module-lib-api-stubs-docs-non-updatable.api.contribution",
+ "art.module.public.api.stubs.source.api.contribution",
+ "art.module.public.api.stubs.source.system.api.contribution",
+ "art.module.public.api.stubs.source.module_lib.api.contribution",
+ "i18n.module.public.api.stubs.source.api.contribution",
+ "i18n.module.public.api.stubs.source.system.api.contribution",
+ "i18n.module.public.api.stubs.source.module_lib.api.contribution",
+ ],
+}
+
+// Java API library definitions per API surface
+java_api_library {
+ name: "android_stubs_current.from-text",
+ api_surface: "public",
+ defaults: [
+ // This module is dynamically created at frameworks/base/api/api.go
+ // instead of being written out, in order to minimize edits in the codebase
+ // when there is a change in the list of modules.
+ // that contributes to an api surface.
+ "android_stubs_current_contributions",
+ "stub-annotation-defaults",
+ ],
+ api_contributions: [
+ "api-stubs-docs-non-updatable.api.contribution",
+ ],
+ visibility: ["//visibility:public"],
+}
+
+java_api_library {
+ name: "android_system_stubs_current.from-text",
+ api_surface: "system",
+ defaults: [
+ "android_stubs_current_contributions",
+ "android_system_stubs_current_contributions",
+ "stub-annotation-defaults",
+ ],
+ api_contributions: [
+ "api-stubs-docs-non-updatable.api.contribution",
+ "system-api-stubs-docs-non-updatable.api.contribution",
+ ],
+ visibility: ["//visibility:public"],
+}
+
+java_api_library {
+ name: "android_test_stubs_current.from-text",
+ api_surface: "test",
+ defaults: [
+ "android_stubs_current_contributions",
+ "android_system_stubs_current_contributions",
+ "android_test_stubs_current_contributions",
+ "stub-annotation-defaults",
+ ],
+ api_contributions: [
+ "api-stubs-docs-non-updatable.api.contribution",
+ "system-api-stubs-docs-non-updatable.api.contribution",
+ ],
+ visibility: ["//visibility:public"],
+}
+
+java_api_library {
+ name: "android_test_frameworks_core_stubs_current.from-text",
+ api_surface: "test",
+ defaults: [
+ "android_stubs_current_contributions",
+ "android_system_stubs_current_contributions",
+ "android_test_frameworks_core_stubs_current_contributions",
+ "stub-annotation-defaults",
+ ],
+ api_contributions: [
+ "api-stubs-docs-non-updatable.api.contribution",
+ "system-api-stubs-docs-non-updatable.api.contribution",
+ ],
+}
+
+java_api_library {
+ name: "android_module_lib_stubs_current_full.from-text",
+ api_surface: "module-lib",
+ defaults: [
+ "android_stubs_current_contributions",
+ "android_system_stubs_current_contributions",
+ "android_module_lib_stubs_current_contributions_full",
+ ],
+ libs: [
+ "stub-annotations",
+ ],
+ api_contributions: [
+ "api-stubs-docs-non-updatable.api.contribution",
+ "system-api-stubs-docs-non-updatable.api.contribution",
+ "module-lib-api-stubs-docs-non-updatable.api.contribution",
+ ],
+ visibility: ["//visibility:public"],
+}
+
+java_api_library {
+ name: "android_module_lib_stubs_current.from-text",
+ api_surface: "module-lib",
+ defaults: [
+ "android_module_lib_stubs_current_contributions",
+ ],
+ libs: [
+ "android_module_lib_stubs_current_full.from-text",
+ "stub-annotations",
+ ],
+ visibility: ["//visibility:public"],
+}
+
+java_api_library {
+ name: "android_system_server_stubs_current.from-text",
+ api_surface: "system-server",
+ api_contributions: [
+ "services-non-updatable-stubs.api.contribution",
+ ],
+ libs: [
+ "android_module_lib_stubs_current.from-text",
+ "stub-annotations",
+ ],
+ static_libs: [
+ "android_module_lib_stubs_current.from-text",
+ ],
+ visibility: ["//visibility:public"],
+}
+
////////////////////////////////////////////////////////////////////////
// api-versions.xml generation, for public and system. This API database
// also contains the android.test.* APIs.
diff --git a/boot/Android.bp b/boot/Android.bp
index 83a46c5..93d425e 100644
--- a/boot/Android.bp
+++ b/boot/Android.bp
@@ -84,6 +84,10 @@
module: "com.android.conscrypt-bootclasspath-fragment",
},
{
+ apex: "com.android.crashrecovery",
+ module: "com.android.crashrecovery-bootclasspath-fragment",
+ },
+ {
apex: "com.android.devicelock",
module: "com.android.devicelock-bootclasspath-fragment",
},
diff --git a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
index b6dc32a..9dedf70 100644
--- a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
+++ b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
@@ -192,7 +192,7 @@
}
if ("whitelist".equals(op)) {
- doPrintWhitelist();
+ doPrintAllowlist();
return;
}
@@ -911,7 +911,7 @@
}
}
- private void doPrintWhitelist() {
+ private void doPrintAllowlist() {
try {
final String[] whitelist = mBmgr.getTransportWhitelist();
if (whitelist != null) {
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index 10ce3b8..774ba74 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -1565,6 +1565,7 @@
for (size_t i=0 ; i<pcount ; i++) {
const Animation::Part& part(animation.parts[i]);
const size_t fcount = part.frames.size();
+ glBindTexture(GL_TEXTURE_2D, 0);
// Handle animation package
if (part.animation != nullptr) {
@@ -1641,8 +1642,10 @@
if (r > 0) {
glBindTexture(GL_TEXTURE_2D, frame.tid);
} else {
- glGenTextures(1, &frame.tid);
- glBindTexture(GL_TEXTURE_2D, frame.tid);
+ if (part.count != 1) {
+ glGenTextures(1, &frame.tid);
+ glBindTexture(GL_TEXTURE_2D, frame.tid);
+ }
int w, h;
// Set decoding option to alpha unpremultiplied so that the R, G, B channels
// of transparent pixels are preserved.
diff --git a/cmds/idmap2/libidmap2/XmlParser.cpp b/cmds/idmap2/libidmap2/XmlParser.cpp
index 766ca56..1d78460 100644
--- a/cmds/idmap2/libidmap2/XmlParser.cpp
+++ b/cmds/idmap2/libidmap2/XmlParser.cpp
@@ -109,7 +109,7 @@
switch (value.dataType) {
case Res_value::TYPE_STRING: {
if (auto str = parser.getStrings().string8ObjectAt(value.data); str.ok()) {
- return std::string(str->string());
+ return std::string(str->c_str());
}
break;
}
diff --git a/core/api/current.txt b/core/api/current.txt
index 9ba84c9..cb92926 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -14341,14 +14341,14 @@
method @NonNull public static android.database.sqlite.SQLiteDatabase create(@Nullable android.database.sqlite.SQLiteDatabase.CursorFactory);
method @NonNull public static android.database.sqlite.SQLiteDatabase createInMemory(@NonNull android.database.sqlite.SQLiteDatabase.OpenParams);
method @NonNull public android.database.sqlite.SQLiteRawStatement createRawStatement(@NonNull String);
- method public int delete(String, String, String[]);
+ method public int delete(@NonNull String, @Nullable String, @Nullable String[]);
method public static boolean deleteDatabase(@NonNull java.io.File);
method public void disableWriteAheadLogging();
method public boolean enableWriteAheadLogging();
method public void endTransaction();
method public void execPerConnectionSQL(@NonNull String, @Nullable Object[]) throws android.database.SQLException;
method public void execSQL(String) throws android.database.SQLException;
- method public void execSQL(String, Object[]) throws android.database.SQLException;
+ method public void execSQL(@NonNull String, @NonNull Object[]) throws android.database.SQLException;
method public static String findEditTable(String);
method public java.util.List<android.util.Pair<java.lang.String,java.lang.String>> getAttachedDbs();
method public long getLastChangedRowCount();
@@ -14360,9 +14360,9 @@
method public long getTotalChangedRowCount();
method public int getVersion();
method public boolean inTransaction();
- method public long insert(String, String, android.content.ContentValues);
- method public long insertOrThrow(String, String, android.content.ContentValues) throws android.database.SQLException;
- method public long insertWithOnConflict(String, String, android.content.ContentValues, int);
+ method public long insert(@NonNull String, @Nullable String, @Nullable android.content.ContentValues);
+ method public long insertOrThrow(@NonNull String, @Nullable String, @Nullable android.content.ContentValues) throws android.database.SQLException;
+ method public long insertWithOnConflict(@NonNull String, @Nullable String, @Nullable android.content.ContentValues, int);
method public boolean isDatabaseIntegrityOk();
method public boolean isDbLockedByCurrentThread();
method @Deprecated public boolean isDbLockedByOtherThreads();
@@ -14379,19 +14379,19 @@
method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(@NonNull java.io.File, @Nullable android.database.sqlite.SQLiteDatabase.CursorFactory);
method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(@NonNull String, @Nullable android.database.sqlite.SQLiteDatabase.CursorFactory);
method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(@NonNull String, @Nullable android.database.sqlite.SQLiteDatabase.CursorFactory, @Nullable android.database.DatabaseErrorHandler);
- method public android.database.Cursor query(boolean, String, String[], String, String[], String, String, String, String);
- method public android.database.Cursor query(boolean, String, String[], String, String[], String, String, String, String, android.os.CancellationSignal);
- method public android.database.Cursor query(String, String[], String, String[], String, String, String);
- method public android.database.Cursor query(String, String[], String, String[], String, String, String, String);
- method public android.database.Cursor queryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, boolean, String, String[], String, String[], String, String, String, String);
- method public android.database.Cursor queryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, boolean, String, String[], String, String[], String, String, String, String, android.os.CancellationSignal);
- method public android.database.Cursor rawQuery(String, String[]);
- method public android.database.Cursor rawQuery(String, String[], android.os.CancellationSignal);
- method public android.database.Cursor rawQueryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, String, String[], String);
- method public android.database.Cursor rawQueryWithFactory(android.database.sqlite.SQLiteDatabase.CursorFactory, String, String[], String, android.os.CancellationSignal);
+ method @NonNull public android.database.Cursor query(boolean, @NonNull String, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String, @Nullable String, @Nullable String, @Nullable String);
+ method @NonNull public android.database.Cursor query(boolean, @NonNull String, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String, @Nullable String, @Nullable String, @Nullable String, @Nullable android.os.CancellationSignal);
+ method @NonNull public android.database.Cursor query(@NonNull String, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String, @Nullable String, @Nullable String);
+ method @NonNull public android.database.Cursor query(@NonNull String, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String, @Nullable String, @Nullable String, @Nullable String);
+ method @NonNull public android.database.Cursor queryWithFactory(@Nullable android.database.sqlite.SQLiteDatabase.CursorFactory, boolean, @NonNull String, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String, @Nullable String, @Nullable String, @Nullable String);
+ method @NonNull public android.database.Cursor queryWithFactory(@Nullable android.database.sqlite.SQLiteDatabase.CursorFactory, boolean, @NonNull String, @Nullable String[], @Nullable String, @Nullable String[], @Nullable String, @Nullable String, @Nullable String, @Nullable String, @Nullable android.os.CancellationSignal);
+ method @NonNull public android.database.Cursor rawQuery(@NonNull String, @Nullable String[]);
+ method @NonNull public android.database.Cursor rawQuery(@NonNull String, @Nullable String[], @Nullable android.os.CancellationSignal);
+ method @NonNull public android.database.Cursor rawQueryWithFactory(@Nullable android.database.sqlite.SQLiteDatabase.CursorFactory, @NonNull String, @Nullable String[], @NonNull String);
+ method @NonNull public android.database.Cursor rawQueryWithFactory(@Nullable android.database.sqlite.SQLiteDatabase.CursorFactory, @NonNull String, @Nullable String[], @NonNull String, @Nullable android.os.CancellationSignal);
method public static int releaseMemory();
- method public long replace(String, String, android.content.ContentValues);
- method public long replaceOrThrow(String, String, android.content.ContentValues) throws android.database.SQLException;
+ method public long replace(@NonNull String, @Nullable String, @Nullable android.content.ContentValues);
+ method public long replaceOrThrow(@NonNull String, @Nullable String, @Nullable android.content.ContentValues) throws android.database.SQLException;
method public void setCustomAggregateFunction(@NonNull String, @NonNull java.util.function.BinaryOperator<java.lang.String>) throws android.database.sqlite.SQLiteException;
method public void setCustomScalarFunction(@NonNull String, @NonNull java.util.function.UnaryOperator<java.lang.String>) throws android.database.sqlite.SQLiteException;
method public void setForeignKeyConstraintsEnabled(boolean);
@@ -14402,8 +14402,8 @@
method public void setPageSize(long);
method public void setTransactionSuccessful();
method public void setVersion(int);
- method public int update(String, android.content.ContentValues, String, String[]);
- method public int updateWithOnConflict(String, android.content.ContentValues, String, String[], int);
+ method public int update(@NonNull String, @Nullable android.content.ContentValues, @Nullable String, @Nullable String[]);
+ method public int updateWithOnConflict(@NonNull String, @Nullable android.content.ContentValues, @Nullable String, @Nullable String[], int);
method public void validateSql(@NonNull String, @Nullable android.os.CancellationSignal);
method @Deprecated public boolean yieldIfContended();
method public boolean yieldIfContendedSafely();
@@ -15651,6 +15651,7 @@
public final class Gainmap implements android.os.Parcelable {
ctor public Gainmap(@NonNull android.graphics.Bitmap);
+ ctor public Gainmap(@NonNull android.graphics.Gainmap, @NonNull android.graphics.Bitmap);
method public int describeContents();
method @NonNull public float getDisplayRatioForFullHdr();
method @NonNull public float[] getEpsilonHdr();
@@ -44882,6 +44883,7 @@
field public static final int OUT_OF_NETWORK = 11; // 0xb
field public static final int OUT_OF_SERVICE = 18; // 0x12
field public static final int POWER_OFF = 17; // 0x11
+ field public static final int SATELLITE_ENABLED = 82; // 0x52
field public static final int SERVER_ERROR = 12; // 0xc
field public static final int SERVER_UNREACHABLE = 9; // 0x9
field public static final int TIMED_OUT = 13; // 0xd
@@ -46006,6 +46008,7 @@
field public static final int ERI_FLASH = 2; // 0x2
field public static final int ERI_OFF = 1; // 0x1
field public static final int ERI_ON = 0; // 0x0
+ field public static final String EVENT_DISPLAY_SOS_MESSAGE = "android.telephony.event.DISPLAY_SOS_MESSAGE";
field public static final String EXTRA_ACTIVE_SIM_SUPPORTED_COUNT = "android.telephony.extra.ACTIVE_SIM_SUPPORTED_COUNT";
field public static final String EXTRA_APN_PROTOCOL = "android.telephony.extra.APN_PROTOCOL";
field public static final String EXTRA_APN_TYPE = "android.telephony.extra.APN_TYPE";
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 6141583..7870cee6 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -301,6 +301,7 @@
field public static final String RECOVER_KEYSTORE = "android.permission.RECOVER_KEYSTORE";
field public static final String REGISTER_CALL_PROVIDER = "android.permission.REGISTER_CALL_PROVIDER";
field public static final String REGISTER_CONNECTION_MANAGER = "android.permission.REGISTER_CONNECTION_MANAGER";
+ field public static final String REGISTER_NSD_OFFLOAD_ENGINE = "android.permission.REGISTER_NSD_OFFLOAD_ENGINE";
field public static final String REGISTER_SIM_SUBSCRIPTION = "android.permission.REGISTER_SIM_SUBSCRIPTION";
field public static final String REGISTER_STATS_PULL_ATOM = "android.permission.REGISTER_STATS_PULL_ATOM";
field public static final String REMOTE_DISPLAY_PROVIDER = "android.permission.REMOTE_DISPLAY_PROVIDER";
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index e61c39f..773d720 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -837,6 +837,23 @@
package android.companion {
+ public static final class AssociationInfo.Builder {
+ ctor public AssociationInfo.Builder(int, int, @NonNull String);
+ ctor public AssociationInfo.Builder(@NonNull android.companion.AssociationInfo);
+ method @NonNull public android.companion.AssociationInfo build();
+ method @NonNull public android.companion.AssociationInfo.Builder setAssociatedDevice(@Nullable android.companion.AssociatedDevice);
+ method @NonNull public android.companion.AssociationInfo.Builder setDeviceMacAddress(@Nullable android.net.MacAddress);
+ method @NonNull public android.companion.AssociationInfo.Builder setDeviceProfile(@Nullable String);
+ method @NonNull public android.companion.AssociationInfo.Builder setDisplayName(@Nullable CharSequence);
+ method @NonNull public android.companion.AssociationInfo.Builder setLastTimeConnected(long);
+ method @NonNull public android.companion.AssociationInfo.Builder setNotifyOnDeviceNearby(boolean);
+ method @NonNull public android.companion.AssociationInfo.Builder setRevoked(boolean);
+ method @NonNull public android.companion.AssociationInfo.Builder setSelfManaged(boolean);
+ method @NonNull public android.companion.AssociationInfo.Builder setSystemDataSyncFlags(int);
+ method @NonNull public android.companion.AssociationInfo.Builder setTag(@Nullable String);
+ method @NonNull public android.companion.AssociationInfo.Builder setTimeApproved(long);
+ }
+
public final class CompanionDeviceManager {
method @RequiresPermission("android.permission.MANAGE_COMPANION_DEVICES") public void enableSecureTransport(boolean);
field public static final int MESSAGE_REQUEST_PING = 1669362552; // 0x63807378
@@ -1877,6 +1894,8 @@
public class AudioManager {
method @RequiresPermission("android.permission.QUERY_AUDIO_STATE") public int abandonAudioFocusForTest(@NonNull android.media.AudioFocusRequest, @NonNull String);
+ method @RequiresPermission("Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED") public boolean enterAudioFocusFreezeForTest(@NonNull java.util.List<java.lang.Integer>);
+ method @RequiresPermission("Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED") public boolean exitAudioFocusFreezeForTest();
method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public void forceComputeCsdOnAllDevices(boolean);
method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public void forceUseFrameworkMel(boolean);
method @NonNull @RequiresPermission(android.Manifest.permission.CALL_AUDIO_INTERCEPTION) public android.media.AudioRecord getCallDownlinkExtractionAudioRecord(@NonNull android.media.AudioFormat);
@@ -1884,6 +1903,9 @@
method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public float getCsd();
method @Nullable public static android.media.AudioDeviceInfo getDeviceInfoFromType(int);
method @IntRange(from=0) @RequiresPermission("android.permission.QUERY_AUDIO_STATE") public long getFadeOutDurationOnFocusLossMillis(@NonNull android.media.AudioAttributes);
+ method @NonNull @RequiresPermission("android.permission.QUERY_AUDIO_STATE") public java.util.List<java.lang.Integer> getFocusDuckedUidsForTest();
+ method @RequiresPermission("android.permission.QUERY_AUDIO_STATE") public long getFocusFadeOutDurationForTest();
+ method @RequiresPermission("android.permission.QUERY_AUDIO_STATE") public long getFocusUnmuteDelayAfterFadeOutForTest();
method @Nullable public static android.media.AudioHalVersionInfo getHalVersion();
method public static final int[] getPublicStreamTypes();
method @NonNull public java.util.List<java.lang.Integer> getReportedSurroundFormats();
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java
index 9121cf0..0255860 100644
--- a/core/java/android/app/ApplicationPackageManager.java
+++ b/core/java/android/app/ApplicationPackageManager.java
@@ -179,6 +179,10 @@
@GuardedBy("mDelegates")
private final ArrayList<MoveCallbackDelegate> mDelegates = new ArrayList<>();
+ @NonNull
+ @GuardedBy("mPackageMonitorCallbacks")
+ private final ArraySet<IRemoteCallback> mPackageMonitorCallbacks = new ArraySet<>();
+
UserManager getUserManager() {
if (mUserManager == null) {
mUserManager = UserManager.get(mContext);
@@ -2872,16 +2876,25 @@
final SuspendDialogInfo dialogInfo = !TextUtils.isEmpty(dialogMessage)
? new SuspendDialogInfo.Builder().setMessage(dialogMessage).build()
: null;
- return setPackagesSuspended(packageNames, suspended, appExtras, launcherExtras, dialogInfo);
+ return setPackagesSuspended(packageNames, suspended, appExtras, launcherExtras,
+ dialogInfo, 0);
}
@Override
public String[] setPackagesSuspended(String[] packageNames, boolean suspended,
PersistableBundle appExtras, PersistableBundle launcherExtras,
SuspendDialogInfo dialogInfo) {
+ return setPackagesSuspended(packageNames, suspended, appExtras, launcherExtras,
+ dialogInfo, 0);
+ }
+
+ @Override
+ public String[] setPackagesSuspended(String[] packageNames, boolean suspended,
+ PersistableBundle appExtras, PersistableBundle launcherExtras,
+ SuspendDialogInfo dialogInfo, int flags) {
try {
return mPM.setPackagesSuspendedAsUser(packageNames, suspended, appExtras,
- launcherExtras, dialogInfo, mContext.getOpPackageName(),
+ launcherExtras, dialogInfo, flags, mContext.getOpPackageName(),
getUserId());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
@@ -3926,6 +3939,14 @@
Objects.requireNonNull(callback);
try {
mPM.registerPackageMonitorCallback(callback, userId);
+ synchronized (mPackageMonitorCallbacks) {
+ if (mPackageMonitorCallbacks.contains(callback)) {
+ throw new IllegalStateException(
+ "registerPackageMonitorCallback: callback already registered: "
+ + callback);
+ }
+ mPackageMonitorCallbacks.add(callback);
+ }
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -3936,6 +3957,9 @@
Objects.requireNonNull(callback);
try {
mPM.unregisterPackageMonitorCallback(callback);
+ synchronized (mPackageMonitorCallbacks) {
+ mPackageMonitorCallbacks.remove(callback);
+ }
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java
index 4851279..d0d76a4 100644
--- a/core/java/android/app/Dialog.java
+++ b/core/java/android/app/Dialog.java
@@ -454,12 +454,11 @@
*/
protected void onStart() {
if (mActionBar != null) mActionBar.setShowHideAnimationEnabled(true);
- if (mContext != null
+ if (allowsRegisterDefaultOnBackInvokedCallback() && mContext != null
&& WindowOnBackInvokedDispatcher.isOnBackInvokedCallbackEnabled(mContext)) {
// Add onBackPressed as default back behavior.
mDefaultBackCallback = this::onBackPressed;
getOnBackInvokedDispatcher().registerSystemOnBackInvokedCallback(mDefaultBackCallback);
- mDefaultBackCallback = null;
}
}
@@ -470,9 +469,18 @@
if (mActionBar != null) mActionBar.setShowHideAnimationEnabled(false);
if (mDefaultBackCallback != null) {
getOnBackInvokedDispatcher().unregisterOnBackInvokedCallback(mDefaultBackCallback);
+ mDefaultBackCallback = null;
}
}
+ /**
+ * Whether this dialog allows to register the default onBackInvokedCallback.
+ * @hide
+ */
+ protected boolean allowsRegisterDefaultOnBackInvokedCallback() {
+ return true;
+ }
+
private static final String DIALOG_SHOWING_TAG = "android:dialogShowing";
private static final String DIALOG_HIERARCHY_TAG = "android:dialogHierarchy";
@@ -697,7 +705,8 @@
if (event.isTracking() && !event.isCanceled()) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
- if (!WindowOnBackInvokedDispatcher.isOnBackInvokedCallbackEnabled(mContext)) {
+ if (!WindowOnBackInvokedDispatcher.isOnBackInvokedCallbackEnabled(mContext)
+ || !allowsRegisterDefaultOnBackInvokedCallback()) {
onBackPressed();
return true;
}
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 892b45e..bf5b428 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -1628,6 +1628,14 @@
*/
public static final int GROUP_ALERT_CHILDREN = 2;
+ /**
+ * Constant for the {@link Builder#setGroup(String) group key} that is added to notifications
+ * that are not already grouped when {@link Builder#setSilent()} is used.
+ *
+ * @hide
+ */
+ public static final String GROUP_KEY_SILENT = "silent";
+
private int mGroupAlertBehavior = GROUP_ALERT_ALL;
/**
@@ -2892,11 +2900,6 @@
}
}
- final Person person = extras.getParcelable(EXTRA_MESSAGING_PERSON, Person.class);
- if (person != null) {
- person.visitUris(visitor);
- }
-
final RemoteInputHistoryItem[] history = extras.getParcelableArray(
Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS,
RemoteInputHistoryItem.class);
@@ -2908,9 +2911,14 @@
}
}
}
- }
- if (isStyle(MessagingStyle.class) && extras != null) {
+ // Extras for MessagingStyle. We visit them even if not isStyle(MessagingStyle), since
+ // Notification Listeners might use directly (without the isStyle check).
+ final Person person = extras.getParcelable(EXTRA_MESSAGING_PERSON, Person.class);
+ if (person != null) {
+ person.visitUris(visitor);
+ }
+
final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES,
Parcelable.class);
if (!ArrayUtils.isEmpty(messages)) {
@@ -2930,9 +2938,8 @@
}
visitIconUri(visitor, extras.getParcelable(EXTRA_CONVERSATION_ICON, Icon.class));
- }
- if (isStyle(CallStyle.class) & extras != null) {
+ // Extras for CallStyle (same reason for visiting without checking isStyle).
Person callPerson = extras.getParcelable(EXTRA_CALL_PERSON, Person.class);
if (callPerson != null) {
callPerson.visitUris(visitor);
@@ -4290,6 +4297,35 @@
}
/**
+ * If {@code true}, silences this instance of the notification, regardless of the sounds or
+ * vibrations set on the notification or notification channel. If {@code false}, then the
+ * normal sound and vibration logic applies.
+ *
+ * @hide
+ */
+ public @NonNull Builder setSilent(boolean silent) {
+ if (!silent) {
+ return this;
+ }
+ if (mN.isGroupSummary()) {
+ setGroupAlertBehavior(GROUP_ALERT_CHILDREN);
+ } else {
+ setGroupAlertBehavior(GROUP_ALERT_SUMMARY);
+ }
+
+ setVibrate(null);
+ setSound(null);
+ mN.defaults &= ~DEFAULT_SOUND;
+ mN.defaults &= ~DEFAULT_VIBRATE;
+ setDefaults(mN.defaults);
+
+ if (TextUtils.isEmpty(mN.mGroupKey)) {
+ setGroup(GROUP_KEY_SILENT);
+ }
+ return this;
+ }
+
+ /**
* Set the first line of text in the platform notification template.
*/
@NonNull
@@ -12819,7 +12855,6 @@
} else {
mBackgroundColor = rawColor;
}
- mProtectionColor = COLOR_INVALID; // filled in at the end
mPrimaryTextColor = ContrastColorUtil.findAlphaToMeetContrast(
ContrastColorUtil.resolvePrimaryColor(ctx, mBackgroundColor, nightMode),
mBackgroundColor, 4.5);
@@ -12836,7 +12871,6 @@
} else {
int[] attrs = {
R.attr.colorSurface,
- R.attr.colorBackgroundFloating,
R.attr.textColorPrimary,
R.attr.textColorSecondary,
R.attr.colorAccent,
@@ -12848,15 +12882,14 @@
};
try (TypedArray ta = obtainDayNightAttributes(ctx, attrs)) {
mBackgroundColor = getColor(ta, 0, nightMode ? Color.BLACK : Color.WHITE);
- mProtectionColor = getColor(ta, 1, COLOR_INVALID);
- mPrimaryTextColor = getColor(ta, 2, COLOR_INVALID);
- mSecondaryTextColor = getColor(ta, 3, COLOR_INVALID);
- mPrimaryAccentColor = getColor(ta, 4, COLOR_INVALID);
- mSecondaryAccentColor = getColor(ta, 5, COLOR_INVALID);
- mTertiaryAccentColor = getColor(ta, 6, COLOR_INVALID);
- mOnAccentTextColor = getColor(ta, 7, COLOR_INVALID);
- mErrorColor = getColor(ta, 8, COLOR_INVALID);
- mRippleAlpha = Color.alpha(getColor(ta, 9, 0x33ffffff));
+ mPrimaryTextColor = getColor(ta, 1, COLOR_INVALID);
+ mSecondaryTextColor = getColor(ta, 2, COLOR_INVALID);
+ mPrimaryAccentColor = getColor(ta, 3, COLOR_INVALID);
+ mSecondaryAccentColor = getColor(ta, 4, COLOR_INVALID);
+ mTertiaryAccentColor = getColor(ta, 5, COLOR_INVALID);
+ mOnAccentTextColor = getColor(ta, 6, COLOR_INVALID);
+ mErrorColor = getColor(ta, 7, COLOR_INVALID);
+ mRippleAlpha = Color.alpha(getColor(ta, 8, 0x33ffffff));
}
mContrastColor = calculateContrastColor(ctx, rawColor, mPrimaryAccentColor,
mBackgroundColor, nightMode);
@@ -12889,9 +12922,7 @@
}
}
// make sure every color has a valid value
- if (mProtectionColor == COLOR_INVALID) {
- mProtectionColor = ColorUtils.blendARGB(mPrimaryTextColor, mBackgroundColor, 0.8f);
- }
+ mProtectionColor = ColorUtils.blendARGB(mPrimaryTextColor, mBackgroundColor, 0.9f);
}
/** calculates the contrast color for the non-colorized notifications */
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index e578499..fbb97ff 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -243,6 +243,7 @@
import android.view.translation.TranslationManager;
import android.view.translation.UiTranslationManager;
+import com.android.internal.R;
import com.android.internal.app.IAppOpsService;
import com.android.internal.app.IBatteryStats;
import com.android.internal.app.ISoundTriggerService;
@@ -871,6 +872,10 @@
PackageManager.FEATURE_COMPANION_DEVICE_SETUP)) {
return null;
}
+ if (!ctx.getResources().getBoolean(R.bool.config_enableVirtualDeviceManager)) {
+ return null;
+ }
+
IVirtualDeviceManager service = IVirtualDeviceManager.Stub.asInterface(
ServiceManager.getServiceOrThrow(Context.VIRTUAL_DEVICE_SERVICE));
return new VirtualDeviceManager(service, ctx.getOuterContext());
diff --git a/core/java/android/app/TaskInfo.java b/core/java/android/app/TaskInfo.java
index 2b5175c..634089b 100644
--- a/core/java/android/app/TaskInfo.java
+++ b/core/java/android/app/TaskInfo.java
@@ -248,6 +248,13 @@
public boolean topActivityEligibleForUserAspectRatioButton;
/**
+ * Whether the user has forced the activity to be fullscreen through the user aspect ratio
+ * settings.
+ * @hide
+ */
+ public boolean isUserFullscreenOverrideEnabled;
+
+ /**
* Hint about the letterbox state of the top activity.
* @hide
*/
@@ -543,7 +550,8 @@
&& isSleeping == that.isSleeping
&& Objects.equals(mTopActivityLocusId, that.mTopActivityLocusId)
&& parentTaskId == that.parentTaskId
- && Objects.equals(topActivity, that.topActivity);
+ && Objects.equals(topActivity, that.topActivity)
+ && isUserFullscreenOverrideEnabled == that.isUserFullscreenOverrideEnabled;
}
/**
@@ -574,7 +582,8 @@
&& (!hasCompatUI() || configuration.getLayoutDirection()
== that.configuration.getLayoutDirection())
&& (!hasCompatUI() || configuration.uiMode == that.configuration.uiMode)
- && (!hasCompatUI() || isVisible == that.isVisible);
+ && (!hasCompatUI() || isVisible == that.isVisible)
+ && isUserFullscreenOverrideEnabled == that.isUserFullscreenOverrideEnabled;
}
/**
@@ -630,6 +639,7 @@
topActivityLetterboxHorizontalPosition = source.readInt();
topActivityLetterboxWidth = source.readInt();
topActivityLetterboxHeight = source.readInt();
+ isUserFullscreenOverrideEnabled = source.readBoolean();
}
/**
@@ -686,6 +696,7 @@
dest.writeInt(topActivityLetterboxHorizontalPosition);
dest.writeInt(topActivityLetterboxWidth);
dest.writeInt(topActivityLetterboxHeight);
+ dest.writeBoolean(isUserFullscreenOverrideEnabled);
}
@Override
@@ -732,6 +743,7 @@
+ topActivityLetterboxHorizontalPosition
+ " topActivityLetterboxWidth=" + topActivityLetterboxWidth
+ " topActivityLetterboxHeight=" + topActivityLetterboxHeight
+ + " isUserFullscreenOverrideEnabled=" + isUserFullscreenOverrideEnabled
+ " locusId=" + mTopActivityLocusId
+ " displayAreaFeatureId=" + displayAreaFeatureId
+ " cameraCompatControlState="
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 33b8b03..715edc5 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -16111,11 +16111,6 @@
* Called by a profile owner of an organization-owned managed profile to suspend personal
* apps on the device. When personal apps are suspended the device can only be used for calls.
*
- * <p>When personal apps are suspended, an ongoing notification about that is shown to the user.
- * When the user taps the notification, system invokes {@link #ACTION_CHECK_POLICY_COMPLIANCE}
- * in the profile owner package. Profile owner implementation that uses personal apps suspension
- * must handle this intent.
- *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with
* @param suspended Whether personal apps should be suspended.
* @throws IllegalStateException if the profile owner doesn't have an activity that handles
diff --git a/core/java/android/app/search/SearchSession.java b/core/java/android/app/search/SearchSession.java
index 0dbd81e..99b64a0 100644
--- a/core/java/android/app/search/SearchSession.java
+++ b/core/java/android/app/search/SearchSession.java
@@ -104,7 +104,7 @@
mInterface = android.app.search.ISearchUiManager.Stub.asInterface(b);
mSessionId = new SearchSessionId(
context.getPackageName() + ":" + UUID.randomUUID().toString(), context.getUserId());
- // b/175527717 whitelist possible clients of this API
+ // b/175527717 allowlist possible clients of this API
searchContext.setPackageName(context.getPackageName());
try {
mInterface.createSearchSession(searchContext, mSessionId, mToken);
diff --git a/core/java/android/companion/AssociationInfo.java b/core/java/android/companion/AssociationInfo.java
index 7d62c79..083fa00 100644
--- a/core/java/android/companion/AssociationInfo.java
+++ b/core/java/android/companion/AssociationInfo.java
@@ -17,7 +17,9 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.SuppressLint;
import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.annotation.UserIdInt;
import android.net.MacAddress;
import android.os.Parcel;
@@ -41,24 +43,26 @@
private static final String LAST_TIME_CONNECTED_NONE = "None";
/**
* A unique ID of this Association record.
- * Disclosed to the clients (ie. companion applications) for referring to this record (eg. in
+ * Disclosed to the clients (i.e. companion applications) for referring to this record (e.g. in
* {@code disassociate()} API call).
*/
private final int mId;
-
- private final @UserIdInt int mUserId;
- private final @NonNull String mPackageName;
-
- private final @Nullable MacAddress mDeviceMacAddress;
- private final @Nullable CharSequence mDisplayName;
- private final @Nullable String mDeviceProfile;
- private final @Nullable AssociatedDevice mAssociatedDevice;
-
+ @UserIdInt
+ private final int mUserId;
+ @NonNull
+ private final String mPackageName;
+ @Nullable
+ private final String mTag;
+ @Nullable
+ private final MacAddress mDeviceMacAddress;
+ @Nullable
+ private final CharSequence mDisplayName;
+ @Nullable
+ private final String mDeviceProfile;
+ @Nullable
+ private final AssociatedDevice mAssociatedDevice;
private final boolean mSelfManaged;
private final boolean mNotifyOnDeviceNearby;
- private final int mSystemDataSyncFlags;
- private final String mTag;
-
/**
* Indicates that the association has been revoked (removed), but we keep the association
* record for final clean up (e.g. removing the app from the list of the role holders).
@@ -72,6 +76,7 @@
* Default value is Long.MAX_VALUE.
*/
private final long mLastTimeConnectedMs;
+ private final int mSystemDataSyncFlags;
/**
* Creates a new Association.
@@ -93,16 +98,13 @@
}
mId = id;
-
mUserId = userId;
mPackageName = packageName;
-
mDeviceMacAddress = macAddress;
mDisplayName = displayName;
mTag = tag;
mDeviceProfile = deviceProfile;
mAssociatedDevice = associatedDevice;
-
mSelfManaged = selfManaged;
mNotifyOnDeviceNearby = notifyOnDeviceNearby;
mRevoked = revoked;
@@ -119,18 +121,11 @@
}
/**
- * @return the tag of this association.
- * @see CompanionDeviceManager#setAssociationTag(int, String)
- */
- public @Nullable String getTag() {
- return mTag;
- }
-
- /**
* @return the ID of the user who "owns" this association.
* @hide
*/
- public @UserIdInt int getUserId() {
+ @UserIdInt
+ public int getUserId() {
return mUserId;
}
@@ -139,19 +134,31 @@
* @hide
*/
@SystemApi
- public @NonNull String getPackageName() {
+ @NonNull
+ public String getPackageName() {
return mPackageName;
}
/**
+ * @return the tag of this association.
+ * @see CompanionDeviceManager#setAssociationTag(int, String)
+ */
+ @Nullable
+ public String getTag() {
+ return mTag;
+ }
+
+ /**
* @return the MAC address of the device.
*/
- public @Nullable MacAddress getDeviceMacAddress() {
+ @Nullable
+ public MacAddress getDeviceMacAddress() {
return mDeviceMacAddress;
}
/** @hide */
- public @Nullable String getDeviceMacAddressAsString() {
+ @Nullable
+ public String getDeviceMacAddressAsString() {
return mDeviceMacAddress != null ? mDeviceMacAddress.toString().toUpperCase() : null;
}
@@ -161,7 +168,8 @@
*
* @see AssociationRequest.Builder#setDisplayName(CharSequence)
*/
- public @Nullable CharSequence getDisplayName() {
+ @Nullable
+ public CharSequence getDisplayName() {
return mDisplayName;
}
@@ -170,7 +178,8 @@
* association, or {@code null} if no specific profile was used.
* @see AssociationRequest.Builder#setDeviceProfile(String)
*/
- public @Nullable String getDeviceProfile() {
+ @Nullable
+ public String getDeviceProfile() {
return mDeviceProfile;
}
@@ -187,7 +196,8 @@
* @return the companion device that was associated, or {@code null} if the device is
* self-managed or this association info was retrieved from persistent storage.
*/
- public @Nullable AssociatedDevice getAssociatedDevice() {
+ @Nullable
+ public AssociatedDevice getAssociatedDevice() {
return mAssociatedDevice;
}
@@ -228,14 +238,14 @@
* @return the last time self reported disconnected for selfManaged only.
* @hide
*/
- public Long getLastTimeConnectedMs() {
+ public long getLastTimeConnectedMs() {
return mLastTimeConnectedMs;
}
/**
* @return Enabled system data sync flags set via
- * {@link CompanionDeviceManager#enableSystemDataSync(int, int)} and
- * {@link CompanionDeviceManager#disableSystemDataSync(int, int)}.
+ * {@link CompanionDeviceManager#enableSystemDataSyncForTypes(int, int)} (int, int)} and
+ * {@link CompanionDeviceManager#disableSystemDataSyncForTypes(int, int)} (int, int)}.
* Or by default all flags are 1 (enabled).
*/
public int getSystemDataSyncFlags() {
@@ -279,7 +289,8 @@
}
/** @hide */
- public @NonNull String toShortString() {
+ @NonNull
+ public String toShortString() {
final StringBuilder sb = new StringBuilder();
sb.append("id=").append(mId);
if (mDeviceMacAddress != null) {
@@ -350,16 +361,13 @@
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeInt(mId);
-
dest.writeInt(mUserId);
dest.writeString(mPackageName);
dest.writeString(mTag);
-
dest.writeTypedObject(mDeviceMacAddress, 0);
dest.writeCharSequence(mDisplayName);
dest.writeString(mDeviceProfile);
dest.writeTypedObject(mAssociatedDevice, 0);
-
dest.writeBoolean(mSelfManaged);
dest.writeBoolean(mNotifyOnDeviceNearby);
dest.writeBoolean(mRevoked);
@@ -370,16 +378,13 @@
private AssociationInfo(@NonNull Parcel in) {
mId = in.readInt();
-
mUserId = in.readInt();
mPackageName = in.readString();
mTag = in.readString();
-
mDeviceMacAddress = in.readTypedObject(MacAddress.CREATOR);
mDisplayName = in.readCharSequence();
mDeviceProfile = in.readString();
mAssociatedDevice = in.readTypedObject(AssociatedDevice.CREATOR);
-
mSelfManaged = in.readBoolean();
mNotifyOnDeviceNearby = in.readBoolean();
mRevoked = in.readBoolean();
@@ -403,45 +408,137 @@
};
/**
- * Use this method to obtain a builder that you can use to create a copy of the
- * given {@link AssociationInfo} with modified values of {@code mLastTimeConnected}
- * or {@code mNotifyOnDeviceNearby}.
- * <p>
- * Note that you <b>must</b> call either {@link Builder#setLastTimeConnected(long)
- * setLastTimeConnected} or {@link Builder#setNotifyOnDeviceNearby(boolean)
- * setNotifyOnDeviceNearby} before you will be able to call {@link Builder#build() build}.
- *
- * This is ensured statically at compile time.
+ * Builder for {@link AssociationInfo}
*
* @hide
*/
- @NonNull
- public static NonActionableBuilder builder(@NonNull AssociationInfo info) {
- return new Builder(info);
- }
-
- /** @hide */
- public static final class Builder implements NonActionableBuilder {
- @NonNull
- private final AssociationInfo mOriginalInfo;
+ @TestApi
+ public static final class Builder {
+ private final int mId;
+ private final int mUserId;
+ private final String mPackageName;
+ private String mTag;
+ private MacAddress mDeviceMacAddress;
+ private CharSequence mDisplayName;
+ private String mDeviceProfile;
+ private AssociatedDevice mAssociatedDevice;
+ private boolean mSelfManaged;
private boolean mNotifyOnDeviceNearby;
private boolean mRevoked;
+ private long mTimeApprovedMs;
private long mLastTimeConnectedMs;
private int mSystemDataSyncFlags;
- private String mTag;
- private Builder(@NonNull AssociationInfo info) {
- mOriginalInfo = info;
+ /** @hide */
+ @TestApi
+ public Builder(int id, int userId, @NonNull String packageName) {
+ mId = id;
+ mUserId = userId;
+ mPackageName = packageName;
+ }
+
+ /** @hide */
+ @TestApi
+ public Builder(@NonNull AssociationInfo info) {
+ mId = info.mId;
+ mUserId = info.mUserId;
+ mPackageName = info.mPackageName;
mTag = info.mTag;
+ mDeviceMacAddress = info.mDeviceMacAddress;
+ mDisplayName = info.mDisplayName;
+ mDeviceProfile = info.mDeviceProfile;
+ mAssociatedDevice = info.mAssociatedDevice;
+ mSelfManaged = info.mSelfManaged;
mNotifyOnDeviceNearby = info.mNotifyOnDeviceNearby;
mRevoked = info.mRevoked;
+ mTimeApprovedMs = info.mTimeApprovedMs;
mLastTimeConnectedMs = info.mLastTimeConnectedMs;
mSystemDataSyncFlags = info.mSystemDataSyncFlags;
}
/** @hide */
- @Override
+ @TestApi
@NonNull
+ public Builder setTag(@Nullable String tag) {
+ mTag = tag;
+ return this;
+ }
+
+ /** @hide */
+ @TestApi
+ @NonNull
+ public Builder setDeviceMacAddress(@Nullable MacAddress deviceMacAddress) {
+ mDeviceMacAddress = deviceMacAddress;
+ return this;
+ }
+
+ /** @hide */
+ @TestApi
+ @NonNull
+ public Builder setDisplayName(@Nullable CharSequence displayName) {
+ mDisplayName = displayName;
+ return this;
+ }
+
+ /** @hide */
+ @TestApi
+ @NonNull
+ public Builder setDeviceProfile(@Nullable String deviceProfile) {
+ mDeviceProfile = deviceProfile;
+ return this;
+ }
+
+ /** @hide */
+ @TestApi
+ @NonNull
+ public Builder setAssociatedDevice(@Nullable AssociatedDevice associatedDevice) {
+ mAssociatedDevice = associatedDevice;
+ return this;
+ }
+
+ /** @hide */
+ @TestApi
+ @NonNull
+ public Builder setSelfManaged(boolean selfManaged) {
+ mSelfManaged = selfManaged;
+ return this;
+ }
+
+ /** @hide */
+ @TestApi
+ @NonNull
+ @SuppressLint("MissingGetterMatchingBuilder")
+ public Builder setNotifyOnDeviceNearby(boolean notifyOnDeviceNearby) {
+ mNotifyOnDeviceNearby = notifyOnDeviceNearby;
+ return this;
+ }
+
+ /** @hide */
+ @TestApi
+ @NonNull
+ @SuppressLint("MissingGetterMatchingBuilder")
+ public Builder setRevoked(boolean revoked) {
+ mRevoked = revoked;
+ return this;
+ }
+
+ /** @hide */
+ @TestApi
+ @NonNull
+ @SuppressLint("MissingGetterMatchingBuilder")
+ public Builder setTimeApproved(long timeApprovedMs) {
+ if (timeApprovedMs < 0) {
+ throw new IllegalArgumentException("timeApprovedMs must be positive. Was given ("
+ + timeApprovedMs + ")");
+ }
+ mTimeApprovedMs = timeApprovedMs;
+ return this;
+ }
+
+ /** @hide */
+ @TestApi
+ @NonNull
+ @SuppressLint("MissingGetterMatchingBuilder")
public Builder setLastTimeConnected(long lastTimeConnectedMs) {
if (lastTimeConnectedMs < 0) {
throw new IllegalArgumentException(
@@ -453,23 +550,7 @@
}
/** @hide */
- @Override
- @NonNull
- public Builder setNotifyOnDeviceNearby(boolean notifyOnDeviceNearby) {
- mNotifyOnDeviceNearby = notifyOnDeviceNearby;
- return this;
- }
-
- /** @hide */
- @Override
- @NonNull
- public Builder setRevoked(boolean revoked) {
- mRevoked = revoked;
- return this;
- }
-
- /** @hide */
- @Override
+ @TestApi
@NonNull
public Builder setSystemDataSyncFlags(int flags) {
mSystemDataSyncFlags = flags;
@@ -477,65 +558,32 @@
}
/** @hide */
- @Override
- @NonNull
- public Builder setTag(String tag) {
- mTag = tag;
- return this;
- }
-
- /** @hide */
+ @TestApi
@NonNull
public AssociationInfo build() {
+ if (mId <= 0) {
+ throw new IllegalArgumentException("Association ID should be greater than 0");
+ }
+ if (mDeviceMacAddress == null && mDisplayName == null) {
+ throw new IllegalArgumentException("MAC address and the display name must NOT be "
+ + "null at the same time");
+ }
return new AssociationInfo(
- mOriginalInfo.mId,
- mOriginalInfo.mUserId,
- mOriginalInfo.mPackageName,
+ mId,
+ mUserId,
+ mPackageName,
mTag,
- mOriginalInfo.mDeviceMacAddress,
- mOriginalInfo.mDisplayName,
- mOriginalInfo.mDeviceProfile,
- mOriginalInfo.mAssociatedDevice,
- mOriginalInfo.mSelfManaged,
+ mDeviceMacAddress,
+ mDisplayName,
+ mDeviceProfile,
+ mAssociatedDevice,
+ mSelfManaged,
mNotifyOnDeviceNearby,
mRevoked,
- mOriginalInfo.mTimeApprovedMs,
+ mTimeApprovedMs,
mLastTimeConnectedMs,
mSystemDataSyncFlags
);
}
}
-
- /**
- * This interface is returned from the
- * {@link AssociationInfo#builder(android.companion.AssociationInfo) builder} entry point
- * to indicate that this builder is not yet in a state that can produce a meaningful
- * {@link AssociationInfo} object that is different from the one originally passed in.
- *
- * <p>
- * Only by calling one of the setter methods is this builder turned into one where calling
- * {@link Builder#build() build()} makes sense.
- *
- * @hide
- */
- public interface NonActionableBuilder {
- /** @hide */
- @NonNull
- Builder setNotifyOnDeviceNearby(boolean notifyOnDeviceNearby);
-
- /** @hide */
- @NonNull
- Builder setLastTimeConnected(long lastTimeConnectedMs);
-
- /** @hide */
- @NonNull
- Builder setRevoked(boolean revoked);
-
- /** @hide */
- @NonNull
- Builder setSystemDataSyncFlags(int flags);
-
- /** @hide */
- Builder setTag(String tag);
- }
}
diff --git a/core/java/android/companion/virtual/IVirtualDeviceManager.aidl b/core/java/android/companion/virtual/IVirtualDeviceManager.aidl
index ee7836f..ed8484f 100644
--- a/core/java/android/companion/virtual/IVirtualDeviceManager.aidl
+++ b/core/java/android/companion/virtual/IVirtualDeviceManager.aidl
@@ -21,6 +21,7 @@
import android.companion.virtual.IVirtualDeviceSoundEffectListener;
import android.companion.virtual.VirtualDevice;
import android.companion.virtual.VirtualDeviceParams;
+import android.content.AttributionSource;
import android.hardware.display.IVirtualDisplayCallback;
import android.hardware.display.VirtualDisplayConfig;
@@ -46,7 +47,7 @@
*/
@EnforcePermission("CREATE_VIRTUAL_DEVICE")
IVirtualDevice createVirtualDevice(
- in IBinder token, String packageName, int associationId,
+ in IBinder token, in AttributionSource attributionSource, int associationId,
in VirtualDeviceParams params, in IVirtualDeviceActivityListener activityListener,
in IVirtualDeviceSoundEffectListener soundEffectListener);
diff --git a/core/java/android/companion/virtual/VirtualDeviceInternal.java b/core/java/android/companion/virtual/VirtualDeviceInternal.java
index f68cfff..d13bfd4 100644
--- a/core/java/android/companion/virtual/VirtualDeviceInternal.java
+++ b/core/java/android/companion/virtual/VirtualDeviceInternal.java
@@ -145,7 +145,7 @@
mContext = context.getApplicationContext();
mVirtualDevice = service.createVirtualDevice(
new Binder(),
- mContext.getPackageName(),
+ mContext.getAttributionSource(),
associationId,
params,
mActivityListenerBinder,
diff --git a/core/java/android/companion/virtual/VirtualDeviceParams.java b/core/java/android/companion/virtual/VirtualDeviceParams.java
index 45d6dc6..b6d8375 100644
--- a/core/java/android/companion/virtual/VirtualDeviceParams.java
+++ b/core/java/android/companion/virtual/VirtualDeviceParams.java
@@ -43,6 +43,7 @@
import android.util.SparseArray;
import android.util.SparseIntArray;
+import java.io.PrintWriter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -501,6 +502,26 @@
+ ")";
}
+ /**
+ * Dumps debugging information about the VirtualDeviceParams
+ * @hide
+ */
+ public void dump(PrintWriter pw, String prefix) {
+ pw.println(prefix + "mName=" + mName);
+ pw.println(prefix + "mLockState=" + mLockState);
+ pw.println(prefix + "mUsersWithMatchingAccounts=" + mUsersWithMatchingAccounts);
+ pw.println(prefix + "mAllowedCrossTaskNavigations=" + mAllowedCrossTaskNavigations);
+ pw.println(prefix + "mBlockedCrossTaskNavigations=" + mBlockedCrossTaskNavigations);
+ pw.println(prefix + "mAllowedActivities=" + mAllowedActivities);
+ pw.println(prefix + "mBlockedActivities=" + mBlockedActivities);
+ pw.println(prefix + "mDevicePolicies=" + mDevicePolicies);
+ pw.println(prefix + "mDefaultNavigationPolicy=" + mDefaultNavigationPolicy);
+ pw.println(prefix + "mDefaultActivityPolicy=" + mDefaultActivityPolicy);
+ pw.println(prefix + "mVirtualSensorConfigs=" + mVirtualSensorConfigs);
+ pw.println(prefix + "mAudioPlaybackSessionId=" + mAudioPlaybackSessionId);
+ pw.println(prefix + "mAudioRecordingSessionId=" + mAudioRecordingSessionId);
+ }
+
@NonNull
public static final Parcelable.Creator<VirtualDeviceParams> CREATOR =
new Parcelable.Creator<VirtualDeviceParams>() {
diff --git a/core/java/android/companion/virtual/sensor/VirtualSensorConfig.java b/core/java/android/companion/virtual/sensor/VirtualSensorConfig.java
index 3bdf9aa..0dbe411 100644
--- a/core/java/android/companion/virtual/sensor/VirtualSensorConfig.java
+++ b/core/java/android/companion/virtual/sensor/VirtualSensorConfig.java
@@ -104,6 +104,11 @@
parcel.writeInt(mFlags);
}
+ @Override
+ public String toString() {
+ return "VirtualSensorConfig{" + "mType=" + mType + ", mName='" + mName + '\'' + '}';
+ }
+
/**
* Returns the type of the sensor.
*
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index c11a8fc..5ef7b11 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -323,6 +323,7 @@
// Make sure no flag uses the sign bit (most significant bit) of the long integer,
// to avoid future confusion.
BIND_BYPASS_USER_NETWORK_RESTRICTIONS,
+ BIND_FILTER_OUT_QUARANTINED_COMPONENTS,
})
@Retention(RetentionPolicy.SOURCE)
public @interface BindServiceFlagsLongBits {}
@@ -697,6 +698,13 @@
*/
public static final long BIND_BYPASS_USER_NETWORK_RESTRICTIONS = 0x1_0000_0000L;
+ /**
+ * Flag for {@link #bindService}.
+ *
+ * @hide
+ */
+ public static final long BIND_FILTER_OUT_QUARANTINED_COMPONENTS = 0x2_0000_0000L;
+
/**
* These bind flags reduce the strength of the binding such that we shouldn't
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index fe108a5..afeb3d29 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -6383,6 +6383,15 @@
"android.intent.extra.changed_uid_list";
/**
+ * This field is part of
+ * {@link android.content.Intent#ACTION_PACKAGES_SUSPENDED},
+ * and only present if the packages were quarantined.
+ * @hide
+ */
+ public static final String EXTRA_QUARANTINED =
+ "android.intent.extra.quarantined";
+
+ /**
* An integer denoting a bitwise combination of restrictions set on distracting packages via
* {@link PackageManager#setDistractingPackageRestrictions(String[], int)}
*
diff --git a/core/java/android/content/pm/CrossProfileApps.java b/core/java/android/content/pm/CrossProfileApps.java
index c3df17d..529363f 100644
--- a/core/java/android/content/pm/CrossProfileApps.java
+++ b/core/java/android/content/pm/CrossProfileApps.java
@@ -344,15 +344,22 @@
// If there is a label for the launcher intent, then use that as it is typically shorter.
// Otherwise, just use the top-level application name.
Intent launchIntent = pm.getLaunchIntentForPackage(mContext.getPackageName());
+ if (launchIntent == null) {
+ return getDefaultCallingApplicationLabel();
+ }
List<ResolveInfo> infos =
pm.queryIntentActivities(
launchIntent, PackageManager.ResolveInfoFlags.of(MATCH_DEFAULT_ONLY));
if (infos.size() > 0) {
return infos.get(0).loadLabel(pm);
}
+ return getDefaultCallingApplicationLabel();
+ }
+
+ private CharSequence getDefaultCallingApplicationLabel() {
return mContext.getApplicationInfo()
.loadSafeLabel(
- pm,
+ mContext.getPackageManager(),
/* ellipsizeDip= */ 0,
TextUtils.SAFE_STRING_FLAG_SINGLE_LINE
| TextUtils.SAFE_STRING_FLAG_TRIM);
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index 7c9ccba..ea0f5ff 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -298,12 +298,14 @@
String[] setPackagesSuspendedAsUser(in String[] packageNames, boolean suspended,
in PersistableBundle appExtras, in PersistableBundle launcherExtras,
- in SuspendDialogInfo dialogInfo, String callingPackage, int userId);
+ in SuspendDialogInfo dialogInfo, int flags, String callingPackage, int userId);
String[] getUnsuspendablePackagesForUser(in String[] packageNames, int userId);
boolean isPackageSuspendedForUser(String packageName, int userId);
+ boolean isPackageQuarantinedForUser(String packageName, int userId);
+
Bundle getSuspendedPackageAppExtras(String packageName, int userId);
/**
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 9f14c97..885e67e1 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -834,6 +834,7 @@
GET_DISABLED_COMPONENTS,
GET_DISABLED_UNTIL_USED_COMPONENTS,
GET_UNINSTALLED_PACKAGES,
+ FILTER_OUT_QUARANTINED_COMPONENTS,
})
@Retention(RetentionPolicy.SOURCE)
public @interface ComponentInfoFlagsBits {}
@@ -857,7 +858,8 @@
GET_DISABLED_COMPONENTS,
GET_DISABLED_UNTIL_USED_COMPONENTS,
GET_UNINSTALLED_PACKAGES,
- MATCH_CLONE_PROFILE
+ MATCH_CLONE_PROFILE,
+ FILTER_OUT_QUARANTINED_COMPONENTS,
})
@Retention(RetentionPolicy.SOURCE)
public @interface ResolveInfoFlagsBits {}
@@ -1233,6 +1235,11 @@
public static final long GET_ATTRIBUTIONS_LONG = 0x80000000L;
/**
+ * @hide
+ */
+ public static final long FILTER_OUT_QUARANTINED_COMPONENTS = 0x100000000L;
+
+ /**
* Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: when
* resolving an intent that matches the {@code CrossProfileIntentFilter},
* the current profile will be skipped. Only activities in the target user
@@ -1685,7 +1692,7 @@
/** @hide */
@IntDef(flag = true, value = {
DONT_KILL_APP,
- SYNCHRONOUS
+ SYNCHRONOUS,
})
@Retention(RetentionPolicy.SOURCE)
public @interface EnabledFlags {}
@@ -1708,6 +1715,24 @@
public static final int SYNCHRONOUS = 0x00000002;
/** @hide */
+ @IntDef(flag = true, value = {
+ FLAG_SUSPEND_QUARANTINED,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface SuspendedFlags {}
+
+ /**
+ * Flag parameter {@link #setPackagesSuspended(String[], boolean, PersistableBundle,
+ * PersistableBundle, android.content.pm.SuspendDialogInfo, int)}:
+ * Apps in this state not only appear suspended for all user visible purposes (eg, Launcher,
+ * ShareSheet), but also individual components of the app can behave as disabled depending on
+ * the importance of the calling app.
+ *
+ * @hide
+ */
+ public static final int FLAG_SUSPEND_QUARANTINED = 0x00000001;
+
+ /** @hide */
@IntDef(prefix = { "INSTALL_REASON_" }, value = {
INSTALL_REASON_UNKNOWN,
INSTALL_REASON_POLICY,
@@ -9654,6 +9679,63 @@
}
/**
+ * Puts the given packages in a suspended state, where attempts at starting activities are
+ * denied.
+ *
+ * <p>The suspended application's notifications and all of its windows will be hidden, any
+ * of its started activities will be stopped and it won't be able to ring the device.
+ * It doesn't remove the data or the actual package file.
+ *
+ * <p>When the user tries to launch a suspended app, a system dialog alerting them that the app
+ * is suspended will be shown instead.
+ * The caller can optionally customize the dialog by passing a {@link SuspendDialogInfo} object
+ * to this API. This dialog will have a button that starts the
+ * {@link Intent#ACTION_SHOW_SUSPENDED_APP_DETAILS} intent if the suspending app declares an
+ * activity which handles this action.
+ *
+ * <p>The packages being suspended must already be installed. If a package is uninstalled, it
+ * will no longer be suspended.
+ *
+ * <p>Optionally, the suspending app can provide extra information in the form of
+ * {@link PersistableBundle} objects to be shared with the apps being suspended and the
+ * launcher to support customization that they might need to handle the suspended state.
+ *
+ * <p>The caller must hold {@link Manifest.permission#SUSPEND_APPS} to use this API except for
+ * device owner and profile owner.
+ *
+ * @param packageNames The names of the packages to set the suspended status.
+ * @param suspended If set to {@code true}, the packages will be suspended, if set to
+ * {@code false}, the packages will be unsuspended.
+ * @param appExtras An optional {@link PersistableBundle} that the suspending app can provide
+ * which will be shared with the apps being suspended. Ignored if
+ * {@code suspended} is false.
+ * @param launcherExtras An optional {@link PersistableBundle} that the suspending app can
+ * provide which will be shared with the launcher. Ignored if
+ * {@code suspended} is false.
+ * @param dialogInfo An optional {@link SuspendDialogInfo} object describing the dialog that
+ * should be shown to the user when they try to launch a suspended app.
+ * Ignored if {@code suspended} is false.
+ * @param flags Optional behavior flags.
+ *
+ * @return an array of package names for which the suspended status could not be set as
+ * requested in this method. Returns {@code null} if {@code packageNames} was {@code null}.
+ *
+ * @see #isPackageSuspended
+ * @see SuspendDialogInfo
+ * @see SuspendDialogInfo.Builder
+ * @see Intent#ACTION_SHOW_SUSPENDED_APP_DETAILS
+ *
+ * @hide
+ */
+ @RequiresPermission(value=Manifest.permission.SUSPEND_APPS, conditional=true)
+ @Nullable
+ public String[] setPackagesSuspended(@Nullable String[] packageNames, boolean suspended,
+ @Nullable PersistableBundle appExtras, @Nullable PersistableBundle launcherExtras,
+ @Nullable SuspendDialogInfo dialogInfo, @SuspendedFlags int flags) {
+ throw new UnsupportedOperationException("setPackagesSuspended not implemented");
+ }
+
+ /**
* Returns any packages in a given set of packages that cannot be suspended via a call to {@link
* #setPackagesSuspended(String[], boolean, PersistableBundle, PersistableBundle,
* SuspendDialogInfo) setPackagesSuspended}. The platform prevents suspending certain critical
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 048289f..9387ae1 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -8005,7 +8005,7 @@
ai.enabled = true;
} else if (state.getEnabledState()
== PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED) {
- ai.enabled = (flags&PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS) != 0;
+ ai.enabled = (flags & PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS) != 0;
} else if (state.getEnabledState() == PackageManager.COMPONENT_ENABLED_STATE_DISABLED
|| state.getEnabledState()
== PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER) {
diff --git a/core/java/android/content/res/Element.java b/core/java/android/content/res/Element.java
index e931fe8..1ef3d27 100644
--- a/core/java/android/content/res/Element.java
+++ b/core/java/android/content/res/Element.java
@@ -42,7 +42,7 @@
public static final int MAX_ATTR_LEN_PATH = 4000;
public static final int MAX_ATTR_LEN_DATA_VALUE = 4000;
- private static final String BAD_COMPONENT_NAME_CHARS = ";,[](){}:?-%^*|/\\";
+ private static final String BAD_COMPONENT_NAME_CHARS = ";,[](){}:?%^*|/\\";
private static final String TAG = "PackageParsing";
protected static final String TAG_ACTION = "action";
diff --git a/core/java/android/credentials/CredentialManager.java b/core/java/android/credentials/CredentialManager.java
index c2a0062..eedb25b 100644
--- a/core/java/android/credentials/CredentialManager.java
+++ b/core/java/android/credentials/CredentialManager.java
@@ -123,7 +123,7 @@
* credential, display a picker when multiple credentials exist, etc.
* Callers (e.g. browsers) may optionally set origin in {@link GetCredentialRequest} for an
* app different from their own, to be able to get credentials on behalf of that app. They would
- * need additional permission {@link CREDENTIAL_MANAGER_SET_ORIGIN}
+ * need additional permission {@code CREDENTIAL_MANAGER_SET_ORIGIN}
* to use this functionality
*
* @param context the context used to launch any UI needed; use an activity context to make sure
@@ -209,9 +209,9 @@
*
* <p>This API doesn't invoke any UI. It only performs the preparation work so that you can
* later launch the remaining get-credential operation (involves UIs) through the {@link
- * #getCredential(PrepareGetCredentialResponse.PendingGetCredentialHandle, Context,
+ * #getCredential(Context, PrepareGetCredentialResponse.PendingGetCredentialHandle,
* CancellationSignal, Executor, OutcomeReceiver)} API which incurs less latency compared to
- * the {@link #getCredential(GetCredentialRequest, Context, CancellationSignal, Executor,
+ * the {@link #getCredential(Context, GetCredentialRequest, CancellationSignal, Executor,
* OutcomeReceiver)} API that executes the whole operation in one call.
*
* @param request the request specifying type(s) of credentials to get from the user
@@ -261,7 +261,7 @@
* storing the new credential, etc.
* Callers (e.g. browsers) may optionally set origin in {@link CreateCredentialRequest} for an
* app different from their own, to be able to get credentials on behalf of that app. They would
- * need additional permission {@link CREDENTIAL_MANAGER_SET_ORIGIN}
+ * need additional permission {@code CREDENTIAL_MANAGER_SET_ORIGIN}
* to use this functionality
*
* @param context the context used to launch any UI needed; use an activity context to make sure
diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java
index 5b80e6a..746f2f2 100644
--- a/core/java/android/database/sqlite/SQLiteDatabase.java
+++ b/core/java/android/database/sqlite/SQLiteDatabase.java
@@ -44,10 +44,12 @@
import android.util.Log;
import android.util.Pair;
import android.util.Printer;
+
import com.android.internal.util.Preconditions;
import dalvik.annotation.optimization.NeverCompile;
import dalvik.system.CloseGuard;
+
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
@@ -1473,8 +1475,10 @@
* SQL WHERE clause (excluding the WHERE itself). Passing null
* will return all rows for the given table.
* @param selectionArgs You may include ?s in selection, which will be
- * replaced by the values from selectionArgs, in order that they
+ * replaced by the values from selectionArgs, in the order that they
* appear in the selection. The values will be bound as Strings.
+ * If selection is null or does not contain ?s then selectionArgs
+ * may be null.
* @param groupBy A filter declaring how to group rows, formatted as an SQL
* GROUP BY clause (excluding the GROUP BY itself). Passing null
* will cause the rows to not be grouped.
@@ -1492,9 +1496,11 @@
* {@link Cursor}s are not synchronized, see the documentation for more details.
* @see Cursor
*/
- public Cursor query(boolean distinct, String table, String[] columns,
- String selection, String[] selectionArgs, String groupBy,
- String having, String orderBy, String limit) {
+ @NonNull
+ public Cursor query(boolean distinct, @NonNull String table,
+ @Nullable String[] columns, @Nullable String selection,
+ @Nullable String[] selectionArgs, @Nullable String groupBy, @Nullable String having,
+ @Nullable String orderBy, @Nullable String limit) {
return queryWithFactory(null, distinct, table, columns, selection, selectionArgs,
groupBy, having, orderBy, limit, null);
}
@@ -1511,8 +1517,10 @@
* SQL WHERE clause (excluding the WHERE itself). Passing null
* will return all rows for the given table.
* @param selectionArgs You may include ?s in selection, which will be
- * replaced by the values from selectionArgs, in order that they
+ * replaced by the values from selectionArgs, in the order that they
* appear in the selection. The values will be bound as Strings.
+ * If selection is null or does not contain ?s then selectionArgs
+ * may be null.
* @param groupBy A filter declaring how to group rows, formatted as an SQL
* GROUP BY clause (excluding the GROUP BY itself). Passing null
* will cause the rows to not be grouped.
@@ -1533,9 +1541,12 @@
* {@link Cursor}s are not synchronized, see the documentation for more details.
* @see Cursor
*/
- public Cursor query(boolean distinct, String table, String[] columns,
- String selection, String[] selectionArgs, String groupBy,
- String having, String orderBy, String limit, CancellationSignal cancellationSignal) {
+ @NonNull
+ public Cursor query(boolean distinct, @NonNull String table,
+ @Nullable String[] columns, @Nullable String selection,
+ @Nullable String[] selectionArgs, @Nullable String groupBy, @Nullable String having,
+ @Nullable String orderBy, @Nullable String limit,
+ @Nullable CancellationSignal cancellationSignal) {
return queryWithFactory(null, distinct, table, columns, selection, selectionArgs,
groupBy, having, orderBy, limit, cancellationSignal);
}
@@ -1553,8 +1564,10 @@
* SQL WHERE clause (excluding the WHERE itself). Passing null
* will return all rows for the given table.
* @param selectionArgs You may include ?s in selection, which will be
- * replaced by the values from selectionArgs, in order that they
+ * replaced by the values from selectionArgs, in the order that they
* appear in the selection. The values will be bound as Strings.
+ * If selection is null or does not contain ?s then selectionArgs
+ * may be null.
* @param groupBy A filter declaring how to group rows, formatted as an SQL
* GROUP BY clause (excluding the GROUP BY itself). Passing null
* will cause the rows to not be grouped.
@@ -1572,10 +1585,12 @@
* {@link Cursor}s are not synchronized, see the documentation for more details.
* @see Cursor
*/
- public Cursor queryWithFactory(CursorFactory cursorFactory,
- boolean distinct, String table, String[] columns,
- String selection, String[] selectionArgs, String groupBy,
- String having, String orderBy, String limit) {
+ @SuppressLint("SamShouldBeLast")
+ @NonNull
+ public Cursor queryWithFactory(@Nullable CursorFactory cursorFactory,
+ boolean distinct, @NonNull String table, @Nullable String[] columns,
+ @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String groupBy,
+ @Nullable String having, @Nullable String orderBy, @Nullable String limit) {
return queryWithFactory(cursorFactory, distinct, table, columns, selection,
selectionArgs, groupBy, having, orderBy, limit, null);
}
@@ -1593,8 +1608,10 @@
* SQL WHERE clause (excluding the WHERE itself). Passing null
* will return all rows for the given table.
* @param selectionArgs You may include ?s in selection, which will be
- * replaced by the values from selectionArgs, in order that they
+ * replaced by the values from selectionArgs, in the order that they
* appear in the selection. The values will be bound as Strings.
+ * If selection is null or does not contain ?s then selectionArgs
+ * may be null.
* @param groupBy A filter declaring how to group rows, formatted as an SQL
* GROUP BY clause (excluding the GROUP BY itself). Passing null
* will cause the rows to not be grouped.
@@ -1615,10 +1632,13 @@
* {@link Cursor}s are not synchronized, see the documentation for more details.
* @see Cursor
*/
- public Cursor queryWithFactory(CursorFactory cursorFactory,
- boolean distinct, String table, String[] columns,
- String selection, String[] selectionArgs, String groupBy,
- String having, String orderBy, String limit, CancellationSignal cancellationSignal) {
+ @SuppressLint("SamShouldBeLast")
+ @NonNull
+ public Cursor queryWithFactory(@Nullable CursorFactory cursorFactory,
+ boolean distinct, @NonNull String table, @Nullable String[] columns,
+ @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String groupBy,
+ @Nullable String having, @Nullable String orderBy, @Nullable String limit,
+ @Nullable CancellationSignal cancellationSignal) {
acquireReference();
try {
String sql = SQLiteQueryBuilder.buildQueryString(
@@ -1642,8 +1662,10 @@
* SQL WHERE clause (excluding the WHERE itself). Passing null
* will return all rows for the given table.
* @param selectionArgs You may include ?s in selection, which will be
- * replaced by the values from selectionArgs, in order that they
+ * replaced by the values from selectionArgs, in the order that they
* appear in the selection. The values will be bound as Strings.
+ * If selection is null or does not contain ?s then selectionArgs
+ * may be null.
* @param groupBy A filter declaring how to group rows, formatted as an SQL
* GROUP BY clause (excluding the GROUP BY itself). Passing null
* will cause the rows to not be grouped.
@@ -1659,9 +1681,10 @@
* {@link Cursor}s are not synchronized, see the documentation for more details.
* @see Cursor
*/
- public Cursor query(String table, String[] columns, String selection,
- String[] selectionArgs, String groupBy, String having,
- String orderBy) {
+ @NonNull
+ public Cursor query(@NonNull String table, @Nullable String[] columns,
+ @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String groupBy,
+ @Nullable String having, @Nullable String orderBy) {
return query(false, table, columns, selection, selectionArgs, groupBy,
having, orderBy, null /* limit */);
@@ -1678,8 +1701,10 @@
* SQL WHERE clause (excluding the WHERE itself). Passing null
* will return all rows for the given table.
* @param selectionArgs You may include ?s in selection, which will be
- * replaced by the values from selectionArgs, in order that they
+ * replaced by the values from selectionArgs, in the order that they
* appear in the selection. The values will be bound as Strings.
+ * If selection is null or does not contain ?s then selectionArgs
+ * may be null.
* @param groupBy A filter declaring how to group rows, formatted as an SQL
* GROUP BY clause (excluding the GROUP BY itself). Passing null
* will cause the rows to not be grouped.
@@ -1697,9 +1722,10 @@
* {@link Cursor}s are not synchronized, see the documentation for more details.
* @see Cursor
*/
- public Cursor query(String table, String[] columns, String selection,
- String[] selectionArgs, String groupBy, String having,
- String orderBy, String limit) {
+ @NonNull
+ public Cursor query(@NonNull String table, @Nullable String[] columns,
+ @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String groupBy,
+ @Nullable String having, @Nullable String orderBy, @Nullable String limit) {
return query(false, table, columns, selection, selectionArgs, groupBy,
having, orderBy, limit);
@@ -1711,11 +1737,13 @@
* @param sql the SQL query. The SQL string must not be ; terminated
* @param selectionArgs You may include ?s in where clause in the query,
* which will be replaced by the values from selectionArgs. The
- * values will be bound as Strings.
+ * values will be bound as Strings. If selection is null or does not contain ?s then
+ * selectionArgs may be null.
* @return A {@link Cursor} object, which is positioned before the first entry. Note that
* {@link Cursor}s are not synchronized, see the documentation for more details.
*/
- public Cursor rawQuery(String sql, String[] selectionArgs) {
+ @NonNull
+ public Cursor rawQuery(@NonNull String sql, @Nullable String[] selectionArgs) {
return rawQueryWithFactory(null, sql, selectionArgs, null, null);
}
@@ -1725,15 +1753,17 @@
* @param sql the SQL query. The SQL string must not be ; terminated
* @param selectionArgs You may include ?s in where clause in the query,
* which will be replaced by the values from selectionArgs. The
- * values will be bound as Strings.
+ * values will be bound as Strings. If selection is null or does not contain ?s then
+ * selectionArgs may be null.
* @param cancellationSignal A signal to cancel the operation in progress, or null if none.
* If the operation is canceled, then {@link OperationCanceledException} will be thrown
* when the query is executed.
* @return A {@link Cursor} object, which is positioned before the first entry. Note that
* {@link Cursor}s are not synchronized, see the documentation for more details.
*/
- public Cursor rawQuery(String sql, String[] selectionArgs,
- CancellationSignal cancellationSignal) {
+ @NonNull
+ public Cursor rawQuery(@NonNull String sql, @Nullable String[] selectionArgs,
+ @Nullable CancellationSignal cancellationSignal) {
return rawQueryWithFactory(null, sql, selectionArgs, null, cancellationSignal);
}
@@ -1744,14 +1774,16 @@
* @param sql the SQL query. The SQL string must not be ; terminated
* @param selectionArgs You may include ?s in where clause in the query,
* which will be replaced by the values from selectionArgs. The
- * values will be bound as Strings.
+ * values will be bound as Strings. If selection is null or does not contain ?s then
+ * selectionArgs may be null.
* @param editTable the name of the first table, which is editable
* @return A {@link Cursor} object, which is positioned before the first entry. Note that
* {@link Cursor}s are not synchronized, see the documentation for more details.
*/
+ @NonNull
public Cursor rawQueryWithFactory(
- CursorFactory cursorFactory, String sql, String[] selectionArgs,
- String editTable) {
+ @Nullable CursorFactory cursorFactory, @NonNull String sql,
+ @Nullable String[] selectionArgs, @NonNull String editTable) {
return rawQueryWithFactory(cursorFactory, sql, selectionArgs, editTable, null);
}
@@ -1762,7 +1794,8 @@
* @param sql the SQL query. The SQL string must not be ; terminated
* @param selectionArgs You may include ?s in where clause in the query,
* which will be replaced by the values from selectionArgs. The
- * values will be bound as Strings.
+ * values will be bound as Strings. If selection is null or does not contain ?s then
+ * selectionArgs may be null.
* @param editTable the name of the first table, which is editable
* @param cancellationSignal A signal to cancel the operation in progress, or null if none.
* If the operation is canceled, then {@link OperationCanceledException} will be thrown
@@ -1770,9 +1803,11 @@
* @return A {@link Cursor} object, which is positioned before the first entry. Note that
* {@link Cursor}s are not synchronized, see the documentation for more details.
*/
+ @NonNull
public Cursor rawQueryWithFactory(
- CursorFactory cursorFactory, String sql, String[] selectionArgs,
- String editTable, CancellationSignal cancellationSignal) {
+ @Nullable CursorFactory cursorFactory, @NonNull String sql,
+ @Nullable String[] selectionArgs, @NonNull String editTable,
+ @Nullable CancellationSignal cancellationSignal) {
acquireReference();
try {
SQLiteCursorDriver driver = new SQLiteDirectCursorDriver(this, sql, editTable,
@@ -1800,7 +1835,8 @@
* column values
* @return the row ID of the newly inserted row, or -1 if an error occurred
*/
- public long insert(String table, String nullColumnHack, ContentValues values) {
+ public long insert(@NonNull String table, @Nullable String nullColumnHack,
+ @Nullable ContentValues values) {
try {
return insertWithOnConflict(table, nullColumnHack, values, CONFLICT_NONE);
} catch (SQLException e) {
@@ -1826,8 +1862,8 @@
* @throws SQLException
* @return the row ID of the newly inserted row, or -1 if an error occurred
*/
- public long insertOrThrow(String table, String nullColumnHack, ContentValues values)
- throws SQLException {
+ public long insertOrThrow(@NonNull String table, @Nullable String nullColumnHack,
+ @Nullable ContentValues values) throws SQLException {
return insertWithOnConflict(table, nullColumnHack, values, CONFLICT_NONE);
}
@@ -1847,7 +1883,8 @@
* the row. The keys should be the column names and the values the column values.
* @return the row ID of the newly inserted row, or -1 if an error occurred
*/
- public long replace(String table, String nullColumnHack, ContentValues initialValues) {
+ public long replace(@NonNull String table, @Nullable String nullColumnHack,
+ @Nullable ContentValues initialValues) {
try {
return insertWithOnConflict(table, nullColumnHack, initialValues,
CONFLICT_REPLACE);
@@ -1874,8 +1911,8 @@
* @throws SQLException
* @return the row ID of the newly inserted row, or -1 if an error occurred
*/
- public long replaceOrThrow(String table, String nullColumnHack,
- ContentValues initialValues) throws SQLException {
+ public long replaceOrThrow(@NonNull String table, @Nullable String nullColumnHack,
+ @Nullable ContentValues initialValues) throws SQLException {
return insertWithOnConflict(table, nullColumnHack, initialValues,
CONFLICT_REPLACE);
}
@@ -1899,8 +1936,8 @@
* input parameter <code>conflictAlgorithm</code> = {@link #CONFLICT_IGNORE}
* or an error occurred.
*/
- public long insertWithOnConflict(String table, String nullColumnHack,
- ContentValues initialValues, int conflictAlgorithm) {
+ public long insertWithOnConflict(@NonNull String table, @Nullable String nullColumnHack,
+ @Nullable ContentValues initialValues, int conflictAlgorithm) {
acquireReference();
try {
StringBuilder sql = new StringBuilder();
@@ -1950,12 +1987,14 @@
* Passing null will delete all rows.
* @param whereArgs You may include ?s in the where clause, which
* will be replaced by the values from whereArgs. The values
- * will be bound as Strings.
+ * will be bound as Strings. If whereClause is null or does not
+ * contain ?s then whereArgs may be null.
* @return the number of rows affected if a whereClause is passed in, 0
* otherwise. To remove all rows and get a count pass "1" as the
* whereClause.
*/
- public int delete(String table, String whereClause, String[] whereArgs) {
+ public int delete(@NonNull String table, @Nullable String whereClause,
+ @Nullable String[] whereArgs) {
acquireReference();
try {
SQLiteStatement statement = new SQLiteStatement(this, "DELETE FROM " + table +
@@ -1980,10 +2019,12 @@
* Passing null will update all rows.
* @param whereArgs You may include ?s in the where clause, which
* will be replaced by the values from whereArgs. The values
- * will be bound as Strings.
+ * will be bound as Strings. If whereClause is null or does not
+ * contain ?s then whereArgs may be null.
* @return the number of rows affected
*/
- public int update(String table, ContentValues values, String whereClause, String[] whereArgs) {
+ public int update(@NonNull String table, @Nullable ContentValues values,
+ @Nullable String whereClause, @Nullable String[] whereArgs) {
return updateWithOnConflict(table, values, whereClause, whereArgs, CONFLICT_NONE);
}
@@ -1997,12 +2038,13 @@
* Passing null will update all rows.
* @param whereArgs You may include ?s in the where clause, which
* will be replaced by the values from whereArgs. The values
- * will be bound as Strings.
+ * will be bound as Strings. If whereClause is null or does not
+ * contain ?s then whereArgs may be null.
* @param conflictAlgorithm for update conflict resolver
* @return the number of rows affected
*/
- public int updateWithOnConflict(String table, ContentValues values,
- String whereClause, String[] whereArgs, int conflictAlgorithm) {
+ public int updateWithOnConflict(@NonNull String table, @Nullable ContentValues values,
+ @Nullable String whereClause, @Nullable String[] whereArgs, int conflictAlgorithm) {
if (values == null || values.isEmpty()) {
throw new IllegalArgumentException("Empty values");
}
@@ -2125,7 +2167,8 @@
* @param bindArgs only byte[], String, Long and Double are supported in bindArgs.
* @throws SQLException if the SQL string is invalid
*/
- public void execSQL(String sql, Object[] bindArgs) throws SQLException {
+ public void execSQL(@NonNull String sql, @NonNull Object[] bindArgs)
+ throws SQLException {
if (bindArgs == null) {
throw new IllegalArgumentException("Empty bindArgs");
}
@@ -2133,7 +2176,8 @@
}
/** {@hide} */
- public int executeSql(String sql, Object[] bindArgs) throws SQLException {
+ public int executeSql(@NonNull String sql, @NonNull Object[] bindArgs)
+ throws SQLException {
acquireReference();
try {
final int statementType = DatabaseUtils.getSqlStatementType(sql);
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index ccc39b6..0396443 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -41,11 +41,6 @@
import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
-import android.renderscript.Allocation;
-import android.renderscript.Element;
-import android.renderscript.RSIllegalArgumentException;
-import android.renderscript.RenderScript;
-import android.renderscript.Type;
import android.text.TextUtils;
import android.util.Log;
import android.view.Surface;
@@ -1007,132 +1002,6 @@
private native final void _addCallbackBuffer(
byte[] callbackBuffer, int msgType);
- /**
- * <p>Create a {@link android.renderscript RenderScript}
- * {@link android.renderscript.Allocation Allocation} to use as a
- * destination of preview callback frames. Use
- * {@link #setPreviewCallbackAllocation setPreviewCallbackAllocation} to use
- * the created Allocation as a destination for camera preview frames.</p>
- *
- * <p>The Allocation will be created with a YUV type, and its contents must
- * be accessed within Renderscript with the {@code rsGetElementAtYuv_*}
- * accessor methods. Its size will be based on the current
- * {@link Parameters#getPreviewSize preview size} configured for this
- * camera.</p>
- *
- * @param rs the RenderScript context for this Allocation.
- * @param usage additional usage flags to set for the Allocation. The usage
- * flag {@link android.renderscript.Allocation#USAGE_IO_INPUT} will always
- * be set on the created Allocation, but additional flags may be provided
- * here.
- * @return a new YUV-type Allocation with dimensions equal to the current
- * preview size.
- * @throws RSIllegalArgumentException if the usage flags are not compatible
- * with an YUV Allocation.
- * @see #setPreviewCallbackAllocation
- * @hide
- */
- public final Allocation createPreviewAllocation(RenderScript rs, int usage)
- throws RSIllegalArgumentException {
- Parameters p = getParameters();
- Size previewSize = p.getPreviewSize();
- Type.Builder yuvBuilder = new Type.Builder(rs,
- Element.createPixel(rs,
- Element.DataType.UNSIGNED_8,
- Element.DataKind.PIXEL_YUV));
- // Use YV12 for wide compatibility. Changing this requires also
- // adjusting camera service's format selection.
- yuvBuilder.setYuvFormat(ImageFormat.YV12);
- yuvBuilder.setX(previewSize.width);
- yuvBuilder.setY(previewSize.height);
-
- Allocation a = Allocation.createTyped(rs, yuvBuilder.create(),
- usage | Allocation.USAGE_IO_INPUT);
-
- return a;
- }
-
- /**
- * <p>Set an {@link android.renderscript.Allocation Allocation} as the
- * target of preview callback data. Use this method for efficient processing
- * of camera preview data with RenderScript. The Allocation must be created
- * with the {@link #createPreviewAllocation createPreviewAllocation }
- * method.</p>
- *
- * <p>Setting a preview allocation will disable any active preview callbacks
- * set by {@link #setPreviewCallback setPreviewCallback} or
- * {@link #setPreviewCallbackWithBuffer setPreviewCallbackWithBuffer}, and
- * vice versa. Using a preview allocation still requires an active standard
- * preview target to be set, either with
- * {@link #setPreviewTexture setPreviewTexture} or
- * {@link #setPreviewDisplay setPreviewDisplay}.</p>
- *
- * <p>To be notified when new frames are available to the Allocation, use
- * {@link android.renderscript.Allocation#setIoInputNotificationHandler Allocation.setIoInputNotificationHandler}. To
- * update the frame currently accessible from the Allocation to the latest
- * preview frame, call
- * {@link android.renderscript.Allocation#ioReceive Allocation.ioReceive}.</p>
- *
- * <p>To disable preview into the Allocation, call this method with a
- * {@code null} parameter.</p>
- *
- * <p>Once a preview allocation is set, the preview size set by
- * {@link Parameters#setPreviewSize setPreviewSize} cannot be changed. If
- * you wish to change the preview size, first remove the preview allocation
- * by calling {@code setPreviewCallbackAllocation(null)}, then change the
- * preview size, create a new preview Allocation with
- * {@link #createPreviewAllocation createPreviewAllocation}, and set it as
- * the new preview callback allocation target.</p>
- *
- * <p>If you are using the preview data to create video or still images,
- * strongly consider using {@link android.media.MediaActionSound} to
- * properly indicate image capture or recording start/stop to the user.</p>
- *
- * @param previewAllocation the allocation to use as destination for preview
- * @throws IOException if configuring the camera to use the Allocation for
- * preview fails.
- * @throws IllegalArgumentException if the Allocation's dimensions or other
- * parameters don't meet the requirements.
- * @see #createPreviewAllocation
- * @see #setPreviewCallback
- * @see #setPreviewCallbackWithBuffer
- * @hide
- */
- public final void setPreviewCallbackAllocation(Allocation previewAllocation)
- throws IOException {
- Surface previewSurface = null;
- if (previewAllocation != null) {
- Parameters p = getParameters();
- Size previewSize = p.getPreviewSize();
- if (previewSize.width != previewAllocation.getType().getX() ||
- previewSize.height != previewAllocation.getType().getY()) {
- throw new IllegalArgumentException(
- "Allocation dimensions don't match preview dimensions: " +
- "Allocation is " +
- previewAllocation.getType().getX() +
- ", " +
- previewAllocation.getType().getY() +
- ". Preview is " + previewSize.width + ", " +
- previewSize.height);
- }
- if ((previewAllocation.getUsage() &
- Allocation.USAGE_IO_INPUT) == 0) {
- throw new IllegalArgumentException(
- "Allocation usage does not include USAGE_IO_INPUT");
- }
- if (previewAllocation.getType().getElement().getDataKind() !=
- Element.DataKind.PIXEL_YUV) {
- throw new IllegalArgumentException(
- "Allocation is not of a YUV type");
- }
- previewSurface = previewAllocation.getSurface();
- mUsingPreviewAllocation = true;
- } else {
- mUsingPreviewAllocation = false;
- }
- setPreviewCallbackSurface(previewSurface);
- }
-
private native final void setPreviewCallbackSurface(Surface s);
private class EventHandler extends Handler
diff --git a/core/java/android/hardware/biometrics/BiometricPrompt.java b/core/java/android/hardware/biometrics/BiometricPrompt.java
index 912e8df..af448f0 100644
--- a/core/java/android/hardware/biometrics/BiometricPrompt.java
+++ b/core/java/android/hardware/biometrics/BiometricPrompt.java
@@ -466,6 +466,19 @@
// LINT.ThenChange(frameworks/base/core/java/android/hardware/biometrics/PromptInfo.java)
/**
+ * Set if emergency call button should show, for example if biometrics are
+ * required to access the dialer app
+ * @param showEmergencyCallButton if true, shows emergency call button
+ * @return This builder.
+ * @hide
+ */
+ @NonNull
+ public Builder setShowEmergencyCallButton(boolean showEmergencyCallButton) {
+ mPromptInfo.setShowEmergencyCallButton(showEmergencyCallButton);
+ return this;
+ }
+
+ /**
* Creates a {@link BiometricPrompt}.
*
* @return An instance of {@link BiometricPrompt}.
diff --git a/core/java/android/hardware/biometrics/PromptInfo.java b/core/java/android/hardware/biometrics/PromptInfo.java
index e275078..24cfd164 100644
--- a/core/java/android/hardware/biometrics/PromptInfo.java
+++ b/core/java/android/hardware/biometrics/PromptInfo.java
@@ -48,6 +48,7 @@
private boolean mAllowBackgroundAuthentication;
private boolean mIgnoreEnrollmentState;
private boolean mIsForLegacyFingerprintManager = false;
+ private boolean mShowEmergencyCallButton = false;
public PromptInfo() {
@@ -72,6 +73,7 @@
mAllowBackgroundAuthentication = in.readBoolean();
mIgnoreEnrollmentState = in.readBoolean();
mIsForLegacyFingerprintManager = in.readBoolean();
+ mShowEmergencyCallButton = in.readBoolean();
}
public static final Creator<PromptInfo> CREATOR = new Creator<PromptInfo>() {
@@ -111,6 +113,7 @@
dest.writeBoolean(mAllowBackgroundAuthentication);
dest.writeBoolean(mIgnoreEnrollmentState);
dest.writeBoolean(mIsForLegacyFingerprintManager);
+ dest.writeBoolean(mShowEmergencyCallButton);
}
// LINT.IfChange
@@ -228,6 +231,10 @@
mAllowedSensorIds.add(sensorId);
}
+ public void setShowEmergencyCallButton(boolean showEmergencyCallButton) {
+ mShowEmergencyCallButton = showEmergencyCallButton;
+ }
+
// Getters
public CharSequence getTitle() {
@@ -309,4 +316,8 @@
public boolean isForLegacyFingerprintManager() {
return mIsForLegacyFingerprintManager;
}
+
+ public boolean isShowEmergencyCallButton() {
+ return mShowEmergencyCallButton;
+ }
}
diff --git a/core/java/android/hardware/camera2/CameraDevice.java b/core/java/android/hardware/camera2/CameraDevice.java
index 0e45787..082a336 100644
--- a/core/java/android/hardware/camera2/CameraDevice.java
+++ b/core/java/android/hardware/camera2/CameraDevice.java
@@ -541,14 +541,6 @@
* or configuring it to use one of the supported
* {@link android.media.CamcorderProfile CamcorderProfiles}.</li>
*
- * <li>For efficient YUV processing with {@link android.renderscript}:
- * Create a RenderScript
- * {@link android.renderscript.Allocation Allocation} with a supported YUV
- * type, the IO_INPUT flag, and one of the sizes returned by
- * {@link StreamConfigurationMap#getOutputSizes(Class) getOutputSizes(Allocation.class)},
- * Then obtain the Surface with
- * {@link android.renderscript.Allocation#getSurface}.</li>
- *
* <li>For access to RAW, uncompressed YUV, or compressed JPEG data in the application: Create an
* {@link android.media.ImageReader} object with one of the supported output formats given by
* {@link StreamConfigurationMap#getOutputFormats()}, setting its size to one of the
diff --git a/core/java/android/hardware/camera2/CameraExtensionCharacteristics.java b/core/java/android/hardware/camera2/CameraExtensionCharacteristics.java
index 6baf91d7..ea951a5 100644
--- a/core/java/android/hardware/camera2/CameraExtensionCharacteristics.java
+++ b/core/java/android/hardware/camera2/CameraExtensionCharacteristics.java
@@ -236,9 +236,10 @@
private static final CameraExtensionManagerGlobal GLOBAL_CAMERA_MANAGER =
new CameraExtensionManagerGlobal();
private final Object mLock = new Object();
- private final int PROXY_SERVICE_DELAY_MS = 1000;
+ private final int PROXY_SERVICE_DELAY_MS = 2000;
private InitializerFuture mInitFuture = null;
private ServiceConnection mConnection = null;
+ private int mConnectionCount = 0;
private ICameraExtensionsProxyService mProxy = null;
private boolean mSupportsAdvancedExtensions = false;
@@ -249,6 +250,15 @@
return GLOBAL_CAMERA_MANAGER;
}
+ private void releaseProxyConnectionLocked(Context ctx) {
+ if (mConnection != null ) {
+ ctx.unbindService(mConnection);
+ mConnection = null;
+ mProxy = null;
+ mConnectionCount = 0;
+ }
+ }
+
private void connectToProxyLocked(Context ctx) {
if (mConnection == null) {
Intent intent = new Intent();
@@ -270,7 +280,6 @@
mConnection = new ServiceConnection() {
@Override
public void onServiceDisconnected(ComponentName component) {
- mInitFuture.setStatus(false);
mConnection = null;
mProxy = null;
}
@@ -348,23 +357,32 @@
public boolean registerClient(Context ctx, IBinder token) {
synchronized (mLock) {
+ boolean ret = false;
connectToProxyLocked(ctx);
if (mProxy == null) {
return false;
}
+ mConnectionCount++;
try {
- return mProxy.registerClient(token);
+ ret = mProxy.registerClient(token);
} catch (RemoteException e) {
Log.e(TAG, "Failed to initialize extension! Extension service does "
+ " not respond!");
}
+ if (!ret) {
+ mConnectionCount--;
+ }
- return false;
+ if (mConnectionCount <= 0) {
+ releaseProxyConnectionLocked(ctx);
+ }
+
+ return ret;
}
}
- public void unregisterClient(IBinder token) {
+ public void unregisterClient(Context ctx, IBinder token) {
synchronized (mLock) {
if (mProxy != null) {
try {
@@ -372,6 +390,11 @@
} catch (RemoteException e) {
Log.e(TAG, "Failed to de-initialize extension! Extension service does"
+ " not respond!");
+ } finally {
+ mConnectionCount--;
+ if (mConnectionCount <= 0) {
+ releaseProxyConnectionLocked(ctx);
+ }
}
}
}
@@ -446,8 +469,8 @@
/**
* @hide
*/
- public static void unregisterClient(IBinder token) {
- CameraExtensionManagerGlobal.get().unregisterClient(token);
+ public static void unregisterClient(Context ctx, IBinder token) {
+ CameraExtensionManagerGlobal.get().unregisterClient(ctx, token);
}
/**
@@ -578,7 +601,7 @@
}
}
} finally {
- unregisterClient(token);
+ unregisterClient(mContext, token);
}
return Collections.unmodifiableList(ret);
@@ -626,7 +649,7 @@
Log.e(TAG, "Failed to query the extension for postview availability! Extension "
+ "service does not respond!");
} finally {
- unregisterClient(token);
+ unregisterClient(mContext, token);
}
return false;
@@ -722,7 +745,7 @@
+ "service does not respond!");
return Collections.emptyList();
} finally {
- unregisterClient(token);
+ unregisterClient(mContext, token);
}
}
@@ -791,7 +814,7 @@
+ " not respond!");
return new ArrayList<>();
} finally {
- unregisterClient(token);
+ unregisterClient(mContext, token);
}
}
@@ -872,7 +895,7 @@
}
}
} finally {
- unregisterClient(token);
+ unregisterClient(mContext, token);
}
} catch (RemoteException e) {
Log.e(TAG, "Failed to query the extension supported sizes! Extension service does"
@@ -957,7 +980,7 @@
Log.e(TAG, "Failed to query the extension capture latency! Extension service does"
+ " not respond!");
} finally {
- unregisterClient(token);
+ unregisterClient(mContext, token);
}
return null;
@@ -998,7 +1021,7 @@
Log.e(TAG, "Failed to query the extension progress callbacks! Extension service does"
+ " not respond!");
} finally {
- unregisterClient(token);
+ unregisterClient(mContext, token);
}
return false;
@@ -1075,7 +1098,7 @@
} catch (RemoteException e) {
throw new IllegalStateException("Failed to query the available capture request keys!");
} finally {
- unregisterClient(token);
+ unregisterClient(mContext, token);
}
return Collections.unmodifiableSet(ret);
@@ -1155,7 +1178,7 @@
} catch (RemoteException e) {
throw new IllegalStateException("Failed to query the available capture result keys!");
} finally {
- unregisterClient(token);
+ unregisterClient(mContext, token);
}
return Collections.unmodifiableSet(ret);
diff --git a/core/java/android/hardware/camera2/camera_platform.aconfig b/core/java/android/hardware/camera2/camera_platform.aconfig
new file mode 100644
index 0000000..67f6300
--- /dev/null
+++ b/core/java/android/hardware/camera2/camera_platform.aconfig
@@ -0,0 +1,8 @@
+package: "com.android.hardware.camera2"
+
+flag {
+ namespace: "camera_platform"
+ name: "initial_test_flag"
+ description: "Flag infrastructure test flag"
+ bug: "292631208"
+}
diff --git a/core/java/android/hardware/camera2/impl/CameraAdvancedExtensionSessionImpl.java b/core/java/android/hardware/camera2/impl/CameraAdvancedExtensionSessionImpl.java
index e06699b..c7e74c0 100644
--- a/core/java/android/hardware/camera2/impl/CameraAdvancedExtensionSessionImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraAdvancedExtensionSessionImpl.java
@@ -90,7 +90,7 @@
private final HashMap<Integer, ImageReader> mReaderMap = new HashMap<>();
private RequestProcessor mRequestProcessor = new RequestProcessor();
private final int mSessionId;
- private final IBinder mToken;
+ private IBinder mToken = null;
private Surface mClientRepeatingRequestSurface;
private Surface mClientCaptureSurface;
@@ -103,6 +103,8 @@
private boolean mInitialized;
private boolean mSessionClosed;
+ private final Context mContext;
+
// Lock to synchronize cross-thread access to device public interface
final Object mInterfaceLock;
@@ -113,14 +115,9 @@
public static CameraAdvancedExtensionSessionImpl createCameraAdvancedExtensionSession(
@NonNull android.hardware.camera2.impl.CameraDeviceImpl cameraDevice,
@NonNull Map<String, CameraCharacteristics> characteristicsMap,
- @NonNull Context ctx, @NonNull ExtensionSessionConfiguration config, int sessionId)
+ @NonNull Context ctx, @NonNull ExtensionSessionConfiguration config, int sessionId,
+ @NonNull IBinder token)
throws CameraAccessException, RemoteException {
- final IBinder token = new Binder(TAG + " : " + sessionId);
- boolean success = CameraExtensionCharacteristics.registerClient(ctx, token);
- if (!success) {
- throw new UnsupportedOperationException("Unsupported extension!");
- }
-
String cameraId = cameraDevice.getId();
CameraExtensionCharacteristics extensionChars = new CameraExtensionCharacteristics(ctx,
cameraId, characteristicsMap);
@@ -204,8 +201,9 @@
IAdvancedExtenderImpl extender = CameraExtensionCharacteristics.initializeAdvancedExtension(
config.getExtension());
extender.init(cameraId, characteristicsMapNative);
- CameraAdvancedExtensionSessionImpl ret = new CameraAdvancedExtensionSessionImpl(extender,
- cameraDevice, characteristicsMapNative, repeatingRequestSurface,
+
+ CameraAdvancedExtensionSessionImpl ret = new CameraAdvancedExtensionSessionImpl(ctx,
+ extender, cameraDevice, characteristicsMapNative, repeatingRequestSurface,
burstCaptureSurface, postviewSurface, config.getStateCallback(),
config.getExecutor(), sessionId, token);
@@ -217,13 +215,16 @@
return ret;
}
- private CameraAdvancedExtensionSessionImpl(@NonNull IAdvancedExtenderImpl extender,
+ private CameraAdvancedExtensionSessionImpl(Context ctx,
+ @NonNull IAdvancedExtenderImpl extender,
@NonNull CameraDeviceImpl cameraDevice,
Map<String, CameraMetadataNative> characteristicsMap,
@Nullable Surface repeatingRequestSurface, @Nullable Surface burstCaptureSurface,
@Nullable Surface postviewSurface,
@NonNull StateCallback callback, @NonNull Executor executor,
- int sessionId, @NonNull IBinder token) {
+ int sessionId,
+ @NonNull IBinder token) {
+ mContext = ctx;
mAdvancedExtender = extender;
mCameraDevice = cameraDevice;
mCharacteristicsMap = characteristicsMap;
@@ -578,12 +579,16 @@
mSessionProcessor = null;
}
- CameraExtensionCharacteristics.unregisterClient(mToken);
- if (mInitialized || (mCaptureSession != null)) {
- notifyClose = true;
- CameraExtensionCharacteristics.releaseSession();
+
+ if (mToken != null) {
+ if (mInitialized || (mCaptureSession != null)) {
+ notifyClose = true;
+ CameraExtensionCharacteristics.releaseSession();
+ }
+ CameraExtensionCharacteristics.unregisterClient(mContext, mToken);
}
mInitialized = false;
+ mToken = null;
for (ImageReader reader : mReaderMap.values()) {
reader.close();
diff --git a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
index d3bde4b..181ab2c 100644
--- a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
@@ -2550,19 +2550,32 @@
HashMap<String, CameraCharacteristics> characteristicsMap = new HashMap<>(
mPhysicalIdsToChars);
characteristicsMap.put(mCameraId, mCharacteristics);
+ boolean initializationFailed = true;
+ IBinder token = new Binder(TAG + " : " + mNextSessionId++);
try {
+ boolean ret = CameraExtensionCharacteristics.registerClient(mContext, token);
+ if (!ret) {
+ token = null;
+ throw new UnsupportedOperationException("Unsupported extension!");
+ }
+
if (CameraExtensionCharacteristics.areAdvancedExtensionsSupported()) {
mCurrentAdvancedExtensionSession =
CameraAdvancedExtensionSessionImpl.createCameraAdvancedExtensionSession(
this, characteristicsMap, mContext, extensionConfiguration,
- mNextSessionId++);
+ mNextSessionId, token);
} else {
mCurrentExtensionSession = CameraExtensionSessionImpl.createCameraExtensionSession(
this, characteristicsMap, mContext, extensionConfiguration,
- mNextSessionId++);
+ mNextSessionId, token);
}
+ initializationFailed = false;
} catch (RemoteException e) {
throw new CameraAccessException(CameraAccessException.CAMERA_ERROR);
+ } finally {
+ if (initializationFailed && (token != null)) {
+ CameraExtensionCharacteristics.unregisterClient(mContext, token);
+ }
}
}
}
diff --git a/core/java/android/hardware/camera2/impl/CameraExtensionSessionImpl.java b/core/java/android/hardware/camera2/impl/CameraExtensionSessionImpl.java
index 5d25681..bf77681 100644
--- a/core/java/android/hardware/camera2/impl/CameraExtensionSessionImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraExtensionSessionImpl.java
@@ -91,7 +91,7 @@
private final Set<CaptureRequest.Key> mSupportedRequestKeys;
private final Set<CaptureResult.Key> mSupportedResultKeys;
private final ExtensionSessionStatsAggregator mStatsAggregator;
- private final IBinder mToken;
+ private IBinder mToken = null;
private boolean mCaptureResultsSupported;
private CameraCaptureSession mCaptureSession = null;
@@ -119,6 +119,8 @@
// will do so internally.
private boolean mInternalRepeatingRequestEnabled = true;
+ private final Context mContext;
+
// Lock to synchronize cross-thread access to device public interface
final Object mInterfaceLock;
@@ -135,14 +137,9 @@
@NonNull Map<String, CameraCharacteristics> characteristicsMap,
@NonNull Context ctx,
@NonNull ExtensionSessionConfiguration config,
- int sessionId)
+ int sessionId,
+ @NonNull IBinder token)
throws CameraAccessException, RemoteException {
- final IBinder token = new Binder(TAG + " : " + sessionId);
- boolean success = CameraExtensionCharacteristics.registerClient(ctx, token);
- if (!success) {
- throw new UnsupportedOperationException("Unsupported extension!");
- }
-
String cameraId = cameraDevice.getId();
CameraExtensionCharacteristics extensionChars = new CameraExtensionCharacteristics(ctx,
cameraId, characteristicsMap);
@@ -234,6 +231,7 @@
characteristicsMap.get(cameraId).getNativeMetadata());
CameraExtensionSessionImpl session = new CameraExtensionSessionImpl(
+ ctx,
extenders.second,
extenders.first,
supportedPreviewSizes,
@@ -256,7 +254,7 @@
return session;
}
- public CameraExtensionSessionImpl(@NonNull IImageCaptureExtenderImpl imageExtender,
+ public CameraExtensionSessionImpl(Context ctx, @NonNull IImageCaptureExtenderImpl imageExtender,
@NonNull IPreviewExtenderImpl previewExtender,
@NonNull List<Size> previewSizes,
@NonNull android.hardware.camera2.impl.CameraDeviceImpl cameraDevice,
@@ -269,6 +267,7 @@
@NonNull IBinder token,
@NonNull Set<CaptureRequest.Key> requestKeys,
@Nullable Set<CaptureResult.Key> resultKeys) {
+ mContext = ctx;
mImageExtender = imageExtender;
mPreviewExtender = previewExtender;
mCameraDevice = cameraDevice;
@@ -878,12 +877,15 @@
+ " respond!");
}
- CameraExtensionCharacteristics.unregisterClient(mToken);
- if (mInitialized || (mCaptureSession != null)) {
- notifyClose = true;
- CameraExtensionCharacteristics.releaseSession();
+ if (mToken != null) {
+ if (mInitialized || (mCaptureSession != null)) {
+ notifyClose = true;
+ CameraExtensionCharacteristics.releaseSession();
+ }
+ CameraExtensionCharacteristics.unregisterClient(mContext, mToken);
}
mInitialized = false;
+ mToken = null;
if (mRepeatingRequestImageCallback != null) {
mRepeatingRequestImageCallback.close();
diff --git a/core/java/android/hardware/camera2/params/OutputConfiguration.java b/core/java/android/hardware/camera2/params/OutputConfiguration.java
index 21540bf..5e53373 100644
--- a/core/java/android/hardware/camera2/params/OutputConfiguration.java
+++ b/core/java/android/hardware/camera2/params/OutputConfiguration.java
@@ -1193,12 +1193,12 @@
String physicalCameraId = source.readString();
boolean isMultiResolutionOutput = source.readInt() == 1;
int[] sensorPixelModesUsed = source.createIntArray();
- long streamUseCase = source.readLong();
checkArgumentInRange(rotation, ROTATION_0, ROTATION_270, "Rotation constant");
long dynamicRangeProfile = source.readLong();
DynamicRangeProfiles.checkProfileValue(dynamicRangeProfile);
int colorSpace = source.readInt();
+ long streamUseCase = source.readLong();
int timestampBase = source.readInt();
int mirrorMode = source.readInt();
diff --git a/core/java/android/hardware/camera2/params/StreamConfigurationMap.java b/core/java/android/hardware/camera2/params/StreamConfigurationMap.java
index ef0db7f..b85d686 100644
--- a/core/java/android/hardware/camera2/params/StreamConfigurationMap.java
+++ b/core/java/android/hardware/camera2/params/StreamConfigurationMap.java
@@ -509,8 +509,6 @@
* Recommended for recording video (simple to use)
* <li>{@link android.media.MediaCodec} -
* Recommended for recording video (more complicated to use, with more flexibility)
- * <li>{@link android.renderscript.Allocation} -
- * Recommended for image processing with {@link android.renderscript RenderScript}
* <li>{@link android.view.SurfaceHolder} -
* Recommended for low-power camera preview with {@link android.view.SurfaceView}
* <li>{@link android.graphics.SurfaceTexture} -
diff --git a/core/java/android/hardware/display/DisplayManagerInternal.java b/core/java/android/hardware/display/DisplayManagerInternal.java
index 94bff89..4700720 100644
--- a/core/java/android/hardware/display/DisplayManagerInternal.java
+++ b/core/java/android/hardware/display/DisplayManagerInternal.java
@@ -370,8 +370,9 @@
/**
* Returns the default size of the surface associated with the display, or null if the surface
- * is not provided for layer mirroring by SurfaceFlinger.
- * Only used for mirroring started from MediaProjection.
+ * is not provided for layer mirroring by SurfaceFlinger. Size is rotated to reflect the current
+ * display device orientation.
+ * Used for mirroring from MediaProjection, or a physical display based on display flags.
*/
public abstract Point getDisplaySurfaceDefaultSize(int displayId);
diff --git a/core/java/android/hardware/fingerprint/FingerprintAuthenticateOptions.java b/core/java/android/hardware/fingerprint/FingerprintAuthenticateOptions.java
index 763246e..dc66542 100644
--- a/core/java/android/hardware/fingerprint/FingerprintAuthenticateOptions.java
+++ b/core/java/android/hardware/fingerprint/FingerprintAuthenticateOptions.java
@@ -21,6 +21,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.hardware.biometrics.AuthenticateOptions;
+import android.hardware.biometrics.common.AuthenticateReason;
import android.os.Parcelable;
import com.android.internal.util.DataClass;
@@ -85,7 +86,16 @@
return null;
}
-
+ /**
+ * The Vendor extension, if any.
+ *
+ * This option may be present when a vendor would like to send additional information for each
+ * auth attempt.
+ */
+ @Nullable private AuthenticateReason.Vendor mVendorReason;
+ private static AuthenticateReason.Vendor defaultVendorReason() {
+ return null;
+ }
// Code below generated by codegen v1.0.23.
//
@@ -107,7 +117,8 @@
boolean ignoreEnrollmentState,
@AuthenticateOptions.DisplayState int displayState,
@NonNull String opPackageName,
- @Nullable String attributionTag) {
+ @Nullable String attributionTag,
+ @Nullable AuthenticateReason.Vendor vendorReason) {
this.mUserId = userId;
this.mSensorId = sensorId;
this.mIgnoreEnrollmentState = ignoreEnrollmentState;
@@ -118,6 +129,7 @@
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mOpPackageName);
this.mAttributionTag = attributionTag;
+ this.mVendorReason = vendorReason;
// onConstructed(); // You can define this method to get a callback
}
@@ -176,6 +188,17 @@
}
/**
+ * The Vendor extension, if any.
+ *
+ * This option may be present when a vendor would like to send additional information for each
+ * auth attempt.
+ */
+ @DataClass.Generated.Member
+ public @Nullable AuthenticateReason.Vendor getVendorReason() {
+ return mVendorReason;
+ }
+
+ /**
* The sensor id for this operation.
*/
@DataClass.Generated.Member
@@ -209,6 +232,18 @@
return this;
}
+ /**
+ * The Vendor extension, if any.
+ *
+ * This option may be present when a vendor would like to send additional information for each
+ * auth attempt.
+ */
+ @DataClass.Generated.Member
+ public @NonNull FingerprintAuthenticateOptions setVendorReason(@NonNull AuthenticateReason.Vendor value) {
+ mVendorReason = value;
+ return this;
+ }
+
@Override
@DataClass.Generated.Member
public boolean equals(@Nullable Object o) {
@@ -227,7 +262,8 @@
&& mIgnoreEnrollmentState == that.mIgnoreEnrollmentState
&& mDisplayState == that.mDisplayState
&& java.util.Objects.equals(mOpPackageName, that.mOpPackageName)
- && java.util.Objects.equals(mAttributionTag, that.mAttributionTag);
+ && java.util.Objects.equals(mAttributionTag, that.mAttributionTag)
+ && java.util.Objects.equals(mVendorReason, that.mVendorReason);
}
@Override
@@ -243,6 +279,7 @@
_hash = 31 * _hash + mDisplayState;
_hash = 31 * _hash + java.util.Objects.hashCode(mOpPackageName);
_hash = 31 * _hash + java.util.Objects.hashCode(mAttributionTag);
+ _hash = 31 * _hash + java.util.Objects.hashCode(mVendorReason);
return _hash;
}
@@ -255,12 +292,14 @@
byte flg = 0;
if (mIgnoreEnrollmentState) flg |= 0x4;
if (mAttributionTag != null) flg |= 0x20;
+ if (mVendorReason != null) flg |= 0x40;
dest.writeByte(flg);
dest.writeInt(mUserId);
dest.writeInt(mSensorId);
dest.writeInt(mDisplayState);
dest.writeString(mOpPackageName);
if (mAttributionTag != null) dest.writeString(mAttributionTag);
+ if (mVendorReason != null) dest.writeTypedObject(mVendorReason, flags);
}
@Override
@@ -281,6 +320,7 @@
int displayState = in.readInt();
String opPackageName = in.readString();
String attributionTag = (flg & 0x20) == 0 ? null : in.readString();
+ AuthenticateReason.Vendor vendorReason = (flg & 0x40) == 0 ? null : (AuthenticateReason.Vendor) in.readTypedObject(AuthenticateReason.Vendor.CREATOR);
this.mUserId = userId;
this.mSensorId = sensorId;
@@ -292,6 +332,7 @@
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mOpPackageName);
this.mAttributionTag = attributionTag;
+ this.mVendorReason = vendorReason;
// onConstructed(); // You can define this method to get a callback
}
@@ -323,6 +364,7 @@
private @AuthenticateOptions.DisplayState int mDisplayState;
private @NonNull String mOpPackageName;
private @Nullable String mAttributionTag;
+ private @Nullable AuthenticateReason.Vendor mVendorReason;
private long mBuilderFieldsSet = 0L;
@@ -400,10 +442,24 @@
return this;
}
+ /**
+ * The Vendor extension, if any.
+ *
+ * This option may be present when a vendor would like to send additional information for each
+ * auth attempt.
+ */
+ @DataClass.Generated.Member
+ public @NonNull Builder setVendorReason(@NonNull AuthenticateReason.Vendor value) {
+ checkNotUsed();
+ mBuilderFieldsSet |= 0x40;
+ mVendorReason = value;
+ return this;
+ }
+
/** Builds the instance. This builder should not be touched after calling this! */
public @NonNull FingerprintAuthenticateOptions build() {
checkNotUsed();
- mBuilderFieldsSet |= 0x40; // Mark builder used
+ mBuilderFieldsSet |= 0x80; // Mark builder used
if ((mBuilderFieldsSet & 0x1) == 0) {
mUserId = defaultUserId();
@@ -423,18 +479,22 @@
if ((mBuilderFieldsSet & 0x20) == 0) {
mAttributionTag = defaultAttributionTag();
}
+ if ((mBuilderFieldsSet & 0x40) == 0) {
+ mVendorReason = defaultVendorReason();
+ }
FingerprintAuthenticateOptions o = new FingerprintAuthenticateOptions(
mUserId,
mSensorId,
mIgnoreEnrollmentState,
mDisplayState,
mOpPackageName,
- mAttributionTag);
+ mAttributionTag,
+ mVendorReason);
return o;
}
private void checkNotUsed() {
- if ((mBuilderFieldsSet & 0x40) != 0) {
+ if ((mBuilderFieldsSet & 0x80) != 0) {
throw new IllegalStateException(
"This Builder should not be reused. Use a new Builder instance instead");
}
@@ -442,10 +502,10 @@
}
@DataClass.Generated(
- time = 1677119626721L,
+ time = 1689703591032L,
codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/hardware/fingerprint/FingerprintAuthenticateOptions.java",
- inputSignatures = "private final int mUserId\nprivate int mSensorId\nprivate final boolean mIgnoreEnrollmentState\nprivate final @android.hardware.biometrics.AuthenticateOptions.DisplayState int mDisplayState\nprivate @android.annotation.NonNull java.lang.String mOpPackageName\nprivate @android.annotation.Nullable java.lang.String mAttributionTag\nprivate static int defaultUserId()\nprivate static int defaultSensorId()\nprivate static boolean defaultIgnoreEnrollmentState()\nprivate static int defaultDisplayState()\nprivate static java.lang.String defaultOpPackageName()\nprivate static java.lang.String defaultAttributionTag()\nclass FingerprintAuthenticateOptions extends java.lang.Object implements [android.hardware.biometrics.AuthenticateOptions, android.os.Parcelable]\n@com.android.internal.util.DataClass(genParcelable=true, genAidl=true, genBuilder=true, genSetters=true, genEqualsHashCode=true)")
+ inputSignatures = "private final int mUserId\nprivate int mSensorId\nprivate final boolean mIgnoreEnrollmentState\nprivate final @android.hardware.biometrics.AuthenticateOptions.DisplayState int mDisplayState\nprivate @android.annotation.NonNull java.lang.String mOpPackageName\nprivate @android.annotation.Nullable java.lang.String mAttributionTag\nprivate @android.annotation.Nullable android.hardware.biometrics.common.AuthenticateReason.Vendor mVendorReason\nprivate static int defaultUserId()\nprivate static int defaultSensorId()\nprivate static boolean defaultIgnoreEnrollmentState()\nprivate static int defaultDisplayState()\nprivate static java.lang.String defaultOpPackageName()\nprivate static java.lang.String defaultAttributionTag()\nprivate static android.hardware.biometrics.common.AuthenticateReason.Vendor defaultVendorReason()\nclass FingerprintAuthenticateOptions extends java.lang.Object implements [android.hardware.biometrics.AuthenticateOptions, android.os.Parcelable]\n@com.android.internal.util.DataClass(genParcelable=true, genAidl=true, genBuilder=true, genSetters=true, genEqualsHashCode=true)")
@Deprecated
private void __metadata() {}
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 795eb4a..8f653b3 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -576,6 +576,12 @@
@EnabledSince(targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
public static final long DISALLOW_INPUT_METHOD_INTERFACE_OVERRIDE = 148086656L;
+ /**
+ * Enable the logic to allow hiding the IME caption bar ("fake" IME navigation bar).
+ * @hide
+ */
+ public static final boolean ENABLE_HIDE_IME_CAPTION_BAR = true;
+
LayoutInflater mInflater;
TypedArray mThemeAttrs;
@UnsupportedAppUsage
diff --git a/core/java/android/inputmethodservice/NavigationBarController.java b/core/java/android/inputmethodservice/NavigationBarController.java
index 78388ef..c01664e 100644
--- a/core/java/android/inputmethodservice/NavigationBarController.java
+++ b/core/java/android/inputmethodservice/NavigationBarController.java
@@ -16,6 +16,8 @@
package android.inputmethodservice;
+import static android.inputmethodservice.InputMethodService.ENABLE_HIDE_IME_CAPTION_BAR;
+import static android.view.WindowInsets.Type.captionBar;
import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS;
import android.animation.ValueAnimator;
@@ -230,6 +232,16 @@
setIconTintInternal(calculateTargetDarkIntensity(mAppearance,
mDrawLegacyNavigationBarBackground));
+
+ if (ENABLE_HIDE_IME_CAPTION_BAR) {
+ mNavigationBarFrame.setOnApplyWindowInsetsListener((view, insets) -> {
+ if (mNavigationBarFrame != null) {
+ boolean visible = insets.isVisible(captionBar());
+ mNavigationBarFrame.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
+ }
+ return view.onApplyWindowInsets(insets);
+ });
+ }
}
private void uninstallNavigationBarFrameIfNecessary() {
@@ -240,6 +252,9 @@
if (parent instanceof ViewGroup) {
((ViewGroup) parent).removeView(mNavigationBarFrame);
}
+ if (ENABLE_HIDE_IME_CAPTION_BAR) {
+ mNavigationBarFrame.setOnApplyWindowInsetsListener(null);
+ }
mNavigationBarFrame = null;
}
@@ -414,7 +429,9 @@
decor.bringChildToFront(mNavigationBarFrame);
}
}
- mNavigationBarFrame.setVisibility(View.VISIBLE);
+ if (!ENABLE_HIDE_IME_CAPTION_BAR) {
+ mNavigationBarFrame.setVisibility(View.VISIBLE);
+ }
}
}
@@ -435,6 +452,11 @@
mShouldShowImeSwitcherWhenImeIsShown;
mShouldShowImeSwitcherWhenImeIsShown = shouldShowImeSwitcherWhenImeIsShown;
+ if (ENABLE_HIDE_IME_CAPTION_BAR) {
+ mService.mWindow.getWindow().getDecorView().getWindowInsetsController()
+ .setImeCaptionBarInsetsHeight(getImeCaptionBarHeight());
+ }
+
if (imeDrawsImeNavBar) {
installNavigationBarFrameIfNecessary();
if (mNavigationBarFrame == null) {
@@ -528,6 +550,16 @@
return drawLegacyNavigationBarBackground;
}
+ /**
+ * Returns the height of the IME caption bar if this should be shown, or {@code 0} instead.
+ */
+ private int getImeCaptionBarHeight() {
+ return mImeDrawsImeNavBar
+ ? mService.getResources().getDimensionPixelSize(
+ com.android.internal.R.dimen.navigation_bar_frame_height)
+ : 0;
+ }
+
@Override
public String toDebugString() {
return "{mImeDrawsImeNavBar=" + mImeDrawsImeNavBar
diff --git a/core/java/android/inputmethodservice/SoftInputWindow.java b/core/java/android/inputmethodservice/SoftInputWindow.java
index 5704dac..e4a09a6 100644
--- a/core/java/android/inputmethodservice/SoftInputWindow.java
+++ b/core/java/android/inputmethodservice/SoftInputWindow.java
@@ -79,6 +79,13 @@
@WindowState
private int mWindowState = WindowState.TOKEN_PENDING;
+ @Override
+ protected boolean allowsRegisterDefaultOnBackInvokedCallback() {
+ // Do not register OnBackInvokedCallback from Dialog#onStart, InputMethodService will
+ // register CompatOnBackInvokedCallback for input method window.
+ return false;
+ }
+
/**
* Set {@link IBinder} window token to the window.
*
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index 42c5626..8482945 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -19,6 +19,7 @@
import static android.os.BatteryStatsManager.NUM_WIFI_STATES;
import static android.os.BatteryStatsManager.NUM_WIFI_SUPPL_STATES;
+import android.annotation.CurrentTimeMillisLong;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -55,6 +56,7 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.os.BatteryStatsHistoryIterator;
import com.android.internal.os.CpuScalingPolicies;
+import com.android.internal.os.PowerStats;
import com.google.android.collect.Lists;
@@ -1793,75 +1795,55 @@
}
/**
- * Measured energy delta from the previous reading.
+ * An extension to the history item describing a proc state change for a UID.
*/
- public static final class EnergyConsumerDetails {
- /**
- * Description of the energy consumer, such as CPU, DISPLAY etc
- */
- public static final class EnergyConsumer {
- /**
- * See android.hardware.power.stats.EnergyConsumerType
- */
- public int type;
- /**
- * Used when there are multipe energy consumers of the same type, such
- * as CPU clusters, multiple displays on foldable devices etc.
- */
- public int ordinal;
- /**
- * Human-readable name of the energy consumer, e.g. "CPU"
- */
- public String name;
- }
- public EnergyConsumer[] consumers;
- public long[] chargeUC;
-
- @Override
- public String toString() {
- final StringBuilder sb = new StringBuilder();
- for (int i = 0; i < consumers.length; i++) {
- if (chargeUC[i] == POWER_DATA_UNAVAILABLE) {
- continue;
- }
- if (sb.length() != 0) {
- sb.append(' ');
- }
- sb.append(consumers[i].name);
- sb.append('=');
- sb.append(chargeUC[i]);
- }
- return sb.toString();
- }
- }
-
- /**
- * CPU usage for a given UID.
- */
- public static final class CpuUsageDetails {
- /**
- * Descriptions of CPU power brackets, see PowerProfile.getCpuPowerBracketDescription
- */
- public String[] cpuBracketDescriptions;
+ public static final class ProcessStateChange {
public int uid;
- /**
- * The delta, in milliseconds, per CPU power bracket, from the previous record for the
- * same UID.
- */
- public long[] cpuUsageMs;
+ public @BatteryConsumer.ProcessState int processState;
- @Override
- public String toString() {
- final StringBuilder sb = new StringBuilder();
- UserHandle.formatUid(sb, uid);
- sb.append(": ");
- for (int bracket = 0; bracket < cpuUsageMs.length; bracket++) {
- if (bracket != 0) {
- sb.append(", ");
- }
- sb.append(cpuUsageMs[bracket]);
+ private static final int LARGE_UID_FLAG = 0x80000000;
+ private static final int SMALL_UID_MASK = 0x00FFFFFF;
+ private static final int PROC_STATE_MASK = 0x7F000000;
+ private static final int PROC_STATE_SHIFT = Integer.numberOfTrailingZeros(PROC_STATE_MASK);
+
+ /**
+ * Writes this object to the supplied parcel.
+ */
+ public void writeToParcel(Parcel out) {
+ int bits = processState << PROC_STATE_SHIFT;
+ if ((uid & ~SMALL_UID_MASK) == 0) {
+ bits |= uid;
+ out.writeInt(bits);
+ } else {
+ bits |= LARGE_UID_FLAG;
+ out.writeInt(bits);
+ out.writeInt(uid);
}
- return sb.toString();
+ }
+
+ /**
+ * Reads this object from the supplied parcel.
+ */
+ public void readFromParcel(Parcel in) {
+ int bits = in.readInt();
+ processState = (bits & PROC_STATE_MASK) >>> PROC_STATE_SHIFT;
+ if (processState >= BatteryConsumer.PROCESS_STATE_COUNT) {
+ Slog.e(TAG, "Unrecognized proc state in battery history: " + processState);
+ processState = BatteryConsumer.PROCESS_STATE_UNSPECIFIED;
+ }
+ if ((bits & LARGE_UID_FLAG) == 0) {
+ uid = bits & ~PROC_STATE_MASK;
+ } else {
+ uid = in.readInt();
+ }
+ }
+
+ /**
+ * String representation for inclusion in the battery history dump.
+ */
+ public String formatForBatteryHistory() {
+ return UserHandle.formatUid(uid) + ": "
+ + BatteryConsumer.processStateToString(processState);
}
}
@@ -2008,11 +1990,11 @@
// Non-null when there is more detailed information at this step.
public HistoryStepDetails stepDetails;
- // Non-null when there is energy consumer information
- public EnergyConsumerDetails energyConsumerDetails;
+ // Non-null when there are power stats to be written to history
+ public PowerStats powerStats;
- // Non-null when there is CPU usage information
- public CpuUsageDetails cpuUsageDetails;
+ // Non-null when there is procstate change to be written to history
+ public ProcessStateChange processStateChange;
public static final int EVENT_FLAG_START = 0x8000;
public static final int EVENT_FLAG_FINISH = 0x4000;
@@ -2110,6 +2092,7 @@
public final HistoryTag localWakelockTag = new HistoryTag();
public final HistoryTag localWakeReasonTag = new HistoryTag();
public final HistoryTag localEventTag = new HistoryTag();
+ public final ProcessStateChange localProcessStateChange = new ProcessStateChange();
// Includes a tag's first occurrence in the parcel, so the value of the tag is written
// rather than just its index in the history tag pool.
@@ -2222,8 +2205,8 @@
eventCode = EVENT_NONE;
eventTag = null;
tagsFirstOccurrence = false;
- energyConsumerDetails = null;
- cpuUsageDetails = null;
+ powerStats = null;
+ processStateChange = null;
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@@ -2273,8 +2256,8 @@
}
tagsFirstOccurrence = o.tagsFirstOccurrence;
currentTime = o.currentTime;
- energyConsumerDetails = o.energyConsumerDetails;
- cpuUsageDetails = o.cpuUsageDetails;
+ powerStats = o.powerStats;
+ processStateChange = o.processStateChange;
}
public boolean sameNonEvent(HistoryItem o) {
@@ -2434,8 +2417,14 @@
* Returns a BatteryStatsHistoryIterator. Battery history will continue being writable,
* but the iterator will continue iterating over the snapshot taken at the time this method
* is called.
+ *
+ * @param startTimeMs wall-clock time to start iterating from, inclusive
+ * @param endTimeMs wall-clock time to stop iterating, exclusive.
+ * Pass 0 to indicate current time.
*/
- public abstract BatteryStatsHistoryIterator iterateBatteryStatsHistory();
+ public abstract BatteryStatsHistoryIterator iterateBatteryStatsHistory(
+ @CurrentTimeMillisLong long startTimeMs,
+ @CurrentTimeMillisLong long endTimeMs);
/**
* Returns the number of times the device has been started.
@@ -6911,25 +6900,6 @@
private String printNextItem(HistoryItem rec, long baseTime, boolean checkin,
boolean verbose) {
StringBuilder item = new StringBuilder();
-
- if (rec.cpuUsageDetails != null
- && rec.cpuUsageDetails.cpuBracketDescriptions != null
- && checkin) {
- String[] descriptions = rec.cpuUsageDetails.cpuBracketDescriptions;
- for (int bracket = 0; bracket < descriptions.length; bracket++) {
- item.append(BATTERY_STATS_CHECKIN_VERSION);
- item.append(',');
- item.append(HISTORY_DATA);
- item.append(",0,XB,");
- item.append(descriptions.length);
- item.append(',');
- item.append(bracket);
- item.append(',');
- item.append(descriptions[bracket]);
- item.append("\n");
- }
- }
-
if (!checkin) {
item.append(" ");
TimeUtils.formatDuration(
@@ -7165,57 +7135,19 @@
item.append("\"");
}
}
- boolean firstExtension = true;
- if (rec.energyConsumerDetails != null) {
- firstExtension = false;
+ if (rec.powerStats != null && verbose) {
if (!checkin) {
- item.append(" ext=energy:");
- item.append(rec.energyConsumerDetails);
- } else {
- item.append(",XE");
- for (int i = 0; i < rec.energyConsumerDetails.consumers.length; i++) {
- if (rec.energyConsumerDetails.chargeUC[i] != POWER_DATA_UNAVAILABLE) {
- item.append(',');
- item.append(rec.energyConsumerDetails.consumers[i].name);
- item.append('=');
- item.append(rec.energyConsumerDetails.chargeUC[i]);
- }
- }
+ item.append(
+ "\n Stats: ");
+ item.append(rec.powerStats.formatForBatteryHistory(
+ "\n "));
}
}
- if (rec.cpuUsageDetails != null) {
+ if (rec.processStateChange != null && verbose) {
if (!checkin) {
- if (!firstExtension) {
- item.append("\n ");
- }
- String[] descriptions = rec.cpuUsageDetails.cpuBracketDescriptions;
- if (descriptions != null) {
- for (int bracket = 0; bracket < descriptions.length; bracket++) {
- item.append(" ext=cpu-bracket:");
- item.append(bracket);
- item.append(":");
- item.append(descriptions[bracket]);
- item.append("\n ");
- }
- }
- item.append(" ext=cpu:");
- item.append(rec.cpuUsageDetails);
- } else {
- if (!firstExtension) {
- item.append('\n');
- item.append(BATTERY_STATS_CHECKIN_VERSION);
- item.append(',');
- item.append(HISTORY_DATA);
- item.append(",0");
- }
- item.append(",XC,");
- item.append(rec.cpuUsageDetails.uid);
- for (int i = 0; i < rec.cpuUsageDetails.cpuUsageMs.length; i++) {
- item.append(',');
- item.append(rec.cpuUsageDetails.cpuUsageMs[i]);
- }
+ item.append(" procstate: ");
+ item.append(rec.processStateChange.formatForBatteryHistory());
}
- firstExtension = false;
}
item.append("\n");
if (rec.stepDetails != null) {
@@ -7537,7 +7469,7 @@
long baseTime = -1;
boolean printed = false;
HistoryEventTracker tracker = null;
- try (BatteryStatsHistoryIterator iterator = iterateBatteryStatsHistory()) {
+ try (BatteryStatsHistoryIterator iterator = iterateBatteryStatsHistory(0, 0)) {
HistoryItem rec;
while ((rec = iterator.next()) != null) {
try {
@@ -8460,7 +8392,7 @@
long baseTime = -1;
boolean printed = false;
HistoryEventTracker tracker = null;
- try (BatteryStatsHistoryIterator iterator = iterateBatteryStatsHistory()) {
+ try (BatteryStatsHistoryIterator iterator = iterateBatteryStatsHistory(0, 0)) {
HistoryItem rec;
while ((rec = iterator.next()) != null) {
lastTime = rec.time;
diff --git a/core/java/android/os/BatteryUsageStats.java b/core/java/android/os/BatteryUsageStats.java
index e2c52ce..7586bf7 100644
--- a/core/java/android/os/BatteryUsageStats.java
+++ b/core/java/android/os/BatteryUsageStats.java
@@ -315,7 +315,7 @@
throw new IllegalStateException(
"Battery history was not requested in the BatteryUsageStatsQuery");
}
- return new BatteryStatsHistoryIterator(mBatteryStatsHistory);
+ return new BatteryStatsHistoryIterator(mBatteryStatsHistory, 0, 0);
}
@Override
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index eb471705..509c3b8 100755
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -1560,7 +1560,7 @@
String attestProp = getString(
TextUtils.formatSimple("ro.product.%s_for_attestation", property));
return attestProp.equals(UNKNOWN)
- ? getString(TextUtils.formatSimple("ro.product.vendor.%s", property)) : UNKNOWN;
+ ? getString(TextUtils.formatSimple("ro.product.vendor.%s", property)) : attestProp;
}
private static String[] getStringList(String property, String separator) {
diff --git a/core/java/android/os/DropBoxManager.java b/core/java/android/os/DropBoxManager.java
index 403f55c..cf35460 100644
--- a/core/java/android/os/DropBoxManager.java
+++ b/core/java/android/os/DropBoxManager.java
@@ -364,7 +364,7 @@
}
/**
- * Checks any blacklists (set in system settings) to see whether a certain
+ * Checks any denylists (set in system settings) to see whether a certain
* tag is allowed. Entries with disabled tags will be dropped immediately,
* so you can save the work of actually constructing and sending the data.
*
diff --git a/core/java/android/os/OWNERS b/core/java/android/os/OWNERS
index 6ef1dc0..8f7725ec 100644
--- a/core/java/android/os/OWNERS
+++ b/core/java/android/os/OWNERS
@@ -10,6 +10,7 @@
# BatteryStats
per-file *BatteryConsumer* = file:/BATTERY_STATS_OWNERS
per-file BatteryManager* = file:/BATTERY_STATS_OWNERS
+per-file PowerMonitor* = file:/BATTERY_STATS_OWNERS
per-file PowerComponents.java = file:/BATTERY_STATS_OWNERS
per-file *Stats* = file:/BATTERY_STATS_OWNERS
diff --git a/core/java/android/os/SystemVibrator.java b/core/java/android/os/SystemVibrator.java
index bf72b1d..2cda787 100644
--- a/core/java/android/os/SystemVibrator.java
+++ b/core/java/android/os/SystemVibrator.java
@@ -18,26 +18,19 @@
import android.annotation.CallbackExecutor;
import android.annotation.NonNull;
-import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
-import android.hardware.vibrator.IVibrator;
+import android.os.vibrator.VibratorInfoFactory;
import android.util.ArrayMap;
import android.util.Log;
-import android.util.Range;
-import android.util.Slog;
import android.util.SparseArray;
-import android.util.SparseBooleanArray;
-import android.util.SparseIntArray;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Objects;
import java.util.concurrent.Executor;
-import java.util.function.Function;
/**
* Vibrator implementation that controls the main system vibrator.
@@ -82,7 +75,7 @@
if (vibratorIds.length == 0) {
// It is known that the device has no vibrator, so cache and return info that
// reflects the lack of support for effects/primitives.
- return mVibratorInfo = new NoVibratorInfo();
+ return mVibratorInfo = VibratorInfo.EMPTY_VIBRATOR_INFO;
}
VibratorInfo[] vibratorInfos = new VibratorInfo[vibratorIds.length];
for (int i = 0; i < vibratorIds.length; i++) {
@@ -96,12 +89,7 @@
}
vibratorInfos[i] = vibrator.getInfo();
}
- if (vibratorInfos.length == 1) {
- // Device has a single vibrator info, cache and return successfully loaded info.
- return mVibratorInfo = new VibratorInfo(/* id= */ -1, vibratorInfos[0]);
- }
- // Device has multiple vibrators, generate a single info representing all of them.
- return mVibratorInfo = new MultiVibratorInfo(vibratorInfos);
+ return mVibratorInfo = VibratorInfoFactory.create(/* id= */ -1, vibratorInfos);
}
}
@@ -275,296 +263,6 @@
}
/**
- * Represents a device with no vibrator as a single {@link VibratorInfo}.
- *
- * @hide
- */
- @VisibleForTesting
- public static class NoVibratorInfo extends VibratorInfo {
- public NoVibratorInfo() {
- // Use empty arrays to indicate no support, while null would indicate support unknown.
- super(/* id= */ -1,
- /* capabilities= */ 0,
- /* supportedEffects= */ new SparseBooleanArray(),
- /* supportedBraking= */ new SparseBooleanArray(),
- /* supportedPrimitives= */ new SparseIntArray(),
- /* primitiveDelayMax= */ 0,
- /* compositionSizeMax= */ 0,
- /* pwlePrimitiveDurationMax= */ 0,
- /* pwleSizeMax= */ 0,
- /* qFactor= */ Float.NaN,
- new FrequencyProfile(/* resonantFrequencyHz= */ Float.NaN,
- /* minFrequencyHz= */ Float.NaN,
- /* frequencyResolutionHz= */ Float.NaN,
- /* maxAmplitudes= */ null));
- }
- }
-
- /**
- * Represents multiple vibrator information as a single {@link VibratorInfo}.
- *
- * <p>This uses an intersection of all vibrators to decide the capabilities and effect/primitive
- * support.
- *
- * @hide
- */
- @VisibleForTesting
- public static class MultiVibratorInfo extends VibratorInfo {
- // Epsilon used for float comparison applied in calculations for the merged info.
- private static final float EPSILON = 1e-5f;
-
- public MultiVibratorInfo(VibratorInfo[] vibrators) {
- // Need to use an extra constructor to share the computation in super initialization.
- this(vibrators, frequencyProfileIntersection(vibrators));
- }
-
- private MultiVibratorInfo(VibratorInfo[] vibrators,
- VibratorInfo.FrequencyProfile mergedProfile) {
- super(/* id= */ -1,
- capabilitiesIntersection(vibrators, mergedProfile.isEmpty()),
- supportedEffectsIntersection(vibrators),
- supportedBrakingIntersection(vibrators),
- supportedPrimitivesAndDurationsIntersection(vibrators),
- integerLimitIntersection(vibrators, VibratorInfo::getPrimitiveDelayMax),
- integerLimitIntersection(vibrators, VibratorInfo::getCompositionSizeMax),
- integerLimitIntersection(vibrators, VibratorInfo::getPwlePrimitiveDurationMax),
- integerLimitIntersection(vibrators, VibratorInfo::getPwleSizeMax),
- floatPropertyIntersection(vibrators, VibratorInfo::getQFactor),
- mergedProfile);
- }
-
- private static int capabilitiesIntersection(VibratorInfo[] infos,
- boolean frequencyProfileIsEmpty) {
- int intersection = ~0;
- for (VibratorInfo info : infos) {
- intersection &= info.getCapabilities();
- }
- if (frequencyProfileIsEmpty) {
- // Revoke frequency control if the merged frequency profile ended up empty.
- intersection &= ~IVibrator.CAP_FREQUENCY_CONTROL;
- }
- return intersection;
- }
-
- @Nullable
- private static SparseBooleanArray supportedBrakingIntersection(VibratorInfo[] infos) {
- for (VibratorInfo info : infos) {
- if (!info.isBrakingSupportKnown()) {
- // If one vibrator support is unknown, then the intersection is also unknown.
- return null;
- }
- }
-
- SparseBooleanArray intersection = new SparseBooleanArray();
- SparseBooleanArray firstVibratorBraking = infos[0].getSupportedBraking();
-
- brakingIdLoop:
- for (int i = 0; i < firstVibratorBraking.size(); i++) {
- int brakingId = firstVibratorBraking.keyAt(i);
- if (!firstVibratorBraking.valueAt(i)) {
- // The first vibrator already doesn't support this braking, so skip it.
- continue brakingIdLoop;
- }
-
- for (int j = 1; j < infos.length; j++) {
- if (!infos[j].hasBrakingSupport(brakingId)) {
- // One vibrator doesn't support this braking, so the intersection doesn't.
- continue brakingIdLoop;
- }
- }
-
- intersection.put(brakingId, true);
- }
-
- return intersection;
- }
-
- @Nullable
- private static SparseBooleanArray supportedEffectsIntersection(VibratorInfo[] infos) {
- for (VibratorInfo info : infos) {
- if (!info.isEffectSupportKnown()) {
- // If one vibrator support is unknown, then the intersection is also unknown.
- return null;
- }
- }
-
- SparseBooleanArray intersection = new SparseBooleanArray();
- SparseBooleanArray firstVibratorEffects = infos[0].getSupportedEffects();
-
- effectIdLoop:
- for (int i = 0; i < firstVibratorEffects.size(); i++) {
- int effectId = firstVibratorEffects.keyAt(i);
- if (!firstVibratorEffects.valueAt(i)) {
- // The first vibrator already doesn't support this effect, so skip it.
- continue effectIdLoop;
- }
-
- for (int j = 1; j < infos.length; j++) {
- if (infos[j].isEffectSupported(effectId) != VIBRATION_EFFECT_SUPPORT_YES) {
- // One vibrator doesn't support this effect, so the intersection doesn't.
- continue effectIdLoop;
- }
- }
-
- intersection.put(effectId, true);
- }
-
- return intersection;
- }
-
- @NonNull
- private static SparseIntArray supportedPrimitivesAndDurationsIntersection(
- VibratorInfo[] infos) {
- SparseIntArray intersection = new SparseIntArray();
- SparseIntArray firstVibratorPrimitives = infos[0].getSupportedPrimitives();
-
- primitiveIdLoop:
- for (int i = 0; i < firstVibratorPrimitives.size(); i++) {
- int primitiveId = firstVibratorPrimitives.keyAt(i);
- int primitiveDuration = firstVibratorPrimitives.valueAt(i);
- if (primitiveDuration == 0) {
- // The first vibrator already doesn't support this primitive, so skip it.
- continue primitiveIdLoop;
- }
-
- for (int j = 1; j < infos.length; j++) {
- int vibratorPrimitiveDuration = infos[j].getPrimitiveDuration(primitiveId);
- if (vibratorPrimitiveDuration == 0) {
- // One vibrator doesn't support this primitive, so the intersection doesn't.
- continue primitiveIdLoop;
- } else {
- // The primitive vibration duration is the maximum among all vibrators.
- primitiveDuration = Math.max(primitiveDuration, vibratorPrimitiveDuration);
- }
- }
-
- intersection.put(primitiveId, primitiveDuration);
- }
- return intersection;
- }
-
- private static int integerLimitIntersection(VibratorInfo[] infos,
- Function<VibratorInfo, Integer> propertyGetter) {
- int limit = 0; // Limit 0 means unlimited
- for (VibratorInfo info : infos) {
- int vibratorLimit = propertyGetter.apply(info);
- if ((limit == 0) || (vibratorLimit > 0 && vibratorLimit < limit)) {
- // This vibrator is limited and intersection is unlimited or has a larger limit:
- // use smaller limit here for the intersection.
- limit = vibratorLimit;
- }
- }
- return limit;
- }
-
- private static float floatPropertyIntersection(VibratorInfo[] infos,
- Function<VibratorInfo, Float> propertyGetter) {
- float property = propertyGetter.apply(infos[0]);
- if (Float.isNaN(property)) {
- // If one vibrator is undefined then the intersection is undefined.
- return Float.NaN;
- }
- for (int i = 1; i < infos.length; i++) {
- if (Float.compare(property, propertyGetter.apply(infos[i])) != 0) {
- // If one vibrator has a different value then the intersection is undefined.
- return Float.NaN;
- }
- }
- return property;
- }
-
- @NonNull
- private static FrequencyProfile frequencyProfileIntersection(VibratorInfo[] infos) {
- float freqResolution = floatPropertyIntersection(infos,
- info -> info.getFrequencyProfile().getFrequencyResolutionHz());
- float resonantFreq = floatPropertyIntersection(infos,
- VibratorInfo::getResonantFrequencyHz);
- Range<Float> freqRange = frequencyRangeIntersection(infos, freqResolution);
-
- if ((freqRange == null) || Float.isNaN(freqResolution)) {
- return new FrequencyProfile(resonantFreq, Float.NaN, freqResolution, null);
- }
-
- int amplitudeCount =
- Math.round(1 + (freqRange.getUpper() - freqRange.getLower()) / freqResolution);
- float[] maxAmplitudes = new float[amplitudeCount];
-
- // Use MAX_VALUE here to ensure that the FrequencyProfile constructor called with this
- // will fail if the loop below is broken and do not replace filled values with actual
- // vibrator measurements.
- Arrays.fill(maxAmplitudes, Float.MAX_VALUE);
-
- for (VibratorInfo info : infos) {
- Range<Float> vibratorFreqRange = info.getFrequencyProfile().getFrequencyRangeHz();
- float[] vibratorMaxAmplitudes = info.getFrequencyProfile().getMaxAmplitudes();
- int vibratorStartIdx = Math.round(
- (freqRange.getLower() - vibratorFreqRange.getLower()) / freqResolution);
- int vibratorEndIdx = vibratorStartIdx + maxAmplitudes.length - 1;
-
- if ((vibratorStartIdx < 0) || (vibratorEndIdx >= vibratorMaxAmplitudes.length)) {
- Slog.w(TAG, "Error calculating the intersection of vibrator frequency"
- + " profiles: attempted to fetch from vibrator "
- + info.getId() + " max amplitude with bad index " + vibratorStartIdx);
- return new FrequencyProfile(resonantFreq, Float.NaN, Float.NaN, null);
- }
-
- for (int i = 0; i < maxAmplitudes.length; i++) {
- maxAmplitudes[i] = Math.min(maxAmplitudes[i],
- vibratorMaxAmplitudes[vibratorStartIdx + i]);
- }
- }
-
- return new FrequencyProfile(resonantFreq, freqRange.getLower(),
- freqResolution, maxAmplitudes);
- }
-
- @Nullable
- private static Range<Float> frequencyRangeIntersection(VibratorInfo[] infos,
- float frequencyResolution) {
- Range<Float> firstRange = infos[0].getFrequencyProfile().getFrequencyRangeHz();
- if (firstRange == null) {
- // If one vibrator is undefined then the intersection is undefined.
- return null;
- }
- float intersectionLower = firstRange.getLower();
- float intersectionUpper = firstRange.getUpper();
-
- // Generate the intersection of all vibrator supported ranges, making sure that both
- // min supported frequencies are aligned w.r.t. the frequency resolution.
-
- for (int i = 1; i < infos.length; i++) {
- Range<Float> vibratorRange = infos[i].getFrequencyProfile().getFrequencyRangeHz();
- if (vibratorRange == null) {
- // If one vibrator is undefined then the intersection is undefined.
- return null;
- }
-
- if ((vibratorRange.getLower() >= intersectionUpper)
- || (vibratorRange.getUpper() <= intersectionLower)) {
- // If the range and intersection are disjoint then the intersection is undefined
- return null;
- }
-
- float frequencyDelta = Math.abs(intersectionLower - vibratorRange.getLower());
- if ((frequencyDelta % frequencyResolution) > EPSILON) {
- // If the intersection is not aligned with one vibrator then it's undefined
- return null;
- }
-
- intersectionLower = Math.max(intersectionLower, vibratorRange.getLower());
- intersectionUpper = Math.min(intersectionUpper, vibratorRange.getUpper());
- }
-
- if ((intersectionUpper - intersectionLower) < frequencyResolution) {
- // If the intersection is empty then it's undefined.
- return null;
- }
-
- return Range.create(intersectionLower, intersectionUpper);
- }
- }
-
- /**
* Listener for all vibrators state change.
*
* <p>This registers a listener to all vibrators to merge the callbacks into a single state
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index ba1f979..d8cf4de 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -4618,6 +4618,26 @@
}
/**
+ * Returns number of full users on the device.
+ * @hide
+ */
+ @RequiresPermission(anyOf = {
+ android.Manifest.permission.MANAGE_USERS,
+ android.Manifest.permission.CREATE_USERS
+ })
+ public int getFullUserCount() {
+ List<UserInfo> users = getUsers(/* excludePartial= */ true, /* excludeDying= */ true,
+ /* excludePreCreated= */ true);
+ int count = 0;
+ for (UserInfo user : users) {
+ if (user.isFull()) {
+ count++;
+ }
+ }
+ return count;
+ }
+
+ /**
* @deprecated use {@link #getAliveUsers()} for {@code getUsers(true)}, or
* {@link #getUsers()} for @code getUsers(false)}.
*
diff --git a/core/java/android/os/VibrationEffect.java b/core/java/android/os/VibrationEffect.java
index b24b45d..08b32bf 100644
--- a/core/java/android/os/VibrationEffect.java
+++ b/core/java/android/os/VibrationEffect.java
@@ -525,14 +525,14 @@
public abstract long getDuration();
/**
- * Checks if a given {@link Vibrator} can play this effect as intended.
+ * Checks if a vibrator with a given {@link VibratorInfo} can play this effect as intended.
*
- * <p>See @link Vibrator#areVibrationFeaturesSupported(VibrationEffect)} for more information
- * about what counts as supported by a vibrator, and what counts as not.
+ * <p>See {@link VibratorInfo#areVibrationFeaturesSupported(VibrationEffect)} for more
+ * information about what counts as supported by a vibrator, and what counts as not.
*
* @hide
*/
- public abstract boolean areVibrationFeaturesSupported(@NonNull Vibrator vibrator);
+ public abstract boolean areVibrationFeaturesSupported(@NonNull VibratorInfo vibratorInfo);
/**
* Returns true if this effect could represent a touch haptic feedback.
@@ -813,9 +813,9 @@
/** @hide */
@Override
- public boolean areVibrationFeaturesSupported(@NonNull Vibrator vibrator) {
+ public boolean areVibrationFeaturesSupported(@NonNull VibratorInfo vibratorInfo) {
for (VibrationEffectSegment segment : mSegments) {
- if (!segment.areVibrationFeaturesSupported(vibrator)) {
+ if (!segment.areVibrationFeaturesSupported(vibratorInfo)) {
return false;
}
}
diff --git a/core/java/android/os/Vibrator.java b/core/java/android/os/Vibrator.java
index 4e852e3..79e0ca8 100644
--- a/core/java/android/os/Vibrator.java
+++ b/core/java/android/os/Vibrator.java
@@ -216,9 +216,7 @@
*/
@TestApi
public boolean hasFrequencyControl() {
- // We currently can only control frequency of the vibration using the compose PWLE method.
- return getInfo().hasCapability(
- IVibrator.CAP_FREQUENCY_CONTROL | IVibrator.CAP_COMPOSE_PWLE_EFFECTS);
+ return getInfo().hasFrequencyControl();
}
/**
@@ -240,7 +238,7 @@
* @hide
*/
public boolean areVibrationFeaturesSupported(@NonNull VibrationEffect effect) {
- return effect.areVibrationFeaturesSupported(this);
+ return getInfo().areVibrationFeaturesSupported(effect);
}
/**
diff --git a/core/java/android/os/VibratorInfo.java b/core/java/android/os/VibratorInfo.java
index 02e6856..4f8c24d 100644
--- a/core/java/android/os/VibratorInfo.java
+++ b/core/java/android/os/VibratorInfo.java
@@ -156,6 +156,16 @@
return false;
}
VibratorInfo that = (VibratorInfo) o;
+ return mId == that.mId && equalContent(that);
+ }
+
+ /**
+ * Returns {@code true} only if the properties and capabilities of the provided info, except for
+ * the ID, equals to this info. Returns {@code false} otherwise.
+ *
+ * @hide
+ */
+ public boolean equalContent(VibratorInfo that) {
int supportedPrimitivesCount = mSupportedPrimitives.size();
if (supportedPrimitivesCount != that.mSupportedPrimitives.size()) {
return false;
@@ -168,7 +178,7 @@
return false;
}
}
- return mId == that.mId && mCapabilities == that.mCapabilities
+ return mCapabilities == that.mCapabilities
&& mPrimitiveDelayMax == that.mPrimitiveDelayMax
&& mCompositionSizeMax == that.mCompositionSizeMax
&& mPwlePrimitiveDurationMax == that.mPwlePrimitiveDurationMax
@@ -242,6 +252,17 @@
}
/**
+ * Check whether the vibrator has frequency control.
+ *
+ * @return True if the hardware can control the frequency of the vibrations, otherwise false.
+ */
+ public boolean hasFrequencyControl() {
+ // We currently can only control frequency of the vibration using the compose PWLE method.
+ return hasCapability(
+ IVibrator.CAP_FREQUENCY_CONTROL | IVibrator.CAP_COMPOSE_PWLE_EFFECTS);
+ }
+
+ /**
* Returns a default value to be applied to composed PWLE effects for braking.
*
* @return a supported braking value, one of android.hardware.vibrator.Braking.*
@@ -323,6 +344,23 @@
}
/**
+ * Query whether or not the vibrator supports all components of a given {@link VibrationEffect}
+ * (i.e. the vibrator can play the given effect as intended).
+ *
+ * <p>See {@link Vibrator#areVibrationFeaturesSupported(VibrationEffect)} for more
+ * information on how the vibrator support is determined.
+ *
+ * @param effect the {@link VibrationEffect} to check if it is supported
+ * @return {@code true} if the vibrator can play the given {@code effect} as intended,
+ * {@code false} otherwise.
+ *
+ * @hide
+ */
+ public boolean areVibrationFeaturesSupported(@NonNull VibrationEffect effect) {
+ return effect.areVibrationFeaturesSupported(this);
+ }
+
+ /**
* Query the estimated duration of given primitive.
*
* @param primitiveId Which primitives to query for.
@@ -417,7 +455,8 @@
return mFrequencyProfile;
}
- protected long getCapabilities() {
+ /** Returns a single int representing all the capabilities of the vibrator. */
+ public long getCapabilities() {
return mCapabilities;
}
diff --git a/core/java/android/os/storage/StorageManagerInternal.java b/core/java/android/os/storage/StorageManagerInternal.java
index 059bd84..22e8251 100644
--- a/core/java/android/os/storage/StorageManagerInternal.java
+++ b/core/java/android/os/storage/StorageManagerInternal.java
@@ -19,6 +19,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UserIdInt;
+import android.content.pm.UserInfo;
import android.os.IVold;
import java.util.List;
@@ -169,4 +170,19 @@
*/
public abstract void registerCloudProviderChangeListener(
@NonNull CloudProviderChangeListener listener);
+
+ /**
+ * Prepares user data directories before moving storage or apps. This is required as adoptable
+ * storage unlock is tied to the prepare user data and storage needs to be unlocked before
+ * performing any operations on it. This will also create user data directories before
+ * initiating the move operations, which essential for ensuring the directories to have correct
+ * SELinux labels and permissions.
+ *
+ * @param fromVolumeUuid the source volume UUID from which content needs to be transferred
+ * @param toVolumeUuid the destination volume UUID to which contents are to be transferred
+ * @param users a list of users for whom to prepare storage
+ */
+ public abstract void prepareUserStorageForMove(String fromVolumeUuid, String toVolumeUuid,
+ List<UserInfo> users);
+
}
diff --git a/core/java/android/os/vibrator/MultiVibratorInfo.java b/core/java/android/os/vibrator/MultiVibratorInfo.java
new file mode 100644
index 0000000..5f32731
--- /dev/null
+++ b/core/java/android/os/vibrator/MultiVibratorInfo.java
@@ -0,0 +1,294 @@
+/*
+ * Copyright 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.os.vibrator;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.hardware.vibrator.IVibrator;
+import android.os.Vibrator;
+import android.os.VibratorInfo;
+import android.util.Range;
+import android.util.Slog;
+import android.util.SparseBooleanArray;
+import android.util.SparseIntArray;
+
+import java.util.Arrays;
+import java.util.function.Function;
+
+/**
+ * Represents multiple vibrator information as a single {@link VibratorInfo}.
+ *
+ * <p>This uses an intersection of all vibrators to decide the capabilities and effect/primitive
+ * support.
+ *
+ * @hide
+ */
+public final class MultiVibratorInfo extends VibratorInfo {
+ private static final String TAG = "MultiVibratorInfo";
+
+ // Epsilon used for float comparison applied in calculations for the merged info.
+ private static final float EPSILON = 1e-5f;
+
+ public MultiVibratorInfo(int id, VibratorInfo[] vibrators) {
+ this(id, vibrators, frequencyProfileIntersection(vibrators));
+ }
+
+ private MultiVibratorInfo(
+ int id, VibratorInfo[] vibrators, VibratorInfo.FrequencyProfile mergedProfile) {
+ super(id,
+ capabilitiesIntersection(vibrators, mergedProfile.isEmpty()),
+ supportedEffectsIntersection(vibrators),
+ supportedBrakingIntersection(vibrators),
+ supportedPrimitivesAndDurationsIntersection(vibrators),
+ integerLimitIntersection(vibrators, VibratorInfo::getPrimitiveDelayMax),
+ integerLimitIntersection(vibrators, VibratorInfo::getCompositionSizeMax),
+ integerLimitIntersection(vibrators, VibratorInfo::getPwlePrimitiveDurationMax),
+ integerLimitIntersection(vibrators, VibratorInfo::getPwleSizeMax),
+ floatPropertyIntersection(vibrators, VibratorInfo::getQFactor),
+ mergedProfile);
+ }
+
+ private static int capabilitiesIntersection(VibratorInfo[] infos,
+ boolean frequencyProfileIsEmpty) {
+ int intersection = ~0;
+ for (VibratorInfo info : infos) {
+ intersection &= info.getCapabilities();
+ }
+ if (frequencyProfileIsEmpty) {
+ // Revoke frequency control if the merged frequency profile ended up empty.
+ intersection &= ~IVibrator.CAP_FREQUENCY_CONTROL;
+ }
+ return intersection;
+ }
+
+ @Nullable
+ private static SparseBooleanArray supportedBrakingIntersection(VibratorInfo[] infos) {
+ for (VibratorInfo info : infos) {
+ if (!info.isBrakingSupportKnown()) {
+ // If one vibrator support is unknown, then the intersection is also unknown.
+ return null;
+ }
+ }
+
+ SparseBooleanArray intersection = new SparseBooleanArray();
+ SparseBooleanArray firstVibratorBraking = infos[0].getSupportedBraking();
+
+ brakingIdLoop:
+ for (int i = 0; i < firstVibratorBraking.size(); i++) {
+ int brakingId = firstVibratorBraking.keyAt(i);
+ if (!firstVibratorBraking.valueAt(i)) {
+ // The first vibrator already doesn't support this braking, so skip it.
+ continue brakingIdLoop;
+ }
+
+ for (int j = 1; j < infos.length; j++) {
+ if (!infos[j].hasBrakingSupport(brakingId)) {
+ // One vibrator doesn't support this braking, so the intersection doesn't.
+ continue brakingIdLoop;
+ }
+ }
+
+ intersection.put(brakingId, true);
+ }
+
+ return intersection;
+ }
+
+ @Nullable
+ private static SparseBooleanArray supportedEffectsIntersection(VibratorInfo[] infos) {
+ for (VibratorInfo info : infos) {
+ if (!info.isEffectSupportKnown()) {
+ // If one vibrator support is unknown, then the intersection is also unknown.
+ return null;
+ }
+ }
+
+ SparseBooleanArray intersection = new SparseBooleanArray();
+ SparseBooleanArray firstVibratorEffects = infos[0].getSupportedEffects();
+
+ effectIdLoop:
+ for (int i = 0; i < firstVibratorEffects.size(); i++) {
+ int effectId = firstVibratorEffects.keyAt(i);
+ if (!firstVibratorEffects.valueAt(i)) {
+ // The first vibrator already doesn't support this effect, so skip it.
+ continue effectIdLoop;
+ }
+
+ for (int j = 1; j < infos.length; j++) {
+ if (infos[j].isEffectSupported(effectId) != Vibrator.VIBRATION_EFFECT_SUPPORT_YES) {
+ // One vibrator doesn't support this effect, so the intersection doesn't.
+ continue effectIdLoop;
+ }
+ }
+
+ intersection.put(effectId, true);
+ }
+
+ return intersection;
+ }
+
+ @NonNull
+ private static SparseIntArray supportedPrimitivesAndDurationsIntersection(
+ VibratorInfo[] infos) {
+ SparseIntArray intersection = new SparseIntArray();
+ SparseIntArray firstVibratorPrimitives = infos[0].getSupportedPrimitives();
+
+ primitiveIdLoop:
+ for (int i = 0; i < firstVibratorPrimitives.size(); i++) {
+ int primitiveId = firstVibratorPrimitives.keyAt(i);
+ int primitiveDuration = firstVibratorPrimitives.valueAt(i);
+ if (primitiveDuration == 0) {
+ // The first vibrator already doesn't support this primitive, so skip it.
+ continue primitiveIdLoop;
+ }
+
+ for (int j = 1; j < infos.length; j++) {
+ int vibratorPrimitiveDuration = infos[j].getPrimitiveDuration(primitiveId);
+ if (vibratorPrimitiveDuration == 0) {
+ // One vibrator doesn't support this primitive, so the intersection doesn't.
+ continue primitiveIdLoop;
+ } else {
+ // The primitive vibration duration is the maximum among all vibrators.
+ primitiveDuration = Math.max(primitiveDuration, vibratorPrimitiveDuration);
+ }
+ }
+
+ intersection.put(primitiveId, primitiveDuration);
+ }
+ return intersection;
+ }
+
+ private static int integerLimitIntersection(VibratorInfo[] infos,
+ Function<VibratorInfo, Integer> propertyGetter) {
+ int limit = 0; // Limit 0 means unlimited
+ for (VibratorInfo info : infos) {
+ int vibratorLimit = propertyGetter.apply(info);
+ if ((limit == 0) || (vibratorLimit > 0 && vibratorLimit < limit)) {
+ // This vibrator is limited and intersection is unlimited or has a larger limit:
+ // use smaller limit here for the intersection.
+ limit = vibratorLimit;
+ }
+ }
+ return limit;
+ }
+
+ private static float floatPropertyIntersection(VibratorInfo[] infos,
+ Function<VibratorInfo, Float> propertyGetter) {
+ float property = propertyGetter.apply(infos[0]);
+ if (Float.isNaN(property)) {
+ // If one vibrator is undefined then the intersection is undefined.
+ return Float.NaN;
+ }
+ for (int i = 1; i < infos.length; i++) {
+ if (Float.compare(property, propertyGetter.apply(infos[i])) != 0) {
+ // If one vibrator has a different value then the intersection is undefined.
+ return Float.NaN;
+ }
+ }
+ return property;
+ }
+
+ @NonNull
+ private static FrequencyProfile frequencyProfileIntersection(VibratorInfo[] infos) {
+ float freqResolution = floatPropertyIntersection(infos,
+ info -> info.getFrequencyProfile().getFrequencyResolutionHz());
+ float resonantFreq = floatPropertyIntersection(infos,
+ VibratorInfo::getResonantFrequencyHz);
+ Range<Float> freqRange = frequencyRangeIntersection(infos, freqResolution);
+
+ if ((freqRange == null) || Float.isNaN(freqResolution)) {
+ return new FrequencyProfile(resonantFreq, Float.NaN, freqResolution, null);
+ }
+
+ int amplitudeCount =
+ Math.round(1 + (freqRange.getUpper() - freqRange.getLower()) / freqResolution);
+ float[] maxAmplitudes = new float[amplitudeCount];
+
+ // Use MAX_VALUE here to ensure that the FrequencyProfile constructor called with this
+ // will fail if the loop below is broken and do not replace filled values with actual
+ // vibrator measurements.
+ Arrays.fill(maxAmplitudes, Float.MAX_VALUE);
+
+ for (VibratorInfo info : infos) {
+ Range<Float> vibratorFreqRange = info.getFrequencyProfile().getFrequencyRangeHz();
+ float[] vibratorMaxAmplitudes = info.getFrequencyProfile().getMaxAmplitudes();
+ int vibratorStartIdx = Math.round(
+ (freqRange.getLower() - vibratorFreqRange.getLower()) / freqResolution);
+ int vibratorEndIdx = vibratorStartIdx + maxAmplitudes.length - 1;
+
+ if ((vibratorStartIdx < 0) || (vibratorEndIdx >= vibratorMaxAmplitudes.length)) {
+ Slog.w(TAG, "Error calculating the intersection of vibrator frequency"
+ + " profiles: attempted to fetch from vibrator "
+ + info.getId() + " max amplitude with bad index " + vibratorStartIdx);
+ return new FrequencyProfile(resonantFreq, Float.NaN, Float.NaN, null);
+ }
+
+ for (int i = 0; i < maxAmplitudes.length; i++) {
+ maxAmplitudes[i] = Math.min(maxAmplitudes[i],
+ vibratorMaxAmplitudes[vibratorStartIdx + i]);
+ }
+ }
+
+ return new FrequencyProfile(resonantFreq, freqRange.getLower(),
+ freqResolution, maxAmplitudes);
+ }
+
+ @Nullable
+ private static Range<Float> frequencyRangeIntersection(VibratorInfo[] infos,
+ float frequencyResolution) {
+ Range<Float> firstRange = infos[0].getFrequencyProfile().getFrequencyRangeHz();
+ if (firstRange == null) {
+ // If one vibrator is undefined then the intersection is undefined.
+ return null;
+ }
+ float intersectionLower = firstRange.getLower();
+ float intersectionUpper = firstRange.getUpper();
+
+ // Generate the intersection of all vibrator supported ranges, making sure that both
+ // min supported frequencies are aligned w.r.t. the frequency resolution.
+
+ for (int i = 1; i < infos.length; i++) {
+ Range<Float> vibratorRange = infos[i].getFrequencyProfile().getFrequencyRangeHz();
+ if (vibratorRange == null) {
+ // If one vibrator is undefined then the intersection is undefined.
+ return null;
+ }
+
+ if ((vibratorRange.getLower() >= intersectionUpper)
+ || (vibratorRange.getUpper() <= intersectionLower)) {
+ // If the range and intersection are disjoint then the intersection is undefined
+ return null;
+ }
+
+ float frequencyDelta = Math.abs(intersectionLower - vibratorRange.getLower());
+ if ((frequencyDelta % frequencyResolution) > EPSILON) {
+ // If the intersection is not aligned with one vibrator then it's undefined
+ return null;
+ }
+
+ intersectionLower = Math.max(intersectionLower, vibratorRange.getLower());
+ intersectionUpper = Math.min(intersectionUpper, vibratorRange.getUpper());
+ }
+
+ if ((intersectionUpper - intersectionLower) < frequencyResolution) {
+ // If the intersection is empty then it's undefined.
+ return null;
+ }
+
+ return Range.create(intersectionLower, intersectionUpper);
+ }
+}
diff --git a/core/java/android/os/vibrator/PrebakedSegment.java b/core/java/android/os/vibrator/PrebakedSegment.java
index 42b6c2da..a035092 100644
--- a/core/java/android/os/vibrator/PrebakedSegment.java
+++ b/core/java/android/os/vibrator/PrebakedSegment.java
@@ -23,6 +23,7 @@
import android.os.Parcelable;
import android.os.VibrationEffect;
import android.os.Vibrator;
+import android.os.VibratorInfo;
import java.util.Objects;
@@ -77,8 +78,8 @@
/** @hide */
@Override
- public boolean areVibrationFeaturesSupported(@NonNull Vibrator vibrator) {
- if (vibrator.areAllEffectsSupported(mEffectId) == Vibrator.VIBRATION_EFFECT_SUPPORT_YES) {
+ public boolean areVibrationFeaturesSupported(@NonNull VibratorInfo vibratorInfo) {
+ if (vibratorInfo.isEffectSupported(mEffectId) == Vibrator.VIBRATION_EFFECT_SUPPORT_YES) {
return true;
}
if (!mFallback) {
diff --git a/core/java/android/os/vibrator/PrimitiveSegment.java b/core/java/android/os/vibrator/PrimitiveSegment.java
index c52a09c..95d97bf 100644
--- a/core/java/android/os/vibrator/PrimitiveSegment.java
+++ b/core/java/android/os/vibrator/PrimitiveSegment.java
@@ -22,7 +22,7 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.os.VibrationEffect;
-import android.os.Vibrator;
+import android.os.VibratorInfo;
import com.android.internal.util.Preconditions;
@@ -77,8 +77,8 @@
/** @hide */
@Override
- public boolean areVibrationFeaturesSupported(@NonNull Vibrator vibrator) {
- return vibrator.areAllPrimitivesSupported(mPrimitiveId);
+ public boolean areVibrationFeaturesSupported(@NonNull VibratorInfo vibratorInfo) {
+ return vibratorInfo.isPrimitiveSupported(mPrimitiveId);
}
/** @hide */
diff --git a/core/java/android/os/vibrator/RampSegment.java b/core/java/android/os/vibrator/RampSegment.java
index e997bcd..5f9d102 100644
--- a/core/java/android/os/vibrator/RampSegment.java
+++ b/core/java/android/os/vibrator/RampSegment.java
@@ -20,7 +20,7 @@
import android.annotation.TestApi;
import android.os.Parcel;
import android.os.VibrationEffect;
-import android.os.Vibrator;
+import android.os.VibratorInfo;
import com.android.internal.util.Preconditions;
@@ -96,7 +96,7 @@
/** @hide */
@Override
- public boolean areVibrationFeaturesSupported(@NonNull Vibrator vibrator) {
+ public boolean areVibrationFeaturesSupported(@NonNull VibratorInfo vibratorInfo) {
boolean areFeaturesSupported = true;
// If the start/end frequencies are not the same, require frequency control since we need to
// ramp up/down the frequency.
@@ -104,7 +104,7 @@
// If there is no frequency ramping, make sure that the one frequency used does not
// require frequency control.
|| frequencyRequiresFrequencyControl(mStartFrequencyHz)) {
- areFeaturesSupported &= vibrator.hasFrequencyControl();
+ areFeaturesSupported &= vibratorInfo.hasFrequencyControl();
}
// If the start/end amplitudes are not the same, require amplitude control since we need to
// ramp up/down the amplitude.
@@ -112,7 +112,7 @@
// If there is no amplitude ramping, make sure that the amplitude used does not
// require amplitude control.
|| amplitudeRequiresAmplitudeControl(mStartAmplitude)) {
- areFeaturesSupported &= vibrator.hasAmplitudeControl();
+ areFeaturesSupported &= vibratorInfo.hasAmplitudeControl();
}
return areFeaturesSupported;
}
diff --git a/core/java/android/os/vibrator/StepSegment.java b/core/java/android/os/vibrator/StepSegment.java
index a585aa8..9576a5b 100644
--- a/core/java/android/os/vibrator/StepSegment.java
+++ b/core/java/android/os/vibrator/StepSegment.java
@@ -21,7 +21,7 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.os.VibrationEffect;
-import android.os.Vibrator;
+import android.os.VibratorInfo;
import com.android.internal.util.Preconditions;
@@ -82,13 +82,13 @@
/** @hide */
@Override
- public boolean areVibrationFeaturesSupported(@NonNull Vibrator vibrator) {
+ public boolean areVibrationFeaturesSupported(@NonNull VibratorInfo vibratorInfo) {
boolean areFeaturesSupported = true;
if (frequencyRequiresFrequencyControl(mFrequencyHz)) {
- areFeaturesSupported &= vibrator.hasFrequencyControl();
+ areFeaturesSupported &= vibratorInfo.hasFrequencyControl();
}
if (amplitudeRequiresAmplitudeControl(mAmplitude)) {
- areFeaturesSupported &= vibrator.hasAmplitudeControl();
+ areFeaturesSupported &= vibratorInfo.hasAmplitudeControl();
}
return areFeaturesSupported;
}
diff --git a/core/java/android/os/vibrator/VibrationEffectSegment.java b/core/java/android/os/vibrator/VibrationEffectSegment.java
index 3b286a7..17ac36f 100644
--- a/core/java/android/os/vibrator/VibrationEffectSegment.java
+++ b/core/java/android/os/vibrator/VibrationEffectSegment.java
@@ -21,7 +21,7 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.os.VibrationEffect;
-import android.os.Vibrator;
+import android.os.VibratorInfo;
/**
* Representation of a single segment of a {@link VibrationEffect}.
@@ -65,7 +65,7 @@
*
* @hide
*/
- public abstract boolean areVibrationFeaturesSupported(@NonNull Vibrator vibrator);
+ public abstract boolean areVibrationFeaturesSupported(@NonNull VibratorInfo vibratorInfo);
/**
* Returns true if this segment could be a haptic feedback effect candidate.
diff --git a/core/java/android/os/vibrator/VibratorInfoFactory.java b/core/java/android/os/vibrator/VibratorInfoFactory.java
new file mode 100644
index 0000000..d10d7ec
--- /dev/null
+++ b/core/java/android/os/vibrator/VibratorInfoFactory.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 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.os.vibrator;
+
+import android.annotation.NonNull;
+import android.os.VibratorInfo;
+
+/**
+ * Factory for creating {@link VibratorInfo}s.
+ *
+ * @hide
+ */
+public final class VibratorInfoFactory {
+ /**
+ * Creates a single {@link VibratorInfo} that is an intersection of a given collection of
+ * {@link VibratorInfo}s. That is, the capabilities of the returned info will be an
+ * intersection of that of the provided infos.
+ *
+ * @param id the ID for the new {@link VibratorInfo}.
+ * @param vibratorInfos the {@link VibratorInfo}s from which to create a single
+ * {@link VibratorInfo}.
+ * @return a {@link VibratorInfo} that represents the intersection of {@code vibratorInfos}.
+ */
+ @NonNull
+ public static VibratorInfo create(int id, @NonNull VibratorInfo[] vibratorInfos) {
+ if (vibratorInfos.length == 0) {
+ return new VibratorInfo.Builder(id).build();
+ }
+ if (vibratorInfos.length == 1) {
+ // Create an equivalent info with the requested ID.
+ return new VibratorInfo(id, vibratorInfos[0]);
+ }
+ // Create a MultiVibratorInfo that intersects all the given infos and has the requested ID.
+ return new MultiVibratorInfo(id, vibratorInfos);
+ }
+
+ private VibratorInfoFactory() {}
+}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 3f2be51..2791c41 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -1450,7 +1450,7 @@
/**
* Activity Action: Ask the user to allow an app to ignore battery optimizations (that is,
- * put them on the whitelist of apps shown by
+ * put them on the allowlist of apps shown by
* {@link #ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS}). For an app to use this, it also
* must hold the {@link android.Manifest.permission#REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}
* permission.
@@ -3524,7 +3524,6 @@
public ArrayMap<String, String> getStringsForPrefix(ContentResolver cr, String prefix,
List<String> names) {
String namespace = prefix.substring(0, prefix.length() - 1);
- Config.enforceReadPermission(namespace);
ArrayMap<String, String> keyValues = new ArrayMap<>();
int currentGeneration = -1;
boolean needsGenerationTracker = false;
@@ -5627,7 +5626,7 @@
public static final String SHOW_TOUCHES = "show_touches";
/**
- * Show key presses and other events dispatched to focused windows on the screen.
+ * Show key presses dispatched to focused windows on the screen.
* 0 = no
* 1 = yes
* @hide
@@ -5635,6 +5634,14 @@
public static final String SHOW_KEY_PRESSES = "show_key_presses";
/**
+ * Show rotary input dispatched to focused windows on the screen.
+ * 0 = no
+ * 1 = yes
+ * @hide
+ */
+ public static final String SHOW_ROTARY_INPUT = "show_rotary_input";
+
+ /**
* Log raw orientation data from
* {@link com.android.server.policy.WindowOrientationListener} for use with the
* orientationplot.py tool.
@@ -10126,6 +10133,13 @@
public static final String AUDIO_DEVICE_INVENTORY = "audio_device_inventory";
/**
+ * Stores a boolean that defines whether the CSD as a feature is enabled or not.
+ * @hide
+ */
+ public static final String AUDIO_SAFE_CSD_AS_A_FEATURE_ENABLED =
+ "audio_safe_csd_as_a_feature_enabled";
+
+ /**
* Indicates whether notification display on the lock screen is enabled.
* <p>
* Type: int (0 for false, 1 for true)
@@ -10642,6 +10656,14 @@
"assist_long_press_home_enabled";
/**
+ * Whether press and hold on nav handle can trigger search.
+ *
+ * @hide
+ */
+ public static final String SEARCH_PRESS_HOLD_NAV_HANDLE_ENABLED =
+ "search_press_hold_nav_handle_enabled";
+
+ /**
* Control whether Trust Agents are in active unlock or extend unlock mode.
* @hide
*/
@@ -12355,7 +12377,7 @@
public static final String BUGREPORT_IN_POWER_MENU = "bugreport_in_power_menu";
/**
- * The package name for the custom bugreport handler app. This app must be whitelisted.
+ * The package name for the custom bugreport handler app. This app must be allowlisted.
* This is currently used only by Power Menu short press.
* @deprecated Use {@link android.provider.Settings.Secure#CUSTOM_BUGREPORT_HANDLER_APP}
* instead
@@ -12771,7 +12793,7 @@
"location_background_throttle_proximity_alert_interval_ms";
/**
- * Packages that are whitelisted for background throttling (throttling will not be applied).
+ * Packages that are allowlisted for background throttling (throttling will not be applied).
* @hide
*/
@Readable
@@ -12779,7 +12801,7 @@
"location_background_throttle_package_whitelist";
/**
- * Packages that are whitelisted for ignoring location settings (may retrieve location even
+ * Packages that are allowlisted for ignoring location settings (may retrieve location even
* when user location settings are off), for emergency purposes.
* @deprecated No longer used from Android 12+
* @hide
@@ -13363,7 +13385,7 @@
/**
* List of certificate (hex string representation of the application's certificate - SHA-1
- * or SHA-256) and carrier app package pairs which are whitelisted to prompt the user for
+ * or SHA-256) and carrier app package pairs which are allowlisted to prompt the user for
* install when a sim card with matching UICC carrier privilege rules is inserted. The
* certificate is used as a key, so the certificate encoding here must be the same as the
* certificate encoding used on the SIM.
@@ -16764,7 +16786,7 @@
"enable_adb_incremental_install_default";
/**
- * The packages whitelisted to be run in autofill compatibility mode. The list
+ * The packages allowlisted to be run in autofill compatibility mode. The list
* of packages is {@code ":"} colon delimited, and each entry has the name of the
* package and an optional list of url bar resource ids (the list is delimited by
* brackets&mdash{@code [} and {@code ]}&mdash and is also comma delimited).
@@ -16824,7 +16846,7 @@
public static final String STYLUS_EVER_USED = "stylus_ever_used";
/**
- * Exemptions to the hidden API blacklist.
+ * Exemptions to the hidden API denylist.
*
* @hide
*/
@@ -19625,21 +19647,6 @@
.getApplicationContext().checkCallingOrSelfPermission(permission);
}
- /**
- * Enforces READ_DEVICE_CONFIG permission if namespace is not one of public namespaces.
- * @hide
- */
- public static void enforceReadPermission(String namespace) {
- if (ActivityThread.currentApplication().getApplicationContext()
- .checkCallingOrSelfPermission(Manifest.permission.READ_DEVICE_CONFIG)
- != PackageManager.PERMISSION_GRANTED) {
- if (!DeviceConfig.getPublicNamespaces().contains(namespace)) {
- throw new SecurityException("Permission denial: reading from settings requires:"
- + Manifest.permission.READ_DEVICE_CONFIG);
- }
- }
- }
-
private static void setMonitorCallbackAsUser(
@NonNull @CallbackExecutor Executor executor,
@NonNull ContentResolver resolver, @UserIdInt int userHandle,
diff --git a/core/java/android/security/OWNERS b/core/java/android/security/OWNERS
index f6b1235..4e8d6e7 100644
--- a/core/java/android/security/OWNERS
+++ b/core/java/android/security/OWNERS
@@ -6,5 +6,4 @@
per-file NetworkSecurityPolicy.java = klyubin@google.com
per-file FrameworkNetworkSecurityPolicy.java = cbrubaker@google.com
per-file FrameworkNetworkSecurityPolicy.java = klyubin@google.com
-per-file Confirmation*.java = jdanis@google.com
-per-file Confirmation*.java = swillden@google.com
+per-file Confirmation*.java = file:/keystore/OWNERS
diff --git a/core/java/android/security/keystore/OWNERS b/core/java/android/security/keystore/OWNERS
index 65129a4..d9e0116 100644
--- a/core/java/android/security/keystore/OWNERS
+++ b/core/java/android/security/keystore/OWNERS
@@ -1,5 +1 @@
-# Bug component: 189335
-
-swillden@google.com
-jdanis@google.com
-jbires@google.com
+include /keystore/OWNERS
diff --git a/core/java/android/security/keystore/recovery/OWNERS b/core/java/android/security/keystore/recovery/OWNERS
deleted file mode 100644
index 65129a4..0000000
--- a/core/java/android/security/keystore/recovery/OWNERS
+++ /dev/null
@@ -1,5 +0,0 @@
-# Bug component: 189335
-
-swillden@google.com
-jdanis@google.com
-jbires@google.com
diff --git a/core/java/android/service/notification/NotificationRankingUpdate.java b/core/java/android/service/notification/NotificationRankingUpdate.java
index 75640bd..f3b4c6d 100644
--- a/core/java/android/service/notification/NotificationRankingUpdate.java
+++ b/core/java/android/service/notification/NotificationRankingUpdate.java
@@ -92,6 +92,7 @@
mapParcel.recycle();
if (buffer != null) {
mRankingMapFd.unmap(buffer);
+ mRankingMapFd.close();
}
}
} else {
diff --git a/core/java/android/service/quicksettings/Tile.java b/core/java/android/service/quicksettings/Tile.java
index 910fc44..c027981 100644
--- a/core/java/android/service/quicksettings/Tile.java
+++ b/core/java/android/service/quicksettings/Tile.java
@@ -64,6 +64,7 @@
private IBinder mToken;
private Icon mIcon;
private CharSequence mLabel;
+ private CharSequence mDefaultLabel;
private CharSequence mSubtitle;
private CharSequence mContentDescription;
private CharSequence mStateDescription;
@@ -142,10 +143,25 @@
* Gets the current label for the tile.
*/
public CharSequence getLabel() {
+ return mLabel != null ? mLabel : mDefaultLabel;
+ }
+
+ /**
+ * @hide
+ * @return
+ */
+ public CharSequence getCustomLabel() {
return mLabel;
}
/**
+ * @hide
+ */
+ public void setDefaultLabel(CharSequence defaultLabel) {
+ mDefaultLabel = defaultLabel;
+ }
+
+ /**
* Sets the current label for the tile.
*
* Does not take effect until {@link #updateTile()} is called.
@@ -267,6 +283,7 @@
}
dest.writeInt(mState);
TextUtils.writeToParcel(mLabel, dest, flags);
+ TextUtils.writeToParcel(mDefaultLabel, dest, flags);
TextUtils.writeToParcel(mSubtitle, dest, flags);
TextUtils.writeToParcel(mContentDescription, dest, flags);
TextUtils.writeToParcel(mStateDescription, dest, flags);
@@ -285,6 +302,7 @@
}
mState = source.readInt();
mLabel = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
+ mDefaultLabel = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
mSubtitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
mContentDescription = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
mStateDescription = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
diff --git a/core/java/android/service/voice/AlwaysOnHotwordDetector.java b/core/java/android/service/voice/AlwaysOnHotwordDetector.java
index 21f676e..94d8516 100644
--- a/core/java/android/service/voice/AlwaysOnHotwordDetector.java
+++ b/core/java/android/service/voice/AlwaysOnHotwordDetector.java
@@ -67,6 +67,7 @@
import com.android.internal.app.IHotwordRecognitionStatusCallback;
import com.android.internal.app.IVoiceInteractionManagerService;
import com.android.internal.app.IVoiceInteractionSoundTriggerSession;
+import com.android.internal.infra.AndroidFuture;
import java.io.PrintWriter;
import java.lang.annotation.Retention;
@@ -1710,6 +1711,11 @@
Slog.i(TAG, "onProcessRestarted");
mHandler.sendEmptyMessage(MSG_PROCESS_RESTARTED);
}
+
+ @Override
+ public void onOpenFile(String filename, AndroidFuture future) throws RemoteException {
+ throw new UnsupportedOperationException("Hotword cannot access files from the disk.");
+ }
}
void onDetectorRemoteException() {
diff --git a/core/java/android/service/voice/HotwordDetectionService.java b/core/java/android/service/voice/HotwordDetectionService.java
index d9ee859..ccf8b67 100644
--- a/core/java/android/service/voice/HotwordDetectionService.java
+++ b/core/java/android/service/voice/HotwordDetectionService.java
@@ -227,6 +227,12 @@
public void stopDetection() {
HotwordDetectionService.this.onStopDetection();
}
+
+ @Override
+ public void registerRemoteStorageService(IDetectorSessionStorageService
+ detectorSessionStorageService) {
+ throw new UnsupportedOperationException("Hotword cannot access files from the disk.");
+ }
};
@Override
diff --git a/core/java/android/service/voice/IDetectorSessionStorageService.aidl b/core/java/android/service/voice/IDetectorSessionStorageService.aidl
new file mode 100644
index 0000000..592373e
--- /dev/null
+++ b/core/java/android/service/voice/IDetectorSessionStorageService.aidl
@@ -0,0 +1,30 @@
+/*
+ * 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.service.voice;
+
+import com.android.internal.infra.AndroidFuture;
+
+/**
+ * @hide
+ */
+oneway interface IDetectorSessionStorageService {
+ /**
+ * Called when a file open request is sent. Only files with the given names under the internal
+ * app storage, i.e., {@link Context#getFilesDir()} can be opened.
+ */
+ void openFile(in String filename, in AndroidFuture future);
+}
diff --git a/core/java/android/service/voice/ISandboxedDetectionService.aidl b/core/java/android/service/voice/ISandboxedDetectionService.aidl
index 098536d..c76ac28 100644
--- a/core/java/android/service/voice/ISandboxedDetectionService.aidl
+++ b/core/java/android/service/voice/ISandboxedDetectionService.aidl
@@ -24,6 +24,7 @@
import android.os.ParcelFileDescriptor;
import android.os.PersistableBundle;
import android.os.SharedMemory;
+import android.service.voice.IDetectorSessionStorageService;
import android.service.voice.IDetectorSessionVisualQueryDetectionCallback;
import android.service.voice.IDspHotwordDetectionCallback;
import android.view.contentcapture.IContentCaptureManager;
@@ -71,4 +72,10 @@
void ping(in IRemoteCallback callback);
void stopDetection();
+
+ /**
+ * Registers the interface stub to talk to the voice interaction service for initialization/
+ * detection unrelated functionalities.
+ */
+ void registerRemoteStorageService(in IDetectorSessionStorageService detectorSessionStorageService);
}
diff --git a/core/java/android/service/voice/SoftwareHotwordDetector.java b/core/java/android/service/voice/SoftwareHotwordDetector.java
index 128bc0d..f1bc792 100644
--- a/core/java/android/service/voice/SoftwareHotwordDetector.java
+++ b/core/java/android/service/voice/SoftwareHotwordDetector.java
@@ -36,6 +36,7 @@
import com.android.internal.app.IHotwordRecognitionStatusCallback;
import com.android.internal.app.IVoiceInteractionManagerService;
+import com.android.internal.infra.AndroidFuture;
import java.io.PrintWriter;
import java.util.concurrent.Executor;
@@ -302,6 +303,11 @@
Binder.withCleanCallingIdentity(() -> mExecutor.execute(
() -> mCallback.onHotwordDetectionServiceRestarted()));
}
+
+ @Override
+ public void onOpenFile(String filename, AndroidFuture future) throws RemoteException {
+ throw new UnsupportedOperationException("Hotword cannot access files from the disk.");
+ }
}
/** @hide */
diff --git a/core/java/android/service/voice/VisualQueryDetectionService.java b/core/java/android/service/voice/VisualQueryDetectionService.java
index cbe7666..d184b1e 100644
--- a/core/java/android/service/voice/VisualQueryDetectionService.java
+++ b/core/java/android/service/voice/VisualQueryDetectionService.java
@@ -40,7 +40,12 @@
import android.view.contentcapture.ContentCaptureManager;
import android.view.contentcapture.IContentCaptureManager;
+import com.android.internal.infra.AndroidFuture;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.util.Objects;
+import java.util.concurrent.ExecutionException;
import java.util.function.IntConsumer;
/**
@@ -86,6 +91,8 @@
private ContentCaptureManager mContentCaptureManager;
@Nullable
private IRecognitionServiceManager mIRecognitionServiceManager;
+ @Nullable
+ private IDetectorSessionStorageService mDetectorSessionStorageService;
private final ISandboxedDetectionService mInterface = new ISandboxedDetectionService.Stub() {
@@ -154,6 +161,12 @@
public void updateRecognitionServiceManager(IRecognitionServiceManager manager) {
mIRecognitionServiceManager = manager;
}
+
+ @Override
+ public void registerRemoteStorageService(IDetectorSessionStorageService
+ detectorSessionStorageService) {
+ mDetectorSessionStorageService = detectorSessionStorageService;
+ }
};
@Override
@@ -323,4 +336,23 @@
}
}
+ /**
+ * Overrides {@link Context#openFileInput} to read files with the given file names under the
+ * internal app storage of the {@link VoiceInteractionService}, i.e., only files stored in
+ * {@link Context#getFilesDir()} can be opened.
+ */
+ @Override
+ public @Nullable FileInputStream openFileInput(@NonNull String filename) throws
+ FileNotFoundException {
+ try {
+ AndroidFuture<ParcelFileDescriptor> future = new AndroidFuture<>();
+ mDetectorSessionStorageService.openFile(filename, future);
+ ParcelFileDescriptor pfd = future.get();
+ return new FileInputStream(pfd.getFileDescriptor());
+ } catch (RemoteException | ExecutionException | InterruptedException e) {
+ Log.w(TAG, "Cannot open file due to remote service failure");
+ throw new FileNotFoundException(e.getMessage());
+ }
+ }
+
}
diff --git a/core/java/android/service/voice/VisualQueryDetector.java b/core/java/android/service/voice/VisualQueryDetector.java
index 9e0eb4b..b5448d4 100644
--- a/core/java/android/service/voice/VisualQueryDetector.java
+++ b/core/java/android/service/voice/VisualQueryDetector.java
@@ -25,6 +25,7 @@
import android.annotation.RequiresPermission;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
+import android.content.Context;
import android.hardware.soundtrigger.SoundTrigger;
import android.media.AudioFormat;
import android.os.Binder;
@@ -37,7 +38,10 @@
import com.android.internal.app.IHotwordRecognitionStatusCallback;
import com.android.internal.app.IVoiceInteractionManagerService;
+import com.android.internal.infra.AndroidFuture;
+import java.io.File;
+import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
@@ -58,18 +62,20 @@
private final Callback mCallback;
private final Executor mExecutor;
+ private final Context mContext;
private final IVoiceInteractionManagerService mManagerService;
private final VisualQueryDetectorInitializationDelegate mInitializationDelegate;
private final String mAttributionTag;
VisualQueryDetector(
IVoiceInteractionManagerService managerService,
- @NonNull @CallbackExecutor Executor executor,
- Callback callback, @Nullable String attributionTag) {
+ @NonNull @CallbackExecutor Executor executor, Callback callback, Context context,
+ @Nullable String attributionTag) {
mManagerService = managerService;
mCallback = callback;
mExecutor = executor;
mInitializationDelegate = new VisualQueryDetectorInitializationDelegate();
+ mContext = context;
mAttributionTag = attributionTag;
}
@@ -247,7 +253,7 @@
@Override
void initialize(@Nullable PersistableBundle options, @Nullable SharedMemory sharedMemory) {
initAndVerifyDetector(options, sharedMemory,
- new InitializationStateListener(mExecutor, mCallback),
+ new InitializationStateListener(mExecutor, mCallback, mContext),
DETECTOR_TYPE_VISUAL_QUERY_DETECTOR, mAttributionTag);
}
@@ -332,9 +338,12 @@
private final Executor mExecutor;
private final Callback mCallback;
- InitializationStateListener(Executor executor, Callback callback) {
+ private final Context mContext;
+
+ InitializationStateListener(Executor executor, Callback callback, Context context) {
this.mExecutor = executor;
this.mCallback = callback;
+ this.mContext = context;
}
@Override
@@ -428,5 +437,22 @@
!TextUtils.isEmpty(errorMessage) ? errorMessage : "Error data is null");
}));
}
+ @Override
+ public void onOpenFile(String filename, AndroidFuture future) throws RemoteException {
+ Slog.v(TAG, "BinderCallback#onOpenFile " + filename);
+ Binder.withCleanCallingIdentity(() -> mExecutor.execute(() -> {
+ Slog.v(TAG, "onOpenFile: " + filename);
+ File f = new File(mContext.getFilesDir(), filename);
+ ParcelFileDescriptor pfd = null;
+ try {
+ Slog.d(TAG, "opened a file with ParcelFileDescriptor.");
+ pfd = ParcelFileDescriptor.open(f, ParcelFileDescriptor.MODE_READ_ONLY);
+ } catch (FileNotFoundException e) {
+ Slog.e(TAG, "Cannot open file. No ParcelFileDescriptor returned.");
+ } finally {
+ future.complete(pfd);
+ }
+ }));
+ }
}
}
diff --git a/core/java/android/service/voice/VoiceInteractionService.java b/core/java/android/service/voice/VoiceInteractionService.java
index 8cec17f..b48b7ec 100644
--- a/core/java/android/service/voice/VoiceInteractionService.java
+++ b/core/java/android/service/voice/VoiceInteractionService.java
@@ -965,7 +965,7 @@
}
VisualQueryDetector visualQueryDetector =
- new VisualQueryDetector(mSystemService, executor, callback,
+ new VisualQueryDetector(mSystemService, executor, callback, this,
getAttributionTag());
HotwordDetector visualQueryDetectorInitializationDelegate =
visualQueryDetector.getInitializationDelegate();
diff --git a/core/java/android/speech/OWNERS b/core/java/android/speech/OWNERS
index 162e029..0f2f8ad 100644
--- a/core/java/android/speech/OWNERS
+++ b/core/java/android/speech/OWNERS
@@ -1,5 +1,4 @@
volnov@google.com
eugeniom@google.com
schfan@google.com
-andreaambu@google.com
-hackz@google.com
\ No newline at end of file
+hackz@google.com
diff --git a/core/java/android/speech/RecognitionService.java b/core/java/android/speech/RecognitionService.java
index 9656f36..7f313c1 100644
--- a/core/java/android/speech/RecognitionService.java
+++ b/core/java/android/speech/RecognitionService.java
@@ -38,6 +38,7 @@
import android.os.RemoteException;
import android.util.Log;
+import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.function.pooled.PooledLambda;
import java.lang.ref.WeakReference;
@@ -232,39 +233,68 @@
intent,
attributionSource,
new ModelDownloadListener() {
+
+ private final Object mLock = new Object();
+
+ @GuardedBy("mLock")
+ private boolean mIsTerminated = false;
+
@Override
public void onProgress(int completedPercent) {
- try {
- listener.onProgress(completedPercent);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ synchronized (mLock) {
+ if (mIsTerminated) {
+ return;
+ }
+ try {
+ listener.onProgress(completedPercent);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
}
@Override
public void onSuccess() {
- try {
- listener.onSuccess();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ synchronized (mLock) {
+ if (mIsTerminated) {
+ return;
+ }
+ mIsTerminated = true;
+ try {
+ listener.onSuccess();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
}
@Override
public void onScheduled() {
- try {
- listener.onScheduled();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ synchronized (mLock) {
+ if (mIsTerminated) {
+ return;
+ }
+ mIsTerminated = true;
+ try {
+ listener.onScheduled();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
}
@Override
public void onError(int error) {
- try {
- listener.onError(error);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ synchronized (mLock) {
+ if (mIsTerminated) {
+ return;
+ }
+ mIsTerminated = true;
+ try {
+ listener.onError(error);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
}
});
diff --git a/core/java/android/text/DynamicLayout.java b/core/java/android/text/DynamicLayout.java
index 3bdaca9..e287bd9 100644
--- a/core/java/android/text/DynamicLayout.java
+++ b/core/java/android/text/DynamicLayout.java
@@ -622,7 +622,7 @@
sBuilder = null;
}
- if (reflowed == null) {
+ if (b == null) {
b = StaticLayout.Builder.obtain(text, where, where + after, getPaint(), getWidth());
}
@@ -641,7 +641,7 @@
.setAddLastLineLineSpacing(!islast)
.setIncludePad(false);
- reflowed = b.regenerate(true /* trackpadding */, reflowed);
+ reflowed = b.buildPartialStaticLayoutForDynamicLayout(true /* trackpadding */, reflowed);
int n = reflowed.getLineCount();
// If the new layout has a blank line at the end, but it is not
// the very end of the buffer, then we already have a line that
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java
index f843900..3d1895c 100644
--- a/core/java/android/text/StaticLayout.java
+++ b/core/java/android/text/StaticLayout.java
@@ -437,13 +437,25 @@
return result;
}
- /* package */ @NonNull StaticLayout regenerate(boolean trackpadding, StaticLayout recycle) {
+ /**
+ * DO NOT USE THIS METHOD OTHER THAN DynamicLayout.
+ *
+ * This class generates a very weird StaticLayout only for getting a result of line break.
+ * Since DynamicLayout keeps StaticLayout reference in the static context for object
+ * recycling but keeping text reference in static context will end up with leaking Context
+ * due to TextWatcher via TextView.
+ *
+ * So, this is a dirty work around that creating StaticLayout without passing text reference
+ * to the super constructor, but calculating the text layout by calling generate function
+ * directly.
+ */
+ /* package */ @NonNull StaticLayout buildPartialStaticLayoutForDynamicLayout(
+ boolean trackpadding, StaticLayout recycle) {
if (recycle == null) {
- return new StaticLayout(this, trackpadding, COLUMNS_ELLIPSIZE);
- } else {
- recycle.generate(this, mIncludePad, trackpadding);
- return recycle;
+ recycle = new StaticLayout();
}
+ recycle.generate(this, mIncludePad, trackpadding);
+ return recycle;
}
private CharSequence mText;
@@ -474,6 +486,37 @@
}
/**
+ * DO NOT USE THIS CONSTRUCTOR OTHER THAN FOR DYNAMIC LAYOUT.
+ * See Builder#buildPartialStaticLayoutForDynamicLayout for the reason of this constructor.
+ */
+ private StaticLayout() {
+ super(
+ null, // text
+ null, // paint
+ 0, // width
+ null, // alignment
+ null, // textDir
+ 1, // spacing multiplier
+ 0, // spacing amount
+ false, // include font padding
+ false, // fallback line spacing
+ 0, // ellipsized width
+ null, // ellipsize
+ 1, // maxLines
+ BREAK_STRATEGY_SIMPLE,
+ HYPHENATION_FREQUENCY_NONE,
+ null, // leftIndents
+ null, // rightIndents
+ JUSTIFICATION_MODE_NONE,
+ null // lineBreakConfig
+ );
+
+ mColumns = COLUMNS_ELLIPSIZE;
+ mLineDirections = ArrayUtils.newUnpaddedArray(Directions.class, 2);
+ mLines = ArrayUtils.newUnpaddedIntArray(2 * mColumns);
+ }
+
+ /**
* @deprecated Use {@link Builder} instead.
*/
@Deprecated
diff --git a/core/java/android/util/IntArray.java b/core/java/android/util/IntArray.java
index 511cb2d..ac76fc2 100644
--- a/core/java/android/util/IntArray.java
+++ b/core/java/android/util/IntArray.java
@@ -212,6 +212,11 @@
return -1;
}
+ /** Returns {@code true} if this array contains the specified value. */
+ public boolean contains(int value) {
+ return indexOf(value) != -1;
+ }
+
/**
* Removes the value at the specified index from this array.
*/
diff --git a/core/java/android/view/HandwritingInitiator.java b/core/java/android/view/HandwritingInitiator.java
index 751cd21..6e73a3c 100644
--- a/core/java/android/view/HandwritingInitiator.java
+++ b/core/java/android/view/HandwritingInitiator.java
@@ -19,7 +19,10 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
+import android.graphics.Matrix;
import android.graphics.Rect;
+import android.graphics.RectF;
+import android.graphics.Region;
import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;
@@ -78,11 +81,17 @@
private int mConnectionCount = 0;
private final InputMethodManager mImm;
+ private final RectF mTempRectF = new RectF();
+
+ private final Region mTempRegion = new Region();
+
+ private final Matrix mTempMatrix = new Matrix();
+
/**
* The handwrite-able View that is currently the target of a hovering stylus pointer. This is
* used to help determine whether the handwriting PointerIcon should be shown in
* {@link #onResolvePointerIcon(Context, MotionEvent)} so that we can reduce the number of calls
- * to {@link #findBestCandidateView(float, float)}.
+ * to {@link #findBestCandidateView(float, float, boolean)}.
*/
@Nullable
private WeakReference<View> mCachedHoverTarget = null;
@@ -184,8 +193,8 @@
final float y = motionEvent.getY(pointerIndex);
if (largerThanTouchSlop(x, y, mState.mStylusDownX, mState.mStylusDownY)) {
mState.mExceedHandwritingSlop = true;
- View candidateView =
- findBestCandidateView(mState.mStylusDownX, mState.mStylusDownY);
+ View candidateView = findBestCandidateView(mState.mStylusDownX,
+ mState.mStylusDownY, /* isHover */ false);
if (candidateView != null) {
if (candidateView == getConnectedView()) {
if (!candidateView.hasFocus()) {
@@ -393,13 +402,14 @@
final View cachedHoverTarget = getCachedHoverTarget();
if (cachedHoverTarget != null) {
final Rect handwritingArea = getViewHandwritingArea(cachedHoverTarget);
- if (isInHandwritingArea(handwritingArea, hoverX, hoverY, cachedHoverTarget)
+ if (isInHandwritingArea(handwritingArea, hoverX, hoverY, cachedHoverTarget,
+ /* isHover */ true)
&& shouldTriggerStylusHandwritingForView(cachedHoverTarget)) {
return cachedHoverTarget;
}
}
- final View candidateView = findBestCandidateView(hoverX, hoverY);
+ final View candidateView = findBestCandidateView(hoverX, hoverY, /* isHover */ true);
if (candidateView != null) {
mCachedHoverTarget = new WeakReference<>(candidateView);
@@ -429,14 +439,14 @@
* @param y the y coordinates of the stylus event, in the coordinates of the window.
*/
@Nullable
- private View findBestCandidateView(float x, float y) {
+ private View findBestCandidateView(float x, float y, boolean isHover) {
// If the connectedView is not null and do not set any handwriting area, it will check
// whether the connectedView's boundary contains the initial stylus position. If true,
// directly return the connectedView.
final View connectedView = getConnectedView();
if (connectedView != null) {
Rect handwritingArea = getViewHandwritingArea(connectedView);
- if (isInHandwritingArea(handwritingArea, x, y, connectedView)
+ if (isInHandwritingArea(handwritingArea, x, y, connectedView, isHover)
&& shouldTriggerStylusHandwritingForView(connectedView)) {
return connectedView;
}
@@ -450,7 +460,7 @@
for (HandwritableViewInfo viewInfo : handwritableViewInfos) {
final View view = viewInfo.getView();
final Rect handwritingArea = viewInfo.getHandwritingArea();
- if (!isInHandwritingArea(handwritingArea, x, y, view)
+ if (!isInHandwritingArea(handwritingArea, x, y, view, isHover)
|| !shouldTriggerStylusHandwritingForView(view)) {
continue;
}
@@ -546,15 +556,48 @@
* Return true if the (x, y) is inside by the given {@link Rect} with the View's
* handwriting bounds with offsets applied.
*/
- private static boolean isInHandwritingArea(@Nullable Rect handwritingArea,
- float x, float y, View view) {
+ private boolean isInHandwritingArea(@Nullable Rect handwritingArea,
+ float x, float y, View view, boolean isHover) {
if (handwritingArea == null) return false;
- return contains(handwritingArea, x, y,
+ if (!contains(handwritingArea, x, y,
view.getHandwritingBoundsOffsetLeft(),
view.getHandwritingBoundsOffsetTop(),
view.getHandwritingBoundsOffsetRight(),
- view.getHandwritingBoundsOffsetBottom());
+ view.getHandwritingBoundsOffsetBottom())) {
+ return false;
+ }
+
+ // The returned handwritingArea computed by ViewParent#getChildVisibleRect didn't consider
+ // the case where a view is stacking on top of the editor. (e.g. DrawerLayout, popup)
+ // We must check the hit region of the editor again, and avoid the case where another
+ // view on top of the editor is handling MotionEvents.
+ ViewParent parent = view.getParent();
+ if (parent == null) {
+ return true;
+ }
+
+ Region region = mTempRegion;
+ mTempRegion.set(0, 0, view.getWidth(), view.getHeight());
+ Matrix matrix = mTempMatrix;
+ matrix.reset();
+ if (!parent.getChildLocalHitRegion(view, region, matrix, isHover)) {
+ return false;
+ }
+
+ // It's not easy to extend the region by the given handwritingBoundsOffset. Instead, we
+ // create a rectangle surrounding the motion event location and check if this rectangle
+ // overlaps with the hit region of the editor.
+ float left = x - view.getHandwritingBoundsOffsetRight();
+ float top = y - view.getHandwritingBoundsOffsetBottom();
+ float right = Math.max(x + view.getHandwritingBoundsOffsetLeft(), left + 1);
+ float bottom = Math.max(y + view.getHandwritingBoundsOffsetTop(), top + 1);
+ RectF rectF = mTempRectF;
+ rectF.set(left, top, right, bottom);
+ matrix.mapRect(rectF);
+
+ return region.op(Math.round(rectF.left), Math.round(rectF.top),
+ Math.round(rectF.right), Math.round(rectF.bottom), Region.Op.INTERSECT);
}
/**
diff --git a/core/java/android/view/IRecentsAnimationRunner.aidl b/core/java/android/view/IRecentsAnimationRunner.aidl
index c7fd380..37663d5 100644
--- a/core/java/android/view/IRecentsAnimationRunner.aidl
+++ b/core/java/android/view/IRecentsAnimationRunner.aidl
@@ -21,6 +21,7 @@
import android.view.RemoteAnimationTarget;
import android.view.IRecentsAnimationController;
import android.window.TaskSnapshot;
+import android.os.Bundle;
/**
* Interface that is used to callback from window manager to the process that runs a recents
@@ -57,7 +58,7 @@
@UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
void onAnimationStart(in IRecentsAnimationController controller,
in RemoteAnimationTarget[] apps, in RemoteAnimationTarget[] wallpapers,
- in Rect homeContentInsets, in Rect minimizedHomeBounds) = 2;
+ in Rect homeContentInsets, in Rect minimizedHomeBounds, in Bundle extras) = 2;
/**
* Called when the task of an activity that has been started while the recents animation
diff --git a/core/java/android/view/InputWindowHandle.java b/core/java/android/view/InputWindowHandle.java
index 3812d37..2761aae 100644
--- a/core/java/android/view/InputWindowHandle.java
+++ b/core/java/android/view/InputWindowHandle.java
@@ -19,6 +19,7 @@
import android.annotation.IntDef;
import android.annotation.Nullable;
import android.graphics.Matrix;
+import android.graphics.Rect;
import android.graphics.Region;
import android.gui.TouchOcclusionMode;
import android.os.IBinder;
@@ -103,10 +104,7 @@
public long dispatchingTimeoutMillis;
// Window frame.
- public int frameLeft;
- public int frameTop;
- public int frameRight;
- public int frameBottom;
+ public final Rect frame = new Rect();
public int surfaceInset;
@@ -184,10 +182,7 @@
layoutParamsFlags = other.layoutParamsFlags;
layoutParamsType = other.layoutParamsType;
dispatchingTimeoutMillis = other.dispatchingTimeoutMillis;
- frameLeft = other.frameLeft;
- frameTop = other.frameTop;
- frameRight = other.frameRight;
- frameBottom = other.frameBottom;
+ frame.set(other.frame);
surfaceInset = other.surfaceInset;
scaleFactor = other.scaleFactor;
touchableRegion.set(other.touchableRegion);
@@ -209,8 +204,7 @@
@Override
public String toString() {
return new StringBuilder(name != null ? name : "")
- .append(", frame=[").append(frameLeft).append(",").append(frameTop).append(",")
- .append(frameRight).append(",").append(frameBottom).append("]")
+ .append(", frame=[").append(frame).append("]")
.append(", touchableRegion=").append(touchableRegion)
.append(", scaleFactor=").append(scaleFactor)
.append(", transform=").append(transform)
diff --git a/core/java/android/view/InsetsAnimationControlImpl.java b/core/java/android/view/InsetsAnimationControlImpl.java
index 6c5f195..fabfed3 100644
--- a/core/java/android/view/InsetsAnimationControlImpl.java
+++ b/core/java/android/view/InsetsAnimationControlImpl.java
@@ -28,7 +28,6 @@
import static android.view.InsetsAnimationControlImplProto.PENDING_INSETS;
import static android.view.InsetsAnimationControlImplProto.SHOWN_ON_FINISH;
import static android.view.InsetsAnimationControlImplProto.TMP_MATRIX;
-import static android.view.InsetsController.ANIMATION_TYPE_SHOW;
import static android.view.InsetsController.AnimationType;
import static android.view.InsetsController.DEBUG;
import static android.view.InsetsController.LAYOUT_INSETS_DURING_ANIMATION_SHOWN;
@@ -285,15 +284,11 @@
return false;
}
final Insets offset = Insets.subtract(mShownInsets, mPendingInsets);
- ArrayList<SurfaceParams> params = new ArrayList<>();
- updateLeashesForSide(ISIDE_LEFT, offset.left, mPendingInsets.left, params, outState,
- mPendingAlpha);
- updateLeashesForSide(ISIDE_TOP, offset.top, mPendingInsets.top, params, outState,
- mPendingAlpha);
- updateLeashesForSide(ISIDE_RIGHT, offset.right, mPendingInsets.right, params, outState,
- mPendingAlpha);
- updateLeashesForSide(ISIDE_BOTTOM, offset.bottom, mPendingInsets.bottom, params, outState,
- mPendingAlpha);
+ final ArrayList<SurfaceParams> params = new ArrayList<>();
+ updateLeashesForSide(ISIDE_LEFT, offset.left, params, outState, mPendingAlpha);
+ updateLeashesForSide(ISIDE_TOP, offset.top, params, outState, mPendingAlpha);
+ updateLeashesForSide(ISIDE_RIGHT, offset.right, params, outState, mPendingAlpha);
+ updateLeashesForSide(ISIDE_BOTTOM, offset.bottom, params, outState, mPendingAlpha);
mController.applySurfaceParams(params.toArray(new SurfaceParams[params.size()]));
mCurrentInsets = mPendingInsets;
@@ -457,7 +452,7 @@
return alpha >= 1 ? 1 : (alpha <= 0 ? 0 : alpha);
}
- private void updateLeashesForSide(@InternalInsetsSide int side, int offset, int inset,
+ private void updateLeashesForSide(@InternalInsetsSide int side, int offset,
ArrayList<SurfaceParams> surfaceParams, @Nullable InsetsState outState, float alpha) {
final ArraySet<InsetsSourceControl> controls = mSideControlsMap.get(side);
if (controls == null) {
@@ -475,9 +470,9 @@
}
addTranslationToMatrix(side, offset, mTmpMatrix, mTmpFrame);
- final boolean visible = mHasZeroInsetsIme && side == ISIDE_BOTTOM
- ? (mAnimationType == ANIMATION_TYPE_SHOW || !mFinished)
- : inset != 0;
+ final boolean visible = mPendingFraction == 0 && source != null
+ ? source.isVisible()
+ : !mFinished || mShownOnFinish;
if (outState != null && source != null) {
outState.addSource(new InsetsSource(source)
diff --git a/core/java/android/view/InsetsController.java b/core/java/android/view/InsetsController.java
index 4ecfc40..8ec7d67 100644
--- a/core/java/android/view/InsetsController.java
+++ b/core/java/android/view/InsetsController.java
@@ -16,10 +16,12 @@
package android.view;
+import static android.inputmethodservice.InputMethodService.ENABLE_HIDE_IME_CAPTION_BAR;
import static android.os.Trace.TRACE_TAG_VIEW;
import static android.view.InsetsControllerProto.CONTROL;
import static android.view.InsetsControllerProto.STATE;
import static android.view.InsetsSource.ID_IME;
+import static android.view.InsetsSource.ID_IME_CAPTION_BAR;
import static android.view.ViewRootImpl.CAPTION_ON_SHELL;
import static android.view.WindowInsets.Type.FIRST;
import static android.view.WindowInsets.Type.LAST;
@@ -40,6 +42,7 @@
import android.content.Context;
import android.content.res.CompatibilityInfo;
import android.graphics.Insets;
+import android.graphics.Point;
import android.graphics.Rect;
import android.os.CancellationSignal;
import android.os.Handler;
@@ -652,6 +655,7 @@
private int mLastWindowingMode;
private boolean mStartingAnimation;
private int mCaptionInsetsHeight = 0;
+ private int mImeCaptionBarInsetsHeight = 0;
private boolean mAnimationsDisabled;
private boolean mCompatSysUiVisibilityStaled;
@@ -662,9 +666,6 @@
/** Set of inset types for which an animation was started since last resetting this field */
private @InsetsType int mLastStartedAnimTypes;
- /** Set of inset types which cannot be controlled by the user animation */
- private @InsetsType int mDisabledUserAnimationInsetsTypes;
-
/** Set of inset types which are existing */
private @InsetsType int mExistingTypes = 0;
@@ -693,6 +694,9 @@
if (!CAPTION_ON_SHELL && source1.getType() == captionBar()) {
return;
}
+ if (source1.getId() == ID_IME_CAPTION_BAR) {
+ return;
+ }
// Don't change the indexes of the sources while traversing. Remove it later.
mPendingRemoveIndexes.add(index1);
@@ -823,6 +827,9 @@
if (mFrame.equals(frame)) {
return;
}
+ if (mImeCaptionBarInsetsHeight != 0) {
+ setImeCaptionBarInsetsHeight(mImeCaptionBarInsetsHeight);
+ }
mHost.notifyInsetsChanged();
mFrame.set(frame);
}
@@ -877,21 +884,11 @@
mState.set(newState, 0 /* types */);
@InsetsType int existingTypes = 0;
@InsetsType int visibleTypes = 0;
- @InsetsType int disabledUserAnimationTypes = 0;
@InsetsType int[] cancelledUserAnimationTypes = {0};
for (int i = 0, size = newState.sourceSize(); i < size; i++) {
final InsetsSource source = newState.sourceAt(i);
@InsetsType int type = source.getType();
@AnimationType int animationType = getAnimationType(type);
- if (!source.isUserControllable()) {
- // The user animation is not allowed when visible frame is empty.
- disabledUserAnimationTypes |= type;
- if (animationType == ANIMATION_TYPE_USER) {
- // Existing user animation needs to be cancelled.
- animationType = ANIMATION_TYPE_NONE;
- cancelledUserAnimationTypes[0] |= type;
- }
- }
final InsetsSourceConsumer consumer = mSourceConsumers.get(source.getId());
if (consumer != null) {
consumer.updateSource(source, animationType);
@@ -921,28 +918,11 @@
}
InsetsState.traverse(mState, newState, mRemoveGoneSources);
- updateDisabledUserAnimationTypes(disabledUserAnimationTypes);
-
if (cancelledUserAnimationTypes[0] != 0) {
mHandler.post(() -> show(cancelledUserAnimationTypes[0]));
}
}
- private void updateDisabledUserAnimationTypes(@InsetsType int disabledUserAnimationTypes) {
- @InsetsType int diff = mDisabledUserAnimationInsetsTypes ^ disabledUserAnimationTypes;
- if (diff != 0) {
- for (int i = mSourceConsumers.size() - 1; i >= 0; i--) {
- InsetsSourceConsumer consumer = mSourceConsumers.valueAt(i);
- if (consumer.getControl() != null && (consumer.getType() & diff) != 0) {
- mHandler.removeCallbacks(mInvokeControllableInsetsChangedListeners);
- mHandler.post(mInvokeControllableInsetsChangedListeners);
- break;
- }
- }
- mDisabledUserAnimationInsetsTypes = disabledUserAnimationTypes;
- }
- }
-
private boolean captionInsetsUnchanged() {
if (CAPTION_ON_SHELL) {
return false;
@@ -1007,6 +987,12 @@
// Ensure to update all existing source consumers
for (int i = mSourceConsumers.size() - 1; i >= 0; i--) {
final InsetsSourceConsumer consumer = mSourceConsumers.valueAt(i);
+ if (consumer.getId() == ID_IME_CAPTION_BAR) {
+ // The inset control for the IME caption bar will never be dispatched
+ // by the server.
+ continue;
+ }
+
final InsetsSourceControl control = mTmpControlArray.get(consumer.getId());
if (control != null) {
controllableTypes |= control.getType();
@@ -1316,26 +1302,6 @@
+ " while an existing " + Type.toString(mTypesBeingCancelled)
+ " is being cancelled.");
}
- if (animationType == ANIMATION_TYPE_USER) {
- final @InsetsType int disabledTypes = types & mDisabledUserAnimationInsetsTypes;
- if (DEBUG) Log.d(TAG, "user animation disabled types: " + disabledTypes);
- types &= ~mDisabledUserAnimationInsetsTypes;
-
- if ((disabledTypes & ime()) != 0) {
- ImeTracker.forLogging().onFailed(statsToken,
- ImeTracker.PHASE_CLIENT_DISABLED_USER_ANIMATION);
-
- if (fromIme
- && !mState.isSourceOrDefaultVisible(mImeSourceConsumer.getId(), ime())) {
- // We've requested IMM to show IME, but the IME is not controllable. We need to
- // cancel the request.
- setRequestedVisibleTypes(0 /* visibleTypes */, ime());
- if (mImeSourceConsumer.onAnimationStateChanged(false /* running */)) {
- notifyVisibilityChanged();
- }
- }
- }
- }
if (types == 0) {
// nothing to animate.
listener.onCancelled(null);
@@ -1499,7 +1465,8 @@
continue;
}
final InsetsSourceControl control = consumer.getControl();
- if (control != null && control.getLeash() != null) {
+ if (control != null
+ && (control.getLeash() != null || control.getId() == ID_IME_CAPTION_BAR)) {
controls.put(control.getId(), new InsetsSourceControl(control));
typesReady |= consumer.getType();
}
@@ -1885,6 +1852,35 @@
}
@Override
+ public void setImeCaptionBarInsetsHeight(int height) {
+ if (!ENABLE_HIDE_IME_CAPTION_BAR) {
+ return;
+ }
+ Rect newFrame = new Rect(mFrame.left, mFrame.bottom - height, mFrame.right, mFrame.bottom);
+ InsetsSource source = mState.peekSource(ID_IME_CAPTION_BAR);
+ if (mImeCaptionBarInsetsHeight != height
+ || (source != null && !newFrame.equals(source.getFrame()))) {
+ mImeCaptionBarInsetsHeight = height;
+ if (mImeCaptionBarInsetsHeight != 0) {
+ mState.getOrCreateSource(ID_IME_CAPTION_BAR, captionBar())
+ .setFrame(newFrame);
+ getSourceConsumer(ID_IME_CAPTION_BAR, captionBar()).setControl(
+ new InsetsSourceControl(ID_IME_CAPTION_BAR, captionBar(),
+ null /* leash */, false /* initialVisible */,
+ new Point(), Insets.NONE),
+ new int[1], new int[1]);
+ } else {
+ mState.removeSource(ID_IME_CAPTION_BAR);
+ InsetsSourceConsumer sourceConsumer = mSourceConsumers.get(ID_IME_CAPTION_BAR);
+ if (sourceConsumer != null) {
+ sourceConsumer.setControl(null, new int[1], new int[1]);
+ }
+ }
+ mHost.notifyInsetsChanged();
+ }
+ }
+
+ @Override
public void setSystemBarsBehavior(@Behavior int behavior) {
mHost.setSystemBarsBehavior(behavior);
}
@@ -1908,7 +1904,7 @@
for (int i = mSourceConsumers.size() - 1; i >= 0; i--) {
InsetsSourceConsumer consumer = mSourceConsumers.valueAt(i);
InsetsSource source = mState.peekSource(consumer.getId());
- if (consumer.getControl() != null && source != null && source.isUserControllable()) {
+ if (consumer.getControl() != null && source != null) {
result |= consumer.getType();
}
}
diff --git a/core/java/android/view/InsetsSource.java b/core/java/android/view/InsetsSource.java
index 6441186..0d5704e 100644
--- a/core/java/android/view/InsetsSource.java
+++ b/core/java/android/view/InsetsSource.java
@@ -20,6 +20,7 @@
import static android.view.InsetsSourceProto.TYPE;
import static android.view.InsetsSourceProto.VISIBLE;
import static android.view.InsetsSourceProto.VISIBLE_FRAME;
+import static android.view.WindowInsets.Type.captionBar;
import static android.view.WindowInsets.Type.ime;
import android.annotation.IntDef;
@@ -47,6 +48,9 @@
/** The insets source ID of IME */
public static final int ID_IME = createId(null, 0, ime());
+ /** The insets source ID of the IME caption bar ("fake" IME navigation bar). */
+ static final int ID_IME_CAPTION_BAR =
+ InsetsSource.createId(null /* owner */, 1 /* index */, captionBar());
/**
* Controls whether this source suppresses the scrim. If the scrim is ignored, the system won't
@@ -183,11 +187,6 @@
return (mFlags & flags) == flags;
}
- boolean isUserControllable() {
- // If mVisibleFrame is null, it will be the same area as mFrame.
- return mVisibleFrame == null || !mVisibleFrame.isEmpty();
- }
-
/**
* Calculates the insets this source will cause to a client window.
*
@@ -215,8 +214,12 @@
// During drag-move and drag-resizing, the caption insets position may not get updated
// before the app frame get updated. To layout the app content correctly during drag events,
// we always return the insets with the corresponding height covering the top.
+ // However, with the "fake" IME navigation bar treated as a caption bar, we return the
+ // insets with the corresponding height the bottom.
if (getType() == WindowInsets.Type.captionBar()) {
- return Insets.of(0, frame.height(), 0, 0);
+ return getId() == ID_IME_CAPTION_BAR
+ ? Insets.of(0, 0, 0, frame.height())
+ : Insets.of(0, frame.height(), 0, 0);
}
// Checks for whether there is shared edge with insets for 0-width/height window.
final boolean hasIntersection = relativeFrame.isEmpty()
diff --git a/core/java/android/view/PendingInsetsController.java b/core/java/android/view/PendingInsetsController.java
index e8f62fc..a4cbc52 100644
--- a/core/java/android/view/PendingInsetsController.java
+++ b/core/java/android/view/PendingInsetsController.java
@@ -44,6 +44,7 @@
private ArrayList<OnControllableInsetsChangedListener> mControllableInsetsChangedListeners
= new ArrayList<>();
private int mCaptionInsetsHeight = 0;
+ private int mImeCaptionBarInsetsHeight = 0;
private WindowInsetsAnimationControlListener mLoggingListener;
private @InsetsType int mRequestedVisibleTypes = WindowInsets.Type.defaultVisible();
@@ -91,6 +92,11 @@
}
@Override
+ public void setImeCaptionBarInsetsHeight(int height) {
+ mImeCaptionBarInsetsHeight = height;
+ }
+
+ @Override
public void setSystemBarsBehavior(int behavior) {
if (mReplayedInsetsController != null) {
mReplayedInsetsController.setSystemBarsBehavior(behavior);
@@ -168,6 +174,9 @@
if (mCaptionInsetsHeight != 0) {
controller.setCaptionInsetsHeight(mCaptionInsetsHeight);
}
+ if (mImeCaptionBarInsetsHeight != 0) {
+ controller.setImeCaptionBarInsetsHeight(mImeCaptionBarInsetsHeight);
+ }
if (mAnimationsDisabled) {
controller.setAnimationsDisabled(true);
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 92509c9..5e19c67 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -9279,8 +9279,8 @@
}
while (parentGroup != null && !parentGroup.isImportantForAutofill()) {
- ignoredParentLeft += parentGroup.mLeft;
- ignoredParentTop += parentGroup.mTop;
+ ignoredParentLeft += parentGroup.mLeft - parentGroup.mScrollX;
+ ignoredParentTop += parentGroup.mTop - parentGroup.mScrollY;
viewParent = parentGroup.getParent();
if (viewParent instanceof View) {
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 1b1098d..7bdff8c 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -7361,6 +7361,90 @@
}
}
+ /**
+ * @hide
+ */
+ @Override
+ public boolean getChildLocalHitRegion(@NonNull View child, @NonNull Region region,
+ @NonNull Matrix matrix, boolean isHover) {
+ if (!child.hasIdentityMatrix()) {
+ matrix.preConcat(child.getInverseMatrix());
+ }
+
+ final int dx = child.mLeft - mScrollX;
+ final int dy = child.mTop - mScrollY;
+ matrix.preTranslate(-dx, -dy);
+
+ final int width = mRight - mLeft;
+ final int height = mBottom - mTop;
+
+ // Map the bounds of this view into the region's coordinates and clip the region.
+ final RectF rect = mAttachInfo != null ? mAttachInfo.mTmpTransformRect : new RectF();
+ rect.set(0, 0, width, height);
+ matrix.mapRect(rect);
+
+ boolean notEmpty = region.op(Math.round(rect.left), Math.round(rect.top),
+ Math.round(rect.right), Math.round(rect.bottom), Region.Op.INTERSECT);
+
+ if (isHover) {
+ HoverTarget target = mFirstHoverTarget;
+ boolean childIsHit = false;
+ while (target != null) {
+ final HoverTarget next = target.next;
+ if (target.child == child) {
+ childIsHit = true;
+ break;
+ }
+ target = next;
+ }
+ if (!childIsHit) {
+ target = mFirstHoverTarget;
+ while (notEmpty && target != null) {
+ final HoverTarget next = target.next;
+ final View hoveredView = target.child;
+
+ rect.set(hoveredView.mLeft, hoveredView.mTop, hoveredView.mRight,
+ hoveredView.mBottom);
+ matrix.mapRect(rect);
+ notEmpty = region.op(Math.round(rect.left), Math.round(rect.top),
+ Math.round(rect.right), Math.round(rect.bottom), Region.Op.DIFFERENCE);
+ target = next;
+ }
+ }
+ } else {
+ TouchTarget target = mFirstTouchTarget;
+ boolean childIsHit = false;
+ while (target != null) {
+ final TouchTarget next = target.next;
+ if (target.child == child) {
+ childIsHit = true;
+ break;
+ }
+ target = next;
+ }
+ if (!childIsHit) {
+ target = mFirstTouchTarget;
+ while (notEmpty && target != null) {
+ final TouchTarget next = target.next;
+ final View touchedView = target.child;
+
+ rect.set(touchedView.mLeft, touchedView.mTop, touchedView.mRight,
+ touchedView.mBottom);
+ matrix.mapRect(rect);
+ notEmpty = region.op(Math.round(rect.left), Math.round(rect.top),
+ Math.round(rect.right), Math.round(rect.bottom), Region.Op.DIFFERENCE);
+ target = next;
+ }
+ }
+ }
+
+ if (notEmpty && mParent != null) {
+ notEmpty = mParent.getChildLocalHitRegion(this, region, matrix, isHover);
+ }
+ return notEmpty;
+ }
+
+
private static void applyOpToRegionByBounds(Region region, View view, Region.Op op) {
final int[] locationInWindow = new int[2];
view.getLocationInWindow(locationInWindow);
diff --git a/core/java/android/view/ViewParent.java b/core/java/android/view/ViewParent.java
index 1020d2e..54bc348 100644
--- a/core/java/android/view/ViewParent.java
+++ b/core/java/android/view/ViewParent.java
@@ -18,6 +18,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.Region;
import android.os.Bundle;
@@ -686,6 +687,36 @@
}
/**
+ * Compute the region where the child can receive the {@link MotionEvent}s from the root view.
+ *
+ * <p> Given region where the child will accept {@link MotionEvent}s.
+ * Modify the region to the unblocked region where the child can receive the
+ * {@link MotionEvent}s from the view root.
+ * </p>
+ *
+ * <p> The given region is always clipped by the bounds of the parent views. When there are
+ * on-going {@link MotionEvent}s, this method also makes use of the event dispatching results to
+ * determine whether a sibling view will also block the child's hit region.
+ * </p>
+ *
+ * @param child a child View, whose hit region we want to compute.
+ * @param region the initial hit region where the child view will handle {@link MotionEvent}s,
+ * defined in the child coordinates. Will be overwritten to the result hit region.
+ * @param matrix the matrix that maps the given child view's coordinates to the region
+ * coordinates. It will be modified to a matrix that maps window coordinates to
+ * the result region's coordinates.
+ * @param isHover if true it will return the hover events' hit region, otherwise it will
+ * return the touch events' hit region.
+ * @return true if the returned region is not empty.
+ * @hide
+ */
+ default boolean getChildLocalHitRegion(@NonNull View child, @NonNull Region region,
+ @NonNull Matrix matrix, boolean isHover) {
+ region.setEmpty();
+ return false;
+ }
+
+ /**
* Unbuffered dispatch has been requested by a child of this view parent.
* This method is called by the View hierarchy to signal ancestors that a View needs to
* request unbuffered dispatch.
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 3aa610a..ddd3269 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -128,6 +128,7 @@
import android.graphics.PorterDuff;
import android.graphics.RecordingCanvas;
import android.graphics.Rect;
+import android.graphics.RectF;
import android.graphics.Region;
import android.graphics.RenderNode;
import android.graphics.drawable.Drawable;
@@ -321,13 +322,6 @@
SystemProperties.getBoolean("persist.wm.debug.client_immersive_confirmation", false);
/**
- * Whether the client should compute the window frame on its own.
- * @hide
- */
- public static final boolean LOCAL_LAYOUT =
- SystemProperties.getBoolean("persist.debug.local_layout", true);
-
- /**
* Set this system property to true to force the view hierarchy to render
* at 60 Hz. This can be used to measure the potential framerate.
*/
@@ -1911,8 +1905,8 @@
final float compatScale = frames.compatScale;
final boolean frameChanged = !mWinFrame.equals(frame);
final boolean configChanged = !mLastReportedMergedConfiguration.equals(mergedConfiguration);
- final boolean attachedFrameChanged = LOCAL_LAYOUT
- && !Objects.equals(mTmpFrames.attachedFrame, attachedFrame);
+ final boolean attachedFrameChanged =
+ !Objects.equals(mTmpFrames.attachedFrame, attachedFrame);
final boolean displayChanged = mDisplay.getDisplayId() != displayId;
final boolean compatScaleChanged = mTmpFrames.compatScale != compatScale;
final boolean dragResizingChanged = mPendingDragResizing != dragResizing;
@@ -2397,6 +2391,22 @@
}
@Override
+ public boolean getChildLocalHitRegion(@NonNull View child, @NonNull Region region,
+ @NonNull Matrix matrix, boolean isHover) {
+ if (child != mView) {
+ throw new IllegalArgumentException("child " + child + " is not the root view "
+ + mView + " managed by this ViewRootImpl");
+ }
+
+ RectF rectF = new RectF(0, 0, mWidth, mHeight);
+ matrix.mapRect(rectF);
+ // Note: don't apply scroll offset, because we want to know its
+ // visibility in the virtual canvas being given to the view hierarchy.
+ return region.op(Math.round(rectF.left), Math.round(rectF.top),
+ Math.round(rectF.right), Math.round(rectF.bottom), Region.Op.INTERSECT);
+ }
+
+ @Override
public void bringChildToFront(View child) {
}
@@ -8292,8 +8302,7 @@
final int measuredWidth = mMeasuredWidth;
final int measuredHeight = mMeasuredHeight;
final boolean relayoutAsync;
- if (LOCAL_LAYOUT
- && (mViewFrameInfo.flags & FrameInfo.FLAG_WINDOW_VISIBILITY_CHANGED) == 0
+ if ((mViewFrameInfo.flags & FrameInfo.FLAG_WINDOW_VISIBILITY_CHANGED) == 0
&& mWindowAttributes.type != TYPE_APPLICATION_STARTING
&& mSyncSeqId <= mLastSyncSeqId
&& winConfigFromAm.diff(winConfigFromWm, false /* compareUndefined */) == 0) {
diff --git a/core/java/android/view/WindowInsetsController.java b/core/java/android/view/WindowInsetsController.java
index bc0bab7..cc2cd79 100644
--- a/core/java/android/view/WindowInsetsController.java
+++ b/core/java/android/view/WindowInsetsController.java
@@ -250,6 +250,16 @@
void setCaptionInsetsHeight(int height);
/**
+ * Sets the insets height for the IME caption bar, which corresponds to the
+ * "fake" IME navigation bar.
+ *
+ * @param height the insets height of the IME caption bar.
+ * @hide
+ */
+ default void setImeCaptionBarInsetsHeight(int height) {
+ }
+
+ /**
* Controls the behavior of system bars.
*
* @param behavior Determines how the bars behave when being hidden by the application.
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index bb1d5b1..62e37a4 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -3839,6 +3839,7 @@
* @see #ROTATION_ANIMATION_ROTATE
* @see #ROTATION_ANIMATION_CROSSFADE
* @see #ROTATION_ANIMATION_JUMPCUT
+ * @see #ROTATION_ANIMATION_SEAMLESS
*/
public int rotationAnimation = ROTATION_ANIMATION_ROTATE;
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 7a96fd2..e1de05b 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -6948,6 +6948,7 @@
// something is going to start.
opts.setPendingIntentBackgroundActivityStartMode(
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
+ opts.setPendingIntentBackgroundActivityLaunchAllowedByPermission(true);
return Pair.create(intent, opts);
}
}
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index afe7559..8899f5c 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -12884,6 +12884,15 @@
}
/**
+ * @return true if this TextView could be filled by an Autofill service. Note that disabled
+ * fields can still be filled.
+ */
+ @UnsupportedAppUsage
+ boolean isTextAutofillable() {
+ return mText instanceof Editable && onCheckIsTextEditor();
+ }
+
+ /**
* Returns true, only while processing a touch gesture, if the initial
* touch down event caused focus to move to the text view and as a result
* its selection changed. Only valid while processing the touch gesture
@@ -13605,7 +13614,7 @@
@Override
public void autofill(AutofillValue value) {
- if (!isTextEditable()) {
+ if (!isTextAutofillable()) {
Log.w(LOG_TAG, "cannot autofill non-editable TextView: " + this);
return;
}
@@ -13621,7 +13630,7 @@
@Override
public @AutofillType int getAutofillType() {
- return isTextEditable() ? AUTOFILL_TYPE_TEXT : AUTOFILL_TYPE_NONE;
+ return isTextAutofillable() ? AUTOFILL_TYPE_TEXT : AUTOFILL_TYPE_NONE;
}
/**
@@ -13635,7 +13644,7 @@
@Override
@Nullable
public AutofillValue getAutofillValue() {
- if (isTextEditable()) {
+ if (isTextAutofillable()) {
final CharSequence text = TextUtils.trimToParcelableSize(getText());
return AutofillValue.forText(text);
}
diff --git a/core/java/android/window/WindowInfosListenerForTest.java b/core/java/android/window/WindowInfosListenerForTest.java
index be88e53..6e9f044 100644
--- a/core/java/android/window/WindowInfosListenerForTest.java
+++ b/core/java/android/window/WindowInfosListenerForTest.java
@@ -161,10 +161,8 @@
private static List<WindowInfo> buildWindowInfos(InputWindowHandle[] windowHandles) {
var windowInfos = new ArrayList<WindowInfo>(windowHandles.length);
for (var handle : windowHandles) {
- var bounds = new Rect(handle.frameLeft, handle.frameTop, handle.frameRight,
- handle.frameBottom);
windowInfos.add(new WindowInfo(handle.getWindowToken(), handle.name, handle.displayId,
- bounds, handle.inputConfig, handle.transform));
+ handle.frame, handle.inputConfig, handle.transform));
}
return windowInfos;
}
diff --git a/core/java/android/window/flags/windowing_sdk.aconfig b/core/java/android/window/flags/windowing_sdk.aconfig
new file mode 100644
index 0000000..560e41b
--- /dev/null
+++ b/core/java/android/window/flags/windowing_sdk.aconfig
@@ -0,0 +1,10 @@
+package: "com.android.window.flags"
+
+# Project link: https://gantry.corp.google.com/projects/android_platform_windowing_sdk/changes
+
+flag {
+ namespace: "windowing_sdk"
+ name: "sync_window_config_update_flag"
+ description: "Whether the feature to sync different window-related config updates is enabled"
+ bug: "260873529"
+}
diff --git a/core/java/com/android/internal/app/IHotwordRecognitionStatusCallback.aidl b/core/java/com/android/internal/app/IHotwordRecognitionStatusCallback.aidl
index 3801188..ba87caa 100644
--- a/core/java/com/android/internal/app/IHotwordRecognitionStatusCallback.aidl
+++ b/core/java/com/android/internal/app/IHotwordRecognitionStatusCallback.aidl
@@ -22,6 +22,7 @@
import android.service.voice.HotwordRejectedResult;
import android.service.voice.SoundTriggerFailure;
import android.service.voice.VisualQueryDetectionServiceFailure;
+import com.android.internal.infra.AndroidFuture;
/**
* @hide
@@ -113,4 +114,9 @@
/** Called when the hotword detection process is restarted */
void onProcessRestarted();
+
+ /**
+ * Called when a file open request is sent.
+ */
+ void onOpenFile(in String filename, in AndroidFuture future);
}
diff --git a/core/java/com/android/internal/app/SuspendedAppActivity.java b/core/java/com/android/internal/app/SuspendedAppActivity.java
index a5e775a..1e0b2a0 100644
--- a/core/java/com/android/internal/app/SuspendedAppActivity.java
+++ b/core/java/com/android/internal/app/SuspendedAppActivity.java
@@ -297,7 +297,7 @@
final IPackageManager ipm = AppGlobals.getPackageManager();
try {
final String[] errored = ipm.setPackagesSuspendedAsUser(
- new String[]{mSuspendedPackage}, false, null, null, null,
+ new String[]{mSuspendedPackage}, false, null, null, null, 0,
mSuspendingPackage, mUserId);
if (ArrayUtils.contains(errored, mSuspendedPackage)) {
Slog.e(TAG, "Could not unsuspend " + mSuspendedPackage);
diff --git a/core/java/com/android/internal/os/BatteryStatsHistory.java b/core/java/com/android/internal/os/BatteryStatsHistory.java
index 79152b4..d3103f1 100644
--- a/core/java/com/android/internal/os/BatteryStatsHistory.java
+++ b/core/java/com/android/internal/os/BatteryStatsHistory.java
@@ -18,11 +18,10 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.os.BatteryConsumer;
import android.os.BatteryManager;
import android.os.BatteryStats;
import android.os.BatteryStats.BitDescription;
-import android.os.BatteryStats.CpuUsageDetails;
-import android.os.BatteryStats.EnergyConsumerDetails;
import android.os.BatteryStats.HistoryItem;
import android.os.BatteryStats.HistoryStepDetails;
import android.os.BatteryStats.HistoryTag;
@@ -42,7 +41,6 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.util.ParseUtils;
import java.io.File;
import java.io.FileOutputStream;
@@ -83,7 +81,7 @@
private static final int VERSION = 209;
private static final String HISTORY_DIR = "battery-history";
- private static final String FILE_SUFFIX = ".bin";
+ private static final String FILE_SUFFIX = ".bh";
private static final int MIN_FREE_SPACE = 100 * 1024 * 1024;
// Part of initial delta int that specifies the time delta.
@@ -124,10 +122,9 @@
// therefore the tag value is written in the parcel
static final int TAG_FIRST_OCCURRENCE_FLAG = 0x8000;
- static final int EXTENSION_MEASURED_ENERGY_HEADER_FLAG = 0x00000001;
- static final int EXTENSION_MEASURED_ENERGY_FLAG = 0x00000002;
- static final int EXTENSION_CPU_USAGE_HEADER_FLAG = 0x00000004;
- static final int EXTENSION_CPU_USAGE_FLAG = 0x00000008;
+ static final int EXTENSION_POWER_STATS_DESCRIPTOR_FLAG = 0x00000001;
+ static final int EXTENSION_POWER_STATS_FLAG = 0x00000002;
+ static final int EXTENSION_PROCESS_STATE_CHANGE_FLAG = 0x00000004;
// For state1, trace everything except the wakelock bit (which can race with
// suspend) and the running bit (which isn't meaningful in traces).
@@ -149,10 +146,11 @@
* The active history file that the history buffer is backed up into.
*/
private AtomicFile mActiveFile;
+
/**
- * A list of history files with incremental indexes.
+ * A list of history files with increasing timestamps.
*/
- private final List<Integer> mFileNumbers = new ArrayList<>();
+ private final List<BatteryHistoryFile> mHistoryFiles = new ArrayList<>();
/**
* A list of small history parcels, used when BatteryStatsImpl object is created from
@@ -200,14 +198,42 @@
private long mTrackRunningHistoryElapsedRealtimeMs = 0;
private long mTrackRunningHistoryUptimeMs = 0;
private long mHistoryBaseTimeMs;
- private boolean mMeasuredEnergyHeaderWritten = false;
- private boolean mCpuUsageHeaderWritten = false;
- private final VarintParceler mVarintParceler = new VarintParceler();
+ private final ArraySet<PowerStats.Descriptor> mWrittenPowerStatsDescriptors = new ArraySet<>();
private byte mLastHistoryStepLevel = 0;
private boolean mMutable = true;
private final BatteryStatsHistory mWritableHistory;
private boolean mCleanupEnabled = true;
+ private static class BatteryHistoryFile implements Comparable<BatteryHistoryFile> {
+ public final long monotonicTimeMs;
+ public final AtomicFile atomicFile;
+
+ private BatteryHistoryFile(File directory, long monotonicTimeMs) {
+ this.monotonicTimeMs = monotonicTimeMs;
+ atomicFile = new AtomicFile(new File(directory, monotonicTimeMs + FILE_SUFFIX));
+ }
+
+ @Override
+ public int compareTo(BatteryHistoryFile o) {
+ return Long.compare(monotonicTimeMs, o.monotonicTimeMs);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return monotonicTimeMs == ((BatteryHistoryFile) o).monotonicTimeMs;
+ }
+
+ @Override
+ public int hashCode() {
+ return Long.hashCode(monotonicTimeMs);
+ }
+
+ @Override
+ public String toString() {
+ return atomicFile.getBaseFile().toString();
+ }
+ }
+
/**
* A delegate responsible for computing additional details for a step in battery history.
*/
@@ -317,30 +343,45 @@
Slog.wtf(TAG, "HistoryDir does not exist:" + mHistoryDir.getPath());
}
- final Set<Integer> dedup = new ArraySet<>();
- // scan directory, fill mFileNumbers and mActiveFile.
+ final List<File> toRemove = new ArrayList<>();
+ final Set<BatteryHistoryFile> dedup = new ArraySet<>();
mHistoryDir.listFiles((dir, name) -> {
final int b = name.lastIndexOf(FILE_SUFFIX);
if (b <= 0) {
+ toRemove.add(new File(dir, name));
return false;
}
- final int c = ParseUtils.parseInt(name.substring(0, b), -1);
- if (c != -1) {
- dedup.add(c);
- return true;
- } else {
+ try {
+ long monotonicTime = Long.parseLong(name.substring(0, b));
+ dedup.add(new BatteryHistoryFile(mHistoryDir, monotonicTime));
+ } catch (NumberFormatException e) {
+ toRemove.add(new File(dir, name));
return false;
}
+ return true;
});
if (!dedup.isEmpty()) {
- mFileNumbers.addAll(dedup);
- Collections.sort(mFileNumbers);
- setActiveFile(mFileNumbers.get(mFileNumbers.size() - 1));
- } else {
- // No file found, default to have file 0.
- mFileNumbers.add(0);
- setActiveFile(0);
+ mHistoryFiles.addAll(dedup);
+ Collections.sort(mHistoryFiles);
+ setActiveFile(mHistoryFiles.get(mHistoryFiles.size() - 1));
+ } else if (mMutable) {
+ // No file found, default to have the initial file.
+ BatteryHistoryFile name = makeBatteryHistoryFile();
+ mHistoryFiles.add(name);
+ setActiveFile(name);
}
+ if (!toRemove.isEmpty()) {
+ // Clear out legacy history files, which did not follow the X-Y.bin naming format.
+ BackgroundThread.getHandler().post(() -> {
+ for (File file : toRemove) {
+ file.delete();
+ }
+ });
+ }
+ }
+
+ private BatteryHistoryFile makeBatteryHistoryFile() {
+ return new BatteryHistoryFile(mHistoryDir, mClock.elapsedRealtime() + mHistoryBaseTimeMs);
}
public BatteryStatsHistory(int maxHistoryFiles, int maxHistoryBufferSize,
@@ -384,8 +425,7 @@
mLastHistoryElapsedRealtimeMs = 0;
mTrackRunningHistoryElapsedRealtimeMs = 0;
mTrackRunningHistoryUptimeMs = 0;
- mMeasuredEnergyHeaderWritten = false;
- mCpuUsageHeaderWritten = false;
+ mWrittenPowerStatsDescriptors.clear();
mHistoryBuffer.setDataSize(0);
mHistoryBuffer.setDataPosition(0);
@@ -439,28 +479,15 @@
/**
* Set the active file that mHistoryBuffer is backed up into.
- *
- * @param fileNumber the history file that mHistoryBuffer is backed up into.
*/
- private void setActiveFile(int fileNumber) {
- mActiveFile = getFile(fileNumber);
+ private void setActiveFile(BatteryHistoryFile file) {
+ mActiveFile = file.atomicFile;
if (DEBUG) {
Slog.d(TAG, "activeHistoryFile:" + mActiveFile.getBaseFile().getPath());
}
}
/**
- * Create history AtomicFile from file number.
- *
- * @param num file number.
- * @return AtomicFile object.
- */
- private AtomicFile getFile(int num) {
- return new AtomicFile(
- new File(mHistoryDir, num + FILE_SUFFIX));
- }
-
- /**
* When {@link #mHistoryBuffer} reaches {@link BatteryStatsImpl.Constants#MAX_HISTORY_BUFFER},
* create next history file.
*/
@@ -470,15 +497,19 @@
return;
}
- if (mFileNumbers.isEmpty()) {
+ if (mHistoryFiles.isEmpty()) {
Slog.wtf(TAG, "mFileNumbers should never be empty");
return;
}
- // The last number in mFileNumbers is the highest number. The next file number is highest
- // number plus one.
- final int next = mFileNumbers.get(mFileNumbers.size() - 1) + 1;
- mFileNumbers.add(next);
+ final long start = SystemClock.uptimeMillis();
+ writeHistory();
+ if (DEBUG) {
+ Slog.d(TAG, "writeHistory took ms:" + (SystemClock.uptimeMillis() - start));
+ }
+
+ final BatteryHistoryFile next = makeBatteryHistoryFile();
+ mHistoryFiles.add(next);
setActiveFile(next);
try {
mActiveFile.getBaseFile().createNewFile();
@@ -486,6 +517,21 @@
Slog.e(TAG, "Could not create history file: " + mActiveFile.getBaseFile());
}
+ mHistoryBuffer.setDataSize(0);
+ mHistoryBuffer.setDataPosition(0);
+ mHistoryBuffer.setDataCapacity(mMaxHistoryBufferSize / 2);
+ mHistoryBufferLastPos = -1;
+ mHistoryLastWritten.clear();
+ mHistoryLastLastWritten.clear();
+
+ // Mark every entry in the pool with a flag indicating that the tag
+ // has not yet been encountered while writing the current history buffer.
+ for (Map.Entry<HistoryTag, Integer> entry : mHistoryTagPool.entrySet()) {
+ entry.setValue(entry.getValue() | BatteryStatsHistory.TAG_FIRST_OCCURRENCE_FLAG);
+ }
+
+ mWrittenPowerStatsDescriptors.clear();
+
synchronized (this) {
cleanupLocked();
}
@@ -507,17 +553,17 @@
// if free disk space is less than 100MB, delete oldest history file.
if (!hasFreeDiskSpace()) {
- int oldest = mFileNumbers.remove(0);
- getFile(oldest).delete();
+ BatteryHistoryFile oldest = mHistoryFiles.remove(0);
+ oldest.atomicFile.delete();
}
// if there are more history files than allowed, delete oldest history files.
// mMaxHistoryFiles comes from Constants.MAX_HISTORY_FILES and can be updated by GService
// config at run time.
- while (mFileNumbers.size() > mMaxHistoryFiles) {
- int oldest = mFileNumbers.get(0);
- getFile(oldest).delete();
- mFileNumbers.remove(0);
+ while (mHistoryFiles.size() > mMaxHistoryFiles) {
+ BatteryHistoryFile oldest = mHistoryFiles.get(0);
+ oldest.atomicFile.delete();
+ mHistoryFiles.remove(0);
}
}
@@ -537,12 +583,14 @@
*/
public void reset() {
if (DEBUG) Slog.i(TAG, "********** CLEARING HISTORY!");
- for (Integer i : mFileNumbers) {
- getFile(i).delete();
+ for (BatteryHistoryFile file : mHistoryFiles) {
+ file.atomicFile.delete();
}
- mFileNumbers.clear();
- mFileNumbers.add(0);
- setActiveFile(0);
+ mHistoryFiles.clear();
+
+ BatteryHistoryFile name = makeBatteryHistoryFile();
+ mHistoryFiles.add(name);
+ setActiveFile(name);
initHistoryBuffer();
}
@@ -550,9 +598,13 @@
/**
* Start iterating history files and history buffer.
*
- * @return always return true.
+ * @param startTimeMs monotonic time (the HistoryItem.time field) to start iterating from,
+ * inclusive
+ * @param endTimeMs monotonic time to stop iterating, exclusive.
+ * Pass 0 to indicate current time.
*/
- public BatteryStatsHistoryIterator iterate() {
+ @NonNull
+ public BatteryStatsHistoryIterator iterate(long startTimeMs, long endTimeMs) {
mCurrentFileIndex = 0;
mCurrentParcel = null;
mCurrentParcelEnd = 0;
@@ -563,7 +615,7 @@
mWritableHistory.setCleanupEnabledLocked(false);
}
}
- return new BatteryStatsHistoryIterator(this);
+ return new BatteryStatsHistoryIterator(this, startTimeMs, endTimeMs);
}
/**
@@ -590,7 +642,7 @@
* buffer
*/
@Nullable
- public Parcel getNextParcel() {
+ public Parcel getNextParcel(long startTimeMs, long endTimeMs) {
// First iterate through all records in current parcel.
if (mCurrentParcel != null) {
if (mCurrentParcel.dataPosition() < mCurrentParcelEnd) {
@@ -606,13 +658,29 @@
}
}
- // Try next available history file.
+ int firstFileIndex = 0;
// skip the last file because its data is in history buffer.
- while (mCurrentFileIndex < mFileNumbers.size() - 1) {
+ int lastFileIndex = mHistoryFiles.size() - 1;
+ for (int i = mHistoryFiles.size() - 1; i >= 0; i--) {
+ BatteryHistoryFile file = mHistoryFiles.get(i);
+ if (file.monotonicTimeMs >= endTimeMs) {
+ lastFileIndex = i;
+ }
+ if (file.monotonicTimeMs <= startTimeMs) {
+ firstFileIndex = i;
+ break;
+ }
+ }
+
+ if (mCurrentFileIndex < firstFileIndex) {
+ mCurrentFileIndex = firstFileIndex;
+ }
+
+ while (mCurrentFileIndex < lastFileIndex) {
mCurrentParcel = null;
mCurrentParcelEnd = 0;
final Parcel p = Parcel.obtain();
- AtomicFile file = getFile(mFileNumbers.get(mCurrentFileIndex++));
+ AtomicFile file = mHistoryFiles.get(mCurrentFileIndex++).atomicFile;
if (readFileToParcel(p, file)) {
int bufSize = p.readInt();
int curPos = p.dataPosition();
@@ -769,9 +837,9 @@
private void writeToParcel(Parcel out, boolean useBlobs) {
final long start = SystemClock.uptimeMillis();
- out.writeInt(mFileNumbers.size() - 1);
- for (int i = 0; i < mFileNumbers.size() - 1; i++) {
- AtomicFile file = getFile(mFileNumbers.get(i));
+ out.writeInt(mHistoryFiles.size() - 1);
+ for (int i = 0; i < mHistoryFiles.size() - 1; i++) {
+ AtomicFile file = mHistoryFiles.get(i).atomicFile;
byte[] raw = new byte[0];
try {
raw = file.readFully();
@@ -872,8 +940,12 @@
}
@VisibleForTesting
- public List<Integer> getFilesNumbers() {
- return mFileNumbers;
+ public List<String> getFilesNames() {
+ List<String> names = new ArrayList<>();
+ for (BatteryHistoryFile historyFile : mHistoryFiles) {
+ names.add(historyFile.atomicFile.getBaseFile().getName());
+ }
+ return names;
}
@VisibleForTesting
@@ -886,8 +958,8 @@
*/
public int getHistoryUsedSize() {
int ret = 0;
- for (int i = 0; i < mFileNumbers.size() - 1; i++) {
- ret += getFile(mFileNumbers.get(i)).getBaseFile().length();
+ for (int i = 0; i < mHistoryFiles.size() - 1; i++) {
+ ret += mHistoryFiles.get(i).atomicFile.getBaseFile().length();
}
ret += mHistoryBuffer.dataSize();
if (mHistoryParcels != null) {
@@ -937,7 +1009,7 @@
* Prepares to continue recording after restoring previous history from persistent storage.
*/
public void continueRecordingHistory() {
- if (mHistoryBuffer.dataPosition() <= 0 && mFileNumbers.size() <= 1) {
+ if (mHistoryBuffer.dataPosition() <= 0 && mHistoryFiles.size() <= 1) {
return;
}
@@ -1050,11 +1122,23 @@
}
/**
- * Records measured energy data.
+ * Records a PowerStats snapshot.
*/
- public void recordEnergyConsumerDetails(long elapsedRealtimeMs, long uptimeMs,
- EnergyConsumerDetails energyConsumerDetails) {
- mHistoryCur.energyConsumerDetails = energyConsumerDetails;
+ public void recordPowerStats(long elapsedRealtimeMs, long uptimeMs,
+ PowerStats powerStats) {
+ mHistoryCur.powerStats = powerStats;
+ mHistoryCur.states2 |= HistoryItem.STATE2_EXTENSIONS_FLAG;
+ writeHistoryItem(elapsedRealtimeMs, uptimeMs);
+ }
+
+ /**
+ * Records the change of a UID's proc state.
+ */
+ public void recordProcessStateChange(long elapsedRealtimeMs, long uptimeMs,
+ int uid, @BatteryConsumer.ProcessState int processState) {
+ mHistoryCur.processStateChange = mHistoryCur.localProcessStateChange;
+ mHistoryCur.processStateChange.uid = uid;
+ mHistoryCur.processStateChange.processState = processState;
mHistoryCur.states2 |= HistoryItem.STATE2_EXTENSIONS_FLAG;
writeHistoryItem(elapsedRealtimeMs, uptimeMs);
}
@@ -1279,17 +1363,6 @@
}
/**
- * Records CPU usage by a specific UID. The recorded data is the delta from
- * the previous record for the same UID.
- */
- public void recordCpuUsage(long elapsedRealtimeMs, long uptimeMs,
- CpuUsageDetails cpuUsageDetails) {
- mHistoryCur.cpuUsageDetails = cpuUsageDetails;
- mHistoryCur.states2 |= HistoryItem.STATE2_EXTENSIONS_FLAG;
- writeHistoryItem(elapsedRealtimeMs, uptimeMs);
- }
-
- /**
* Writes changes to a HistoryItem state bitmap to Atrace.
*/
private void recordTraceCounters(int oldval, int newval, int mask,
@@ -1355,7 +1428,9 @@
mTraceLastState2 = cur.states2;
}
- if (!mHaveBatteryLevel || !mRecordingHistory) {
+ if ((!mHaveBatteryLevel || !mRecordingHistory)
+ && cur.powerStats == null
+ && cur.processStateChange == null) {
return;
}
@@ -1391,8 +1466,8 @@
&& mHistoryLastWritten.batteryPlugType == cur.batteryPlugType
&& mHistoryLastWritten.batteryTemperature == cur.batteryTemperature
&& mHistoryLastWritten.batteryVoltage == cur.batteryVoltage
- && mHistoryLastWritten.energyConsumerDetails == null
- && mHistoryLastWritten.cpuUsageDetails == null) {
+ && mHistoryLastWritten.powerStats == null
+ && mHistoryLastWritten.processStateChange == null) {
// We can merge this new change in with the last one. Merging is
// allowed as long as only the states have changed, and within those states
// as long as no bit has changed both between now and the last entry, as
@@ -1434,34 +1509,15 @@
mMaxHistoryBufferSize = 1024;
}
- //open a new history file.
- final long start = SystemClock.uptimeMillis();
- writeHistory();
- if (DEBUG) {
- Slog.d(TAG, "addHistoryBufferLocked writeHistory took ms:"
- + (SystemClock.uptimeMillis() - start));
- }
- startNextFile();
- mHistoryBuffer.setDataSize(0);
- mHistoryBuffer.setDataPosition(0);
- mHistoryBuffer.setDataCapacity(mMaxHistoryBufferSize / 2);
- mHistoryBufferLastPos = -1;
- mHistoryLastWritten.clear();
- mHistoryLastLastWritten.clear();
-
- // Mark every entry in the pool with a flag indicating that the tag
- // has not yet been encountered while writing the current history buffer.
- for (Map.Entry<HistoryTag, Integer> entry : mHistoryTagPool.entrySet()) {
- entry.setValue(entry.getValue() | BatteryStatsHistory.TAG_FIRST_OCCURRENCE_FLAG);
- }
- mMeasuredEnergyHeaderWritten = false;
- mCpuUsageHeaderWritten = false;
-
// Make a copy of mHistoryCur.
HistoryItem copy = new HistoryItem();
copy.setTo(cur);
+
+ startNextFile();
+
// startRecordingHistory will reset mHistoryCur.
startRecordingHistory(elapsedRealtimeMs, uptimeMs, false);
+
// Add the copy into history buffer.
writeHistoryItem(elapsedRealtimeMs, uptimeMs, copy, HistoryItem.CMD_UPDATE);
return;
@@ -1477,8 +1533,8 @@
copy.eventCode = HistoryItem.EVENT_NONE;
copy.eventTag = null;
copy.tagsFirstOccurrence = false;
- copy.energyConsumerDetails = null;
- copy.cpuUsageDetails = null;
+ copy.powerStats = null;
+ copy.processStateChange = null;
writeHistoryItem(elapsedRealtimeMs, uptimeMs, copy, HistoryItem.CMD_RESET);
}
writeHistoryItem(elapsedRealtimeMs, uptimeMs, cur, HistoryItem.CMD_UPDATE);
@@ -1506,8 +1562,8 @@
cur.eventCode = HistoryItem.EVENT_NONE;
cur.eventTag = null;
cur.tagsFirstOccurrence = false;
- cur.energyConsumerDetails = null;
- cur.cpuUsageDetails = null;
+ cur.powerStats = null;
+ cur.processStateChange = null;
if (DEBUG) {
Slog.i(TAG, "Writing history buffer: was " + mHistoryBufferLastPos
+ " now " + mHistoryBuffer.dataPosition()
@@ -1638,17 +1694,14 @@
if (stateIntChanged) {
firstToken |= BatteryStatsHistory.DELTA_STATE_FLAG;
}
- if (cur.energyConsumerDetails != null) {
- extensionFlags |= BatteryStatsHistory.EXTENSION_MEASURED_ENERGY_FLAG;
- if (!mMeasuredEnergyHeaderWritten) {
- extensionFlags |= BatteryStatsHistory.EXTENSION_MEASURED_ENERGY_HEADER_FLAG;
+ if (cur.powerStats != null) {
+ extensionFlags |= BatteryStatsHistory.EXTENSION_POWER_STATS_FLAG;
+ if (!mWrittenPowerStatsDescriptors.contains(cur.powerStats.descriptor)) {
+ extensionFlags |= BatteryStatsHistory.EXTENSION_POWER_STATS_DESCRIPTOR_FLAG;
}
}
- if (cur.cpuUsageDetails != null) {
- extensionFlags |= EXTENSION_CPU_USAGE_FLAG;
- if (!mCpuUsageHeaderWritten) {
- extensionFlags |= BatteryStatsHistory.EXTENSION_CPU_USAGE_HEADER_FLAG;
- }
+ if (cur.processStateChange != null) {
+ extensionFlags |= BatteryStatsHistory.EXTENSION_PROCESS_STATE_CHANGE_FLAG;
}
if (extensionFlags != 0) {
cur.states2 |= HistoryItem.STATE2_EXTENSIONS_FLAG;
@@ -1773,37 +1826,16 @@
dest.writeDouble(cur.wifiRailChargeMah);
if (extensionFlags != 0) {
dest.writeInt(extensionFlags);
- if (cur.energyConsumerDetails != null) {
- if (DEBUG) {
- Slog.i(TAG, "WRITE DELTA: measuredEnergyDetails=" + cur.energyConsumerDetails);
+ if (cur.powerStats != null) {
+ if ((extensionFlags & BatteryStatsHistory.EXTENSION_POWER_STATS_DESCRIPTOR_FLAG)
+ != 0) {
+ cur.powerStats.descriptor.writeSummaryToParcel(dest);
+ mWrittenPowerStatsDescriptors.add(cur.powerStats.descriptor);
}
- if (!mMeasuredEnergyHeaderWritten) {
- EnergyConsumerDetails.EnergyConsumer[] consumers =
- cur.energyConsumerDetails.consumers;
- dest.writeInt(consumers.length);
- for (EnergyConsumerDetails.EnergyConsumer consumer : consumers) {
- dest.writeInt(consumer.type);
- dest.writeInt(consumer.ordinal);
- dest.writeString(consumer.name);
- }
- mMeasuredEnergyHeaderWritten = true;
- }
- mVarintParceler.writeLongArray(dest, cur.energyConsumerDetails.chargeUC);
+ cur.powerStats.writeToParcel(dest);
}
-
- if (cur.cpuUsageDetails != null) {
- if (DEBUG) {
- Slog.i(TAG, "WRITE DELTA: cpuUsageDetails=" + cur.cpuUsageDetails);
- }
- if (!mCpuUsageHeaderWritten) {
- dest.writeInt(cur.cpuUsageDetails.cpuBracketDescriptions.length);
- for (String desc: cur.cpuUsageDetails.cpuBracketDescriptions) {
- dest.writeString(desc);
- }
- mCpuUsageHeaderWritten = true;
- }
- dest.writeInt(cur.cpuUsageDetails.uid);
- mVarintParceler.writeLongArray(dest, cur.cpuUsageDetails.cpuUsageMs);
+ if (cur.processStateChange != null) {
+ cur.processStateChange.writeToParcel(dest);
}
}
}
@@ -2054,13 +2086,15 @@
* fewer bytes. It is a bit more expensive than just writing the long into the parcel,
* but at scale saves a lot of storage and allows recording of longer battery history.
*/
- @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
public static final class VarintParceler {
/**
* Writes an array of longs into Parcel using the varint format, see
* https://developers.google.com/protocol-buffers/docs/encoding#varints
*/
public void writeLongArray(Parcel parcel, long[] values) {
+ if (values.length == 0) {
+ return;
+ }
int out = 0;
int shift = 0;
for (long value : values) {
@@ -2092,6 +2126,9 @@
* Reads a long written with {@link #writeLongArray}
*/
public void readLongArray(Parcel parcel, long[] values) {
+ if (values.length == 0) {
+ return;
+ }
int in = parcel.readInt();
int available = 4;
for (int i = 0; i < values.length; i++) {
diff --git a/core/java/com/android/internal/os/BatteryStatsHistoryIterator.java b/core/java/com/android/internal/os/BatteryStatsHistoryIterator.java
index 4c2b2854..a5d2d0f 100644
--- a/core/java/com/android/internal/os/BatteryStatsHistoryIterator.java
+++ b/core/java/com/android/internal/os/BatteryStatsHistoryIterator.java
@@ -16,6 +16,7 @@
package com.android.internal.os;
+import android.annotation.CurrentTimeMillisLong;
import android.annotation.NonNull;
import android.os.BatteryManager;
import android.os.BatteryStats;
@@ -33,32 +34,32 @@
private static final boolean DEBUG = false;
private static final String TAG = "BatteryStatsHistoryItr";
private final BatteryStatsHistory mBatteryStatsHistory;
+ private final @CurrentTimeMillisLong long mStartTimeMs;
+ private final @CurrentTimeMillisLong long mEndTimeMs;
private final BatteryStats.HistoryStepDetails mReadHistoryStepDetails =
new BatteryStats.HistoryStepDetails();
private final SparseArray<BatteryStats.HistoryTag> mHistoryTags = new SparseArray<>();
- private BatteryStats.EnergyConsumerDetails mEnergyConsumerDetails;
- private BatteryStats.CpuUsageDetails mCpuUsageDetails;
- private final BatteryStatsHistory.VarintParceler mVarintParceler =
- new BatteryStatsHistory.VarintParceler();
+ private final PowerStats.DescriptorRegistry mDescriptorRegistry =
+ new PowerStats.DescriptorRegistry();
+ private BatteryStats.HistoryItem mHistoryItem = new BatteryStats.HistoryItem();
+ private boolean mNextItemReady;
- private final BatteryStats.HistoryItem mHistoryItem = new BatteryStats.HistoryItem();
-
- private static final int MAX_ENERGY_CONSUMER_COUNT = 100;
- private static final int MAX_CPU_BRACKET_COUNT = 100;
-
- public BatteryStatsHistoryIterator(@NonNull BatteryStatsHistory history) {
+ public BatteryStatsHistoryIterator(@NonNull BatteryStatsHistory history,
+ @CurrentTimeMillisLong long startTimeMs,
+ @CurrentTimeMillisLong long endTimeMs) {
mBatteryStatsHistory = history;
+ mStartTimeMs = startTimeMs;
+ mEndTimeMs = (endTimeMs != 0) ? endTimeMs : Long.MAX_VALUE;
mHistoryItem.clear();
}
@Override
public boolean hasNext() {
- Parcel p = mBatteryStatsHistory.getNextParcel();
- if (p == null) {
- close();
- return false;
+ if (!mNextItemReady) {
+ advance();
}
- return true;
+
+ return mHistoryItem != null;
}
/**
@@ -67,25 +68,45 @@
*/
@Override
public BatteryStats.HistoryItem next() {
- Parcel p = mBatteryStatsHistory.getNextParcel();
- if (p == null) {
- close();
- return null;
+ if (!mNextItemReady) {
+ advance();
+ }
+ mNextItemReady = false;
+ return mHistoryItem;
+ }
+
+ private void advance() {
+ while (true) {
+ Parcel p = mBatteryStatsHistory.getNextParcel(mStartTimeMs, mEndTimeMs);
+ if (p == null) {
+ break;
+ }
+
+ final long lastRealtimeMs = mHistoryItem.time;
+ final long lastWalltimeMs = mHistoryItem.currentTime;
+ try {
+ readHistoryDelta(p, mHistoryItem);
+ } catch (Throwable t) {
+ Slog.wtf(TAG, "Corrupted battery history", t);
+ break;
+ }
+ if (mHistoryItem.cmd != BatteryStats.HistoryItem.CMD_CURRENT_TIME
+ && mHistoryItem.cmd != BatteryStats.HistoryItem.CMD_RESET
+ && lastWalltimeMs != 0) {
+ mHistoryItem.currentTime = lastWalltimeMs + (mHistoryItem.time - lastRealtimeMs);
+ }
+ if (mEndTimeMs != 0 && mHistoryItem.currentTime >= mEndTimeMs) {
+ break;
+ }
+ if (mHistoryItem.currentTime >= mStartTimeMs) {
+ mNextItemReady = true;
+ return;
+ }
}
- final long lastRealtimeMs = mHistoryItem.time;
- final long lastWalltimeMs = mHistoryItem.currentTime;
- try {
- readHistoryDelta(p, mHistoryItem);
- } catch (Throwable t) {
- Slog.wtf(TAG, "Corrupted battery history", t);
- return null;
- }
- if (mHistoryItem.cmd != BatteryStats.HistoryItem.CMD_CURRENT_TIME
- && mHistoryItem.cmd != BatteryStats.HistoryItem.CMD_RESET && lastWalltimeMs != 0) {
- mHistoryItem.currentTime = lastWalltimeMs + (mHistoryItem.time - lastRealtimeMs);
- }
- return mHistoryItem;
+ mHistoryItem = null;
+ mNextItemReady = true;
+ close();
}
private void readHistoryDelta(Parcel src, BatteryStats.HistoryItem cur) {
@@ -229,74 +250,24 @@
cur.wifiRailChargeMah = src.readDouble();
if ((cur.states2 & BatteryStats.HistoryItem.STATE2_EXTENSIONS_FLAG) != 0) {
final int extensionFlags = src.readInt();
- if ((extensionFlags & BatteryStatsHistory.EXTENSION_MEASURED_ENERGY_HEADER_FLAG) != 0) {
- if (mEnergyConsumerDetails == null) {
- mEnergyConsumerDetails = new BatteryStats.EnergyConsumerDetails();
- }
-
- final int consumerCount = src.readInt();
- if (consumerCount > MAX_ENERGY_CONSUMER_COUNT) {
- // Check to avoid a heap explosion in case the parcel is corrupted
- throw new IllegalStateException(
- "EnergyConsumer count too high: " + consumerCount
- + ". Max = " + MAX_ENERGY_CONSUMER_COUNT);
- }
- mEnergyConsumerDetails.consumers =
- new BatteryStats.EnergyConsumerDetails.EnergyConsumer[consumerCount];
- mEnergyConsumerDetails.chargeUC = new long[consumerCount];
- for (int i = 0; i < consumerCount; i++) {
- BatteryStats.EnergyConsumerDetails.EnergyConsumer consumer =
- new BatteryStats.EnergyConsumerDetails.EnergyConsumer();
- consumer.type = src.readInt();
- consumer.ordinal = src.readInt();
- consumer.name = src.readString();
- mEnergyConsumerDetails.consumers[i] = consumer;
- }
+ if ((extensionFlags & BatteryStatsHistory.EXTENSION_POWER_STATS_DESCRIPTOR_FLAG) != 0) {
+ PowerStats.Descriptor descriptor = PowerStats.Descriptor.readSummaryFromParcel(src);
+ mDescriptorRegistry.register(descriptor);
}
-
- if ((extensionFlags & BatteryStatsHistory.EXTENSION_MEASURED_ENERGY_FLAG) != 0) {
- if (mEnergyConsumerDetails == null) {
- throw new IllegalStateException("MeasuredEnergyDetails without a header");
- }
-
- mVarintParceler.readLongArray(src, mEnergyConsumerDetails.chargeUC);
- cur.energyConsumerDetails = mEnergyConsumerDetails;
+ if ((extensionFlags & BatteryStatsHistory.EXTENSION_POWER_STATS_FLAG) != 0) {
+ cur.powerStats = PowerStats.readFromParcel(src, mDescriptorRegistry);
} else {
- cur.energyConsumerDetails = null;
+ cur.powerStats = null;
}
-
- if ((extensionFlags & BatteryStatsHistory.EXTENSION_CPU_USAGE_HEADER_FLAG) != 0) {
- mCpuUsageDetails = new BatteryStats.CpuUsageDetails();
- final int cpuBracketCount = src.readInt();
- if (cpuBracketCount > MAX_CPU_BRACKET_COUNT) {
- // Check to avoid a heap explosion in case the parcel is corrupted
- throw new IllegalStateException("Too many CPU brackets: " + cpuBracketCount
- + ". Max = " + MAX_CPU_BRACKET_COUNT);
- }
- mCpuUsageDetails.cpuBracketDescriptions = new String[cpuBracketCount];
- for (int i = 0; i < cpuBracketCount; i++) {
- mCpuUsageDetails.cpuBracketDescriptions[i] = src.readString();
- }
- mCpuUsageDetails.cpuUsageMs =
- new long[mCpuUsageDetails.cpuBracketDescriptions.length];
- } else if (mCpuUsageDetails != null) {
- mCpuUsageDetails.cpuBracketDescriptions = null;
- }
-
- if ((extensionFlags & BatteryStatsHistory.EXTENSION_CPU_USAGE_FLAG) != 0) {
- if (mCpuUsageDetails == null) {
- throw new IllegalStateException("CpuUsageDetails without a header");
- }
-
- mCpuUsageDetails.uid = src.readInt();
- mVarintParceler.readLongArray(src, mCpuUsageDetails.cpuUsageMs);
- cur.cpuUsageDetails = mCpuUsageDetails;
+ if ((extensionFlags & BatteryStatsHistory.EXTENSION_PROCESS_STATE_CHANGE_FLAG) != 0) {
+ cur.processStateChange = cur.localProcessStateChange;
+ cur.processStateChange.readFromParcel(src);
} else {
- cur.cpuUsageDetails = null;
+ cur.processStateChange = null;
}
} else {
- cur.energyConsumerDetails = null;
- cur.cpuUsageDetails = null;
+ cur.powerStats = null;
+ cur.processStateChange = null;
}
}
diff --git a/core/java/com/android/internal/os/LongArrayMultiStateCounter.java b/core/java/com/android/internal/os/LongArrayMultiStateCounter.java
index 664aeee..5ea6ba8 100644
--- a/core/java/com/android/internal/os/LongArrayMultiStateCounter.java
+++ b/core/java/com/android/internal/os/LongArrayMultiStateCounter.java
@@ -195,6 +195,34 @@
* is distributed among the state according to the time the object spent in those states
* since the previous call to updateValues.
*/
+ public void updateValues(long[] values, long timestampMs) {
+ LongArrayContainer container = sTmpArrayContainer.getAndSet(null);
+ if (container == null || container.mLength != values.length) {
+ container = new LongArrayContainer(values.length);
+ }
+ container.setValues(values);
+ updateValues(container, timestampMs);
+ sTmpArrayContainer.set(container);
+ }
+
+ /**
+ * Adds the supplied values to the current accumulated values in the counter.
+ */
+ public void incrementValues(long[] values, long timestampMs) {
+ LongArrayContainer container = sTmpArrayContainer.getAndSet(null);
+ if (container == null || container.mLength != values.length) {
+ container = new LongArrayContainer(values.length);
+ }
+ container.setValues(values);
+ native_incrementValues(mNativeObject, container.mNativeObject, timestampMs);
+ sTmpArrayContainer.set(container);
+ }
+
+ /**
+ * Sets the new values. The delta between the previously set values and these values
+ * is distributed among the state according to the time the object spent in those states
+ * since the previous call to updateValues.
+ */
public void updateValues(LongArrayContainer longArrayContainer, long timestampMs) {
if (longArrayContainer.mLength != mLength) {
throw new IllegalArgumentException(
@@ -293,6 +321,10 @@
long longArrayContainerNativeObject, long timestampMs);
@CriticalNative
+ private static native void native_incrementValues(long nativeObject,
+ long longArrayContainerNativeObject, long timestampMs);
+
+ @CriticalNative
private static native void native_addCounts(long nativeObject,
long longArrayContainerNativeObject);
diff --git a/core/java/com/android/internal/os/MultiStateStats.java b/core/java/com/android/internal/os/MultiStateStats.java
new file mode 100644
index 0000000..f971849
--- /dev/null
+++ b/core/java/com/android/internal/os/MultiStateStats.java
@@ -0,0 +1,303 @@
+/*
+ * 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.internal.os;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.Preconditions;
+
+import java.io.PrintWriter;
+import java.util.Arrays;
+
+/**
+ * Maintains multidimensional multi-state stats. States could be something like on-battery (0,1),
+ * screen-on (0,1), process state etc. Dimensions refer to the metrics themselves, e.g.
+ * CPU residency, Network packet counts etc. All metrics must be represented as <code>long</code>
+ * values;
+ */
+public class MultiStateStats {
+ /**
+ * A set of states, e.g. on-battery, screen-on, procstate. The state values are integers
+ * from 0 to States.mLabels.length
+ */
+ public static class States {
+ final boolean mTracked;
+ final String[] mLabels;
+
+ public States(boolean tracked, String... labels) {
+ this.mTracked = tracked;
+ this.mLabels = labels;
+ }
+
+ public boolean isTracked() {
+ return mTracked;
+ }
+ }
+
+ /**
+ * Factory for MultiStateStats containers. All generated containers retain their connection
+ * to the Factory and the corresponding configuration.
+ */
+ public static class Factory {
+ private static final int INVALID_SERIAL_STATE = -1;
+ final int mDimensionCount;
+ final States[] mStates;
+ /*
+ * The LongArrayMultiStateCounter object that is used for accumulation of per-state
+ * stats thinks of "state" as a simple 0-based index. This Factory object's job is to
+ * map a combination of individual states (e.g. on-battery, process state etc) to
+ * such a simple index.
+ *
+ * This task is performed in two steps:
+ * 1) We define "composite state" as an integer that combines all constituent States
+ * into one integer as bit fields. This gives us a convenient mechanism for updating a
+ * single constituent State at a time. We maintain an array of bit field masks
+ * corresponding to each constituent State.
+ *
+ * 2) We map composite states to "serial states", i.e. simple integer indexes, taking
+ * into account which constituent states are configured as tracked. If a state is not
+ * tracked, there is no need to maintain separate counts for its values, thus
+ * all values of that constituent state can be mapped to the same serial state.
+ */
+ private final int[] mStateBitFieldMasks;
+ private final short[] mStateBitFieldShifts;
+ final int[] mCompositeToSerialState;
+ final int mSerialStateCount;
+
+ public Factory(int dimensionCount, States... states) {
+ mDimensionCount = dimensionCount;
+ mStates = states;
+
+ int serialStateCount = 1;
+ for (States state : mStates) {
+ if (state.mTracked) {
+ serialStateCount *= state.mLabels.length;
+ }
+ }
+ mSerialStateCount = serialStateCount;
+
+ mStateBitFieldMasks = new int[mStates.length];
+ mStateBitFieldShifts = new short[mStates.length];
+
+ int shift = 0;
+ for (int i = 0; i < mStates.length; i++) {
+ mStateBitFieldShifts[i] = (short) shift;
+ if (mStates[i].mLabels.length < 2) {
+ throw new IllegalArgumentException("Invalid state: " + Arrays.toString(
+ mStates[i].mLabels) + ". Should have at least two values.");
+ }
+ int max = mStates[i].mLabels.length - 1;
+ int bitcount = Integer.SIZE - Integer.numberOfLeadingZeros(max);
+ mStateBitFieldMasks[i] = ((1 << bitcount) - 1) << shift;
+ shift = shift + bitcount;
+ }
+
+ if (shift >= Integer.SIZE - 1) {
+ throw new IllegalArgumentException("Too many states: " + shift
+ + " bits are required to represent the composite state, but only "
+ + (Integer.SIZE - 1) + " are available");
+ }
+
+ // Create a mask that filters out all non tracked states
+ int trackedMask = 0xFFFFFFFF;
+ for (int state = 0; state < mStates.length; state++) {
+ if (!mStates[state].mTracked) {
+ trackedMask &= ~mStateBitFieldMasks[state];
+ }
+ }
+
+ mCompositeToSerialState = new int[1 << shift];
+ Arrays.fill(mCompositeToSerialState, INVALID_SERIAL_STATE);
+
+ int nextSerialState = 0;
+ for (int composite = 0; composite < mCompositeToSerialState.length; composite++) {
+ if (!isValidCompositeState(composite)) continue;
+
+ // Values of an untracked State map to different composite states, but must map to
+ // the same serial state. Achieve that by computing a "base composite", which
+ // is equivalent to the current composite, but has 0 for all untracked States.
+ // See if the base composite already has a serial state assigned. If so, just use
+ // the same one for the current composite.
+ int baseComposite = composite & trackedMask;
+ if (mCompositeToSerialState[baseComposite] != INVALID_SERIAL_STATE) {
+ mCompositeToSerialState[composite] = mCompositeToSerialState[baseComposite];
+ } else {
+ mCompositeToSerialState[composite] = nextSerialState++;
+ }
+ }
+ }
+
+ private boolean isValidCompositeState(int composite) {
+ for (int stateIndex = 0; stateIndex < mStates.length; stateIndex++) {
+ int state = extractStateFromComposite(composite, stateIndex);
+ if (state >= mStates[stateIndex].mLabels.length) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private int extractStateFromComposite(int compositeState, int stateIndex) {
+ return (compositeState & mStateBitFieldMasks[stateIndex])
+ >>> mStateBitFieldShifts[stateIndex];
+ }
+
+ private int setStateInComposite(int baseCompositeState, int stateIndex, int value) {
+ return (baseCompositeState & ~mStateBitFieldMasks[stateIndex])
+ | (value << mStateBitFieldShifts[stateIndex]);
+ }
+
+ /**
+ * Allocates a new stats container using this Factory's configuration.
+ */
+ public MultiStateStats create() {
+ return new MultiStateStats(this, mDimensionCount);
+ }
+
+ /**
+ * Returns the total number of composite states handled by this container. For example,
+ * if there are two states: on-battery (0,1) and screen-on (0,1), both tracked, then the
+ * serial state count will be 2 * 2 = 4
+ */
+ @VisibleForTesting
+ public int getSerialStateCount() {
+ return mSerialStateCount;
+ }
+
+ /**
+ * Returns the integer index used by this container to represent the supplied composite
+ * state.
+ */
+ @VisibleForTesting
+ public int getSerialState(int[] states) {
+ Preconditions.checkArgument(states.length == mStates.length);
+ int compositeState = 0;
+ for (int i = 0; i < states.length; i++) {
+ compositeState = setStateInComposite(compositeState, i, states[i]);
+ }
+ int serialState = mCompositeToSerialState[compositeState];
+ if (serialState == INVALID_SERIAL_STATE) {
+ throw new IllegalArgumentException("State values out of bounds: "
+ + Arrays.toString(states));
+ }
+ return serialState;
+ }
+ }
+
+ private final Factory mFactory;
+ private final LongArrayMultiStateCounter mCounter;
+ private int mCompositeState;
+ private boolean mTracking;
+
+ public MultiStateStats(Factory factory, int dimensionCount) {
+ this.mFactory = factory;
+ mCounter = new LongArrayMultiStateCounter(factory.mSerialStateCount, dimensionCount);
+ }
+
+ /**
+ * Updates the current composite state by changing one of the States supplied to the Factory
+ * constructor.
+ *
+ * @param stateIndex Corresponds to the index of the States supplied to the Factory constructor
+ * @param state The new value of the state (e.g. 0 or 1 for "on-battery")
+ * @param timestampMs The time when the state change occurred
+ */
+ public void setState(int stateIndex, int state, long timestampMs) {
+ if (!mTracking) {
+ mCounter.updateValues(new long[mCounter.getArrayLength()], timestampMs);
+ mTracking = true;
+ }
+ mCompositeState = mFactory.setStateInComposite(mCompositeState, stateIndex, state);
+ mCounter.setState(mFactory.mCompositeToSerialState[mCompositeState], timestampMs);
+ }
+
+ /**
+ * Adds the delta to the metrics. The number of values must correspond to the dimension count
+ * supplied to the Factory constructor
+ */
+ public void increment(long[] values, long timestampMs) {
+ mCounter.incrementValues(values, timestampMs);
+ mTracking = true;
+ }
+
+ /**
+ * Returns accumulated stats for the specified composite state.
+ */
+ public void getStats(long[] outValues, int[] states) {
+ mCounter.getCounts(outValues, mFactory.getSerialState(states));
+ }
+
+ /**
+ * Resets the counters.
+ */
+ public void reset() {
+ mCounter.reset();
+ mTracking = false;
+ }
+
+ @Override
+ public String toString() {
+ return mCounter.toString();
+ }
+
+ /**
+ * Prints the accumulated stats, one line of every combination of states that has data.
+ */
+ public void dump(PrintWriter pw) {
+ long[] tmpArray = new long[mCounter.getArrayLength()];
+ dumpAllStates(pw, new int[mFactory.mStates.length], 0, tmpArray);
+ }
+
+ private void dumpAllStates(PrintWriter pw, int[] states, int stateIndex, long[] values) {
+ if (stateIndex < states.length) {
+ if (!mFactory.mStates[stateIndex].mTracked) {
+ dumpAllStates(pw, states, stateIndex + 1, values);
+ return;
+ }
+
+ for (int i = 0; i < mFactory.mStates[stateIndex].mLabels.length; i++) {
+ states[stateIndex] = i;
+ dumpAllStates(pw, states, stateIndex + 1, values);
+ }
+ return;
+ }
+
+ mCounter.getCounts(values, mFactory.getSerialState(states));
+ boolean nonZero = false;
+ for (long value : values) {
+ if (value != 0) {
+ nonZero = true;
+ break;
+ }
+ }
+ if (!nonZero) {
+ return;
+ }
+
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < states.length; i++) {
+ if (mFactory.mStates[i].mTracked) {
+ if (sb.length() != 0) {
+ sb.append(" ");
+ }
+ sb.append(mFactory.mStates[i].mLabels[states[i]]);
+ }
+ }
+ sb.append(" ");
+ sb.append(Arrays.toString(values));
+ pw.println(sb);
+ }
+}
diff --git a/core/java/com/android/internal/os/OWNERS b/core/java/com/android/internal/os/OWNERS
index 0b9773e..e35b7f1 100644
--- a/core/java/com/android/internal/os/OWNERS
+++ b/core/java/com/android/internal/os/OWNERS
@@ -11,6 +11,7 @@
per-file *ChargeCalculator* = file:/BATTERY_STATS_OWNERS
per-file *PowerCalculator* = file:/BATTERY_STATS_OWNERS
per-file *PowerEstimator* = file:/BATTERY_STATS_OWNERS
+per-file *PowerStats* = file:/BATTERY_STATS_OWNERS
per-file *Kernel* = file:/BATTERY_STATS_OWNERS
per-file *MultiState* = file:/BATTERY_STATS_OWNERS
per-file *PowerProfile* = file:/BATTERY_STATS_OWNERS
diff --git a/core/java/com/android/internal/os/PowerStats.java b/core/java/com/android/internal/os/PowerStats.java
new file mode 100644
index 0000000..8f66d1f
--- /dev/null
+++ b/core/java/com/android/internal/os/PowerStats.java
@@ -0,0 +1,327 @@
+/*
+ * 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.internal.os;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.os.BatteryConsumer;
+import android.os.Bundle;
+import android.os.Parcel;
+import android.os.PersistableBundle;
+import android.os.UserHandle;
+import android.util.IndentingPrintWriter;
+import android.util.Log;
+import android.util.SparseArray;
+
+import java.util.Arrays;
+import java.util.Objects;
+
+/**
+ * Container for power stats, acquired by various PowerStatsCollector classes. See subclasses for
+ * details.
+ */
+public final class PowerStats {
+ private static final String TAG = "PowerStats";
+
+ private static final BatteryStatsHistory.VarintParceler VARINT_PARCELER =
+ new BatteryStatsHistory.VarintParceler();
+ private static final byte PARCEL_FORMAT_VERSION = 1;
+
+ private static final int PARCEL_FORMAT_VERSION_MASK = 0x000000FF;
+ private static final int PARCEL_FORMAT_VERSION_SHIFT =
+ Integer.numberOfTrailingZeros(PARCEL_FORMAT_VERSION_MASK);
+ private static final int STATS_ARRAY_LENGTH_MASK = 0x0000FF00;
+ private static final int STATS_ARRAY_LENGTH_SHIFT =
+ Integer.numberOfTrailingZeros(STATS_ARRAY_LENGTH_MASK);
+ public static final int MAX_STATS_ARRAY_LENGTH =
+ 2 ^ Integer.bitCount(STATS_ARRAY_LENGTH_MASK) - 1;
+ private static final int UID_STATS_ARRAY_LENGTH_MASK = 0x00FF0000;
+ private static final int UID_STATS_ARRAY_LENGTH_SHIFT =
+ Integer.numberOfTrailingZeros(UID_STATS_ARRAY_LENGTH_MASK);
+ public static final int MAX_UID_STATS_ARRAY_LENGTH =
+ (2 ^ Integer.bitCount(UID_STATS_ARRAY_LENGTH_MASK)) - 1;
+
+ /**
+ * Descriptor of the stats collected for a given power component (e.g. CPU, WiFi etc).
+ * This descriptor is used for storing PowerStats and can also be used by power models
+ * to adjust the algorithm in accordance with the stats available on the device.
+ */
+ public static class Descriptor {
+ /**
+ * {@link BatteryConsumer.PowerComponent} (e.g. CPU, WIFI etc) that this snapshot relates
+ * to; or a custom power component ID (if the value
+ * is >= {@link BatteryConsumer#FIRST_CUSTOM_POWER_COMPONENT_ID}).
+ */
+ public final int powerComponentId;
+ public final String name;
+
+ public final int statsArrayLength;
+ public final int uidStatsArrayLength;
+
+ /**
+ * Extra parameters specific to the power component, e.g. the availability of power
+ * monitors.
+ */
+ public final PersistableBundle extras;
+
+ public Descriptor(@BatteryConsumer.PowerComponent int powerComponentId,
+ int statsArrayLength, int uidStatsArrayLength, @NonNull PersistableBundle extras) {
+ this(powerComponentId, BatteryConsumer.powerComponentIdToString(powerComponentId),
+ statsArrayLength, uidStatsArrayLength, extras);
+ }
+
+ public Descriptor(int customPowerComponentId, String name, int statsArrayLength,
+ int uidStatsArrayLength, PersistableBundle extras) {
+ if (statsArrayLength > MAX_STATS_ARRAY_LENGTH) {
+ throw new IllegalArgumentException(
+ "statsArrayLength is too high. Max = " + MAX_STATS_ARRAY_LENGTH);
+ }
+ if (uidStatsArrayLength > MAX_UID_STATS_ARRAY_LENGTH) {
+ throw new IllegalArgumentException(
+ "uidStatsArrayLength is too high. Max = " + MAX_UID_STATS_ARRAY_LENGTH);
+ }
+ this.powerComponentId = customPowerComponentId;
+ this.name = name;
+ this.statsArrayLength = statsArrayLength;
+ this.uidStatsArrayLength = uidStatsArrayLength;
+ this.extras = extras;
+ }
+
+ /**
+ * Writes the Descriptor into the parcel.
+ */
+ public void writeSummaryToParcel(Parcel parcel) {
+ int firstWord = ((PARCEL_FORMAT_VERSION << PARCEL_FORMAT_VERSION_SHIFT)
+ & PARCEL_FORMAT_VERSION_MASK)
+ | ((statsArrayLength << STATS_ARRAY_LENGTH_SHIFT)
+ & STATS_ARRAY_LENGTH_MASK)
+ | ((uidStatsArrayLength << UID_STATS_ARRAY_LENGTH_SHIFT)
+ & UID_STATS_ARRAY_LENGTH_MASK);
+ parcel.writeInt(firstWord);
+ parcel.writeInt(powerComponentId);
+ parcel.writeString(name);
+ extras.writeToParcel(parcel, 0);
+ }
+
+ /**
+ * Reads a Descriptor from the parcel. If the parcel has an incompatible format,
+ * returns null.
+ */
+ @Nullable
+ public static Descriptor readSummaryFromParcel(Parcel parcel) {
+ int firstWord = parcel.readInt();
+ int version = (firstWord & PARCEL_FORMAT_VERSION_MASK) >>> PARCEL_FORMAT_VERSION_SHIFT;
+ if (version != PARCEL_FORMAT_VERSION) {
+ Log.w(TAG, "Cannot read PowerStats from Parcel - the parcel format version has "
+ + "changed from " + version + " to " + PARCEL_FORMAT_VERSION);
+ return null;
+ }
+ int statsArrayLength =
+ (firstWord & STATS_ARRAY_LENGTH_MASK) >>> STATS_ARRAY_LENGTH_SHIFT;
+ int uidStatsArrayLength =
+ (firstWord & UID_STATS_ARRAY_LENGTH_MASK) >>> UID_STATS_ARRAY_LENGTH_SHIFT;
+ int powerComponentId = parcel.readInt();
+ String name = parcel.readString();
+ PersistableBundle extras = parcel.readPersistableBundle();
+ return new Descriptor(powerComponentId, name, statsArrayLength, uidStatsArrayLength,
+ extras);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof Descriptor)) return false;
+ Descriptor that = (Descriptor) o;
+ return powerComponentId == that.powerComponentId
+ && statsArrayLength == that.statsArrayLength
+ && uidStatsArrayLength == that.uidStatsArrayLength
+ && Objects.equals(name, that.name)
+ && extras.size() == that.extras.size() // Unparcel the Parcel if not yet
+ && Bundle.kindofEquals(extras,
+ that.extras); // Since the Parcel is now unparceled, do a deep comparison
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(powerComponentId);
+ }
+
+ @Override
+ public String toString() {
+ if (extras != null) {
+ extras.size(); // Unparcel
+ }
+ return "PowerStats.Descriptor{"
+ + "powerComponentId=" + powerComponentId
+ + ", name='" + name + '\''
+ + ", statsArrayLength=" + statsArrayLength
+ + ", uidStatsArrayLength=" + uidStatsArrayLength
+ + ", extras=" + extras
+ + '}';
+ }
+ }
+
+ /**
+ * A registry for all supported power component types (e.g. CPU, WiFi).
+ */
+ public static class DescriptorRegistry {
+ private final SparseArray<Descriptor> mDescriptors = new SparseArray<>();
+
+ /**
+ * Adds the specified descriptor to the registry. If the registry already
+ * contained a descriptor for the same power component, then the new one replaces
+ * the old one.
+ */
+ public void register(Descriptor descriptor) {
+ mDescriptors.put(descriptor.powerComponentId, descriptor);
+ }
+
+ /**
+ * @param powerComponentId either a BatteryConsumer.PowerComponent or a custom power
+ * component ID
+ */
+ public Descriptor get(int powerComponentId) {
+ return mDescriptors.get(powerComponentId);
+ }
+ }
+
+ public final Descriptor descriptor;
+
+ /**
+ * Duration, in milliseconds, covered by this snapshot.
+ */
+ public long durationMs;
+
+ /**
+ * Device-wide stats.
+ */
+ public long[] stats;
+
+ /**
+ * Per-UID CPU stats.
+ */
+ public final SparseArray<long[]> uidStats = new SparseArray<>();
+
+ public PowerStats(Descriptor descriptor) {
+ this.descriptor = descriptor;
+ stats = new long[descriptor.statsArrayLength];
+ }
+
+ /**
+ * Writes the object into the parcel.
+ */
+ public void writeToParcel(Parcel parcel) {
+ int lengthPos = parcel.dataPosition();
+ parcel.writeInt(0); // Placeholder for length
+
+ int startPos = parcel.dataPosition();
+ parcel.writeInt(descriptor.powerComponentId);
+ parcel.writeLong(durationMs);
+ VARINT_PARCELER.writeLongArray(parcel, stats);
+ parcel.writeInt(uidStats.size());
+ for (int i = 0; i < uidStats.size(); i++) {
+ parcel.writeInt(uidStats.keyAt(i));
+ VARINT_PARCELER.writeLongArray(parcel, uidStats.valueAt(i));
+ }
+
+ int endPos = parcel.dataPosition();
+ parcel.setDataPosition(lengthPos);
+ parcel.writeInt(endPos - startPos);
+ parcel.setDataPosition(endPos);
+ }
+
+ /**
+ * Reads a PowerStats object from the supplied Parcel. If the parcel has an incompatible
+ * format, returns null.
+ */
+ @Nullable
+ public static PowerStats readFromParcel(Parcel parcel, DescriptorRegistry registry) {
+ int length = parcel.readInt();
+ int startPos = parcel.dataPosition();
+ int endPos = startPos + length;
+
+ try {
+ int powerComponentId = parcel.readInt();
+
+ Descriptor descriptor = registry.get(powerComponentId);
+ if (descriptor == null) {
+ Log.e(TAG, "Unsupported PowerStats for power component ID: " + powerComponentId);
+ return null;
+ }
+ PowerStats stats = new PowerStats(descriptor);
+ stats.durationMs = parcel.readLong();
+ stats.stats = new long[descriptor.statsArrayLength];
+ VARINT_PARCELER.readLongArray(parcel, stats.stats);
+ int uidCount = parcel.readInt();
+ for (int i = 0; i < uidCount; i++) {
+ int uid = parcel.readInt();
+ long[] uidStats = new long[descriptor.uidStatsArrayLength];
+ VARINT_PARCELER.readLongArray(parcel, uidStats);
+ stats.uidStats.put(uid, uidStats);
+ }
+ if (parcel.dataPosition() != endPos) {
+ Log.e(TAG, "Corrupted PowerStats parcel. Expected length: " + length
+ + ", actual length: " + (parcel.dataPosition() - startPos));
+ return null;
+ }
+ return stats;
+ } finally {
+ // Unconditionally skip to the end of the written data, even if the actual parcel
+ // format is incompatible
+ parcel.setDataPosition(endPos);
+ }
+ }
+
+ /**
+ * Formats the stats as a string suitable to be included in the Battery History dump.
+ */
+ public String formatForBatteryHistory(String uidPrefix) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("duration=").append(durationMs).append(" ").append(descriptor.name);
+ if (stats.length > 0) {
+ sb.append("=").append(Arrays.toString(stats));
+ }
+ for (int i = 0; i < uidStats.size(); i++) {
+ sb.append(uidPrefix)
+ .append(UserHandle.formatUid(uidStats.keyAt(i)))
+ .append(": ").append(Arrays.toString(uidStats.valueAt(i)));
+ }
+ return sb.toString();
+ }
+
+ /**
+ * Prints the contents of the stats snapshot.
+ */
+ public void dump(IndentingPrintWriter pw) {
+ pw.println("PowerStats: " + descriptor.name + " (" + descriptor.powerComponentId + ')');
+ pw.increaseIndent();
+ pw.print("duration", durationMs).println();
+ for (int i = 0; i < uidStats.size(); i++) {
+ pw.print("UID ");
+ pw.print(uidStats.keyAt(i));
+ pw.print(": ");
+ pw.print(Arrays.toString(uidStats.valueAt(i)));
+ pw.println();
+ }
+ pw.decreaseIndent();
+ }
+
+ @Override
+ public String toString() {
+ return "PowerStats: " + formatForBatteryHistory(" UID ");
+ }
+}
diff --git a/core/java/com/android/internal/widget/BigPictureNotificationImageView.java b/core/java/com/android/internal/widget/BigPictureNotificationImageView.java
index 3a7cf74..f95f5db 100644
--- a/core/java/com/android/internal/widget/BigPictureNotificationImageView.java
+++ b/core/java/com/android/internal/widget/BigPictureNotificationImageView.java
@@ -37,13 +37,16 @@
* Icon.loadDrawable().
*/
@RemoteViews.RemoteView
-public class BigPictureNotificationImageView extends ImageView {
+public class BigPictureNotificationImageView extends ImageView implements
+ NotificationDrawableConsumer {
private static final String TAG = BigPictureNotificationImageView.class.getSimpleName();
private final int mMaximumDrawableWidth;
private final int mMaximumDrawableHeight;
+ private NotificationIconManager mIconManager;
+
public BigPictureNotificationImageView(@NonNull Context context) {
this(context, null, 0, 0);
}
@@ -69,6 +72,19 @@
: R.dimen.notification_big_picture_max_height);
}
+
+ /**
+ * Sets an {@link NotificationIconManager} on this ImageView, which handles the loading of
+ * icons, instead of using the {@link LocalImageResolver} directly.
+ * If set, it overrides the behaviour of {@link #setImageIconAsync} and {@link #setImageIcon},
+ * and it expects that the content of this imageView is only updated calling these two methods.
+ *
+ * @param iconManager to be called, when the icon is updated
+ */
+ public void setIconManager(NotificationIconManager iconManager) {
+ mIconManager = iconManager;
+ }
+
@Override
@android.view.RemotableViewMethod(asyncImpl = "setImageURIAsync")
public void setImageURI(@Nullable Uri uri) {
@@ -84,11 +100,20 @@
@Override
@android.view.RemotableViewMethod(asyncImpl = "setImageIconAsync")
public void setImageIcon(@Nullable Icon icon) {
+ if (mIconManager != null) {
+ mIconManager.updateIcon(this, icon).run();
+ return;
+ }
+ // old code path
setImageDrawable(loadImage(icon));
}
/** @hide **/
public Runnable setImageIconAsync(@Nullable Icon icon) {
+ if (mIconManager != null) {
+ return mIconManager.updateIcon(this, icon);
+ }
+ // old code path
final Drawable drawable = loadImage(icon);
return () -> setImageDrawable(drawable);
}
diff --git a/core/java/com/android/internal/widget/ConversationLayout.java b/core/java/com/android/internal/widget/ConversationLayout.java
index 7dda91d..42be784 100644
--- a/core/java/com/android/internal/widget/ConversationLayout.java
+++ b/core/java/com/android/internal/widget/ConversationLayout.java
@@ -149,6 +149,7 @@
private View mAppNameDivider;
private TouchDelegateComposite mTouchDelegate = new TouchDelegateComposite(this);
private ArrayList<MessagingLinearLayout.MessagingChild> mToRecycle = new ArrayList<>();
+ private boolean mPrecomputedTextEnabled = false;
public ConversationLayout(@NonNull Context context) {
super(context);
@@ -389,34 +390,37 @@
*/
@RemotableViewMethod(asyncImpl = "setDataAsync")
public void setData(Bundle extras) {
+ bind(parseMessagingData(extras, /* usePrecomputedText= */ false));
+ }
+
+ @NonNull
+ private MessagingData parseMessagingData(Bundle extras, boolean usePrecomputedText) {
Parcelable[] messages = extras.getParcelableArray(Notification.EXTRA_MESSAGES);
- List<Notification.MessagingStyle.Message> newMessages
- = Notification.MessagingStyle.Message.getMessagesFromBundleArray(messages);
+ List<Notification.MessagingStyle.Message> newMessages =
+ Notification.MessagingStyle.Message.getMessagesFromBundleArray(messages);
Parcelable[] histMessages = extras.getParcelableArray(Notification.EXTRA_HISTORIC_MESSAGES);
- List<Notification.MessagingStyle.Message> newHistoricMessages
- = Notification.MessagingStyle.Message.getMessagesFromBundleArray(histMessages);
+ List<Notification.MessagingStyle.Message> newHistoricMessages =
+ Notification.MessagingStyle.Message.getMessagesFromBundleArray(histMessages);
// mUser now set (would be nice to avoid the side effect but WHATEVER)
final Person user = extras.getParcelable(Notification.EXTRA_MESSAGING_PERSON, Person.class);
// Append remote input history to newMessages (again, side effect is lame but WHATEVS)
RemoteInputHistoryItem[] history = (RemoteInputHistoryItem[])
- extras.getParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS, android.app.RemoteInputHistoryItem.class);
+ extras.getParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS,
+ RemoteInputHistoryItem.class);
addRemoteInputHistoryToMessages(newMessages, history);
boolean showSpinner =
extras.getBoolean(Notification.EXTRA_SHOW_REMOTE_INPUT_SPINNER, false);
int unreadCount = extras.getInt(Notification.EXTRA_CONVERSATION_UNREAD_MESSAGE_COUNT);
- // convert MessagingStyle.Message to MessagingMessage, re-using ones from a previous binding
- // if they exist
final List<MessagingMessage> newMessagingMessages =
- createMessages(newMessages, false /* isHistoric */);
+ createMessages(newMessages, /* isHistoric= */false, usePrecomputedText);
final List<MessagingMessage> newHistoricMessagingMessages =
- createMessages(newHistoricMessages, true /* isHistoric */);
- // bind it, baby
- bindViews(user, showSpinner, unreadCount,
- newMessagingMessages,
- newHistoricMessagingMessages);
+ createMessages(newHistoricMessages, /* isHistoric= */true, usePrecomputedText);
+
+ return new MessagingData(user, showSpinner, unreadCount,
+ newHistoricMessagingMessages, newMessagingMessages);
}
/**
@@ -428,7 +432,33 @@
*/
@NonNull
public Runnable setDataAsync(Bundle extras) {
- return () -> setData(extras);
+ if (!mPrecomputedTextEnabled) {
+ return () -> setData(extras);
+ }
+
+ final MessagingData messagingData =
+ parseMessagingData(extras, /* usePrecomputedText= */ true);
+
+ return () -> {
+ finalizeInflate(messagingData.getHistoricMessagingMessages());
+ finalizeInflate(messagingData.getNewMessagingMessages());
+
+ bind(messagingData);
+ };
+ }
+
+ /**
+ * enable/disable precomputed text usage
+ * @hide
+ */
+ public void setPrecomputedTextEnabled(boolean precomputedTextEnabled) {
+ mPrecomputedTextEnabled = precomputedTextEnabled;
+ }
+
+ private void finalizeInflate(List<MessagingMessage> historicMessagingMessages) {
+ for (MessagingMessage messagingMessage : historicMessagingMessages) {
+ messagingMessage.finalizeInflate();
+ }
}
@Override
@@ -458,17 +488,12 @@
}
}
+ private void bind(MessagingData messagingData) {
+ setUser(messagingData.getUser());
+ setUnreadCount(messagingData.getUnreadCount());
- private void bindViews(Person user,
- boolean showSpinner, int unreadCount, List<MessagingMessage> newMessagingMessages,
- List<MessagingMessage> newHistoricMessagingMessages) {
- setUser(user);
- setUnreadCount(unreadCount);
- bind(showSpinner, newMessagingMessages, newHistoricMessagingMessages);
- }
-
- private void bind(boolean showSpinner, List<MessagingMessage> messages,
- List<MessagingMessage> historicMessages) {
+ List<MessagingMessage> messages = messagingData.getNewMessagingMessages();
+ List<MessagingMessage> historicMessages = messagingData.getHistoricMessagingMessages();
// Copy our groups, before they get clobbered
ArrayList<MessagingGroup> oldGroups = new ArrayList<>(mGroups);
@@ -481,7 +506,7 @@
// Let's now create the views and reorder them accordingly
// side-effect: updates mGroups, mAddedGroups
- createGroupViews(groups, senders, showSpinner);
+ createGroupViews(groups, senders, messagingData.getShowSpinner());
// Let's first check which groups were removed altogether and remove them in one animation
removeGroups(oldGroups);
@@ -583,7 +608,7 @@
// When collapsed, we're displaying the image message in a dedicated container
// on the right of the layout instead of inline. Let's add the isolated image there
- MessagingGroup messagingGroup = mGroups.get(mGroups.size() -1);
+ MessagingGroup messagingGroup = mGroups.get(mGroups.size() - 1);
MessagingImageMessage isolatedMessage = messagingGroup.getIsolatedMessage();
if (isolatedMessage != null) {
newMessage = isolatedMessage.getView();
@@ -981,15 +1006,17 @@
* @param newMessages the messages to parse.
*/
private List<MessagingMessage> createMessages(
- List<Notification.MessagingStyle.Message> newMessages, boolean historic) {
+ List<Notification.MessagingStyle.Message> newMessages, boolean isHistoric,
+ boolean usePrecomputedText) {
List<MessagingMessage> result = new ArrayList<>();
for (int i = 0; i < newMessages.size(); i++) {
Notification.MessagingStyle.Message m = newMessages.get(i);
MessagingMessage message = findAndRemoveMatchingMessage(m);
if (message == null) {
- message = MessagingMessage.createMessage(this, m, mImageResolver);
+ message = MessagingMessage.createMessage(this, m,
+ mImageResolver, usePrecomputedText);
}
- message.setIsHistoric(historic);
+ message.setIsHistoric(isHistoric);
result.add(message);
}
return result;
@@ -1038,7 +1065,7 @@
}
if (visibleChildren > 0 && group.getVisibility() == GONE) {
group.setVisibility(VISIBLE);
- } else if (visibleChildren == 0 && group.getVisibility() != GONE) {
+ } else if (visibleChildren == 0 && group.getVisibility() != GONE) {
group.setVisibility(GONE);
}
}
@@ -1255,7 +1282,7 @@
public boolean onTouchEvent(MotionEvent event) {
float x = event.getX();
float y = event.getY();
- for (TouchDelegate delegate: mDelegates) {
+ for (TouchDelegate delegate : mDelegates) {
event.setLocation(x, y);
if (delegate.onTouchEvent(event)) {
return true;
diff --git a/core/java/com/android/internal/widget/MessagingData.java b/core/java/com/android/internal/widget/MessagingData.java
new file mode 100644
index 0000000..85b0201
--- /dev/null
+++ b/core/java/com/android/internal/widget/MessagingData.java
@@ -0,0 +1,70 @@
+/*
+ * 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.internal.widget;
+
+import android.app.Person;
+
+import java.util.List;
+
+/**
+ * @hide
+ */
+final class MessagingData {
+ private final Person mUser;
+ private final boolean mShowSpinner;
+ private final List<MessagingMessage> mHistoricMessagingMessages;
+ private final List<MessagingMessage> mNewMessagingMessages;
+ private final int mUnreadCount;
+
+ MessagingData(Person user, boolean showSpinner,
+ List<MessagingMessage> historicMessagingMessages,
+ List<MessagingMessage> newMessagingMessages) {
+ this(user, showSpinner, /* unreadCount= */0,
+ historicMessagingMessages, newMessagingMessages);
+ }
+
+ MessagingData(Person user, boolean showSpinner,
+ int unreadCount,
+ List<MessagingMessage> historicMessagingMessages,
+ List<MessagingMessage> newMessagingMessages) {
+ mUser = user;
+ mShowSpinner = showSpinner;
+ mUnreadCount = unreadCount;
+ mHistoricMessagingMessages = historicMessagingMessages;
+ mNewMessagingMessages = newMessagingMessages;
+ }
+
+ public Person getUser() {
+ return mUser;
+ }
+
+ public boolean getShowSpinner() {
+ return mShowSpinner;
+ }
+
+ public List<MessagingMessage> getHistoricMessagingMessages() {
+ return mHistoricMessagingMessages;
+ }
+
+ public List<MessagingMessage> getNewMessagingMessages() {
+ return mNewMessagingMessages;
+ }
+
+ public int getUnreadCount() {
+ return mUnreadCount;
+ }
+}
diff --git a/core/java/com/android/internal/widget/MessagingImageMessage.java b/core/java/com/android/internal/widget/MessagingImageMessage.java
index 098bce1..c132d6a 100644
--- a/core/java/com/android/internal/widget/MessagingImageMessage.java
+++ b/core/java/com/android/internal/widget/MessagingImageMessage.java
@@ -93,8 +93,9 @@
}
@Override
- public boolean setMessage(Notification.MessagingStyle.Message message) {
- MessagingMessage.super.setMessage(message);
+ public boolean setMessage(Notification.MessagingStyle.Message message,
+ boolean usePrecomputedText) {
+ MessagingMessage.super.setMessage(message, usePrecomputedText);
Drawable drawable;
try {
Uri uri = message.getDataUri();
@@ -114,32 +115,42 @@
}
mDrawable = drawable;
mAspectRatio = ((float) mDrawable.getIntrinsicWidth()) / intrinsicHeight;
- setImageDrawable(drawable);
- setContentDescription(message.getText());
+ if (!usePrecomputedText) {
+ finalizeInflate();
+ }
return true;
}
static MessagingMessage createMessage(IMessagingLayout layout,
- Notification.MessagingStyle.Message m, ImageResolver resolver) {
+ Notification.MessagingStyle.Message m, ImageResolver resolver,
+ boolean usePrecomputedText) {
MessagingLinearLayout messagingLinearLayout = layout.getMessagingLinearLayout();
MessagingImageMessage createdMessage = sInstancePool.acquire();
if (createdMessage == null) {
createdMessage = (MessagingImageMessage) LayoutInflater.from(
layout.getContext()).inflate(
- R.layout.notification_template_messaging_image_message,
- messagingLinearLayout,
- false);
+ R.layout.notification_template_messaging_image_message,
+ messagingLinearLayout,
+ false);
createdMessage.addOnLayoutChangeListener(MessagingLayout.MESSAGING_PROPERTY_ANIMATOR);
}
createdMessage.setImageResolver(resolver);
- boolean created = createdMessage.setMessage(m);
- if (!created) {
+ // MessagingImageMessage does not use usePrecomputedText.
+ boolean populated = createdMessage.setMessage(m, /* usePrecomputedText= */false);
+ if (!populated) {
createdMessage.recycle();
- return MessagingTextMessage.createMessage(layout, m);
+ return MessagingTextMessage.createMessage(layout, m, usePrecomputedText);
}
return createdMessage;
}
+
+ @Override
+ public void finalizeInflate() {
+ setImageDrawable(mDrawable);
+ setContentDescription(getMessage().getText());
+ }
+
private void setImageResolver(ImageResolver resolver) {
mImageResolver = resolver;
}
diff --git a/core/java/com/android/internal/widget/MessagingLayout.java b/core/java/com/android/internal/widget/MessagingLayout.java
index 8345c5c..b6d7503 100644
--- a/core/java/com/android/internal/widget/MessagingLayout.java
+++ b/core/java/com/android/internal/widget/MessagingLayout.java
@@ -87,7 +87,7 @@
private ImageResolver mImageResolver;
private CharSequence mConversationTitle;
private ArrayList<MessagingLinearLayout.MessagingChild> mToRecycle = new ArrayList<>();
-
+ private boolean mPrecomputedTextEnabled = false;
public MessagingLayout(@NonNull Context context) {
super(context);
}
@@ -162,15 +162,23 @@
*/
@RemotableViewMethod(asyncImpl = "setDataAsync")
public void setData(Bundle extras) {
+ bind(parseMessagingData(extras, /* usePrecomputedText= */false));
+ }
+
+ @NonNull
+ private MessagingData parseMessagingData(Bundle extras, boolean usePrecomputedText) {
Parcelable[] messages = extras.getParcelableArray(Notification.EXTRA_MESSAGES);
- List<Notification.MessagingStyle.Message> newMessages
- = Notification.MessagingStyle.Message.getMessagesFromBundleArray(messages);
+ List<Notification.MessagingStyle.Message> newMessages =
+ Notification.MessagingStyle.Message.getMessagesFromBundleArray(messages);
Parcelable[] histMessages = extras.getParcelableArray(Notification.EXTRA_HISTORIC_MESSAGES);
- List<Notification.MessagingStyle.Message> newHistoricMessages
- = Notification.MessagingStyle.Message.getMessagesFromBundleArray(histMessages);
- setUser(extras.getParcelable(Notification.EXTRA_MESSAGING_PERSON, android.app.Person.class));
- RemoteInputHistoryItem[] history = (RemoteInputHistoryItem[])
- extras.getParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS, android.app.RemoteInputHistoryItem.class);
+ List<Notification.MessagingStyle.Message> newHistoricMessages =
+ Notification.MessagingStyle.Message.getMessagesFromBundleArray(histMessages);
+ setUser(extras.getParcelable(Notification.EXTRA_MESSAGING_PERSON,
+ Person.class));
+ RemoteInputHistoryItem[] history =
+ (RemoteInputHistoryItem[]) extras.getParcelableArray(
+ Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS,
+ RemoteInputHistoryItem.class);
addRemoteInputHistoryToMessages(newMessages, history);
final Person user = extras.getParcelable(Notification.EXTRA_MESSAGING_PERSON, Person.class);
@@ -178,10 +186,12 @@
extras.getBoolean(Notification.EXTRA_SHOW_REMOTE_INPUT_SPINNER, false);
final List<MessagingMessage> historicMessagingMessages = createMessages(newHistoricMessages,
- true /* isHistoric */);
+ /* isHistoric= */true, usePrecomputedText);
final List<MessagingMessage> newMessagingMessages =
- createMessages(newMessages, false /* isHistoric */);
- bindViews(user, showSpinner, historicMessagingMessages, newMessagingMessages);
+ createMessages(newMessages, /* isHistoric */false, usePrecomputedText);
+
+ return new MessagingData(user, showSpinner,
+ historicMessagingMessages, newMessagingMessages);
}
/**
@@ -193,7 +203,32 @@
*/
@NonNull
public Runnable setDataAsync(Bundle extras) {
- return () -> setData(extras);
+ if (!mPrecomputedTextEnabled) {
+ return () -> setData(extras);
+ }
+
+ final MessagingData messagingData =
+ parseMessagingData(extras, /* usePrecomputedText= */true);
+
+ return () -> {
+ finalizeInflate(messagingData.getHistoricMessagingMessages());
+ finalizeInflate(messagingData.getNewMessagingMessages());
+ bind(messagingData);
+ };
+ }
+
+ /**
+ * enable/disable precomputed text usage
+ * @hide
+ */
+ public void setPrecomputedTextEnabled(boolean precomputedTextEnabled) {
+ mPrecomputedTextEnabled = precomputedTextEnabled;
+ }
+
+ private void finalizeInflate(List<MessagingMessage> historicMessagingMessages) {
+ for (MessagingMessage messagingMessage: historicMessagingMessages) {
+ messagingMessage.finalizeInflate();
+ }
}
@Override
@@ -218,17 +253,13 @@
}
}
- private void bindViews(Person user, boolean showSpinner,
- List<MessagingMessage> historicMessagingMessages,
- List<MessagingMessage> newMessagingMessages) {
- setUser(user);
- bind(showSpinner, historicMessagingMessages, newMessagingMessages);
- }
+ private void bind(MessagingData messagingData) {
+ setUser(messagingData.getUser());
- private void bind(boolean showSpinner, List<MessagingMessage> historicMessages,
- List<MessagingMessage> messages) {
+ List<MessagingMessage> historicMessages = messagingData.getHistoricMessagingMessages();
+ List<MessagingMessage> messages = messagingData.getNewMessagingMessages();
ArrayList<MessagingGroup> oldGroups = new ArrayList<>(mGroups);
- addMessagesToGroups(historicMessages, messages, showSpinner);
+ addMessagesToGroups(historicMessages, messages, messagingData.getShowSpinner());
// Let's first check which groups were removed altogether and remove them in one animation
removeGroups(oldGroups);
@@ -518,15 +549,17 @@
* @param newMessages the messages to parse.
*/
private List<MessagingMessage> createMessages(
- List<Notification.MessagingStyle.Message> newMessages, boolean historic) {
+ List<Notification.MessagingStyle.Message> newMessages, boolean isHistoric,
+ boolean usePrecomputedText) {
List<MessagingMessage> result = new ArrayList<>();
for (int i = 0; i < newMessages.size(); i++) {
Notification.MessagingStyle.Message m = newMessages.get(i);
MessagingMessage message = findAndRemoveMatchingMessage(m);
if (message == null) {
- message = MessagingMessage.createMessage(this, m, mImageResolver);
+ message = MessagingMessage.createMessage(this, m,
+ mImageResolver, usePrecomputedText);
}
- message.setIsHistoric(historic);
+ message.setIsHistoric(isHistoric);
result.add(message);
}
return result;
diff --git a/core/java/com/android/internal/widget/MessagingMessage.java b/core/java/com/android/internal/widget/MessagingMessage.java
index 5ecd3b8..ad90a63 100644
--- a/core/java/com/android/internal/widget/MessagingMessage.java
+++ b/core/java/com/android/internal/widget/MessagingMessage.java
@@ -34,11 +34,12 @@
String IMAGE_MIME_TYPE_PREFIX = "image/";
static MessagingMessage createMessage(IMessagingLayout layout,
- Notification.MessagingStyle.Message m, ImageResolver resolver) {
+ Notification.MessagingStyle.Message m, ImageResolver resolver,
+ boolean usePrecomputedText) {
if (hasImage(m) && !ActivityManager.isLowRamDeviceStatic()) {
- return MessagingImageMessage.createMessage(layout, m, resolver);
+ return MessagingImageMessage.createMessage(layout, m, resolver, usePrecomputedText);
} else {
- return MessagingTextMessage.createMessage(layout, m);
+ return MessagingTextMessage.createMessage(layout, m, usePrecomputedText);
}
}
@@ -55,9 +56,11 @@
/**
* Set a message for this view.
+ *
* @return true if setting the message worked
*/
- default boolean setMessage(Notification.MessagingStyle.Message message) {
+ default boolean setMessage(Notification.MessagingStyle.Message message,
+ boolean usePrecomputedText) {
getState().setMessage(message);
return true;
}
@@ -151,4 +154,10 @@
void setVisibility(int visibility);
int getVisibility();
+
+ /**
+ * Finalize inflation of the MessagingMessages, which should be called on Main Thread.
+ * @hide
+ */
+ void finalizeInflate();
}
diff --git a/core/java/com/android/internal/widget/MessagingTextMessage.java b/core/java/com/android/internal/widget/MessagingTextMessage.java
index 19791db..bd62aad 100644
--- a/core/java/com/android/internal/widget/MessagingTextMessage.java
+++ b/core/java/com/android/internal/widget/MessagingTextMessage.java
@@ -23,7 +23,9 @@
import android.app.Notification;
import android.content.Context;
import android.text.Layout;
+import android.text.PrecomputedText;
import android.util.AttributeSet;
+import android.util.Log;
import android.view.LayoutInflater;
import android.widget.RemoteViews;
@@ -35,10 +37,13 @@
@RemoteViews.RemoteView
public class MessagingTextMessage extends ImageFloatingTextView implements MessagingMessage {
+ private static final String TAG = "MessagingTextMessage";
private static final MessagingPool<MessagingTextMessage> sInstancePool =
new MessagingPool<>(20);
private final MessagingMessageState mState = new MessagingMessageState(this);
+ private PrecomputedText mPrecomputedText = null;
+
public MessagingTextMessage(@NonNull Context context) {
super(context);
}
@@ -63,25 +68,32 @@
}
@Override
- public boolean setMessage(Notification.MessagingStyle.Message message) {
- MessagingMessage.super.setMessage(message);
- setText(message.getText());
+ public boolean setMessage(Notification.MessagingStyle.Message message,
+ boolean usePrecomputedText) {
+ MessagingMessage.super.setMessage(message, usePrecomputedText);
+ if (usePrecomputedText) {
+ mPrecomputedText = PrecomputedText.create(message.getText(), getTextMetricsParams());
+ } else {
+ setText(message.getText());
+ mPrecomputedText = null;
+ }
+
return true;
}
static MessagingMessage createMessage(IMessagingLayout layout,
- Notification.MessagingStyle.Message m) {
+ Notification.MessagingStyle.Message m, boolean usePrecomputedText) {
MessagingLinearLayout messagingLinearLayout = layout.getMessagingLinearLayout();
MessagingTextMessage createdMessage = sInstancePool.acquire();
if (createdMessage == null) {
createdMessage = (MessagingTextMessage) LayoutInflater.from(
layout.getContext()).inflate(
- R.layout.notification_template_messaging_text_message,
- messagingLinearLayout,
- false);
+ R.layout.notification_template_messaging_text_message,
+ messagingLinearLayout,
+ false);
createdMessage.addOnLayoutChangeListener(MessagingLayout.MESSAGING_PROPERTY_ANIMATOR);
}
- createdMessage.setMessage(m);
+ createdMessage.setMessage(m, usePrecomputedText);
return createdMessage;
}
@@ -135,4 +147,20 @@
public void setColor(int color) {
setTextColor(color);
}
+
+ @Override
+ public void finalizeInflate() {
+ try {
+ setText(mPrecomputedText != null ? mPrecomputedText
+ : getState().getMessage().getText());
+ } catch (IllegalArgumentException exception) {
+ Log.wtf(
+ /* tag = */ TAG,
+ /* msg = */ "PrecomputedText setText failed for TextView:" + this,
+ /* tr = */ exception
+ );
+ mPrecomputedText = null;
+ setText(getState().getMessage().getText());
+ }
+ }
}
diff --git a/core/java/com/android/internal/widget/NotificationDrawableConsumer.java b/core/java/com/android/internal/widget/NotificationDrawableConsumer.java
new file mode 100644
index 0000000..7c4d929
--- /dev/null
+++ b/core/java/com/android/internal/widget/NotificationDrawableConsumer.java
@@ -0,0 +1,34 @@
+/*
+ * 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.internal.widget;
+
+import android.graphics.drawable.Drawable;
+
+import androidx.annotation.Nullable;
+
+/**
+ * An interface for the class, who will use {@link NotificationIconManager} to load icons.
+ */
+public interface NotificationDrawableConsumer {
+
+ /**
+ * Sets a drawable as the content of this consumer.
+ *
+ * @param drawable the {@link Drawable} to set, or {@code null} to clear the content
+ */
+ void setImageDrawable(@Nullable Drawable drawable);
+}
diff --git a/core/java/com/android/internal/widget/NotificationIconManager.java b/core/java/com/android/internal/widget/NotificationIconManager.java
new file mode 100644
index 0000000..221845c
--- /dev/null
+++ b/core/java/com/android/internal/widget/NotificationIconManager.java
@@ -0,0 +1,42 @@
+/*
+ * 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.internal.widget;
+
+import android.graphics.drawable.Icon;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+/**
+ * An interface used for Notification views to delegate handling the loading of icons.
+ */
+public interface NotificationIconManager {
+
+ /**
+ * Called when a new icon is provided to display.
+ *
+ * @param drawableConsumer a consumer, which can display the loaded drawable.
+ * @param icon the updated icon to be displayed.
+ *
+ * @return a {@link Runnable} that sets the drawable on the consumer
+ */
+ @NonNull
+ Runnable updateIcon(
+ @NonNull NotificationDrawableConsumer drawableConsumer,
+ @Nullable Icon icon
+ );
+}
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 9aa992b..b5d70d3 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -353,7 +353,7 @@
JNIEnv* env;
jmethodID methodId;
- ALOGD("Calling main entry %s", className.string());
+ ALOGD("Calling main entry %s", className.c_str());
env = getJNIEnv();
if (clazz == NULL || env == NULL) {
@@ -362,7 +362,7 @@
methodId = env->GetStaticMethodID(clazz, "main", "([Ljava/lang/String;)V");
if (methodId == NULL) {
- ALOGE("ERROR: could not find method %s.main(String[])\n", className.string());
+ ALOGE("ERROR: could not find method %s.main(String[])\n", className.c_str());
return UNKNOWN_ERROR;
}
@@ -378,7 +378,7 @@
strArray = env->NewObjectArray(numArgs, stringClass, NULL);
for (size_t i = 0; i < numArgs; i++) {
- jstring argStr = env->NewStringUTF(args[i].string());
+ jstring argStr = env->NewStringUTF(args[i].c_str());
env->SetObjectArrayElement(strArray, i, argStr);
}
@@ -1269,7 +1269,7 @@
env->SetObjectArrayElement(strArray, 0, classNameStr);
for (size_t i = 0; i < options.size(); ++i) {
- jstring optionsStr = env->NewStringUTF(options.itemAt(i).string());
+ jstring optionsStr = env->NewStringUTF(options.itemAt(i).c_str());
assert(optionsStr != NULL);
env->SetObjectArrayElement(strArray, i + 1, optionsStr);
}
diff --git a/core/jni/android_content_res_ObbScanner.cpp b/core/jni/android_content_res_ObbScanner.cpp
index de429a0..760037f 100644
--- a/core/jni/android_content_res_ObbScanner.cpp
+++ b/core/jni/android_content_res_ObbScanner.cpp
@@ -52,7 +52,7 @@
env->ReleaseStringUTFChars(file, filePath);
- const char* packageNameStr = obb->getPackageName().string();
+ const char* packageNameStr = obb->getPackageName().c_str();
jstring packageName = env->NewStringUTF(packageNameStr);
if (packageName == NULL) {
diff --git a/core/jni/android_hardware_SensorManager.cpp b/core/jni/android_hardware_SensorManager.cpp
index 9c6a534..deb138f 100644
--- a/core/jni/android_hardware_SensorManager.cpp
+++ b/core/jni/android_hardware_SensorManager.cpp
@@ -150,7 +150,7 @@
return gStringOffsets.emptyString;
}
- ScopedLocalRef<jstring> javaString(env, env->NewStringUTF(string.string()));
+ ScopedLocalRef<jstring> javaString(env, env->NewStringUTF(string.c_str()));
jstring internedString = (jstring)
env->CallObjectMethod(javaString.get(), gStringOffsets.intern);
return internedString;
diff --git a/core/jni/android_hardware_input_InputWindowHandle.cpp b/core/jni/android_hardware_input_InputWindowHandle.cpp
index eb5f297..ea3c70f 100644
--- a/core/jni/android_hardware_input_InputWindowHandle.cpp
+++ b/core/jni/android_hardware_input_InputWindowHandle.cpp
@@ -35,6 +35,7 @@
#include "android_util_Binder.h"
#include "core_jni_helpers.h"
#include "jni.h"
+#include "jni_common.h"
namespace android {
@@ -57,10 +58,7 @@
jfieldID layoutParamsFlags;
jfieldID layoutParamsType;
jfieldID dispatchingTimeoutMillis;
- jfieldID frameLeft;
- jfieldID frameTop;
- jfieldID frameRight;
- jfieldID frameBottom;
+ jfieldID frame;
jfieldID surfaceInset;
jfieldID scaleFactor;
jfieldID touchableRegion;
@@ -128,14 +126,11 @@
mInfo.dispatchingTimeout = std::chrono::milliseconds(
env->GetLongField(obj, gInputWindowHandleClassInfo.dispatchingTimeoutMillis));
- mInfo.frameLeft = env->GetIntField(obj,
- gInputWindowHandleClassInfo.frameLeft);
- mInfo.frameTop = env->GetIntField(obj,
- gInputWindowHandleClassInfo.frameTop);
- mInfo.frameRight = env->GetIntField(obj,
- gInputWindowHandleClassInfo.frameRight);
- mInfo.frameBottom = env->GetIntField(obj,
- gInputWindowHandleClassInfo.frameBottom);
+
+ ScopedLocalRef<jobject> frameObj(env,
+ env->GetObjectField(obj, gInputWindowHandleClassInfo.frame));
+ mInfo.frame = JNICommon::rectFromObj(env, frameObj.get());
+
mInfo.surfaceInset = env->GetIntField(obj,
gInputWindowHandleClassInfo.surfaceInset);
mInfo.globalScaleFactor = env->GetFloatField(obj,
@@ -283,13 +278,9 @@
std::chrono::duration_cast<std::chrono::milliseconds>(
windowInfo.dispatchingTimeout)
.count());
- env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.frameLeft,
- windowInfo.frameLeft);
- env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.frameTop, windowInfo.frameTop);
- env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.frameRight,
- windowInfo.frameRight);
- env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.frameBottom,
- windowInfo.frameBottom);
+ ScopedLocalRef<jobject> rectObj(env, JNICommon::objFromRect(env, windowInfo.frame));
+ env->SetObjectField(inputWindowHandle, gInputWindowHandleClassInfo.frame, rectObj.get());
+
env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.surfaceInset,
windowInfo.surfaceInset);
env->SetFloatField(inputWindowHandle, gInputWindowHandleClassInfo.scaleFactor,
@@ -400,17 +391,7 @@
GET_FIELD_ID(gInputWindowHandleClassInfo.dispatchingTimeoutMillis, clazz,
"dispatchingTimeoutMillis", "J");
- GET_FIELD_ID(gInputWindowHandleClassInfo.frameLeft, clazz,
- "frameLeft", "I");
-
- GET_FIELD_ID(gInputWindowHandleClassInfo.frameTop, clazz,
- "frameTop", "I");
-
- GET_FIELD_ID(gInputWindowHandleClassInfo.frameRight, clazz,
- "frameRight", "I");
-
- GET_FIELD_ID(gInputWindowHandleClassInfo.frameBottom, clazz,
- "frameBottom", "I");
+ GET_FIELD_ID(gInputWindowHandleClassInfo.frame, clazz, "frame", "Landroid/graphics/Rect;");
GET_FIELD_ID(gInputWindowHandleClassInfo.surfaceInset, clazz,
"surfaceInset", "I");
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index 979c9e3..f04b901 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -295,7 +295,7 @@
if (alloc.length() <= 0) {
return nullptr;
}
- return env->NewStringUTF(alloc.string());
+ return env->NewStringUTF(alloc.c_str());
}
static jint NativeGetGlobalAssetManagerCount(JNIEnv* /*env*/, jobject /*clazz*/) {
@@ -456,7 +456,7 @@
}
for (size_t i = 0; i < file_count; i++) {
- jstring java_string = env->NewStringUTF(asset_dir->getFileName(i).string());
+ jstring java_string = env->NewStringUTF(asset_dir->getFileName(i).c_str());
// Check for errors creating the strings (if malformed or no memory).
if (env->ExceptionCheck()) {
diff --git a/core/jni/android_view_DisplayEventReceiver.cpp b/core/jni/android_view_DisplayEventReceiver.cpp
index 624bd5f..69fc515 100644
--- a/core/jni/android_view_DisplayEventReceiver.cpp
+++ b/core/jni/android_view_DisplayEventReceiver.cpp
@@ -292,7 +292,7 @@
if (status) {
String8 message;
message.appendFormat("Failed to initialize display event receiver. status=%d", status);
- jniThrowRuntimeException(env, message.string());
+ jniThrowRuntimeException(env, message.c_str());
return 0;
}
@@ -316,7 +316,7 @@
if (status) {
String8 message;
message.appendFormat("Failed to schedule next vertical sync pulse. status=%d", status);
- jniThrowRuntimeException(env, message.string());
+ jniThrowRuntimeException(env, message.c_str());
}
}
diff --git a/core/jni/android_view_InputEventSender.cpp b/core/jni/android_view_InputEventSender.cpp
index 061f669..833952d 100644
--- a/core/jni/android_view_InputEventSender.cpp
+++ b/core/jni/android_view_InputEventSender.cpp
@@ -340,7 +340,7 @@
if (status) {
String8 message;
message.appendFormat("Failed to initialize input event sender. status=%d", status);
- jniThrowRuntimeException(env, message.string());
+ jniThrowRuntimeException(env, message.c_str());
return 0;
}
diff --git a/core/jni/com_android_internal_os_LongArrayMultiStateCounter.cpp b/core/jni/com_android_internal_os_LongArrayMultiStateCounter.cpp
index 76f5c10..6920211 100644
--- a/core/jni/com_android_internal_os_LongArrayMultiStateCounter.cpp
+++ b/core/jni/com_android_internal_os_LongArrayMultiStateCounter.cpp
@@ -65,6 +65,16 @@
counter->updateValue(*vector, timestamp);
}
+static void native_incrementValues(jlong nativePtr, jlong longArrayContainerNativePtr,
+ jlong timestamp) {
+ battery::LongArrayMultiStateCounter *counter =
+ reinterpret_cast<battery::LongArrayMultiStateCounter *>(nativePtr);
+ std::vector<uint64_t> *vector =
+ reinterpret_cast<std::vector<uint64_t> *>(longArrayContainerNativePtr);
+
+ counter->incrementValue(*vector, timestamp);
+}
+
static void native_addCounts(jlong nativePtr, jlong longArrayContainerNativePtr) {
battery::LongArrayMultiStateCounter *counter =
reinterpret_cast<battery::LongArrayMultiStateCounter *>(nativePtr);
@@ -202,6 +212,8 @@
// @CriticalNative
{"native_updateValues", "(JJJ)V", (void *)native_updateValues},
// @CriticalNative
+ {"native_incrementValues", "(JJJ)V", (void *)native_incrementValues},
+ // @CriticalNative
{"native_addCounts", "(JJ)V", (void *)native_addCounts},
// @CriticalNative
{"native_reset", "(J)V", (void *)native_reset},
diff --git a/core/jni/jni_common.cpp b/core/jni/jni_common.cpp
index 8d376cf..b81c9b6 100644
--- a/core/jni/jni_common.cpp
+++ b/core/jni/jni_common.cpp
@@ -26,6 +26,8 @@
namespace android {
static struct {
+ jclass clazz;
+ jmethodID ctor;
jfieldID bottom;
jfieldID left;
jfieldID right;
@@ -40,8 +42,15 @@
return Rect(left, top, right, bottom);
}
+jobject JNICommon::objFromRect(JNIEnv* env, Rect rect) {
+ return env->NewObject(gRectClassInfo.clazz, gRectClassInfo.ctor, rect.left, rect.top,
+ rect.right, rect.bottom);
+}
+
int register_jni_common(JNIEnv* env) {
jclass rectClazz = FindClassOrDie(env, "android/graphics/Rect");
+ gRectClassInfo.clazz = MakeGlobalRefOrDie(env, rectClazz);
+ gRectClassInfo.ctor = GetMethodIDOrDie(env, rectClazz, "<init>", "(IIII)V");
gRectClassInfo.bottom = GetFieldIDOrDie(env, rectClazz, "bottom", "I");
gRectClassInfo.left = GetFieldIDOrDie(env, rectClazz, "left", "I");
gRectClassInfo.right = GetFieldIDOrDie(env, rectClazz, "right", "I");
diff --git a/core/jni/jni_common.h b/core/jni/jni_common.h
index a2bf6fb..d670a7d 100644
--- a/core/jni/jni_common.h
+++ b/core/jni/jni_common.h
@@ -22,5 +22,6 @@
class JNICommon {
public:
static Rect rectFromObj(JNIEnv* env, jobject rectObj);
+ static jobject objFromRect(JNIEnv* env, Rect rect);
};
} // namespace android
\ No newline at end of file
diff --git a/core/proto/android/providers/settings/secure.proto b/core/proto/android/providers/settings/secure.proto
index d7969cf..ed0081c 100644
--- a/core/proto/android/providers/settings/secure.proto
+++ b/core/proto/android/providers/settings/secure.proto
@@ -137,6 +137,7 @@
optional SettingProto gesture_setup_complete = 9 [ (android.privacy).dest = DEST_AUTOMATIC ];
optional SettingProto touch_gesture_enabled = 10 [ (android.privacy).dest = DEST_AUTOMATIC ];
optional SettingProto long_press_home_enabled = 11 [ (android.privacy).dest = DEST_AUTOMATIC ];
+ optional SettingProto search_press_hold_nav_handle_enabled = 12 [ (android.privacy).dest = DEST_AUTOMATIC ];
}
optional Assist assist = 7;
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 67710f6..ffd640f 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -2267,6 +2267,14 @@
<permission android:name="android.permission.MANAGE_ETHERNET_NETWORKS"
android:protectionLevel="signature" />
+ <!-- Allows system apps to call methods to register itself as a mDNS offload engine.
+ <p>Not for use by third-party or privileged applications.
+ @SystemApi
+ @hide This should only be used by system apps.
+ -->
+ <permission android:name="android.permission.REGISTER_NSD_OFFLOAD_ENGINE"
+ android:protectionLevel="signature" />
+
<!-- ======================================= -->
<!-- Permissions for short range, peripheral networks -->
<!-- ======================================= -->
@@ -7790,8 +7798,9 @@
android:process=":ui">
</activity>
<activity android:name="com.android.internal.app.PlatLogoActivity"
- android:theme="@style/Theme.Wallpaper.NoTitleBar.Fullscreen"
+ android:theme="@style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
+ android:enableOnBackInvokedCallback="true"
android:icon="@drawable/platlogo"
android:process=":ui">
</activity>
@@ -7863,12 +7872,6 @@
</intent-filter>
</activity>
- <activity android:name="com.android.internal.app.NetInitiatedActivity"
- android:theme="@style/Theme.Dialog.Confirmation"
- android:excludeFromRecents="true"
- android:process=":ui">
- </activity>
-
<activity android:name="com.android.internal.app.SystemUserHomeActivity"
android:enabled="false"
android:process=":ui"
diff --git a/core/res/res/drawable/focus_event_rotary_input_background.xml b/core/res/res/drawable/focus_event_rotary_input_background.xml
new file mode 100644
index 0000000..512cd68
--- /dev/null
+++ b/core/res/res/drawable/focus_event_rotary_input_background.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 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.
+-->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:name="focus_event_rotary_input_background"
+ android:shape="rectangle">
+
+ <!-- View background color -->
+ <solid android:color="#80741b47" />
+
+ <!-- View border color and width -->
+ <stroke android:width="1dp" android:color="#ffff00ff" />
+
+ <!-- The radius makes the corners rounded -->
+ <corners android:radius="4dp" />
+
+</shape>
\ No newline at end of file
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index 2d13ab5..7675da5 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Gebruik biometrie of skermslot"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verifieer dat dit jy is"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Gebruik jou biometrie om voort te gaan"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Gebruik jou vingerafdruk om voort te gaan"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Gebruik jou gesig om voort te gaan"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Gebruik jou biometriese data of skermslot om voort te gaan"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometriese hardeware is nie beskikbaar nie"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Stawing is gekanselleer"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Vingerafdruk word nie herken nie"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Vingerafdruk word nie herken nie"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Kan nie gesig herken nie. Gebruik eerder vingerafdruk."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Vingerafdruk is gestaaf"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Gesig is gestaaf"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Gesig is gestaaf; druk asseblief bevestig"</string>
@@ -2331,11 +2330,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Laat ’n metgeselapp toe om voorgronddienste van agtergrond af te begin"</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Mikrofoon is beskikbaar"</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Mikrofoon is geblokkeer"</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dubbelskerm"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dubbelskerm is aan"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual Screen is aan"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> gebruik tans albei skerms om inhoud te wys"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Toestel is te warm"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dubbelskerm is nie beskikbaar nie omdat jou foon tans te warm word"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen is nie beskikbaar nie omdat jou foon tans te warm word"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen is nie beskikbaar nie"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Dual Screen is nie beskikbaar nie omdat Batterybespaarder aan is. Jy kan dit in Instellings afskakel."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Gaan na Instellings"</string>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index 2dd8f3b..8a03761 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"ባዮሜትሪክስ ወይም ማያ ገፅ መቆለፊያን ይጠቀሙ"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"እርስዎን መሆንዎን ያረጋግጡ"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"ለመቀጠል ባዮሜትሪክዎን ይጠቀሙ"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"ለመቀጠል የእርስዎን የጣት አሻራ ይጠቀሙ"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"ለመቀጠል የእርስዎን መልክ ይጠቀሙ"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"ለመቀጠል የባዮሜትሪክ ወይም የማያ ገፅ ቁልፍዎን ይጠቀሙ"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"ባዮሜትራዊ ሃርድዌር አይገኝም"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"ማረጋገጥ ተሰርዟል"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"የጣት አሻራ አልታወቀም"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"የጣት አሻራ አልታወቀም"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"መልክን መለየት አልተቻለም። በምትኩ የጣት አሻራ ይጠቀሙ።"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"የጣት አሻራ ትክክለኛነት ተረጋግጧል"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"ፊት ተረጋግጧል"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"ፊት ተረጋግጧል፣ እባክዎ አረጋግጥን ይጫኑ"</string>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index 322ae8d..fea0e8f 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -622,8 +622,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"استخدام المقاييس الحيوية أو قفل الشاشة"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"إثبات هويتك"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"استخدام المقاييس الحيوية للمتابعة"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"استخدِم بصمة إصبعك للمتابعة"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"استخدِم وجهك للمتابعة"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"استخدام المقاييس الحيوية أو قفل الشاشة للمتابعة"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"معدّات المقاييس الحيوية غير متاحة."</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"تم إلغاء المصادقة."</string>
@@ -649,6 +647,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"لم يتمّ التعرّف على البصمة."</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"لم يتمّ التعرّف على بصمة الإصبع."</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"يتعذّر التعرّف على الوجه. استخدِم بصمة الإصبع بدلاً من ذلك."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"تم مصادقة بصمة الإصبع"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"تمّت مصادقة الوجه"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"تمّت مصادقة الوجه، يُرجى الضغط على \"تأكيد\"."</string>
@@ -2335,11 +2334,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"يسمح هذا الإذن للتطبيق المصاحب ببدء الخدمات التي تعمل في المقدّمة من الخلفية."</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"الميكروفون متاح."</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"تم حظر الميكروفون."</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"استخدام الشاشتين"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"ميزة \"استخدام الشاشتين\" مفعّلة"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"ميزة Dual Screen مفعّلة"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"يستخدم \"<xliff:g id="APP_NAME">%1$s</xliff:g>\" كلتا الشاشتين لعرض المحتوى."</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"الجهاز ساخن للغاية"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"ميزة \"استخدام الشاشتين\" غير متاحة لأن هاتفك ساخن للغاية."</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"ميزة Dual Screen غير متاحة لأنّ هاتفك ساخن للغاية."</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"ميزة Dual Screen غير متاحة"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"ميزة Dual Screen غير متاحة لأن ميزة \"توفير شحن البطارية\" مفعّلة. ويمكنك إيقاف هذا الإجراء من خلال \"الإعدادات\"."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"الانتقال إلى الإعدادات"</string>
diff --git a/core/res/res/values-as/strings.xml b/core/res/res/values-as/strings.xml
index 12e0948..24d2932 100644
--- a/core/res/res/values-as/strings.xml
+++ b/core/res/res/values-as/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"বায়\'মেট্ৰিক অথবা স্ক্ৰীন লক ব্যৱহাৰ কৰক"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"এইয়া আপুনিয়েই বুলি সত্যাপন কৰক"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"অব্যাহত ৰাখিবলৈ আপোনাৰ বায়\'মেট্ৰিক ব্যৱহাৰ কৰক"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"অব্যাহত ৰাখিবলৈ আপোনাৰ ফিংগাৰপ্ৰিণ্ট ব্যৱহাৰ কৰক"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"অব্যাহত ৰাখিবলৈ নিজৰ মুখাৱয়ব ব্যৱহাৰ কৰক"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"অব্যাহত ৰাখিবলৈ আপোনাৰ বায়’মেট্ৰিক অথবা স্ক্ৰীন লক ব্যৱহাৰ কৰক"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"বায়োমেট্ৰিক হাৰ্ডৱেৰ উপলব্ধ নহয়"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"বিশ্বাসযোগ্যতাৰ প্ৰমাণীকৰণ বাতিল কৰা হৈছে"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"ফিংগাৰপ্ৰিণ্ট চিনাক্ত কৰিব পৰা নাই"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"ফিংগাৰপ্ৰিণ্ট চিনাক্ত কৰিব পৰা নাই"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"মুখাৱয়ব চিনিব নোৱাৰি। ফিংগাৰপ্ৰিণ্ট ব্যৱহাৰ কৰক।"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"ফিংগাৰপ্ৰিণ্টৰ সত্যাপন কৰা হ’ল"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"মুখমণ্ডলৰ বিশ্বাসযোগ্যতা প্ৰমাণীকৰণ কৰা হ’ল"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"মুখমণ্ডলৰ বিশ্বাসযোগ্যতা প্ৰমাণীকৰণ কৰা হ’ল, অনুগ্ৰহ কৰি ‘নিশ্চিত কৰক’ বুটামটো টিপক"</string>
diff --git a/core/res/res/values-az/strings.xml b/core/res/res/values-az/strings.xml
index ff7436f..4a6d7ff 100644
--- a/core/res/res/values-az/strings.xml
+++ b/core/res/res/values-az/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Biometrik məlumatlardan və ya ekran kilidindən istifadə edin"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Kimliyinizi doğrulayın"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Davam etmək üçün biometrik məlumatlarınızdan istifadə edin"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Barmaq izi ilə davam edin"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Üz ilə davam edin"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Davam etmək üçün biometrik məlumatlar və ya ekran kilidinizdən istifadə edin"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrik proqram əlçatan deyil"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Doğrulama ləğv edildi"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Barmaq izi tanınmır"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Barmaq izi tanınmır"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Tanımaq olmur. Barmaq izini işlədin."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Barmaq izi doğrulandı"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Üz doğrulandı"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Üz təsdiq edildi, təsdiq düyməsinə basın"</string>
diff --git a/core/res/res/values-b+sr+Latn/strings.xml b/core/res/res/values-b+sr+Latn/strings.xml
index c32f95a..7a07cac 100644
--- a/core/res/res/values-b+sr+Latn/strings.xml
+++ b/core/res/res/values-b+sr+Latn/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Koristite biometriju ili zaključavanje ekrana"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Potvrdite svoj identitet"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Koristite biometrijski podatak da biste nastavili"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Nastavite pomoću otiska prsta"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Potvrdite identitet licem da biste nastavili"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Koristite biometrijski podatak ili zaključavanje ekrana da biste nastavili"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrijski hardver nije dostupan"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Potvrda identiteta je otkazana"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Otisak prsta nije prepoznat"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Otisak prsta nije prepoznat"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Lice nije prepoznato. Koristite otisak prsta."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Otisak prsta je potvrđen"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Lice je potvrđeno"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Lice je potvrđeno. Pritisnite Potvrdi"</string>
@@ -2332,11 +2331,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Dozvoljava pratećoj aplikaciji da pokrene usluge u prvom planu iz pozadine."</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Mikrofon je dostupan"</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Mikrofon je blokiran"</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dvojni ekran"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dvojni ekran je uključen"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual Screen je uključen"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> koristi oba ekrana za prikazivanje sadržaja"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Uređaj je previše zagrejan"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dvojni ekran je nedostupan jer je telefon previše zagrejan"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen je nedostupan jer je telefon previše zagrejan"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen nije dostupan"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Dual Screen nije dostupan zato što je Ušteda baterije uključena. To možete da isključite u podešavanjima."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Idi u Podešavanja"</string>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index 3be47fa..2c352f9d 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -620,8 +620,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Выкарыстоўваць біяметрыю ці блакіроўку экрана"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Спраўдзіце, што гэта вы"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Каб працягнуць, скарыстайце свае біяметрычныя даныя"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Каб працягнуць, скарыстайце адбітак пальца"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Каб працягнуць, скарыстайце распазнаванне твару"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Каб працягнуць, скарыстайце біяметрычныя даныя ці сродак разблакіроўкі экрана"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Біяметрычнае абсталяванне недаступнае"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Аўтэнтыфікацыя скасавана"</string>
@@ -647,6 +645,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Адбітак пальца не распазнаны"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Адбітак пальца не распазнаны"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Твар не распазнаны. Скарыстайце адбітак пальца."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Адбітак пальца распазнаны"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Твар распазнаны"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Твар распазнаны. Націсніце, каб пацвердзіць"</string>
@@ -2333,11 +2332,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Спадарожная праграма зможа запускаць актыўныя сэрвісы з фонавага рэжыму."</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Мікрафон даступны"</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Мікрафон заблакіраваны"</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Двайны экран"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Уключана функцыя \"Двайны экран\""</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Уключана функцыя Dual Screen"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"Праграма \"<xliff:g id="APP_NAME">%1$s</xliff:g>\" выкарыстоўвае абодва экраны для паказу змесціва"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Прылада моцна нагрэлася"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Функцыя \"Двайны экран\" недаступная, бо тэлефон моцна награваецца"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Функцыя Dual Screen недаступная, бо тэлефон моцна награваецца"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Функцыя Dual Screen недаступная"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Функцыя Dual Screen недаступная, бо ўключаны рэжым энергазберажэння. Вы можаце выключыць яго ў Наладах."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Перайсці ў Налады."</string>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index 10d747b..078ec85 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Използване на биометрични данни или опцията за заключване на екрана"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Потвърдете, че сте вие"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Използвайте биометричните си данни, за да продължите"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Използвайте отпечатъка си, за да продължите"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Използвайте лицето си, за да продължите"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Използвайте биометричните си данни или опцията за заключване на екрана, за да продължите"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Биометричният хардуер не е налице"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Удостоверяването бе анулирано"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Отпечатъкът не е разпознат"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Отпечатъкът не е разпознат"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Лицето не е разпознато. Използвайте отпечатък."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Отпечатъкът е удостоверен"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Лицето е удостоверено"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Лицето е удостоверено. Моля, натиснете „Потвърждаване“"</string>
diff --git a/core/res/res/values-bn/strings.xml b/core/res/res/values-bn/strings.xml
index 9d276cb..f451da3 100644
--- a/core/res/res/values-bn/strings.xml
+++ b/core/res/res/values-bn/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"বায়োমেট্রিক্স অথবা স্ক্রিন লক ব্যবহার করুন"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"আপনার পরিচয় যাচাই করুন"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"চালিয়ে যেতে আপনার বায়োমেট্রিক্স ব্যবহার করুন"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"চালিয়ে যেতে ফিঙ্গারপ্রিন্ট ব্যবহার করুন"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"চালিয়ে যেতে আপনার ফেস ব্যবহার করুন"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"চালিয়ে যেতে আপনার বায়োমেট্রিক্স বা স্ক্রিন লক ব্যবহার করুন"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"বায়োমেট্রিক হার্ডওয়্যার পাওয়া যাবে না"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"যাচাইকরণ বাতিল হয়েছে"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"ফিঙ্গারপ্রিন্ট শনাক্ত করা যায়নি"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"ফিঙ্গারপ্রিন্ট শনাক্ত করা যায়নি"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"মুখ শনাক্ত করতে পারছি না। পরিবর্তে আঙ্গুলের ছাপ ব্যবহার করুন।"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"আঙ্গুলের ছাপ যাচাই করা হয়েছে"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"ফেস যাচাই করা হয়েছে"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"ফেস যাচাই করা হয়েছে, \'কনফার্ম করুন\' বোতাম প্রেস করুন"</string>
diff --git a/core/res/res/values-bs/strings.xml b/core/res/res/values-bs/strings.xml
index 33ac0c3..fb02763 100644
--- a/core/res/res/values-bs/strings.xml
+++ b/core/res/res/values-bs/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Koristi biometriju ili zaključavanje ekrana"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Potvrdite identitet"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Koristite biometriju da nastavite"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Potvrdite identitet otiskom prsta da nastavite"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Potvrdite identitet licem da nastavite"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Koristite biometriju ili zaključavanje ekrana da nastavite"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrijski hardver nije dostupan"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autentifikacija je otkazana"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Otisak prsta nije prepoznat"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Otisak prsta nije prepoznat"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Nije moguće prepoznati lice. Koristite otisak prsta."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Otisak prsta je potvrđen"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Lice je provjereno"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Lice je provjereno, pritisnite dugme za potvrdu"</string>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index 356576d..edfd9d1 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Fes servir la biometria o el bloqueig de pantalla"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verifica la teva identitat"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Utilitza la teva biometria per continuar"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Utilitza l\'empremta digital per continuar"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Utilitza la cara per continuar"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Utilitza la biometria o el bloqueig de pantalla per continuar"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Maquinari biomètric no disponible"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"S\'ha cancel·lat l\'autenticació"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"L\'empremta digital no s\'ha reconegut"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"L\'empremta digital no s\'ha reconegut"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"No podem detectar la cara. Usa l\'empremta digital."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"L\'empremta digital s\'ha autenticat"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Cara autenticada"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Cara autenticada; prem el botó per confirmar"</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index a4e9ab5..d2baa9b 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -620,8 +620,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Použít biometrii nebo zámek obrazovky"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Potvrďte, že jste to vy"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Pokračujte biometrickým ověřením"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Pokračujte přiložením prstu"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Pokračujte ověřením obličeje"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Pokračujte ověřením pomocí biometrických údajů nebo zámku obrazovky"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrický hardware není k dispozici"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Ověření bylo zrušeno"</string>
@@ -647,6 +645,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Otisk prstu nebyl rozpoznán"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Otisk prstu nebyl rozpoznán"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Obličej se nepodařilo rozpoznat. Použijte místo něj otisk prstu."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Otisk byl ověřen"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Obličej byl ověřen"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Obličej byl ověřen, stiskněte tlačítko pro potvrzení"</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index b8bd5ba..6de92f9 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Brug biometri eller skærmlås"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verificer, at det er dig"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Brug dine biometriske data for at fortsætte"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Brug dit fingeraftryk for at fortsætte"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Brug dit ansigt for at fortsætte"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Brug dine biometriske data eller din skærmlås for at fortsætte"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrisk hardware er ikke tilgængelig"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Godkendelsen blev annulleret"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Fingeraftrykket blev ikke genkendt"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Fingeraftrykket blev ikke genkendt"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Ansigtet kan ikke genkendes. Brug fingeraftryk i stedet."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Fingeraftrykket blev godkendt"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Ansigtet er godkendt"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Ansigtet er godkendt. Tryk på Bekræft."</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index 84f2c1f..ec8bb7b 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Biometrisches Verfahren oder Displaysperre verwenden"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Deine Identität bestätigen"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Mithilfe eines biometrischen Verfahrens fortfahren"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Fingerabdruck verwenden, um fortzufahren"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Gesichtserkennung verwenden, um fortzufahren"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Verwende deine biometrischen Daten oder deine Display-Entsperrmethode, um fortzufahren"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrische Hardware nicht verfügbar"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Authentifizierung abgebrochen"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Fingerabdruck nicht erkannt"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Fingerabdruck nicht erkannt"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Gesicht wurde nicht erkannt. Verwende stattdessen den Fingerabdruck."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Fingerabdruck wurde authentifiziert"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Gesicht authentifiziert"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Gesicht authentifiziert, bitte bestätigen"</string>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index d603a26..66148a9 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Χρήση βιομετρικών ή κλειδώματος οθόνης"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Επαλήθευση ταυτότητας"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Χρησιμοποιήστε βιομετρικά για να συνεχίσετε"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Χρησιμοποιήστε το δακτυλικό σας αποτύπωμα για να συνεχίσετε"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Χρησιμοποιήστε το πρόσωπό σας για να συνεχίσετε"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Χρήση βιομετρικών στοιχείων ή κλειδώματος οθόνης για συνέχεια"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Δεν υπάρχει διαθέσιμος βιομετρικός εξοπλισμός"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Ο έλεγχος ταυτότητας ακυρώθηκε"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Δεν είναι δυνατή η αναγνώριση του δακτυλικού αποτυπώματος"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Δεν είναι δυνατή η αναγνώριση του δακτυλικού αποτυπώματος"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Το πρόσωπο δεν αναγνωρίζεται. Χρησιμ. δακτ. αποτ."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Η ταυτότητα του δακτυλικού αποτυπώματος ελέγχθηκε"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Έγινε έλεγχος ταυτότητας προσώπου"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Έγινε έλεγχος ταυτότητας προσώπου, πατήστε \"Επιβεβαίωση\""</string>
diff --git a/core/res/res/values-en-rAU/strings.xml b/core/res/res/values-en-rAU/strings.xml
index c92f460..906e94c 100644
--- a/core/res/res/values-en-rAU/strings.xml
+++ b/core/res/res/values-en-rAU/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Use biometrics or screen lock"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verify that it’s you"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Use your biometric to continue"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Use your fingerprint to continue"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Use your face to continue"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Use your biometric or screen lock to continue"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometric hardware unavailable"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Authentication cancelled"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Fingerprint not recognised"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Fingerprint not recognised"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Can’t recognise face. Use fingerprint instead."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Fingerprint authenticated"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Face authenticated"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Face authenticated. Please press confirm"</string>
diff --git a/core/res/res/values-en-rCA/strings.xml b/core/res/res/values-en-rCA/strings.xml
index bf94625..2d7ba8d 100644
--- a/core/res/res/values-en-rCA/strings.xml
+++ b/core/res/res/values-en-rCA/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Use biometrics or screen lock"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verify it’s you"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Use your biometric to continue"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Use your fingerprint to continue"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Use your face to continue"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Use your biometric or screen lock to continue"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometric hardware unavailable"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Authentication canceled"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Fingerprint not recognized"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Fingerprint not recognized"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Can’t recognize face. Use fingerprint instead."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Fingerprint authenticated"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Face authenticated"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Face authenticated, please press confirm"</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index 48a10df..ad9c777 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Use biometrics or screen lock"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verify that it’s you"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Use your biometric to continue"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Use your fingerprint to continue"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Use your face to continue"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Use your biometric or screen lock to continue"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometric hardware unavailable"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Authentication cancelled"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Fingerprint not recognised"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Fingerprint not recognised"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Can’t recognise face. Use fingerprint instead."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Fingerprint authenticated"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Face authenticated"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Face authenticated. Please press confirm"</string>
diff --git a/core/res/res/values-en-rIN/strings.xml b/core/res/res/values-en-rIN/strings.xml
index a3f2d7d..c9db594 100644
--- a/core/res/res/values-en-rIN/strings.xml
+++ b/core/res/res/values-en-rIN/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Use biometrics or screen lock"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verify that it’s you"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Use your biometric to continue"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Use your fingerprint to continue"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Use your face to continue"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Use your biometric or screen lock to continue"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometric hardware unavailable"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Authentication cancelled"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Fingerprint not recognised"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Fingerprint not recognised"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Can’t recognise face. Use fingerprint instead."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Fingerprint authenticated"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Face authenticated"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Face authenticated. Please press confirm"</string>
diff --git a/core/res/res/values-en-rXC/strings.xml b/core/res/res/values-en-rXC/strings.xml
index 17e3fcb..5888963 100644
--- a/core/res/res/values-en-rXC/strings.xml
+++ b/core/res/res/values-en-rXC/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Use biometrics or screen lock"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verify it’s you"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Use your biometric to continue"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Use your fingerprint to continue"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Use your face to continue"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Use your biometric or screen lock to continue"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometric hardware unavailable"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Authentication canceled"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Fingerprint not recognized"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Fingerprint not recognized"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Can’t recognize face. Use fingerprint instead."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Fingerprint authenticated"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Face authenticated"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Face authenticated, please press confirm"</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index 347d537..756a198 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Usar datos biométricos o bloqueo de pantalla"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Comprueba que eres tú"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Usa tus datos biométricos para continuar"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Usa tu huella dactilar para continuar"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Usa el rostro para continuar"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Usa tus datos biométricos o bloqueo de pantalla para continuar"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"No hay hardware biométrico disponible"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Se canceló la autenticación"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"No se reconoció la huella dactilar"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"No se reconoció la huella dactilar"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"No se reconoce el rostro. Usa la huella dactilar."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Se autenticó la huella dactilar"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Se autenticó el rostro"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Se autenticó el rostro; presiona Confirmar"</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 70610d1..57480bd 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Usar biometría o bloqueo de pantalla"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verifica que eres tú"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Usa tu biometría para continuar"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Usa la huella digital para continuar"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Usa la cara para continuar"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Usa la biometría o tu bloqueo de pantalla para continuar"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Hardware biométrico no disponible"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autenticación cancelada"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Huella digital no reconocida"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Huella digital no reconocida"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"No se reconoce la cara. Usa la huella digital."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Se ha autenticado la huella digital"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Cara autenticada"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Se ha autenticado la cara, pulsa para confirmar"</string>
@@ -1376,7 +1375,7 @@
<string name="usb_unsupported_audio_accessory_title" msgid="2335775548086533065">"Se ha detectado un accesorio de audio analógico"</string>
<string name="usb_unsupported_audio_accessory_message" msgid="1300168007129796621">"El dispositivo adjunto no es compatible con este teléfono. Toca para obtener más información."</string>
<string name="adb_active_notification_title" msgid="408390247354560331">"Depuración por USB activa"</string>
- <string name="adb_active_notification_message" msgid="5617264033476778211">"Toca para desactivar depuración USB"</string>
+ <string name="adb_active_notification_message" msgid="5617264033476778211">"Toca para desactivar la depuración USB"</string>
<string name="adb_active_notification_message" product="tv" msgid="6624498401272780855">"Seleccionar para inhabilitar la depuración por USB"</string>
<string name="adbwifi_active_notification_title" msgid="6147343659168302473">"Depuración inalámbrica conectada"</string>
<string name="adbwifi_active_notification_message" msgid="930987922852867972">"Toca para desactivar la depuración inalámbrica"</string>
diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml
index 36ef583..3359447 100644
--- a/core/res/res/values-et/strings.xml
+++ b/core/res/res/values-et/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Biomeetria või ekraaniluku kasutamine"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Kinnitage oma isik"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Jätkamiseks kasutage biomeetriat"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Jätkamiseks kasutage oma sõrmejälge"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Jätkamiseks kasutage oma nägu"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Jätkamiseks kasutage oma biomeetrilisi andmeid või ekraanilukku"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biomeetriline riistvara ei ole saadaval"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autentimine tühistati"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Sõrmejälge ei tuvastatud"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Sõrmejälge ei tuvastatud"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Nägu ei õnnestu tuvastada. Kasutage sõrmejälge."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Sõrmejälg autenditi"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Nägu on autenditud"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Nägu on autenditud, vajutage käsku Kinnita"</string>
diff --git a/core/res/res/values-eu/strings.xml b/core/res/res/values-eu/strings.xml
index bd0a045..c2ef534 100644
--- a/core/res/res/values-eu/strings.xml
+++ b/core/res/res/values-eu/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Erabili sistema biometrikoak edo pantailaren blokeoa"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Egiaztatu zeu zarela"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Aurrera egiteko, erabili sistema biometrikoak"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Aurrera egiteko, erabili hatz-marka"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Aurrera egiteko, erabili aurpegia"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Aurrera egiteko, erabili sistema biometrikoak edo pantailaren blokeoa"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Hardware biometrikoa ez dago erabilgarri"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Utzi da autentifikazioa"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Ez da ezagutu hatz-marka"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Ez da ezagutu hatz-marka"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Ezin da hauteman aurpegia. Erabili hatz-marka."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Autentifikatu da hatz-marka"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Autentifikatu da aurpegia"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Autentifikatu da aurpegia; sakatu Berretsi"</string>
@@ -2331,11 +2330,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Aurreko planoko zerbitzuak atzeko planotik abiarazteko baimena ematen die aplikazio osagarriei."</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Erabilgarri dago mikrofonoa"</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Blokeatuta dago mikrofonoa"</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Bi pantailako modua"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Bi pantailako modua aktibatuta dago"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual Screen aktibatuta dago"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> bi pantailak erabiltzen ari da edukia erakusteko"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Gailua beroegi dago"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Bi pantailako modua ez dago erabilgarri telefonoa berotzen ari delako"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen ez dago erabilgarri telefonoa berotzen ari delako"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen ez dago erabilgarri"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Dual Screen ez dago erabilgarri, bateria-aurreztailea aktibatuta dagoelako. Aukera hori desaktibatzeko, joan ezarpenetara."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Joan Ezarpenak atalera"</string>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 2a5f064..3841eaa 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"استفاده از زیستسنجشی یا قفل صفحه"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"تأیید کنید این شمایید"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"برای ادامه، از زیستسنجشی استفاده کنید"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"برای ادامه، از اثر انگشتتان استفاده کنید"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"برای ادامه، از چهرهتان استفاده کنید"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"برای ادامه، از زیستسنجشی یا قفل صفحه استفاده کنید"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"سختافزار زیستسنجی دردسترس نیست"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"اصالتسنجی لغو شد"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"اثر انگشت تشخیص داده نشد"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"اثر انگشت تشخیص داده نشد"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"چهره شناسایی نشد. درعوض از اثر انگشت استفاده کنید."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"اثر انگشت اصالتسنجی شد"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"چهره اصالتسنجی شد"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"چهره اصالتسنجی شد، لطفاً تأیید را فشار دهید"</string>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index 16c864c..5c9f0e4 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Käytä biometriikkaa tai näytön lukitusta"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Vahvista henkilöllisyytesi"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Jatka käyttämällä biometriikkaa"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Jatka sormenjäljen avulla"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Jatka kasvojen avulla"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Jatka biometriikan tai näytön lukituksen avulla"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrinen laitteisto ei käytettävissä"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Todennus peruutettu"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Sormenjälkeä ei tunnistettu"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Sormenjälkeä ei tunnistettu"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Kasvoja ei voi tunnistaa. Käytä sormenjälkeä."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Sormenjälki tunnistettu"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Kasvot tunnistettu"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Kasvot tunnistettu, valitse Vahvista"</string>
diff --git a/core/res/res/values-fr-rCA/strings.xml b/core/res/res/values-fr-rCA/strings.xml
index 60575ad..9b0c536 100644
--- a/core/res/res/values-fr-rCA/strings.xml
+++ b/core/res/res/values-fr-rCA/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Utiliser les données biométriques ou le verrouillage de l\'écran"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Confirmez que c\'est vous"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Utilisez votre méthode d\'authentification biométrique pour continuer"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Utilisez votre empreinte digitale pour continuer"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Utilisez votre visage pour continuer"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Utilisez vos données biométriques ou le verrouillage de l\'écran pour continuer"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Matériel biométrique indisponible"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Authentification annulée"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Empreinte digitale non reconnue"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Empreinte digitale non reconnue"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Visage non reconnu. Utilisez plutôt l\'empreinte digitale."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Empreinte digitale authentifiée"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Visage authentifié"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Visage authentifié, veuillez appuyer sur le bouton Confirmer"</string>
@@ -2332,11 +2331,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Permet à une application compagnon en arrière-plan de lancer des services d\'avant-plan."</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Le microphone est accessible"</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Le microphone est bloqué"</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Double écran"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Le double écran est activé"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual Screen activé"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> utilise les deux écrans pour afficher le contenu"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"L\'appareil est trop chaud"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Le double écran n\'est pas accessible, car votre téléphone est trop chaud"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen n\'est pas accessible, car votre téléphone est trop chaud"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"La fonctionnalité Dual Screen n\'est pas accessible"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"La fonctionnalité Dual Screen n\'est pas accessible, car l\'économiseur de pile est activé. Vous pouvez désactiver cette option dans les paramètres."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Accéder aux paramètres"</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index 0edaac5..f5f4316 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Utiliser la biométrie ou le verrouillage de l\'écran"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Confirmez votre identité"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Utilisez la biométrie pour continuer"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Utilisez votre empreinte digitale pour continuer"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Utilisez la reconnaissance faciale pour continuer"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Utilisez la biométrie ou le verrouillage de l\'écran pour continuer"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Matériel biométrique indisponible"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Authentification annulée"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Empreinte digitale non reconnue"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Empreinte digitale non reconnue"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Visage non reconnu. Utilisez votre empreinte."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Empreinte digitale authentifiée"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Visage authentifié"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Visage authentifié, veuillez appuyer sur \"Confirmer\""</string>
diff --git a/core/res/res/values-gl/strings.xml b/core/res/res/values-gl/strings.xml
index e672b2f..ef6d317 100644
--- a/core/res/res/values-gl/strings.xml
+++ b/core/res/res/values-gl/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Utilizar desbloqueo biométrico ou credencial do dispositivo"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verifica que es ti"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Para continuar, utiliza o desbloqueo biométrico"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Usa a impresión dixital para continuar"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Usa o recoñecemento facial para continuar"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Para continuar, utiliza o desbloqueo biométrico ou o bloqueo de pantalla"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"O hardware biométrico non está dispoñible"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Cancelouse a autenticación"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Non se recoñeceu a impresión dixital"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Non se recoñeceu a impresión dixital"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Non se recoñeceu a cara. Usa a impresión dixital."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Autenticouse a impresión dixital"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Autenticouse a cara"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Autenticouse a cara, preme Confirmar"</string>
diff --git a/core/res/res/values-gu/strings.xml b/core/res/res/values-gu/strings.xml
index 05c839b..1f1bc51 100644
--- a/core/res/res/values-gu/strings.xml
+++ b/core/res/res/values-gu/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"બાયોમેટ્રિક્સ અથવા સ્ક્રીન લૉકનો ઉપયોગ કરો"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"તે તમે જ છો એ ચકાસો"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"આગળ વધવા માટે બાયોમેટ્રિકનો ઉપયોગ કરો"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"ચાલુ રાખવા માટે તમારી ફિંગરપ્રિન્ટનો ઉપયોગ કરો"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"ચાલુ રાખવા માટે તમારા ચહેરાનો ઉપયોગ કરો"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"ચાલુ રાખવા માટે તમારા બાયોમેટ્રિક ડેટા અથવા સ્ક્રીન લૉક સુવિધાનો ઉપયોગ કરો"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"બાયોમેટ્રિક હાર્ડવેર ઉપલબ્ધ નથી"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"પ્રમાણીકરણ રદ કર્યું"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"ફિંગરપ્રિન્ટ ઓળખી શકાઈ નથી"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"ફિંગરપ્રિન્ટ ઓળખી શકાઈ નથી"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"ચહેરો ઓળખી શકતા નથી. તેને બદલે ફિંગરપ્રિન્ટ વાપરો."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"ફિંગરપ્રિન્ટ પ્રમાણિત કરી"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"ચહેરા પ્રમાણિત"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"ચહેરા પ્રમાણિત, કૃપા કરીને કન્ફર્મ કરો"</string>
@@ -2335,9 +2334,9 @@
<string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual screen ચાલુ છે"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"કન્ટેન્ટ બતાવવા માટે <xliff:g id="APP_NAME">%1$s</xliff:g> બન્ને ડિસ્પ્લેનો ઉપયોગ કરી રહી છે"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"ડિવાઇસ ખૂબ જ ગરમ છે"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"ડ્યૂઅલ સ્ક્રીન અનુપલબ્ધ છે કારણ કે તમારો ફોન ખૂબ જ ગરમ થઈ રહ્યો છે"</string>
- <string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"ડ્યૂઅલ સ્ક્રીન અનુપલબ્ધ છે"</string>
- <string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"બૅટરી સેવર ચાલુ હોવાને કારણે ડ્યૂઅલ સ્ક્રીન અનુપલબ્ધ છે. તમે સેટિંગમાં જઈને આને બંધ કરી શકો છો."</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen ઉપલબ્ધ નથી કારણ કે તમારો ફોન ખૂબ જ ગરમ થઈ રહ્યો છે"</string>
+ <string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen ઉપલબ્ધ નથી"</string>
+ <string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"બૅટરી સેવર ચાલુ હોવાને કારણે Dual Screen ઉપલબ્ધ નથી. તમે સેટિંગમાં જઈને આને બંધ કરી શકો છો."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"સેટિંગ પર જાઓ"</string>
<string name="device_state_notification_turn_off_button" msgid="6327161707661689232">"બંધ કરો"</string>
<string name="keyboard_layout_notification_selected_title" msgid="1202560174252421219">"<xliff:g id="DEVICE_NAME">%s</xliff:g>ની ગોઠવણી કરવામાં આવી છે"</string>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index 888fc0f..01dec74 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"बायोमेट्रिक्स या स्क्रीन लॉक का क्रेडेंशियल इस्तेमाल करें"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"अपनी पहचान की पुष्टि करें"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"जारी रखने के लिए, बायोमेट्रिक्स इस्तेमाल करें"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"जारी रखने के लिए, अपने फ़िंगरप्रिंट की मदद से पहचान की पुष्टि करें"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"जारी रखने के लिए, अपने चेहरा की मदद से पहचान की पुष्टि करें"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"जारी रखने के लिए, बायोमेट्रिक या स्क्रीन लॉक क्रेडेंशियल डालकर पुष्टि करें"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"बायोमेट्रिक हार्डवेयर उपलब्ध नहीं है"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"प्रमाणीकरण रद्द किया गया"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"फ़िंगरप्रिंट की पहचान नहीं हो पाई"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"फ़िंगरप्रिंट की पहचान नहीं हो पाई"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"चेहरे की पहचान नहीं हुई. फ़िंगरप्रिंट इस्तेमाल करें."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"फ़िंगरप्रिंट की पुष्टि हो गई"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"चेहरे की पहचान की गई"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"चेहरे की पहचान की गई, कृपया पुष्टि बटन दबाएं"</string>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index 2e1b8ad..c1d7a23 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Upotreba biometrijske autentifikacije ili zaključavanja zaslona"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Potvrdite da ste to vi"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Upotrijebite svoju biometrijsku autentifikaciju da biste nastavili"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Za nastavak upotrijebite otisak prsta"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Za nastavak se identificirajte licem"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Za nastavak se identificirajte biometrijski ili vjerodajnicom zaključavanja zaslona"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrijski hardver nije dostupan"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autentifikacija otkazana"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Otisak prsta nije prepoznat"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Otisak prsta nije prepoznat"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Prepoznavanje lica nije uspjelo. Upotrijebite otisak prsta."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Autentificirano otiskom prsta"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Lice je autentificirano"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Lice je autentificirano, pritisnite Potvrdi"</string>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index bdf81a5..75e1ee2 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"A folytatás biometriai feloldással vagy képernyőzárral lehetséges"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Igazolja, hogy Ön az"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"A folytatás biometriai feloldással lehetséges"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"A folytatáshoz használja ujjlenyomatát"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"A folytatáshoz használja az arcalapú feloldást"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"A folytatás biometriai feloldással vagy a képernyőzár feloldásával lehetséges"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrikus hardver nem áll rendelkezésre"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Hitelesítés megszakítva"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Az ujjlenyomat nem ismerhető fel"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Az ujjlenyomat nem ismerhető fel"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Az arc nem felismerhető. Használjon ujjlenyomatot."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Ujjlenyomat hitelesítve"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Arc hitelesítve"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Arc hitelesítve; nyomja meg a Megerősítés lehetőséget"</string>
diff --git a/core/res/res/values-hy/strings.xml b/core/res/res/values-hy/strings.xml
index 6eec876..b2e1230 100644
--- a/core/res/res/values-hy/strings.xml
+++ b/core/res/res/values-hy/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Օգտագործել կենսաչափական համակարգեր կամ էկրանի կողպում"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Հաստատեք ձեր ինքնությունը"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Շարունակելու համար օգտագործեք կենսաչափական համակարգեր"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Շարունակելու համար օգտագործեք ձեր մատնահետքը"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Շարունակելու համար օգտագործեք դեմքով իսկորոշումը"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Շարունակելու համար օգտագործեք ձեր կենսաչափական տվյալները կամ էկրանի կողպումը"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Կենսաչափական սարքը հասանելի չէ"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Նույնականացումը չեղարկվեց"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Մատնահետքը չի ճանաչվել"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Մատնահետքը չի ճանաչվել"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Դեմքը չի հաջողվում ճանաչել։ Օգտագործեք մատնահետքը։"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Մատնահետքը նույնականացվեց"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Դեմքը ճանաչվեց"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Դեմքը ճանաչվեց: Սեղմեք «Հաստատել»:"</string>
@@ -2331,11 +2330,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Թույլատրում է ուղեկցող հավելվածին ակտիվ ծառայություններ գործարկել ֆոնային ռեժիմից։"</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Խոսափողը հասանելի է"</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Խոսափողն արգելափակված է"</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Կրկնակի էկրան"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Կրկնակի էկրանը միացված է"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual Screen-ը միացված է"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> հավելվածն օգտագործում է երկու էկրանները"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Սարքը գերտաքացել է"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Կրկնակի էկրանն անհասանելի է, քանի որ ձեր հեռախոսը գերտաքանում է"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen-ն անհասանելի է, քանի որ ձեր հեռախոսը գերտաքանում է"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen-ը հասանելի չէ"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Dual Screen-ն անհասանելի է, քանի որ Մարտկոցի տնտեսումը միացված է։ Դուք կարող եք անջատել այս գործառույթը Կարգավորումներում։"</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Անցնել Կարգավորումներ"</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index e65d8e3..f0c8b10 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Gunakan biometrik atau kunci layar"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verifikasi bahwa ini memang Anda"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Gunakan biometrik untuk melanjutkan"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Gunakan sidik jari untuk melanjutkan"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Gunakan wajah untuk melanjutkan"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Gunakan biometrik atau kunci layar untuk melanjutkan"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Hardware biometrik tidak tersedia"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autentikasi dibatalkan"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Sidik jari tidak dikenali"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Sidik jari tidak dikenali"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Tidak dapat mengenali wajah. Gunakan sidik jari."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Sidik jari diautentikasi"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Wajah diautentikasi"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Wajah diautentikasi, silakan tekan konfirmasi"</string>
@@ -2331,11 +2330,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Mengizinkan aplikasi pendamping memulai layanan latar depan dari latar belakang."</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Mikrofon tersedia"</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Mikrofon diblokir"</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Layar ganda"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
<string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual screen aktif"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> menggunakan kedua layar untuk menampilkan konten"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Suhu perangkat terlalu panas"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Layar ganda tidak tersedia karena suhu ponsel terlalu panas"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen tidak tersedia karena suhu ponsel terlalu panas"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen tidak tersedia"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Dual Screen tidak tersedia karena Penghemat Baterai aktif. Anda dapat menonaktifkannya di Setelan."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Buka Setelan"</string>
diff --git a/core/res/res/values-is/strings.xml b/core/res/res/values-is/strings.xml
index e904c43..7584d1c 100644
--- a/core/res/res/values-is/strings.xml
+++ b/core/res/res/values-is/strings.xml
@@ -296,9 +296,9 @@
<string name="foreground_service_multiple_separator" msgid="5002287361849863168">"<xliff:g id="LEFT_SIDE">%1$s</xliff:g>, <xliff:g id="RIGHT_SIDE">%2$s</xliff:g>"</string>
<string name="safeMode" msgid="8974401416068943888">"Örugg stilling"</string>
<string name="android_system_label" msgid="5974767339591067210">"Android kerfið"</string>
- <string name="user_owner_label" msgid="8628726904184471211">"Skipta yfir í eigið snið"</string>
+ <string name="user_owner_label" msgid="8628726904184471211">"Skipta yfir í einkasnið"</string>
<string name="managed_profile_label" msgid="7316778766973512382">"Skipta yfir í vinnusnið"</string>
- <string name="user_owner_app_label" msgid="1553595155465750298">"Skipta yfir í eigið snið <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
+ <string name="user_owner_app_label" msgid="1553595155465750298">"Skipta yfir í einkasnið <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
<string name="managed_profile_app_label" msgid="367401088383965725">"Skipta yfir í vinnusnið <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
<string name="permgrouplab_contacts" msgid="4254143639307316920">"Tengiliðir"</string>
<string name="permgroupdesc_contacts" msgid="9163927941244182567">"fá aðgang að tengiliðunum þínum"</string>
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Nota lífkenni eða skjálás"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Staðfestu hver þú ert"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Notaðu lífkenni til að halda áfram"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Notaðu fingrafarið til að halda áfram"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Notaðu andlitið til að halda áfram"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Notaðu lífkenni eða skjálás til að halda áfram"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Lífkennavélbúnaður ekki tiltækur"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Hætt við auðkenningu"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Fingrafar þekkist ekki"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Fingrafar þekkist ekki"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Andlit þekkist ekki. Notaðu fingrafar í staðinn."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Fingrafar staðfest"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Andlit staðfest"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Andlit staðfest, ýttu til að staðfesta"</string>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index 66ee832..ac0c7df 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Usa la biometria o il blocco schermo"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verifica la tua identità"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Usa la biometria per continuare"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Utilizza la tua impronta per continuare"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Usa il tuo volto per continuare"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Per continuare devi usare i tuoi dati biometrici o il tuo blocco schermo"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Hardware biometrico non disponibile"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autenticazione annullata"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Impronta non riconosciuta"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Impronta non riconosciuta"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Impossibile riconoscere il volto. Usa l\'impronta."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Impronta autenticata"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Volto autenticato"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Volto autenticato, premi Conferma"</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index 16b2d17..a17e989 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"שימוש במידע ביומטרי בנעילת מסך"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"אימות הזהות שלך"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"יש להשתמש במידע ביומטרי כדי להמשיך"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"צריך להשתמש בטביעת האצבע כדי להמשיך"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"צריך להשתמש בזיהוי הפנים כדי להמשיך"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"יש להשתמש במידע הביומטרי או בנעילת המסך כדי להמשיך"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"חומרה ביומטרית לא זמינה"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"האימות בוטל"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"טביעת האצבע לא זוהתה"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"טביעת האצבע לא זוהתה"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"לא ניתן לזהות את הפנים. יש להשתמש בטביעת אצבע במקום."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"טביעת האצבע אומתה"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"זיהוי הפנים בוצע"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"זיהוי הפנים בוצע. יש ללחוץ על אישור"</string>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index d606468..3065202 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"生体認証または画面ロックの使用"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"本人確認"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"続行するには生体認証を使用してください"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"続行するには指紋認証を使用してください"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"続行するには顔認証を使用してください"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"続行するには、生体認証または画面ロックを使用してください"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"生体認証ハードウェアが利用できません"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"認証をキャンセルしました"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"指紋を認識できません"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"指紋を認識できません"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"顔を認識できません。指紋認証を使用してください。"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"指紋認証を完了しました"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"顔を認証しました"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"顔を認証しました。[確認] を押してください"</string>
diff --git a/core/res/res/values-ka/strings.xml b/core/res/res/values-ka/strings.xml
index 2badd0a..dd7aff7 100644
--- a/core/res/res/values-ka/strings.xml
+++ b/core/res/res/values-ka/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"გამოიყენეთ ბიომეტრიული სისტემა ან ეკრანის დაბლოკვა"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"დაადასტურეთ ვინაობა"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"გასაგრძელებლად გამოიყენეთ თქვენი ბიომეტრიული მონაცემები"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"გასაგრძელებლად გამოიყენეთ თქვენი თითის ანაბეჭდი"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"გასაგრძელებლად გამოიყენეთ სახის ამოცნობა"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"გასაგრძელებლად გამოიყენეთ თქვენი ბიომეტრიული მონაცემები ან ეკრანის განბლოკვის ნიმუში"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"ბიომეტრიული აპარატურა მიუწვდომელია"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"ავტორიზაცია გაუქმდა"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"თითის ანაბეჭდის ამოცნობა ვერ მოხერხდა"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"თითის ანაბეჭდის ამოცნობა ვერ მოხერხდა"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"სახის ამოცნობა ვერ ხერხდება. სანაცვლოდ თითის ანაბეჭდი გამოიყენეთ."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"თითის ანაბეჭდი ავტორიზებულია"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"სახე ავტორიზებულია"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"სახე ავტორიზებულია, დააჭირეთ დადასტურებას"</string>
diff --git a/core/res/res/values-kk/strings.xml b/core/res/res/values-kk/strings.xml
index 0bb57f9..8cfc1c0 100644
--- a/core/res/res/values-kk/strings.xml
+++ b/core/res/res/values-kk/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Биометриканы немесе экран құлпын пайдалану"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Бұл сіз екеніңізді растаңыз"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Жалғастыру үшін биометрикаңызды пайдаланыңыз."</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Жалғастыру үшін саусақ ізін пайдаланыңыз."</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Жалғастыру үшін бетті анықтау функциясын пайдаланыңыз."</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Жалғастыру үшін биометриканы немесе экран құлпын пайдаланыңыз."</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Биометрикалық жабдық жоқ"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Аутентификациядан бас тартылды."</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Саусақ ізі танылмады."</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Саусақ ізі танылмады."</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Бет танылмады. Орнына саусақ ізін пайдаланыңыз."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Саусақ ізі аутентификацияланды"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Бет танылды"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Бет танылды, \"Растау\" түймесін басыңыз"</string>
@@ -2331,11 +2330,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Қосымша қолданбаға экрандық режимдегі қызметтерді фоннан іске қосуға рұқсат беріледі."</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Микрофон қолжетімді."</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Микрофон блокталған."</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Қос экран"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Қос экран функциясы қосулы"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual Screen функциясы қосулы"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> қолданбасы контентті көрсету үшін екі дисплейді де пайдаланады."</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Құрылғы қатты қызып кетті."</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Қос экран функциясы істемейді, себебі телефон қатты қызып кетеді."</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen функциясы істемейді, себебі телефон қатты қызып кетеді."</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen қолжетімсіз"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Батареяны үнемдеу режимі қосулы болғандықтан, Dual Screen қолжетімсіз. Мұны параметрлерден өшіруге болады."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Параметрлерге өту"</string>
diff --git a/core/res/res/values-km/strings.xml b/core/res/res/values-km/strings.xml
index 8cc3c64..db89e91 100644
--- a/core/res/res/values-km/strings.xml
+++ b/core/res/res/values-km/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"ប្រើជីវមាត្រ ឬការចាក់សោអេក្រង់"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"ផ្ទៀងផ្ទាត់ថាជាអ្នក"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"ប្រើជីវមាត្ររបស់អ្នក ដើម្បីបន្ត"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"ប្រើស្នាមម្រាមដៃរបស់អ្នក ដើម្បីបន្ត"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"ប្រើមុខរបស់អ្នក ដើម្បីបន្ត"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"ប្រើការចាក់សោអេក្រង់ ឬជីវមាត្ររបស់អ្នក ដើម្បីបន្ត"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"មិនអាចប្រើឧបករណ៍ស្កេនស្នាមម្រាមដៃបានទេ"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"បានបោះបង់ការផ្ទៀងផ្ទាត់"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"មិនស្គាល់ស្នាមម្រាមដៃទេ"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"មិនស្គាល់ស្នាមម្រាមដៃទេ"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"មិនអាចសម្គាល់មុខបានទេ។ សូមប្រើស្នាមម្រាមដៃជំនួសវិញ។"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"បានផ្ទៀងផ្ទាត់ស្នាមម្រាមដៃ"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"បានផ្ទៀងផ្ទាត់មុខ"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"បានផ្ទៀងផ្ទាត់មុខ សូមចុចបញ្ជាក់"</string>
diff --git a/core/res/res/values-kn/strings.xml b/core/res/res/values-kn/strings.xml
index a2a048c..73060eb 100644
--- a/core/res/res/values-kn/strings.xml
+++ b/core/res/res/values-kn/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"ಬಯೋಮೆಟ್ರಿಕ್ಸ್ ಅಥವಾ ಸ್ಕ್ರೀನ್ ಲಾಕ್ ಅನ್ನು ಬಳಸಿ"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"ಇದು ನೀವೇ ಎಂದು ಪರಿಶೀಲಿಸಿ"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"ಮುಂದುವರಿಸಲು ನಿಮ್ಮ ಬಯೋಮೆಟ್ರಿಕ್ ಬಳಸಿ"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"ಮುಂದುವರಿಸಲು ನಿಮ್ಮ ಫಿಂಗರ್ ಪ್ರಿಂಟ್ ಅನ್ನು ಬಳಸಿ"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"ಮುಂದುವರಿಸಲು ನಿಮ್ಮ ಮುಖವನ್ನು ಬಳಸಿ"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"ಮುಂದುವರಿಸಲು ನಿಮ್ಮ ಬಯೋಮೆಟ್ರಿಕ್ ಅಥವಾ ಸ್ಕ್ರೀನ್ ಲಾಕ್ ಅನ್ನು ಬಳಸಿ"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"ಬಯೋಮೆಟ್ರಿಕ್ ಹಾರ್ಡ್ವೇರ್ ಲಭ್ಯವಿಲ್ಲ"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"ಪ್ರಮಾಣೀಕರಣವನ್ನು ರದ್ದುಗೊಳಿಸಲಾಗಿದೆ"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"ಫಿಂಗರ್ಪ್ರಿಂಟ್ ಅನ್ನು ಗುರುತಿಸಲಾಗಿಲ್ಲ"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"ಫಿಂಗರ್ಪ್ರಿಂಟ್ ಅನ್ನು ಗುರುತಿಸಲಾಗಿಲ್ಲ"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"ಮುಖ ಗುರುತಿಸಲಾಗುತ್ತಿಲ್ಲ ಬದಲಿಗೆ ಫಿಂಗರ್ಪ್ರಿಂಟ್ ಬಳಸಿ."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"ಫಿಂಗರ್ಪ್ರಿಂಟ್ ಅನ್ನು ಪ್ರಮಾಣೀಕರಣ ಮಾಡಲಾಗಿದೆ"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"ಮುಖವನ್ನು ದೃಢೀಕರಿಸಲಾಗಿದೆ"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"ಮುಖವನ್ನು ದೃಢೀಕರಿಸಲಾಗಿದೆ, ದೃಢೀಕರಣವನ್ನು ಒತ್ತಿ"</string>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index 5b1dfd1..4fe36b6 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"생체 인식 또는 화면 잠금을 사용"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"본인 확인"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"생체 인식을 사용하여 계속하세요"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"계속하려면 지문을 인증하세요"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"계속하려면 얼굴로 인증하세요"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"계속하려면 생체 인식이나 화면 잠금을 사용하세요"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"생체 인식 하드웨어를 사용할 수 없음"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"인증이 취소되었습니다."</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"지문이 인식되지 않았습니다."</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"지문을 인식할 수 없습니다."</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"얼굴을 인식할 수 없습니다. 대신 지문을 사용하세요."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"지문이 인증됨"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"얼굴이 인증되었습니다"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"얼굴이 인증되었습니다. 확인을 누르세요"</string>
diff --git a/core/res/res/values-ky/strings.xml b/core/res/res/values-ky/strings.xml
index f7852d8..763afb1 100644
--- a/core/res/res/values-ky/strings.xml
+++ b/core/res/res/values-ky/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Биометрикалык жөндөөнү же экрандын кулпусун колдонуу"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Өзүңүздү ырастаңыз"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Улантуу үчүн биометрикалык жөндөөнү колдонуу"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Улантуу үчүн манжаңызды сканерге тийгизиңиз"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Улантуу үчүн жүзүңүздү көрсөтүңүз"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Улантуу үчүн биометрикалык маалыматты же экрандын кулпусун колдонуңуз"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Биометрикалык аппарат жеткиликсиз"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Аныктыгын текшерүү жокко чыгарылды"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Манжа изи таанылган жок"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Манжа изи таанылган жок"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Жүз таанылбай жатат. Манжа изин колдонуңуз."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Манжа изи текшерилди"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Жүздүн аныктыгы текшерилди"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Жүздүн аныктыгы текшерилди, эми \"Ырастоону\" басыңыз"</string>
diff --git a/core/res/res/values-lo/strings.xml b/core/res/res/values-lo/strings.xml
index 68f4acf..c57d386 100644
--- a/core/res/res/values-lo/strings.xml
+++ b/core/res/res/values-lo/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"ໃຊ້ລະບົບຊີວະມິຕິ ຫຼື ການລັອກໜ້າຈໍ"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"ຢັ້ງຢືນວ່າແມ່ນທ່ານ"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"ໃຊ້ລະບົບຊີວະມິຕິຂອງທ່ານເພື່ອດຳເນີນການຕໍ່"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"ໃຊ້ລາຍນິ້ວມືຂອງທ່ານເພື່ອສືບຕໍ່"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"ໃຊ້ໃບໜ້າຂອງທ່ານເພື່ອສືບຕໍ່"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"ໃຊ້ລະບົບຊີວະມິຕິ ຫຼື ການລັອກໜ້າຈໍຂອງທ່ານເພື່ອດຳເນີນການຕໍ່"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"ຮາດແວຊີວະມິຕິບໍ່ສາມາດໃຊ້ໄດ້"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"ຍົກເລີກການຮັບຮອງຄວາມຖືກຕ້ອງແລ້ວ"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"ບໍ່ຮູ້ຈັກລາຍນິ້ວມື"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"ບໍ່ຮູ້ຈັກລາຍນິ້ວມື"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"ບໍ່ສາມາດຈຳແນກໜ້າໄດ້. ກະລຸນາໃຊ້ລາຍນິ້ວມືແທນ."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"ພິສູດຢືນຢັນລາຍນິ້ວມືແລ້ວ"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"ພິສູດຢືນຢັນໃບໜ້າແລ້ວ"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"ພິສູດຢືນຢັນໃບໜ້າແລ້ວ, ກະລຸນາກົດຢືນຢັນ"</string>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index fca59f8..ed12059 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -620,8 +620,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Naudoti biometrinius duomenis arba ekrano užraktą"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Patvirtinkite, kad tai jūs"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Norėdami tęsti, naudokite biometrinius duomenis"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Jei norite tęsti, naudokite piršto atspaudą"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Jei norite tęsti, naudokite veido atpažinimo funkciją"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Jei norite tęsti, naudokite biometrinius duomenis arba ekrano užraktą"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrinė aparatinė įranga nepasiekiama"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autentifikavimas atšauktas"</string>
@@ -647,6 +645,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Piršto atspaudas neatpažintas"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Piršto atspaudas neatpažintas"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Veidas neatpažintas. Naudokite kontrolinį kodą."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Piršto antspaudas autentifikuotas"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Veidas autentifikuotas"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Veidas autentifikuotas, paspauskite patvirtinimo mygtuką"</string>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index 563d206..a2380d9 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Biometrijas vai ekrāna bloķēšanas izmantošana"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Apstipriniet, ka tas esat jūs"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Lai turpinātu, izmantojiet biometriju"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Izmantojiet pirksta nospiedumu, lai turpinātu"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Izmantojiet autorizāciju pēc sejas, lai turpinātu"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Izmantojiet biometrijas datus vai ekrāna bloķēšanas opciju, lai turpinātu"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrisko datu aparatūra nav pieejama"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autentifikācija ir atcelta"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Pirksta nospiedums netika atpazīts"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Pirksta nospiedums netika atpazīts"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Nevar atpazīt seju. Lietojiet pirksta nospiedumu."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Pirksta nospiedums tika autentificēts."</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Seja autentificēta"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Seja ir autentificēta. Nospiediet pogu Apstiprināt."</string>
@@ -2332,13 +2331,13 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Ļauj palīglietotnei sākt priekšplāna pakalpojumus no fona."</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Mikrofons ir pieejams."</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Mikrofons ir bloķēts."</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Divu ekrānu režīms"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Ieslēgts divu ekrānu režīms"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen režīms"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Ieslēgts Dual Screen režīms"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> satura rādīšanai izmanto abus displejus."</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Ierīce ir pārāk sakarsusi"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Divu ekrānu režīms nav pieejams, jo tālrunis sāk pārāk sakarst."</string>
- <string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Divu ekrānu režīms nav pieejams"</string>
- <string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Divu ekrānu režīms nav pieejams, jo ir ieslēgts akumulatora enerģijas taupīšanas režīms. To var izslēgt iestatījumos."</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen režīms nav pieejams, jo tālrunis sāk pārāk sakarst."</string>
+ <string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen režīms nav pieejams"</string>
+ <string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Dual Screen režīms nav pieejams, jo ir ieslēgts akumulatora enerģijas taupīšanas režīms. To var izslēgt iestatījumos."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Atvērt iestatījumus"</string>
<string name="device_state_notification_turn_off_button" msgid="6327161707661689232">"Izslēgt"</string>
<string name="keyboard_layout_notification_selected_title" msgid="1202560174252421219">"<xliff:g id="DEVICE_NAME">%s</xliff:g> ir konfigurēta"</string>
diff --git a/core/res/res/values-mk/strings.xml b/core/res/res/values-mk/strings.xml
index 678d167..0eb3927 100644
--- a/core/res/res/values-mk/strings.xml
+++ b/core/res/res/values-mk/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Користи биометрика или заклучен екран"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Потврдете дека сте вие"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Користете ја вашата биометрика за да продолжите"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Користете го отпечатокот за да продолжите"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Користете го вашиот лик за да продолжите"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Користете ја вашата биометрика или заклучување екран за да продолжите"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Биометрискиот хардвер е недостапен"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Проверката е откажана"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Отпечатокот не е препознаен"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Отпечатокот не е препознаен"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Не се препознава ликот. Користете отпечаток."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Отпечатокот е проверен"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Лицето е проверено"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Лицето е проверено, притиснете го копчето „Потврди“"</string>
diff --git a/core/res/res/values-ml/strings.xml b/core/res/res/values-ml/strings.xml
index c2bce63c..e550bdd 100644
--- a/core/res/res/values-ml/strings.xml
+++ b/core/res/res/values-ml/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"ബയോമെട്രിക്സ് അല്ലെങ്കിൽ സ്ക്രീൻ ലോക്ക് ഉപയോഗിക്കുക"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"ഇത് നിങ്ങളാണെന്ന് പരിശോധിച്ചുറപ്പിക്കുക"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"തുടരാൻ ബയോമെട്രിക് ഉപയോഗിക്കുക"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"തുടരാൻ നിങ്ങളുടെ ഫിംഗർപ്രിന്റ് ഉപയോഗിക്കുക"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"തുടരാൻ നിങ്ങളുടെ മുഖം ഉപയോഗിക്കുക"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"തുടരാൻ നിങ്ങളുടെ ബയോമെട്രിക് അല്ലെങ്കിൽ സ്ക്രീൻ ലോക്ക് ഉപയോഗിക്കുക"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"ബയോമെട്രിക് ഹാർഡ്വെയർ ലഭ്യമല്ല"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"പരിശോധിച്ചുറപ്പിക്കൽ റദ്ദാക്കി"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"ഫിംഗർപ്രിന്റ് തിരിച്ചറിഞ്ഞില്ല"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"ഫിംഗർപ്രിന്റ് തിരിച്ചറിഞ്ഞില്ല"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"മുഖം തിരിച്ചറിയാനായില്ല. പകരം ഫിംഗർപ്രിന്റ് ഉപയോഗിക്കൂ."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"ഫിംഗർപ്രിന്റ് പരിശോധിച്ചുറപ്പിച്ചു"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"മുഖം പരിശോധിച്ചുറപ്പിച്ചു"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"മുഖം പരിശോധിച്ചുറപ്പിച്ചു, സ്ഥിരീകരിക്കുക അമർത്തുക"</string>
diff --git a/core/res/res/values-mn/strings.xml b/core/res/res/values-mn/strings.xml
index 0ea1b08..5205d1e 100644
--- a/core/res/res/values-mn/strings.xml
+++ b/core/res/res/values-mn/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Биометр эсвэл дэлгэцийн түгжээ ашиглах"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Өөрийгөө мөн гэдгийг баталгаажуулаарай"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Үргэлжлүүлэхийн тулд биометрээ ашиглана уу"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Үргэлжлүүлэхийн тулд хурууныхаа хээг ашиглана уу"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Үргэлжлүүлэхийн тулд царайгаа ашиглана уу"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Үргэлжлүүлэхийн тулд биометр эсвэл дэлгэцийн түгжээгээ ашиглана уу"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Биометрийн техник хангамж боломжгүй байна"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Нотолгоог цуцаллаа"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Хурууны хээг таньсангүй"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Хурууны хээг таньсангүй"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Царай таних боломжгүй. Оронд нь хурууны хээ ашигла"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Хурууны хээг нотолсон"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Царайг баталгаажууллаа"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Царайг баталгаажууллаа. Баталгаажуулах товчлуурыг дарна уу"</string>
diff --git a/core/res/res/values-mr/strings.xml b/core/res/res/values-mr/strings.xml
index ff2e089..c469e36 100644
--- a/core/res/res/values-mr/strings.xml
+++ b/core/res/res/values-mr/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"बायोमेट्रिक किंवा स्क्रीन लॉक वापरा"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"हे तुम्हीच आहात याची पडताळणी करा"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"पुढे सुरू ठेवण्यासाठी तुमचे बायोमेट्रिक वापरा"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"पुढे सुरू ठेवण्यासाठी तुमची फिंगरप्रिंट वापरा"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"पुढे सुरू ठेवण्यासाठी तुमचा चेहरा वापरा"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"पुढे सुरू ठेवण्यासाठी तुमचे बायोमेट्रिक किंवा स्क्रीन लॉक वापरा"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"बायोमेट्रिक हार्डवेअर उपलब्ध नाही"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"ऑथेंटिकेशन रद्द केले"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"फिंगरप्रिंट ओळखली नाही"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"फिंगरप्रिंट ओळखली नाही"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"चेहरा ओळखू शकत नाही. त्याऐवजी फिंगरप्रिंट वापरा."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"फिंगरप्रिंट ऑथेंटिकेट केली आहे"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"चेहरा ऑथेंटिकेशन केलेला आहे"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"चेहरा ऑथेंटिकेशन केलेला आहे, कृपया कंफर्म प्रेस करा"</string>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index e98caa6..6ee7721 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Gunakan biometrik atau kunci skrin"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Sahkan itu anda"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Gunakan biometrik anda untuk meneruskan"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Gunakan cap jari anda untuk teruskan"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Gunakan muka anda untuk teruskan"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Gunakan biometrik atau kunci skrin anda untuk meneruskan pengesahan"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Perkakasan biometrik tidak tersedia"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Pengesahan dibatalkan"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Cap jari tidak dikenali"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Cap jari tidak dikenali"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Tidak mengenali wajah. Gunakan cap jari."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Cap jari disahkan"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Wajah disahkan"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Wajah disahkan, sila tekan sahkan"</string>
diff --git a/core/res/res/values-my/strings.xml b/core/res/res/values-my/strings.xml
index d673904..51cf285 100644
--- a/core/res/res/values-my/strings.xml
+++ b/core/res/res/values-my/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"ဇီဝမက်ထရစ်အချက်အလက်များ (သို့) ဖန်သားပြင်လော့ခ်ချခြင်းကို သုံးခြင်း"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"သင်ဖြစ်ကြောင်း အတည်ပြုပါ"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"ရှေ့ဆက်ရန် သင်၏ ဇီဝမက်ထရစ်အချက်အလက်ကို သုံးပါ"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"ရှေ့ဆက်ရန် သင့်လက်ဗွေကို သုံးပါ"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"ရှေ့ဆက်ရန် သင့်မျက်နှာကို သုံးပါ"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"ရှေ့ဆက်ရန် သင်၏ ဇီဝမက်ထရစ်အချက်အလက် (သို့) ဖန်သားပြင်လော့ခ်ကို သုံးပါ"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"ဇီဝအချက်အလက်သုံး ကွန်ပျူတာစက်ပစ္စည်း မရရှိနိုင်ပါ"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"အထောက်အထားစိစစ်ခြင်းကို ပယ်ဖျက်လိုက်သည်"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"လက်ဗွေကို မသိရှိပါ"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"လက်ဗွေကို မသိရှိပါ"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"မျက်နှာကို မမှတ်မိပါ။ လက်ဗွေကို အစားထိုးသုံးပါ။"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"လက်ဗွေကို အထောက်အထား စိစစ်ပြီးပါပြီ"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"မျက်နှာ အထောက်အထားစိစစ်ပြီးပြီ"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"မျက်နှာ အထောက်အထားစိစစ်ပြီးပြီ၊ အတည်ပြုရန်ကို နှိပ်ပါ"</string>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index 50bdebf..d48e831e 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Bruk biometri eller skjermlås"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Bekreft at det er deg"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Bruk biometri for å fortsette"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Bruk fingeravtrykket for å fortsette"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Bruk ansiktet for å fortsette"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Bruk biometri eller skjermlåsen for å fortsette"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrisk maskinvare er utilgjengelig"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autentiseringen er avbrutt"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Gjenkjenner ikke fingeravtrykket"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Gjenkjenner ikke fingeravtrykket"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Ansiktet gjenkjennes ikke. Bruk fingeravtrykk."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Fingeravtrykket er godkjent"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Ansiktet er autentisert"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Ansiktet er autentisert. Trykk på Bekreft"</string>
diff --git a/core/res/res/values-ne/strings.xml b/core/res/res/values-ne/strings.xml
index d95d750..65ea470 100644
--- a/core/res/res/values-ne/strings.xml
+++ b/core/res/res/values-ne/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"बायोमेट्रिक्स वा स्क्रिन लक प्रयोग गर्नुहोस्"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"यो व्यक्ति तपाईं नै हो भन्ने प्रमाणित गर्नुहोस्"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"जारी राख्न आफ्नो बायोमेट्रिक प्रयोग गर्नुहोस्"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"जारी राख्न आफ्नो फिंगरप्रिन्ट प्रयोग गर्नुहोस्"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"जारी राख्न आफ्नो अनुहार प्रयोग गर्नुहोस्"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"जारी राख्न आफ्नो बायोमेट्रिक वा स्क्रिन लक प्रयोग गरी पुष्टि गर्नुहोस्"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"बायोमेट्रिक हार्डवेयर उपलब्ध छैन"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"प्रमाणीकरण रद्द गरियो"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"फिंगरप्रिन्ट पहिचान गर्न सकिएन"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"फिंगरप्रिन्ट पहिचान गर्न सकिएन"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"अनुहार पहिचान गर्न सकिएन। बरु फिंगरप्रिन्ट प्रयोग गर्नुहोस्।"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"फिंगरप्रिन्ट प्रमाणीकरण गरियो"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"अनुहार प्रमाणीकरण गरियो"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"अनुहार प्रमाणीकरण गरियो, कृपया पुष्टि गर्नुहोस् थिच्नुहोस्"</string>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index 9b1e982..9a00d68 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Biometrische gegevens of schermvergrendeling gebruiken"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Je identiteit verifiëren"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Gebruik je biometrische gegevens om door te gaan"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Gebruik je vingerafdruk om door te gaan"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Gebruik je gezicht om door te gaan"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Gebruik je biometrische gegevens of schermvergrendeling om door te gaan"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrische hardware niet beschikbaar"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Verificatie geannuleerd"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Vingerafdruk niet herkend"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Vingerafdruk niet herkend"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Gezicht niet herkend. Gebruik je vingerafdruk."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Vingerafdruk geverifieerd"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Gezicht geverifieerd"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Gezicht geverifieerd. Druk op Bevestigen."</string>
@@ -2331,11 +2330,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Hiermee kan een bijbehorende app services op de voorgrond vanuit de achtergrond starten."</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Microfoon is beschikbaar"</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Microfoon is geblokkeerd"</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dubbel scherm"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dubbel scherm staat aan"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual Screen staat aan"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> gebruikt beide schermen om content te tonen"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Het apparaat is te warm"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dubbel scherm is niet beschikbaar, omdat je telefoon te warm wordt"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen is niet beschikbaar, omdat je telefoon te warm wordt"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen is niet beschikbaar"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Dual Screen is niet beschikbaar omdat Batterijbesparing aanstaat. Je kunt dit uitzetten via Instellingen."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Naar Instellingen"</string>
diff --git a/core/res/res/values-or/strings.xml b/core/res/res/values-or/strings.xml
index 3e8f9d4..5668e25 100644
--- a/core/res/res/values-or/strings.xml
+++ b/core/res/res/values-or/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"ବାୟୋମେଟ୍ରିକ୍ସ ବା ସ୍କ୍ରିନ୍ ଲକ୍ ବ୍ୟବହାର କରନ୍ତୁ"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"ଏହା ଆପଣ ବୋଲି ଯାଞ୍ଚ କରନ୍ତୁ"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"ଜାରି ରଖିବାକୁ ଆପଣଙ୍କ ବାୟୋମେଟ୍ରିକ୍ସ ବ୍ୟବହାର କରନ୍ତୁ"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"ଜାରି ରଖିବାକୁ ଆପଣଙ୍କ ଟିପଚିହ୍ନ ବ୍ୟବହାର କରନ୍ତୁ"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"ଜାରି ରଖିବାକୁ ଆପଣଙ୍କ ଫେସ ବ୍ୟବହାର କରନ୍ତୁ"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"ଜାରି ରଖିବାକୁ ଆପଣଙ୍କ ବାୟୋମେଟ୍ରିକ୍ କିମ୍ବା ସ୍କ୍ରିନ୍ ଲକ୍ ବ୍ୟବହାର କରନ୍ତୁ"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"ବାୟୋମେଟ୍ରିକ୍ ହାର୍ଡୱେର୍ ଉପଲବ୍ଧ ନାହିଁ"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"ପ୍ରାମାଣିକତାକୁ ବାତିଲ୍ କରାଯାଇଛି"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"ଟିପଚିହ୍ନ ଚିହ୍ନଟ ହେଲା ନାହିଁ"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"ଟିପଚିହ୍ନ ଚିହ୍ନଟ ହେଲା ନାହିଁ"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"ଫେସ୍ ଚିହ୍ନଟ କରିହେବ ନାହିଁ। ଟିପଚିହ୍ନ ବ୍ୟବହାର କରନ୍ତୁ।"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"ଟିପଚିହ୍ନ ପ୍ରମାଣିତ ହେଲା"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"ମୁହଁ ଚିହ୍ନଟ ହୋଇଛି"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"ମୁହଁ ଚିହ୍ନଟ ହୋଇଛି, ଦୟାକରି ସୁନିଶ୍ଚିତ ଦବାନ୍ତୁ"</string>
diff --git a/core/res/res/values-pa/strings.xml b/core/res/res/values-pa/strings.xml
index c287bf6..043c296 100644
--- a/core/res/res/values-pa/strings.xml
+++ b/core/res/res/values-pa/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"ਬਾਇਓਮੈਟ੍ਰਿਕ ਜਾਂ ਸਕ੍ਰੀਨ ਲਾਕ ਦੀ ਵਰਤੋਂ ਕਰੋ"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"ਆਪਣੀ ਪਛਾਣ ਦੀ ਪੁਸ਼ਟੀ ਕਰੋ"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"ਜਾਰੀ ਰੱਖਣ ਲਈ ਆਪਣੇ ਬਾਇਓਮੈਟ੍ਰਿਕ ਦੀ ਵਰਤੋਂ ਕਰੋ"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"ਜਾਰੀ ਰੱਖਣ ਲਈ ਆਪਣੇ ਫਿੰਗਰਪ੍ਰਿੰਟ ਦੀ ਵਰਤੋਂ ਕਰੋ"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"ਜਾਰੀ ਰੱਖਣ ਲਈ ਆਪਣੇ ਚਿਹਰੇ ਦੀ ਵਰਤੋਂ ਕਰੋ"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"ਜਾਰੀ ਰੱਖਣ ਲਈ ਆਪਣਾ ਬਾਇਓਮੈਟ੍ਰਿਕ ਜਾਂ ਸਕ੍ਰੀਨ ਲਾਕ ਵਰਤੋ"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"ਬਾਇਓਮੈਟ੍ਰਿਕ ਹਾਰਡਵੇਅਰ ਉਪਲਬਧ ਨਹੀਂ ਹੈ"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"ਪ੍ਰਮਾਣੀਕਰਨ ਰੱਦ ਕੀਤਾ ਗਿਆ"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"ਫਿੰਗਰਪ੍ਰਿੰਟ ਦੀ ਪਛਾਣ ਨਹੀਂ ਹੋਈ"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"ਫਿੰਗਰਪ੍ਰਿੰਟ ਦੀ ਪਛਾਣ ਨਹੀਂ ਹੋਈ"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"ਚਿਹਰਾ ਨਹੀਂ ਪਛਾਣ ਸਕਦੇ। ਇਸਦੀ ਬਜਾਏ ਫਿੰਗਰਪ੍ਰਿੰਟ ਵਰਤੋ।"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"ਫਿੰਗਰਪ੍ਰਿੰਟ ਪ੍ਰਮਾਣਿਤ ਹੋਇਆ"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"ਚਿਹਰਾ ਪੁਸ਼ਟੀਕਰਨ"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"ਚਿਹਰਾ ਪੁਸ਼ਟੀਕਰਨ, ਕਿਰਪਾ ਕਰਕੇ \'ਪੁਸ਼ਟੀ ਕਰੋ\' ਦਬਾਓ"</string>
@@ -2331,11 +2330,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"ਸੰਬੰਧੀ ਐਪ ਨੂੰ ਬੈਕਗ੍ਰਾਊਂਡ ਤੋਂ ਫੋਰਗ੍ਰਾਊਂਡ ਸੇਵਾਵਾਂ ਸ਼ੁਰੂ ਕਰਨ ਦੀ ਆਗਿਆ ਮਿਲਦੀ ਹੈ।"</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"ਮਾਈਕ੍ਰੋਫ਼ੋਨ ਉਪਲਬਧ ਹੈ"</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"ਮਾਈਕ੍ਰੋਫ਼ੋਨ ਬਲਾਕ ਕੀਤਾ ਗਿਆ ਹੈ"</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"ਦੋਹਰੀ ਸਕ੍ਰੀਨ"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"ਦੋਹਰੀ ਸਕ੍ਰੀਨ ਚਾਲੂ ਹੈ"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual Screen ਚਾਲੂ ਹੈ"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> ਸਮੱਗਰੀ ਨੂੰ ਦਿਖਾਉਣ ਲਈ ਦੋਵੇਂ ਡਿਸਪਲੇਆਂ ਦੀ ਵਰਤੋਂ ਕਰ ਰਹੀ ਹੈ"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"ਡੀਵਾਈਸ ਬਹੁਤ ਗਰਮ ਹੈ"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"ਦੋਹਰੀ ਸਕ੍ਰੀਨ ਵਿਸ਼ੇਸ਼ਤਾ ਉਪਲਬਧ ਨਹੀਂ ਹੈ ਕਿਉਂਕਿ ਤੁਹਾਡਾ ਫ਼ੋਨ ਬਹੁਤ ਗਰਮ ਹੋ ਰਿਹਾ ਹੈ"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen ਵਿਸ਼ੇਸ਼ਤਾ ਉਪਲਬਧ ਨਹੀਂ ਹੈ ਕਿਉਂਕਿ ਤੁਹਾਡਾ ਫ਼ੋਨ ਬਹੁਤ ਗਰਮ ਹੋ ਰਿਹਾ ਹੈ"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen ਵਿਸ਼ੇਸ਼ਤਾ ਉਪਲਬਧ ਨਹੀਂ ਹੈ"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Dual Screen ਵਿਸ਼ੇਸ਼ਤਾ ਉਪਲਬਧ ਨਹੀਂ ਹੈ ਕਿਉਂਕਿ ਬੈਟਰੀ ਸੇਵਰ ਚਾਲੂ ਹੈ। ਤੁਸੀਂ ਇਸਨੂੰ ਸੈਟਿੰਗਾਂ ਵਿੱਚ ਬੰਦ ਕਰ ਸਕਦੇ ਹੋ।"</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"ਸੈਟਿੰਗਾਂ \'ਤੇ ਜਾਓ"</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index cf2571b..709b067 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -620,8 +620,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Używaj biometrii lub blokady ekranu"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Potwierdź, że to Ty"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Użyj biometrii, by kontynuować"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Aby kontynuować, użyj odcisku palca"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Aby kontynuować, użyj rozpoznawania twarzy"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Aby kontynuować, użyj biometrii lub blokady ekranu"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Sprzęt biometryczny niedostępny"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Anulowano uwierzytelnianie"</string>
@@ -647,6 +645,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Nie rozpoznano odcisku palca"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Nie rozpoznano odcisku palca"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Nie rozpoznaję twarzy. Użyj odcisku palca."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Uwierzytelniono odciskiem palca"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Twarz rozpoznana"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Twarz rozpoznana, kliknij Potwierdź"</string>
@@ -2337,7 +2336,7 @@
<string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Włączono podwójny ekran"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"Aplikacja <xliff:g id="APP_NAME">%1$s</xliff:g> korzysta z obu wyświetlaczy, aby pokazać treści"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Urządzenie jest za ciepłe"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Podwójny ekran jest niedostępny, ponieważ telefon za bardzo się nagrzewa"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Funkcja Dual Screen jest niedostępna, ponieważ telefon za bardzo się nagrzewa"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Funkcja Dual Screen jest niedostępna"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Funkcja Dual Screen jest niedostępna, ponieważ włączono Oszczędzanie baterii. Możesz to wyłączyć w Ustawieniach."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Otwórz ustawienia"</string>
diff --git a/core/res/res/values-pt-rBR/strings.xml b/core/res/res/values-pt-rBR/strings.xml
index 2ca6ec7..eb6aaeb 100644
--- a/core/res/res/values-pt-rBR/strings.xml
+++ b/core/res/res/values-pt-rBR/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Usar biometria ou bloqueio de tela"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Confirme que é você"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Use seus dados biométricos para continuar"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Use sua impressão digital para continuar"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Use seu rosto para continuar"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Use sua autenticação biométrica ou o bloqueio de tela para continuar"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Hardware biométrico indisponível"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autenticação cancelada"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Impressão digital não reconhecida"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Impressão digital não reconhecida"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Não foi possível reconhecer o rosto Use a impressão digital."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Impressão digital autenticada"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Rosto autenticado"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Rosto autenticado, pressione \"Confirmar\""</string>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index 83da4b5..25a816c 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Usar a biometria ou o bloqueio de ecrã"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Confirme a sua identidade"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Utilize a biometria para continuar."</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Use a impressão digital para continuar"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Use o rosto para continuar"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Utilize a biometria ou o bloqueio de ecrã para continuar"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Hardware biométrico indisponível."</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autenticação cancelada"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Impressão digital não reconhecida"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Impressão digital não reconhecida"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Impos. reconh. rosto. Utilize a impressão digital."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"A impressão digital foi autenticada."</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Rosto autenticado."</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Rosto autenticado. Prima Confirmar."</string>
@@ -966,7 +965,7 @@
<string name="keyguard_password_wrong_pin_code" msgid="8583732939138432793">"Código PIN incorreto."</string>
<string name="keyguard_label_text" msgid="3841953694564168384">"Para desbloquear, prima Menu e, em seguida, 0."</string>
<string name="emergency_call_dialog_number_for_display" msgid="2978165477085612673">"Número de emergência"</string>
- <string name="lockscreen_carrier_default" msgid="6192313772955399160">"Sem rede móvel"</string>
+ <string name="lockscreen_carrier_default" msgid="6192313772955399160">"Sem dados"</string>
<string name="lockscreen_screen_locked" msgid="7364905540516041817">"Ecrã bloqueado."</string>
<string name="lockscreen_instructions_when_pattern_enabled" msgid="7982445492532123308">"Prima Menu para desbloquear ou efectuar uma chamada de emergência."</string>
<string name="lockscreen_instructions_when_pattern_disabled" msgid="7434061749374801753">"Prima Menu para desbloquear."</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index 2ca6ec7..eb6aaeb 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Usar biometria ou bloqueio de tela"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Confirme que é você"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Use seus dados biométricos para continuar"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Use sua impressão digital para continuar"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Use seu rosto para continuar"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Use sua autenticação biométrica ou o bloqueio de tela para continuar"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Hardware biométrico indisponível"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autenticação cancelada"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Impressão digital não reconhecida"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Impressão digital não reconhecida"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Não foi possível reconhecer o rosto Use a impressão digital."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Impressão digital autenticada"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Rosto autenticado"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Rosto autenticado, pressione \"Confirmar\""</string>
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index 345f67f..eca2eb3 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Folosește sistemele biometrice sau blocarea ecranului"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Confirmă-ți identitatea"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Folosește sistemele biometrice pentru a continua"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Folosește amprenta pentru a continua"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Folosește-ți chipul pentru a continua"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Folosește sistemele biometrice sau blocarea ecranului pentru a continua"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Hardware biometric indisponibil"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autentificarea a fost anulată"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Amprenta nu a fost recunoscută"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Amprenta nu a fost recunoscută"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Chipul nu a fost recunoscut. Folosește amprenta."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Amprentă autentificată"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Chip autentificat"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Chip autentificat, apasă pe Confirmă"</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index efebc8a..8326ba8 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -620,8 +620,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Использовать биометрию или блокировку экрана"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Подтвердите, что это вы"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Чтобы продолжить, используйте биометрические данные."</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Чтобы продолжить, прикоснитесь пальцем к сканеру."</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Чтобы продолжить, используйте фейсконтроль."</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Чтобы продолжить, используйте биометрию или данные для разблокировки экрана."</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Биометрическое оборудование недоступно"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Аутентификация отменена"</string>
@@ -647,6 +645,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Отпечаток не распознан."</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Отпечаток не распознан."</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Не удалось распознать лицо. Используйте отпечаток."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Отпечаток пальца проверен"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Лицо распознано"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Лицо распознано, нажмите кнопку \"Подтвердить\""</string>
@@ -2333,11 +2332,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Сопутствующее приложение сможет запускать активные службы из фонового режима."</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Микрофон доступен."</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Микрофон заблокирован."</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Двойной экран"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Двойной экран включен"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Функция Dual Screen включена"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> использует оба экрана."</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Устройство перегрелось"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Двойной экран недоступен из-за перегрева телефона."</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Функция Dual Screen недоступна из-за перегрева телефона."</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Функция Dual Screen недоступна"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Функция Dual Screen недоступна, так как включен режим энергосбережения. Вы можете отключить его в настройках."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Открыть настройки"</string>
diff --git a/core/res/res/values-si/strings.xml b/core/res/res/values-si/strings.xml
index 4a0b715..f81ff63 100644
--- a/core/res/res/values-si/strings.xml
+++ b/core/res/res/values-si/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"ජෛවමිතික හෝ තිර අගුල භාවිත කරන්න"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"එය ඔබ බව තහවුරු කරන්න"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"ඉදිරියට යාමට ඔබගේ ජෛවමිතික භාවිත කරන්න"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"ඉදිරියට යාමට ඔබේ ඇඟිලි සලකුණ භාවිත කරන්න"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"ඉදිරියට යාමට ඔබේ මුහුණ භාවිත කරන්න"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"ඉදිරියට යාමට ඔබගේ ජෛවමිතික හෝ තිර අගුල භාවිත කරන්න"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"ජීවමිතික දෘඪාංග ලබා ගත නොහැකිය"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"සත්යාපනය අවලංගු කළා"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"ඇඟිලි සලකුණ හඳුනා නොගන්නා ලදි"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"ඇඟිලි සලකුණ හඳුනා නොගන්නා ලදි"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"මුහුණ හැඳිනිය නොහැක. ඒ වෙනුවට ඇඟිලි සලකුණ භාවිත ක."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"ඇඟිලි සලකුණ සත්යාපනය කරන ලදී"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"මුහුණ සත්යාපනය කරන ලදී"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"මුහුණ සත්යාපනය කරන ලදී, කරුණාකර තහවුරු කරන්න ඔබන්න"</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index 0a1b1593..7bcf119 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -620,8 +620,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Použiť biometrické údaje alebo zámku obrazovky"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Overenie, že ste to vy"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Ak chcete pokračovať, použite biometrický údaj"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Pokračujte nasnímaním odtlačku prsta"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Pokračujte nasnímaním tváre"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Pokračujte použitím biometrických údajov alebo zámky obrazovky"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrický hardvér nie je k dispozícii"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Overenie bolo zrušené"</string>
@@ -647,6 +645,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Odtlačok prsta nebol rozpoznaný"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Odtlačok prsta nebol rozpoznaný"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Tvár sa nedá rozpoznať. Použite odtlačok prsta."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Odtlačok prsta bol overený"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Tvár bola overená"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Tvár bola overená, stlačte tlačidlo potvrdenia"</string>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index 00cf50b..2035979 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -620,8 +620,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Uporaba biometrike ali odklepanja s poverilnico"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Preverite, da ste res vi"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Za nadaljevanje uporabite biometrični podatek."</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Za nadaljevanje uporabite prstni odtis"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Za nadaljevanje uporabite obraz"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Za nadaljevanje uporabite biometrični podatek ali odklepanje s poverilnico."</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Strojna oprema za biometrične podatke ni na voljo"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Preverjanje pristnosti je preklicano"</string>
@@ -647,6 +645,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Prstni odtis ni prepoznan."</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Prstni odtis ni prepoznan."</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Obraza ni mogoče prepoznati. Uporabite prstni odtis."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Pristnost prstnega odtisa je preverjena"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Pristnost obraza je potrjena"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Pristnost obraza je preverjena. Pritisnite gumb »Potrdi«."</string>
diff --git a/core/res/res/values-sq/strings.xml b/core/res/res/values-sq/strings.xml
index 426b255..a2e851a 100644
--- a/core/res/res/values-sq/strings.xml
+++ b/core/res/res/values-sq/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Përdor sistemet biometrike ose kyçjen e ekranit"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verifiko që je ti"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Përdor sistemet e tua biometrike për të vazhduar"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Përdor gjurmën e gishtit për të vazhduar"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Përdor fytyrën tënde për të vazhduar"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Përdor sistemet e tua biometrike ose kyçjen e ekranit për të vazhduar"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Nuk ofrohet harduer biometrik"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Vërtetimi u anulua"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Gjurma e gishtit nuk u njoh"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Gjurma e gishtit nuk u njoh"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Nuk mund ta dallojë fytyrën. Përdor më mirë gjurmën e gishtit."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Gjurma e gishtit u vërtetua"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Fytyra u vërtetua"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Fytyra u vërtetua, shtyp \"Konfirmo\""</string>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index a2aee9c..a13d56d 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -619,8 +619,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Користите биометрију или закључавање екрана"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Потврдите свој идентитет"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Користите биометријски податак да бисте наставили"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Наставите помоћу отиска прста"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Потврдите идентитет лицем да бисте наставили"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Користите биометријски податак или закључавање екрана да бисте наставили"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Биометријски хардвер није доступан"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Потврда идентитета је отказана"</string>
@@ -646,6 +644,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Отисак прста није препознат"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Отисак прста није препознат"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Лице није препознато. Користите отисак прста."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Отисак прста је потврђен"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Лице је потврђено"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Лице је потврђено. Притисните Потврди"</string>
@@ -2332,11 +2331,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Дозвољава пратећој апликацији да покрене услуге у првом плану из позадине."</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Микрофон је доступан"</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Микрофон је блокиран"</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Двојни екран"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Двојни екран је укључен"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual Screen је укључен"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> користи оба екрана за приказивање садржаја"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Уређај је превише загрејан"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Двојни екран је недоступан јер је телефон превише загрејан"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen је недоступан јер је телефон превише загрејан"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen није доступан"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Dual Screen није доступан зато што је Уштеда батерије укључена. То можете да искључите у подешавањима."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Иди у Подешавања"</string>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index af2e1ea..0a43e46 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Använd biometrisk data eller skärmlåset"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verifiera din identitet"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Fortsätt med hjälp av din biometriska data"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Fortsätt med hjälp av ditt fingeravtryck"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Fortsätt med hjälp av ditt ansikte"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Fortsätt med hjälp av din biometriska data eller skärmlåset"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrisk maskinvara är inte tillgänglig"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autentiseringen avbröts"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Fingeravtrycket känns inte igen"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Fingeravtrycket känns inte igen"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Ansiktet kändes inte igen. Använd fingeravtryck."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Fingeravtrycket har autentiserats"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Ansiktet har autentiserats"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Ansiktet har autentiserats. Tryck på Bekräfta"</string>
@@ -2331,11 +2330,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Tillåter att en tillhörande app startar förgrundstjänster i bakgrunden."</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Mikrofonen är tillgänglig"</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Mikrofonen är blockerad"</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dubbel skärm"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dubbel skärm är på"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual Screen är på"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> använder båda skärmarna för att visa innehåll"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Enheten är för varm"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dubbel skärm kan inte användas eftersom telefonen börjar bli för varm"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen kan inte användas eftersom telefonen börjar bli för varm"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen är inte tillgängligt"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Dual Screen kan inte användas eftersom battersparläget är aktiverat. Du kan inaktivera detta i inställningarna."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Öppna inställningarna"</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index d77385c..466df4f 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Tumia bayometriki au mbinu ya kufunga skrini"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Thibitisha kuwa ni wewe"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Tumia bayometriki yako ili uendelee"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Tumia alama ya kidole chako ili uendelee"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Tumia uso wako ili uendelee"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Tumia bayometriki au mbinu yako ya kufunga skrini ili uendelee"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Maunzi ya bayometriki hayapatikani"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Imeghairi uthibitishaji"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Alama ya kidole haijatambuliwa"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Alama ya kidole haijatambuliwa"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Imeshindwa kutambua uso. Tumia alama ya kidole."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Imethibitisha alama ya kidole"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Uso umethibitishwa"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Uso umethibitishwa, tafadhali bonyeza thibitisha"</string>
@@ -2332,12 +2331,12 @@
<string name="mic_access_on_toast" msgid="2666925317663845156">"Maikrofoni inapatikana"</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Maikrofoni imezuiwa"</string>
<string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual screen"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Umewasha kipengele cha hali ya skrini mbili"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual screen imewasha"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> inatumia skrini zote kuonyesha maudhui"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Kifaa kina joto sana"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Kipengele cha Hali ya Skrini Mbili hakipatikani kwa sababu simu yako inapata joto sana"</string>
- <string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Kipengele cha Hali ya Skrini Mbili hakipatikani"</string>
- <string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Kipengele cha Hali ya Skrini Mbili hakipatikani kwa sababu kipengele cha Kiokoa Betri kimewashwa. Unaweza kuzima kipengele hiki katika Mipangilio."</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Kipengele cha Dual Screen hakipatikani kwa sababu simu yako inapata joto sana"</string>
+ <string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen haipatikani"</string>
+ <string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Kipengele cha Dual Screen hakipatikani kwa sababu Kiokoa Betri kimewashwa. Unaweza kukizima katika Mipangilio."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Nenda kwenye Mipangilio"</string>
<string name="device_state_notification_turn_off_button" msgid="6327161707661689232">"Zima"</string>
<string name="keyboard_layout_notification_selected_title" msgid="1202560174252421219">"<xliff:g id="DEVICE_NAME">%s</xliff:g> imewekewa mipangilio"</string>
diff --git a/core/res/res/values-ta/strings.xml b/core/res/res/values-ta/strings.xml
index 50d056a..b2551e7 100644
--- a/core/res/res/values-ta/strings.xml
+++ b/core/res/res/values-ta/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"பயோமெட்ரிக்ஸையோ திரைப் பூட்டையோ பயன்படுத்து"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"நீங்கள்தான் என உறுதிசெய்க"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"தொடர உங்கள் பயோமெட்ரிக்கைப் பயன்படுத்துங்கள்"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"தொடர்வதற்கு உங்கள் கைரேகையைப் பயன்படுத்துங்கள்"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"தொடர்வதற்கு உங்கள் முகத்தைப் பயன்படுத்துங்கள்"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"தொடர, உங்கள் பயோமெட்ரிக்கையோ திரைப் பூட்டையோ பயன்படுத்துங்கள்"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"பயோமெட்ரிக் வன்பொருள் இல்லை"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"அங்கீகரிப்பு ரத்தானது"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"கைரேகை அங்கீகரிக்கப்படவில்லை"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"கைரேகை அங்கீகரிக்கப்படவில்லை"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"முகத்தை அடையாளம் காண முடியவில்லை. கைரேகையைப் பயன்படுத்தவும்."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"கைரேகை அங்கீகரிக்கப்பட்டது"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"முகம் அங்கீகரிக்கப்பட்டது"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"முகம் அங்கீகரிக்கப்பட்டது. ’உறுதிப்படுத்துக’ என்பதை அழுத்துக"</string>
diff --git a/core/res/res/values-te/strings.xml b/core/res/res/values-te/strings.xml
index 32ef5bd..a90b2bf3 100644
--- a/core/res/res/values-te/strings.xml
+++ b/core/res/res/values-te/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"బయోమెట్రిక్స్ను లేదా స్క్రీన్ లాక్ను ఉపయోగించండి"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"ఇది మీరేనని వెరిఫై చేసుకోండి"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"కొనసాగించడానికి, మీ బయోమెట్రిక్ను ఉపయోగించండి"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"కొనసాగించడానికి మీ వేలిముద్రను ఉపయోగించండి"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"కొనసాగించడానికి మీ ముఖాన్ని ఉపయోగించండి"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"కొనసాగించడానికి మీ బయోమెట్రిక్ లేదా స్క్రీన్ లాక్ను ఉపయోగించండి"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"బయోమెట్రిక్ హార్డ్వేర్ అందుబాటులో లేదు"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"ప్రమాణీకరణ రద్దు చేయబడింది"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"వేలిముద్ర గుర్తించబడలేదు"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"వేలిముద్ర గుర్తించబడలేదు"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"ముఖం గుర్తించలేము. బదులుగా వేలిముద్ర ఉపయోగించండి."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"వేలిముద్ర ప్రమాణీకరించబడింది"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"ముఖం ప్రమాణీకరించబడింది"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"ముఖం ప్రమాణీకరించబడింది, దయచేసి ధృవీకరించును నొక్కండి"</string>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index 1f65086..74b744f 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"ใช้ข้อมูลไบโอเมตริกหรือการล็อกหน้าจอ"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"ยืนยันว่าเป็นตัวคุณ"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"ใช้ข้อมูลไบโอเมตริกเพื่อดำเนินการต่อ"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"ใช้ลายนิ้วมือของคุณเพื่อดำเนินการต่อ"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"ใช้ใบหน้าของคุณเพื่อดำเนินการต่อ"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"ใช้ข้อมูลไบโอเมตริกหรือการล็อกหน้าจอเพื่อดำเนินการต่อ"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"ฮาร์ดแวร์ไบโอเมตริกไม่พร้อมใช้งาน"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"ยกเลิกการตรวจสอบสิทธิ์แล้ว"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"ไม่รู้จักลายนิ้วมือ"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"ไม่รู้จักลายนิ้วมือ"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"ไม่รู้จักใบหน้า ใช้ลายนิ้วมือแทน"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"ตรวจสอบสิทธิ์ลายนิ้วมือแล้ว"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"ตรวจสอบสิทธิ์ใบหน้าแล้ว"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"ตรวจสอบสิทธิ์ใบหน้าแล้ว โปรดกดยืนยัน"</string>
@@ -1404,7 +1403,7 @@
<string name="select_keyboard_layout_notification_message" msgid="8835158247369158154">"แตะเพื่อเลือกภาษาและรูปแบบ"</string>
<string name="fast_scroll_alphabet" msgid="8854435958703888376">" กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรลวศษสหฬอฮ"</string>
<string name="fast_scroll_numeric_alphabet" msgid="2529539945421557329">" กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรลวศษสหฬอฮ"</string>
- <string name="alert_windows_notification_channel_group_name" msgid="6063891141815714246">"แสดงทับแอปอื่นๆ"</string>
+ <string name="alert_windows_notification_channel_group_name" msgid="6063891141815714246">"แสดงทับบนแอปอื่นๆ"</string>
<string name="alert_windows_notification_channel_name" msgid="3437528564303192620">"<xliff:g id="NAME">%s</xliff:g> แสดงทับแอปอื่นๆ"</string>
<string name="alert_windows_notification_title" msgid="6331662751095228536">"<xliff:g id="NAME">%s</xliff:g> กำลังแสดงทับแอปอื่นๆ"</string>
<string name="alert_windows_notification_message" msgid="6538171456970725333">"หากคุณไม่ต้องการให้ <xliff:g id="NAME">%s</xliff:g> ใช้ฟีเจอร์นี้ ให้แตะเพื่อเปิดการตั้งค่าแล้วปิดฟีเจอร์"</string>
@@ -2335,7 +2334,7 @@
<string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual Screen เปิดอยู่"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g> กำลังใช้จอแสดงผลทั้งสองจอเพื่อแสดงเนื้อหา"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"อุปกรณ์ร้อนเกินไป"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"หน้าจอคู่ไม่พร้อมให้ใช้งานเนื่องจากโทรศัพท์ของคุณร้อนเกินไป"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Dual Screen ไม่พร้อมให้ใช้งานเนื่องจากโทรศัพท์ของคุณร้อนเกินไป"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen ใช้งานไม่ได้"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Dual Screen ใช้งานไม่ได้เนื่องจากเปิดโหมดประหยัดแบตเตอรี่อยู่ คุณปิดโหมดนี้ได้ในการตั้งค่า"</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"ไปที่การตั้งค่า"</string>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index 567b67e..633282e 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Gumamit ng biometrics o lock ng screen"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"I-verify na ikaw ito"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Gamitin ang iyong biometric para magpatuloy"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Gamitin ang iyong fingerprint para magpatuloy"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Gamitin ang iyong mukha para magpatuloy"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Gamitin ang iyong biometric o lock ng screen para magpatuloy"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Walang biometric hardware"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Nakansela ang pag-authenticate"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Hindi nakilala ang fingerprint"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Hindi nakilala ang fingerprint"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Hindi makilala ang mukha. Gumamit ng fingerprint."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Na-authenticate ang fingerprint"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Na-authenticate ang mukha"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Na-authenticate ang mukha, pakipindot ang kumpirmahin"</string>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index 3bf35a5..17db4f4 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Biyometri veya ekran kilidi kullan"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Siz olduğunuzu doğrulayın"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Devam etmek için biyometri kullanın"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Devam etmek için parmak izinizi kullanın"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Devam etmek için yüzünüzü kullanın"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Devam etmek için biyometrik kimlik bilginizi veya ekran kilidinizi kullanın"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biyometrik donanım kullanılamıyor"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Kimlik doğrulama iptal edildi"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Parmak izi tanınmadı"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Parmak izi tanınmadı"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Yüz tanınamadı. Bunun yerine parmak izi kullanın."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Parmak izi kimlik doğrulaması yapıldı"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Yüz kimliği doğrulandı"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Yüz kimliği doğrulandı, lütfen onayla\'ya basın"</string>
@@ -2331,11 +2330,11 @@
<string name="permdesc_startForegroundServicesFromBackground" msgid="4071826571656001537">"Tamamlayıcı uygulamanın arka plandan ön plan hizmetlerini başlatmasına izin verir."</string>
<string name="mic_access_on_toast" msgid="2666925317663845156">"Mikrofon kullanılabilir"</string>
<string name="mic_access_off_toast" msgid="8111040892954242437">"Mikrofon engellenmiş"</string>
- <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Çift ekran"</string>
- <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Çift ekran açık"</string>
+ <string name="concurrent_display_notification_name" msgid="1526911253558311131">"Dual Screen"</string>
+ <string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual Screen açık"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"<xliff:g id="APP_NAME">%1$s</xliff:g>, içeriği göstermek için her iki ekranı da kullanıyor"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Cihaz çok ısındı"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Telefonunuz çok ısındığı için Çift Ekran kullanılamıyor"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Telefonunuz çok ısındığı için Dual Screen kullanılamıyor"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Dual Screen kullanılamıyor"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Pil Tasarrufu açık olduğundan Dual Screen kullanılamıyor. Bu özelliği Ayarlar\'dan kapatabilirsiniz."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Ayarlar\'a git"</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index 47e529c..0606c7a 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -620,8 +620,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Використовувати біометрію або дані для розблокування екрана"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Підтвердьте, що це ви"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Щоб продовжити, скористайтеся біометрією"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Щоб продовжити, скористайтеся відбитком пальця"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Щоб продовжити, скористайтеся фейс-контролем"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Щоб продовжити, скористайтеся біометрією або даними для розблокування екрана"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Біометричне апаратне забезпечення недоступне"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Автентифікацію скасовано"</string>
@@ -647,6 +645,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Відбиток пальця не розпізнано"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Відбиток пальця не розпізнано"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Обличчя не розпізнано. Скористайтеся відбитком пальця."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Відбиток пальця автентифіковано"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Обличчя автентифіковано"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Обличчя автентифіковано. Натисніть \"Підтвердити\""</string>
@@ -2337,7 +2336,7 @@
<string name="concurrent_display_notification_active_title" msgid="4892473462327943673">"Dual Screen увімкнено"</string>
<string name="concurrent_display_notification_active_content" msgid="5889355473710601270">"Додаток <xliff:g id="APP_NAME">%1$s</xliff:g> використовує обидва екрани для показу контенту"</string>
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"Пристрій сильно нагрівається"</string>
- <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Подвійний екран недоступний, оскільки телефон сильно нагрівається"</string>
+ <string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"Функція Dual Screen недоступна, оскільки телефон сильно нагрівається"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"Функція Dual Screen недоступна"</string>
<string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"Функція Dual Screen недоступна, оскільки ввімкнено режим енергозбереження. Її можна вимкнути в налаштуваннях."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"Перейти до налаштувань"</string>
diff --git a/core/res/res/values-ur/strings.xml b/core/res/res/values-ur/strings.xml
index 907ebd9..dc4ea46 100644
--- a/core/res/res/values-ur/strings.xml
+++ b/core/res/res/values-ur/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"بایو میٹرکس یا اسکرین لاک استعمال کریں"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"توثیق کریں کہ یہ آپ ہیں"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"جاری رکھنے کیلئے اپنا بایو میٹرک استعمال کریں"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"جاری رکھنے کے لیے اپنا فنگر پرنٹ استعمال کریں"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"جاری رکھنے کے لیے اپنے چہرے کا استعمال کریں"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"جاری رکھنے کے لیے اپنے بایو میٹرک اور اسکرین لاک کا استعمال کریں"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"بایومیٹرک ہارڈ ویئر دستیاب نہیں ہے"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"تصدیق کا عمل منسوخ ہو گیا"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"فنگر پرنٹ کی شناخت نہیں ہو سکی"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"فنگر پرنٹ کی شناخت نہیں ہو سکی"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"چہرے کی شناخت نہیں ہو سکی۔ اس کے بجائے فنگر پرنٹ استعمال کریں۔"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"فنگر پرنٹ کی تصدیق ہو گئی"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"چہرے کی تصدیق ہو گئی"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"چہرے کی تصدیق ہو گئی، براہ کرم \'تصدیق کریں\' کو دبائيں"</string>
diff --git a/core/res/res/values-uz/strings.xml b/core/res/res/values-uz/strings.xml
index a65b478..979c578 100644
--- a/core/res/res/values-uz/strings.xml
+++ b/core/res/res/values-uz/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Biometrika yoki ekran qulfi"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Oʻzingizni taniting"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Davom etish uchun biometrik tasdiqlang"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Davom etish uchun barmoq izingizdan foydalaning"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Yuz tekshiruvi bilan davom eting"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Davom etish uchun biometrika yoki ekran qulfidan foydalaning"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrik sensor ishlamayapti"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autentifikatsiya bekor qilindi"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Barmoq izi aniqlanmadi"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Barmoq izi aniqlanmadi"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Bu yuz notanish. Barmoq izi orqali urining."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Barmoq izi tekshirildi"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Yuzingiz aniqlandi"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Yuzingiz aniqlandi, tasdiqlash uchun bosing"</string>
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index 9c77299..58cec01 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Dùng dữ liệu sinh trắc học hoặc phương thức khóa màn hình"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Xác minh danh tính của bạn"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Dùng dữ liệu sinh trắc học của bạn để tiếp tục"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Hãy dùng vân tay để tiếp tục"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Hãy dùng khuôn mặt để tiếp tục"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Dùng dữ liệu sinh trắc học của bạn hoặc phương thức khóa màn hình để tiếp tục"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Không có phần cứng sinh trắc học"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Đã hủy xác thực"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Không nhận dạng được vân tay"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Không nhận dạng được vân tay"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Không thể nhận dạng khuôn mặt. Hãy dùng vân tay."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Đã xác thực vân tay"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Đã xác thực khuôn mặt"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Đã xác thực khuôn mặt, vui lòng nhấn để xác nhận"</string>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index 955cbe7..e5535af 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -274,7 +274,7 @@
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"实体键盘"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"安全性"</string>
<string name="notification_channel_car_mode" msgid="2123919247040988436">"车载模式"</string>
- <string name="notification_channel_account" msgid="6436294521740148173">"帐号状态"</string>
+ <string name="notification_channel_account" msgid="6436294521740148173">"账号状态"</string>
<string name="notification_channel_developer" msgid="1691059964407549150">"开发者消息"</string>
<string name="notification_channel_developer_important" msgid="7197281908918789589">"重要开发者消息"</string>
<string name="notification_channel_updates" msgid="7907863984825495278">"更新"</string>
@@ -448,9 +448,9 @@
<string name="permdesc_broadcastSticky" product="tv" msgid="2338185920171000650">"允许应用发送置顶广播,这类广播在广播结束后仍会继续存在。过度使用这项功能可能会导致 Android TV 设备使用过多内存,从而降低其运行速度或稳定性。"</string>
<string name="permdesc_broadcastSticky" product="default" msgid="134529339678913453">"允许该应用发送持久广播消息,此类消息在广播结束后仍会保留。过度使用可能会导致手机使用过多内存,从而降低其速度或稳定性。"</string>
<string name="permlab_readContacts" msgid="8776395111787429099">"读取联系人"</string>
- <string name="permdesc_readContacts" product="tablet" msgid="6430093481659992692">"允许该应用读取您的平板电脑上存储的联系人相关数据。应用还将有权访问您的平板电脑上已创建联系人的帐号,其中可能包括您已安装的应用所创建的帐号。此权限允许应用保存您的联系人数据,而恶意应用可能会在您不知情的情况下分享联系人数据。"</string>
- <string name="permdesc_readContacts" product="tv" msgid="8400138591135554789">"允许该应用读取您的 Android TV 设备上存储的联系人相关数据。应用还将有权访问您的 Android TV 设备上已创建联系人的帐号,其中可能包括您已安装的应用所创建的帐号。此权限允许应用保存您的联系人数据,而恶意应用可能会在您不知情的情况下分享联系人数据。"</string>
- <string name="permdesc_readContacts" product="default" msgid="4911989776203207644">"允许该应用读取您手机上存储的联系人相关数据。应用还将有权访问您的手机上已创建联系人的帐号,其中可能包括您已安装的应用所创建的帐号。此权限允许应用保存您的联系人数据,而恶意应用可能会在您不知情的情况下分享联系人数据。"</string>
+ <string name="permdesc_readContacts" product="tablet" msgid="6430093481659992692">"允许该应用读取您的平板电脑上存储的联系人相关数据。应用还将有权访问您的平板电脑上已创建联系人的账号,其中可能包括您已安装的应用所创建的账号。此权限允许应用保存您的联系人数据,而恶意应用可能会在您不知情的情况下分享联系人数据。"</string>
+ <string name="permdesc_readContacts" product="tv" msgid="8400138591135554789">"允许该应用读取您的 Android TV 设备上存储的联系人相关数据。应用还将有权访问您的 Android TV 设备上已创建联系人的账号,其中可能包括您已安装的应用所创建的账号。此权限允许应用保存您的联系人数据,而恶意应用可能会在您不知情的情况下分享联系人数据。"</string>
+ <string name="permdesc_readContacts" product="default" msgid="4911989776203207644">"允许该应用读取您手机上存储的联系人相关数据。应用还将有权访问您的手机上已创建联系人的账号,其中可能包括您已安装的应用所创建的账号。此权限允许应用保存您的联系人数据,而恶意应用可能会在您不知情的情况下分享联系人数据。"</string>
<string name="permlab_writeContacts" msgid="8919430536404830430">"修改您的通讯录"</string>
<string name="permdesc_writeContacts" product="tablet" msgid="6422419281427826181">"允许该应用修改您平板电脑上存储的联系人相关数据。此权限允许应用删除联系人数据。"</string>
<string name="permdesc_writeContacts" product="tv" msgid="6488872735379978935">"允许该应用修改您的 Android TV 设备上存储的联系人相关数据。此权限允许应用删除联系人数据。"</string>
@@ -542,10 +542,10 @@
<string name="permdesc_setTimeZone" product="tablet" msgid="1788868809638682503">"允许应用更改平板电脑的时区。"</string>
<string name="permdesc_setTimeZone" product="tv" msgid="9069045914174455938">"允许应用更改 Android TV 设备的时区。"</string>
<string name="permdesc_setTimeZone" product="default" msgid="4611828585759488256">"允许应用更改手机的时区。"</string>
- <string name="permlab_getAccounts" msgid="5304317160463582791">"查找设备上的帐号"</string>
- <string name="permdesc_getAccounts" product="tablet" msgid="1784452755887604512">"允许该应用获取平板电脑已知的帐号列表,其中可能包括由已安装的应用创建的所有帐号。"</string>
- <string name="permdesc_getAccounts" product="tv" msgid="437604680436540822">"允许应用获取 Android TV 设备已知的帐号列表,其中可能包括您已安装的应用所创建的任何帐号。"</string>
- <string name="permdesc_getAccounts" product="default" msgid="2491273043569751867">"允许该应用获取手机已知的帐号列表,其中可能包括由已安装的应用创建的所有帐号。"</string>
+ <string name="permlab_getAccounts" msgid="5304317160463582791">"查找设备上的账号"</string>
+ <string name="permdesc_getAccounts" product="tablet" msgid="1784452755887604512">"允许该应用获取平板电脑已知的账号列表,其中可能包括由已安装的应用创建的所有账号。"</string>
+ <string name="permdesc_getAccounts" product="tv" msgid="437604680436540822">"允许应用获取 Android TV 设备已知的账号列表,其中可能包括您已安装的应用所创建的任何账号。"</string>
+ <string name="permdesc_getAccounts" product="default" msgid="2491273043569751867">"允许该应用获取手机已知的账号列表,其中可能包括由已安装的应用创建的所有账号。"</string>
<string name="permlab_accessNetworkState" msgid="2349126720783633918">"查看网络连接"</string>
<string name="permdesc_accessNetworkState" msgid="4394564702881662849">"允许该应用查看网络连接的相关信息,例如存在和连接的网络。"</string>
<string name="permlab_createNetworkSockets" msgid="3224420491603590541">"拥有完全的网络访问权限"</string>
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"使用生物识别或屏幕锁定凭据"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"验证是您本人在操作"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"使用生物识别验证身份才能继续"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"如需继续操作,请使用指纹验证身份"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"如需继续操作,请刷脸验证身份"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"使用生物识别或屏幕锁定凭据验证身份,才能继续操作"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"生物识别硬件无法使用"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"身份验证已取消"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"未能识别指纹"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"未能识别指纹"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"无法识别人脸。请改用指纹。"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"已验证指纹"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"面孔已验证"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"面孔已验证,请按确认按钮"</string>
@@ -732,11 +731,11 @@
<string name="face_error_vendor_unknown" msgid="7387005932083302070">"出了点问题,请重试。"</string>
<string name="face_icon_content_description" msgid="465030547475916280">"面孔图标"</string>
<string name="permlab_readSyncSettings" msgid="6250532864893156277">"读取同步设置"</string>
- <string name="permdesc_readSyncSettings" msgid="1325658466358779298">"允许该应用读取某个帐号的同步设置。例如,此权限可确定“联系人”应用是否与某个帐号同步。"</string>
+ <string name="permdesc_readSyncSettings" msgid="1325658466358779298">"允许该应用读取某个账号的同步设置。例如,此权限可确定“联系人”应用是否与某个账号同步。"</string>
<string name="permlab_writeSyncSettings" msgid="6583154300780427399">"启用和停用同步"</string>
- <string name="permdesc_writeSyncSettings" msgid="6029151549667182687">"允许该应用修改某个帐号的同步设置。例如,此权限可用于在“联系人”应用与某个帐号之间启用同步。"</string>
+ <string name="permdesc_writeSyncSettings" msgid="6029151549667182687">"允许该应用修改某个账号的同步设置。例如,此权限可用于在“联系人”应用与某个账号之间启用同步。"</string>
<string name="permlab_readSyncStats" msgid="3747407238320105332">"读取同步统计信息"</string>
- <string name="permdesc_readSyncStats" msgid="3867809926567379434">"允许该应用读取某个帐号的同步统计信息,包括同步活动历史记录和同步数据量。"</string>
+ <string name="permdesc_readSyncStats" msgid="3867809926567379434">"允许该应用读取某个账号的同步统计信息,包括同步活动历史记录和同步数据量。"</string>
<string name="permlab_sdcardRead" msgid="5791467020950064920">"读取您共享存储空间中的内容"</string>
<string name="permdesc_sdcardRead" msgid="6872973242228240382">"允许该应用读取您共享存储空间中的内容。"</string>
<string name="permlab_readMediaAudio" msgid="8723513075731763810">"从共享存储空间读取音频文件"</string>
@@ -1002,7 +1001,7 @@
<string name="lockscreen_too_many_failed_password_attempts_dialog_message" msgid="3118353451602377380">"您已连续 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次输错密码。\n\n请在 <xliff:g id="NUMBER_1">%2$d</xliff:g> 秒后重试。"</string>
<string name="lockscreen_too_many_failed_pin_attempts_dialog_message" msgid="2874278239714821984">"您已经<xliff:g id="NUMBER_0">%1$d</xliff:g>次输错了PIN码。\n\n请在<xliff:g id="NUMBER_1">%2$d</xliff:g>秒后重试。"</string>
<string name="lockscreen_failed_attempts_almost_glogin" product="tablet" msgid="3069635524964070596">"您已连续 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次画错解锁图案。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您使用自己的 Google 登录信息解锁平板电脑。\n\n请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
- <string name="lockscreen_failed_attempts_almost_glogin" product="tv" msgid="6399092175942158529">"您已画错解锁图案 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您登录 Google 帐号来解锁 Android TV 设备。\n\n 请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
+ <string name="lockscreen_failed_attempts_almost_glogin" product="tv" msgid="6399092175942158529">"您已画错解锁图案 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您登录 Google 账号来解锁 Android TV 设备。\n\n 请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
<string name="lockscreen_failed_attempts_almost_glogin" product="default" msgid="5691623136957148335">"您已连续 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次画错解锁图案。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您使用自己的 Google 登录信息解锁手机。\n\n请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
<string name="lockscreen_failed_attempts_almost_at_wipe" product="tablet" msgid="7914445759242151426">"您已经 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次错误地尝试解锁平板电脑。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,平板电脑将恢复为出厂默认设置,所有用户数据都会丢失。"</string>
<string name="lockscreen_failed_attempts_almost_at_wipe" product="tv" msgid="4275591249631864248">"您尝试解锁 Android TV 设备失败的次数已达 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,您的 Android TV 设备就会恢复出厂设置,而且所有用户数据都会丢失。"</string>
@@ -1012,9 +1011,9 @@
<string name="lockscreen_failed_attempts_now_wiping" product="default" msgid="2203704707679895487">"您已经<xliff:g id="NUMBER">%d</xliff:g>次错误地尝试解锁手机。手机现在将恢复为出厂默认设置。"</string>
<string name="lockscreen_too_many_failed_attempts_countdown" msgid="6807200118164539589">"<xliff:g id="NUMBER">%d</xliff:g>秒后重试。"</string>
<string name="lockscreen_forgot_pattern_button_text" msgid="8362442730606839031">"忘记了图案?"</string>
- <string name="lockscreen_glogin_forgot_pattern" msgid="9218940117797602518">"帐号解锁"</string>
+ <string name="lockscreen_glogin_forgot_pattern" msgid="9218940117797602518">"账号解锁"</string>
<string name="lockscreen_glogin_too_many_attempts" msgid="3775904917743034195">"图案尝试次数过多"</string>
- <string name="lockscreen_glogin_instructions" msgid="4695162942525531700">"要解除锁定,请使用您的 Google 帐号登录。"</string>
+ <string name="lockscreen_glogin_instructions" msgid="4695162942525531700">"要解除锁定,请使用您的 Google 账号登录。"</string>
<string name="lockscreen_glogin_username_hint" msgid="6916101478673157045">"用户名(电子邮件)"</string>
<string name="lockscreen_glogin_password_hint" msgid="3031027901286812848">"密码"</string>
<string name="lockscreen_glogin_submit_button" msgid="3590556636347843733">"登录"</string>
@@ -1482,14 +1481,14 @@
<string name="ime_action_default" msgid="8265027027659800121">"执行"</string>
<string name="dial_number_using" msgid="6060769078933953531">"拨打电话\n<xliff:g id="NUMBER">%s</xliff:g>"</string>
<string name="create_contact_using" msgid="6200708808003692594">"创建电话号码为\n<xliff:g id="NUMBER">%s</xliff:g> 的联系人"</string>
- <string name="grant_credentials_permission_message_header" msgid="5365733888842570481">"以下一个或多个应用请求获得相应权限,以便在当前和以后访问您的帐号。"</string>
+ <string name="grant_credentials_permission_message_header" msgid="5365733888842570481">"以下一个或多个应用请求获得相应权限,以便在当前和以后访问您的账号。"</string>
<string name="grant_credentials_permission_message_footer" msgid="1886710210516246461">"您是否同意此请求?"</string>
<string name="grant_permissions_header_text" msgid="3420736827804657201">"访问权限请求"</string>
<string name="allow" msgid="6195617008611933762">"允许"</string>
<string name="deny" msgid="6632259981847676572">"拒绝"</string>
<string name="permission_request_notification_title" msgid="1810025922441048273">"权限请求"</string>
- <string name="permission_request_notification_with_subtitle" msgid="3743417870360129298">"应用对帐号 <xliff:g id="ACCOUNT">%s</xliff:g>\n 提出权限请求。"</string>
- <string name="permission_request_notification_for_app_with_subtitle" msgid="1298704005732851350">"“<xliff:g id="APP">%1$s</xliff:g>”请求获得以下帐号的访问权限:\n<xliff:g id="ACCOUNT">%2$s</xliff:g>。"</string>
+ <string name="permission_request_notification_with_subtitle" msgid="3743417870360129298">"应用对账号 <xliff:g id="ACCOUNT">%s</xliff:g>\n 提出权限请求。"</string>
+ <string name="permission_request_notification_for_app_with_subtitle" msgid="1298704005732851350">"“<xliff:g id="APP">%1$s</xliff:g>”请求获得以下账号的访问权限:\n<xliff:g id="ACCOUNT">%2$s</xliff:g>。"</string>
<string name="forward_intent_to_owner" msgid="4620359037192871015">"您目前是在工作资料之外使用此应用"</string>
<string name="forward_intent_to_work" msgid="3620262405636021151">"您目前是在工作资料内使用此应用"</string>
<string name="input_method_binding_label" msgid="1166731601721983656">"输入法"</string>
@@ -1535,13 +1534,13 @@
<string name="gpsVerifYes" msgid="3719843080744112940">"是"</string>
<string name="gpsVerifNo" msgid="1671201856091564741">"否"</string>
<string name="sync_too_many_deletes" msgid="6999440774578705300">"超出删除限制"</string>
- <string name="sync_too_many_deletes_desc" msgid="7409327940303504440">"帐号 <xliff:g id="ACCOUNT_NAME">%3$s</xliff:g> 在进行“<xliff:g id="TYPE_OF_SYNC">%2$s</xliff:g>”同步时删除了 <xliff:g id="NUMBER_OF_DELETED_ITEMS">%1$d</xliff:g> 项内容。您要如何处理这些删除的内容?"</string>
+ <string name="sync_too_many_deletes_desc" msgid="7409327940303504440">"账号 <xliff:g id="ACCOUNT_NAME">%3$s</xliff:g> 在进行“<xliff:g id="TYPE_OF_SYNC">%2$s</xliff:g>”同步时删除了 <xliff:g id="NUMBER_OF_DELETED_ITEMS">%1$d</xliff:g> 项内容。您要如何处理这些删除的内容?"</string>
<string name="sync_really_delete" msgid="5657871730315579051">"删除这些内容"</string>
<string name="sync_undo_deletes" msgid="5786033331266418896">"撤消删除"</string>
<string name="sync_do_nothing" msgid="4528734662446469646">"目前不进行任何操作"</string>
- <string name="choose_account_label" msgid="5557833752759831548">"选择帐号"</string>
- <string name="add_account_label" msgid="4067610644298737417">"添加帐号"</string>
- <string name="add_account_button_label" msgid="322390749416414097">"添加帐号"</string>
+ <string name="choose_account_label" msgid="5557833752759831548">"选择账号"</string>
+ <string name="add_account_label" msgid="4067610644298737417">"添加账号"</string>
+ <string name="add_account_button_label" msgid="322390749416414097">"添加账号"</string>
<string name="number_picker_increment_button" msgid="7621013714795186298">"增大"</string>
<string name="number_picker_decrement_button" msgid="5116948444762708204">"减小"</string>
<string name="number_picker_increment_scroll_mode" msgid="8403893549806805985">"<xliff:g id="VALUE">%s</xliff:g> 触摸并按住。"</string>
@@ -1665,13 +1664,13 @@
<string name="kg_invalid_puk" msgid="4809502818518963344">"请重新输入正确的PUK码。如果尝试错误次数过多,SIM卡将永久停用。"</string>
<string name="kg_invalid_confirm_pin_hint" product="default" msgid="4705368340409816254">"PIN 码不匹配"</string>
<string name="kg_login_too_many_attempts" msgid="699292728290654121">"图案尝试次数过多"</string>
- <string name="kg_login_instructions" msgid="3619844310339066827">"要解锁,请登录您的 Google 帐号。"</string>
+ <string name="kg_login_instructions" msgid="3619844310339066827">"要解锁,请登录您的 Google 账号。"</string>
<string name="kg_login_username_hint" msgid="1765453775467133251">"用户名(电子邮件地址)"</string>
<string name="kg_login_password_hint" msgid="3330530727273164402">"密码"</string>
<string name="kg_login_submit_button" msgid="893611277617096870">"登录"</string>
<string name="kg_login_invalid_input" msgid="8292367491901220210">"用户名或密码无效。"</string>
<string name="kg_login_account_recovery_hint" msgid="4892466171043541248">"忘记了用户名或密码?\n请访问 "<b>"google.com/accounts/recovery"</b>"。"</string>
- <string name="kg_login_checking_password" msgid="4676010303243317253">"正在检查帐号…"</string>
+ <string name="kg_login_checking_password" msgid="4676010303243317253">"正在检查账号…"</string>
<string name="kg_too_many_failed_pin_attempts_dialog_message" msgid="23741434207544038">"您已经<xliff:g id="NUMBER_0">%1$d</xliff:g>次输错了PIN码。\n\n请在<xliff:g id="NUMBER_1">%2$d</xliff:g>秒后重试。"</string>
<string name="kg_too_many_failed_password_attempts_dialog_message" msgid="3328686432962224215">"您已连续 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次输错密码。\n\n请在 <xliff:g id="NUMBER_1">%2$d</xliff:g> 秒后重试。"</string>
<string name="kg_too_many_failed_pattern_attempts_dialog_message" msgid="7357404233979139075">"您已连续 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次画错解锁图案。\n\n请在 <xliff:g id="NUMBER_1">%2$d</xliff:g> 秒后重试。"</string>
@@ -1681,9 +1680,9 @@
<string name="kg_failed_attempts_now_wiping" product="tablet" msgid="2299099385175083308">"您已经<xliff:g id="NUMBER">%d</xliff:g>次错误地尝试解锁平板电脑。平板电脑现在将恢复为出厂默认设置。"</string>
<string name="kg_failed_attempts_now_wiping" product="tv" msgid="5045460916106267585">"您尝试解锁 Android TV 设备失败的次数已达 <xliff:g id="NUMBER">%d</xliff:g> 次。您的 Android TV 设备现在将恢复出厂设置。"</string>
<string name="kg_failed_attempts_now_wiping" product="default" msgid="5043730590446071189">"您已经<xliff:g id="NUMBER">%d</xliff:g>次错误地尝试解锁手机。手机现在将恢复为出厂默认设置。"</string>
- <string name="kg_failed_attempts_almost_at_login" product="tablet" msgid="7086799295109717623">"您已连续 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次画错解锁图案。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您使用自己的电子邮件帐号解锁平板电脑。\n\n请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
- <string name="kg_failed_attempts_almost_at_login" product="tv" msgid="4670840383567106114">"您已画错解锁图案 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您使用电子邮件帐号解锁 Android TV 设备。\n\n 请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
- <string name="kg_failed_attempts_almost_at_login" product="default" msgid="5270861875006378092">"您已连续 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次画错解锁图案。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您使用自己的电子邮件帐号解锁手机。\n\n请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
+ <string name="kg_failed_attempts_almost_at_login" product="tablet" msgid="7086799295109717623">"您已连续 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次画错解锁图案。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您使用自己的电子邮件账号解锁平板电脑。\n\n请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
+ <string name="kg_failed_attempts_almost_at_login" product="tv" msgid="4670840383567106114">"您已画错解锁图案 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您使用电子邮件账号解锁 Android TV 设备。\n\n 请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
+ <string name="kg_failed_attempts_almost_at_login" product="default" msgid="5270861875006378092">"您已连续 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次画错解锁图案。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您使用自己的电子邮件账号解锁手机。\n\n请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
<string name="kg_text_message_separator" product="default" msgid="4503708889934976866">" — "</string>
<string name="kg_reordering_delete_drop_target_text" msgid="2034358143731750914">"删除"</string>
<string name="safe_media_volume_warning" product="default" msgid="3751676824423049994">"要将音量调高到建议的音量以上吗?\n\n长时间保持高音量可能会损伤听力。"</string>
@@ -1733,7 +1732,7 @@
<string name="accessibility_magnification_chooser_text" msgid="1502075582164931596">"放大功能"</string>
<string name="user_switched" msgid="7249833311585228097">"当前用户是<xliff:g id="NAME">%1$s</xliff:g>。"</string>
<string name="user_switching_message" msgid="1912993630661332336">"正在切换为<xliff:g id="NAME">%1$s</xliff:g>…"</string>
- <string name="user_logging_out_message" msgid="7216437629179710359">"正在将<xliff:g id="NAME">%1$s</xliff:g>退出帐号…"</string>
+ <string name="user_logging_out_message" msgid="7216437629179710359">"正在将<xliff:g id="NAME">%1$s</xliff:g>退出账号…"</string>
<string name="owner_name" msgid="8713560351570795743">"机主"</string>
<string name="guest_name" msgid="8502103277839834324">"访客"</string>
<string name="error_message_title" msgid="4082495589294631966">"错误"</string>
@@ -1938,7 +1937,7 @@
<string name="importance_from_user" msgid="2782756722448800447">"这些通知的重要程度由您来设置。"</string>
<string name="importance_from_person" msgid="4235804979664465383">"这条通知涉及特定的人,因此被归为重要通知。"</string>
<string name="notification_history_title_placeholder" msgid="7748630986182249599">"自定义应用通知"</string>
- <string name="user_creation_account_exists" msgid="2239146360099708035">"允许<xliff:g id="APP">%1$s</xliff:g>使用 <xliff:g id="ACCOUNT">%2$s</xliff:g>(目前已有用户使用此帐号)创建新用户吗?"</string>
+ <string name="user_creation_account_exists" msgid="2239146360099708035">"允许<xliff:g id="APP">%1$s</xliff:g>使用 <xliff:g id="ACCOUNT">%2$s</xliff:g>(目前已有用户使用此账号)创建新用户吗?"</string>
<string name="user_creation_adding" msgid="7305185499667958364">"允许<xliff:g id="APP">%1$s</xliff:g>使用 <xliff:g id="ACCOUNT">%2$s</xliff:g> 创建新用户吗?"</string>
<string name="supervised_user_creation_label" msgid="6884904353827427515">"添加受监管用户"</string>
<string name="language_selection_title" msgid="52674936078683285">"添加语言"</string>
diff --git a/core/res/res/values-zh-rHK/strings.xml b/core/res/res/values-zh-rHK/strings.xml
index 899c314..935e757 100644
--- a/core/res/res/values-zh-rHK/strings.xml
+++ b/core/res/res/values-zh-rHK/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"使用生物識別或螢幕鎖定"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"驗證是你本人"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"如要繼續操作,請使用使用生物識別驗證身分"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"如要繼續操作,請使用你的指紋驗證身分"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"如要繼續操作,請使用你的面孔驗證身分"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"請使用生物識別或螢幕鎖定功能驗證身分,才能繼續操作"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"無法使用生物識別硬件"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"已取消驗證"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"無法辨識指紋"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"無法辨識指紋"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"無法辨識面孔,請改用指紋完成驗證。"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"驗證咗指紋"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"面孔已經驗證"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"面孔已經驗證,請㩒一下 [確認]"</string>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index 717e046..3f93ecd 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"使用生物特徵辨識或螢幕鎖定功能"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"驗證你的身分"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"如要繼續操作,請使用生物特徵辨識功能驗證身分"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"如要繼續操作,請使用指紋驗證身分"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"如要繼續操作,請使用臉孔驗證身分"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"請使用生物特徵辨識或螢幕鎖定功能驗證身分,才能繼續操作"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"無法使用生物特徵辨識硬體"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"已取消驗證"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"指紋辨識失敗"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"指紋辨識失敗"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"無法辨識臉孔,請改用指紋完成驗證。"</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"指紋驗證成功"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"臉孔驗證成功"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"臉孔驗證成功,請按下 [確認] 按鈕"</string>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index 88a3547..929af23 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -618,8 +618,6 @@
<string name="biometric_or_screen_lock_app_setting_name" msgid="5348462421758257752">"Sebenzisa i-biometrics noma ukukhiya isikrini"</string>
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Qinisekisa ukuthi nguwe"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Sebenzisa i-biometric yakho ukuze uqhubeke"</string>
- <string name="biometric_dialog_fingerprint_subtitle" msgid="2520227942533751342">"Sebenzisa isigxivizo sakho somunwe ukuze uqhubeke"</string>
- <string name="biometric_dialog_face_subtitle" msgid="5269284162191087084">"Sebenzisa ubuso bakho ukuze uqhubeke"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Sebenzisa i-biometric noma ukukhiya isikrini ukuze uqhubeke"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"I-Biometric hardware ayitholakali"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Ukufakazela ubuqiniso kukhanseliwe"</string>
@@ -645,6 +643,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Isigxivizo somunwe asaziwa"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Isigxivizo somunwe asaziwa"</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="6226091888364083421">"Ayibazi ubuso. Sebenzisa izigxivizo zeminwe kunalokho."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Izigxivizo zeminwe zigunyaziwe"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Ubuso bufakazelwe ubuqiniso"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Ukuqinisekiswa kobuso, sicela ucindezele okuthi qinisekisa"</string>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index d80cfa3..f45499a 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2465,7 +2465,7 @@
duration of the vector animation automatically. -->
<attr name="windowSplashScreenAnimationDuration" format="integer"/>
- <!-- Place an drawable image in the bottom of the starting window, it can be used to
+ <!-- Place a drawable image in the bottom of the starting window. The image can be used to
represent the branding of the application. -->
<attr name="windowSplashScreenBrandingImage" format="reference"/>
<!-- Set a background behind the splash screen icon. This is useful if there is not enough
@@ -3245,7 +3245,7 @@
<!-- Specifies the id of a view for which this view serves as a label for
accessibility purposes. For example, a TextView before an EditText in
- the UI usually specifies what infomation is contained in the EditText.
+ the UI usually specifies what information is contained in the EditText.
Hence, the TextView is a label for the EditText. -->
<attr name="labelFor" format="reference" />
@@ -6787,7 +6787,7 @@
edges of a bitmap when rotated. Default value is false. -->
<attr name="antialias" format="boolean" />
<!-- Enables or disables bitmap filtering. Filtering is used when the bitmap is
- shrunk or stretched to smooth its apperance. Default value is true. -->
+ shrunk or stretched to smooth its appearance. Default value is true. -->
<attr name="filter" format="boolean" />
<!-- Enables or disables dithering of the bitmap if the bitmap does not have the
same pixel configuration as the screen (for instance: a ARGB 8888 bitmap with
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index b7d088b..95f1493 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -634,7 +634,7 @@
able to return to it. -->
<attr name="noHistory" format="boolean" />
- <!-- Specify whether an acitivty's task state should always be maintained
+ <!-- Specify whether an activity's task state should always be maintained
by the system, or if it is allowed to reset the task to its initial
state in certain situations.
@@ -731,15 +731,17 @@
This is equivalent to calling {@link android.app.Activity#setVrModeEnabled} with the
the given component name within the Activity that this attribute is set for.
Declaring this will prevent the system from leaving VR mode during an Activity
- transtion from one VR activity to another. -->
+ transition from one VR activity to another. -->
<attr name="enableVrMode" format="string" />
- <!-- Flag allowing the activity to specify which screen rotation animation
- it desires. Valid values are "rotate", "crossfade", and "jumpcut"
- as described in {@link android.view.WindowManager.LayoutParams#rotationAnimation}.
- Specifying your Rotation animation in the WindowManager.LayoutParams
- may be racy with app startup and updattransitions occuring during application startup and thusly
- the manifest attribute is preferred.
+ <!-- Flag that specifies the activity's preferred screen rotation animation.
+ Valid values are "rotate", "crossfade", "jumpcut", and "seamless" as
+ described in
+ {@link android.view.WindowManager.LayoutParams#rotationAnimation}.
+ Specifying your rotation animation in
+ <code>WindowManager.LayoutParams</code> may be racy with app startup
+ and update transitions that occur during application startup; and so,
+ specify the animation in the manifest attribute.
-->
<attr name="rotationAnimation">
<flag name="rotate" value= "0" />
@@ -830,7 +832,7 @@
<enum name="singleInstance" value="3" />
<!-- The activity can only be running as the root activity of the task, the first activity
that created the task, and therefore there will only be one instance of this activity
- in a task. In constrast to the {@code singleTask} launch mode, this activity can be
+ in a task. In contrast to the {@code singleTask} launch mode, this activity can be
started in multiple instances in different tasks if the
{@code FLAG_ACTIVITY_MULTIPLE_TASK} or {@code FLAG_ACTIVITY_NEW_DOCUMENT} is set.-->
<enum name="singleInstancePerTask" value="4" />
@@ -1328,7 +1330,7 @@
<p>Such a document is any kind of item for which an application may want to
maintain multiple simultaneous instances. Examples might be text files, web
pages, spreadsheets, or emails. Each such document will be in a separate
- task in the recent taskss list.
+ task in the recent tasks list.
<p>This attribute is equivalent to adding the flag {@link
android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT} to every Intent used to launch
@@ -1771,7 +1773,7 @@
</attr>
<!-- Enable hardware memory tagging (ARM MTE) in this process.
- When enabled, heap memory bugs like use-after-free and buffer overlow
+ When enabled, heap memory bugs like use-after-free and buffer overflow
are detected and result in an immediate ("sync" mode) or delayed ("async"
mode) crash instead of a silent memory corruption. Sync mode, while slower,
provides enhanced bug reports including stack traces at the time of allocation
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 6634425..281053b 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -45,9 +45,7 @@
<item><xliff:g id="id">@string/status_bar_phone_signal</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_secure</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_managed_profile</xliff:g></item>
- <item><xliff:g id="id">@string/status_bar_cast</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_connected_display</xliff:g></item>
- <item><xliff:g id="id">@string/status_bar_screen_record</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_vpn</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_bluetooth</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_camera</xliff:g></item>
@@ -56,6 +54,8 @@
<item><xliff:g id="id">@string/status_bar_mute</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_volume</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_zen</xliff:g></item>
+ <item><xliff:g id="id">@string/status_bar_screen_record</xliff:g></item>
+ <item><xliff:g id="id">@string/status_bar_cast</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_ethernet</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_wifi</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_hotspot</xliff:g></item>
@@ -542,6 +542,9 @@
<bool name="config_goToSleepOnButtonPressTheaterMode">true</bool>
<!-- If this is true, long press on power button will be available from the non-interactive state -->
<bool name="config_supportLongPressPowerWhenNonInteractive">false</bool>
+ <!-- If this is true, short press on power button will be available whenever the default display
+ is on even if the device is non-interactive (dreaming). -->
+ <bool name="config_supportShortPressPowerWhenDefaultDisplayOn">false</bool>
<!-- If this is true, then keep dreaming when unplugging.
This config was formerly known as config_keepDreamingWhenUndocking.
@@ -3039,14 +3042,15 @@
on the headphone/microphone jack. When false use the older uevent framework. -->
<bool name="config_useDevInputEventForAudioJack">false</bool>
- <!-- Whether safe headphone volume is enabled or not (country specific). -->
+ <!-- Whether safe headphone hearing is enforced by any regulation (e.g.
+ EN50332-3, EN50332-2) or not (country specific). -->
<bool name="config_safe_media_volume_enabled">true</bool>
- <!-- Whether safe headphone sound dosage warning is enabled or not
- (country specific). This value should only be overlaid to true
- when a vendor supports offload and has the HAL sound dose
- interfaces implemented. Otherwise, this can lead to a compliance
- issue with the safe hearing standards EN50332-3 and IEC62368-1.
+ <!-- Whether safe headphone sound dosage warning is enabled or not.
+ This value should only be overlaid to true when a vendor supports
+ offload and has the HAL sound dose interfaces implemented.
+ Otherwise, this can lead to a compliance issue with the safe
+ hearing standards EN50332-3 and IEC62368-1.
-->
<bool name="config_safe_sound_dosage_enabled">false</bool>
@@ -5043,6 +5047,21 @@
</array>
<!-- See DisplayWhiteBalanceController.
+ A float array containing a list of ambient brightnesses, in Lux. This array,
+ together with config_displayWhiteBalanceLowLightAmbientBiasesStrong, is used to generate a
+ lookup table used in DisplayWhiteBalanceController. This lookup table is used to map
+ ambient brightness readings to a bias, where the bias is used to linearly interpolate
+ between ambient color temperature and
+ config_displayWhiteBalanceLowLightAmbientColorTemperatureIdle.
+ This table is optional. If used, this array must,
+ 1) Contain at least two entries
+ 2) Be the same length as config_displayWhiteBalanceLowLightAmbientBiasesStrong. -->
+ <array name ="config_displayWhiteBalanceLowLightAmbientBrightnessesStrong">
+ <item>10.0</item>
+ <item>10.0</item>
+ </array>
+
+ <!-- See DisplayWhiteBalanceController.
An array containing a list of biases. See
config_displayWhiteBalanceLowLightAmbientBrightnesses for additional details.
This array must be in the range of [0.0, 1.0]. -->
@@ -5052,12 +5071,28 @@
</array>
<!-- See DisplayWhiteBalanceController.
+ An array containing a list of biases. See
+ config_displayWhiteBalanceLowLightAmbientBrightnessesStrong for additional details.
+ This array must be in the range of [0.0, 1.0]. -->
+ <array name ="config_displayWhiteBalanceLowLightAmbientBiasesStrong">
+ <item>0.0</item>
+ <item>1.0</item>
+ </array>
+
+ <!-- See DisplayWhiteBalanceController.
The ambient color temperature (in cct) to which we interpolate towards using the
the look up table generated by config_displayWhiteBalanceLowLightAmbientBrightnesses
and config_displayWhiteBalanceLowLightAmbientBiases. -->
<item name="config_displayWhiteBalanceLowLightAmbientColorTemperature" format="float" type="dimen">6500.0</item>
<!-- See DisplayWhiteBalanceController.
+ The ambient color temperature (in cct) to which we interpolate towards using the
+ the look up table generated by config_displayWhiteBalanceLowLightAmbientBrightnessesStrong
+ and config_displayWhiteBalanceLowLightAmbientBiasesStrong. Used when device is in Idle Screen
+ Brightness mode. -->
+ <item name="config_displayWhiteBalanceLowLightAmbientColorTemperatureStrong" format="float" type="dimen">6500.0</item>
+
+ <!-- See DisplayWhiteBalanceController.
A float array containing a list of ambient brightnesses, in Lux. This array,
together with config_displayWhiteBalanceHighLightAmbientBiases, is used to generate a
lookup table used in DisplayWhiteBalanceController. This lookup table is used to map
@@ -5071,6 +5106,19 @@
</array>
<!-- See DisplayWhiteBalanceController.
+ A float array containing a list of ambient brightnesses, in Lux. This array,
+ together with config_displayWhiteBalanceHighLightAmbientBiasesStrong, is used to generate a
+ lookup table used in DisplayWhiteBalanceController. This lookup table is used to map
+ ambient brightness readings to a bias, where the bias is used to linearly interpolate
+ between ambient color temperature and
+ config_displayWhiteBalanceHighLightAmbientColorTemperatureStrong.
+ This table is optional. If used, this array must,
+ 1) Contain at least two entries
+ 2) Be the same length as config_displayWhiteBalanceHighLightAmbientBiasesStrong. -->
+ <array name ="config_displayWhiteBalanceHighLightAmbientBrightnessesStrong">
+ </array>
+
+ <!-- See DisplayWhiteBalanceController.
An array containing a list of biases. See
config_displayWhiteBalanceHighLightAmbientBrightnesses for additional details.
This array must be in the range of [0.0, 1.0]. -->
@@ -5078,12 +5126,26 @@
</array>
<!-- See DisplayWhiteBalanceController.
+ An array containing a list of biases. See
+ config_displayWhiteBalanceHighLightAmbientBrightnessesStrong for additional details.
+ This array must be in the range of [0.0, 1.0]. -->
+ <array name ="config_displayWhiteBalanceHighLightAmbientBiasesStrong">
+ </array>
+
+ <!-- See DisplayWhiteBalanceController.
The ambient color temperature (in cct) to which we interpolate towards using the
the look up table generated by config_displayWhiteBalanceHighLightAmbientBrightnesses
and config_displayWhiteBalanceHighLightAmbientBiases. -->
<item name="config_displayWhiteBalanceHighLightAmbientColorTemperature" format="float" type="dimen">8000.0</item>
<!-- See DisplayWhiteBalanceController.
+ The ambient color temperature (in cct) to which we interpolate towards using the
+ the look up table generated by config_displayWhiteBalanceHighLightAmbientBrightnessesStrong
+ and config_displayWhiteBalanceHighLightAmbientBiasesStrong. Used when device is in Idle
+ Screen Brightness mode. -->
+ <item name="config_displayWhiteBalanceHighLightAmbientColorTemperatureStrong" format="float" type="dimen">8000.0</item>
+
+ <!-- See DisplayWhiteBalanceController.
A float array containing a list of ambient color temperatures, in Kelvin. This array,
together with config_displayWhiteBalanceDisplayColorTemperatures, is used to generate a
lookup table used in DisplayWhiteBalanceController. This lookup table is used to map
@@ -5297,6 +5359,7 @@
<item>1,1,1.0,0,1</item>
<item>1,1,1.0,.4,1</item>
<item>1,1,1.0,.15,15</item>
+ <item>0,0,0.7,0,1</item>
</string-array>
<!-- The integer index of the selected option in config_udfps_touch_detection_options -->
@@ -6116,6 +6179,9 @@
<!-- Default value for Settings.ASSIST_TOUCH_GESTURE_ENABLED -->
<bool name="config_assistTouchGestureEnabledDefault">true</bool>
+ <!-- Default value for Settings.SEARCH_PRESS_HOLD_NAV_HANDLE_ENABLED -->
+ <bool name="config_searchPressHoldNavHandleEnabledDefault">true</bool>
+
<!-- The maximum byte size of the information contained in the bundle of
HotwordDetectedResult. -->
<integer translatable="false" name="config_hotwordDetectedResultMaxBundleSize">0</integer>
@@ -6562,11 +6628,6 @@
<!-- Whether to show weather on the lock screen by default. -->
<bool name="config_lockscreenWeatherEnabledByDefault">false</bool>
- <!-- Whether to reset Battery Stats on unplug when the battery level is high. -->
- <bool name="config_batteryStatsResetOnUnplugHighBatteryLevel">true</bool>
- <!-- Whether to reset Battery Stats on unplug if the battery was significantly charged -->
- <bool name="config_batteryStatsResetOnUnplugAfterSignificantCharge">true</bool>
-
<!-- Whether we should persist the brightness value in nits for the default display even if
the underlying display device changes. -->
<bool name="config_persistBrightnessNitsForDefaultDisplay">false</bool>
diff --git a/core/res/res/values/config_battery_stats.xml b/core/res/res/values/config_battery_stats.xml
new file mode 100644
index 0000000..8fb48bc
--- /dev/null
+++ b/core/res/res/values/config_battery_stats.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 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.
+ -->
+
+<!-- These resources are around just to allow their values to be customized
+ for different hardware and product builds. Do not translate.
+
+ NOTE: The naming convention is "config_camelCaseValue". -->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Whether to reset Battery Stats on unplug when the battery level is high. -->
+ <bool name="config_batteryStatsResetOnUnplugHighBatteryLevel">true</bool>
+ <!-- Whether to reset Battery Stats on unplug if the battery was significantly charged -->
+ <bool name="config_batteryStatsResetOnUnplugAfterSignificantCharge">true</bool>
+
+ <!-- CPU power stats collection throttle period in milliseconds. Since power stats collection
+ is a relatively expensive operation, this throttle period may need to be adjusted for low-power
+ devices-->
+ <integer name="config_defaultPowerStatsThrottlePeriodCpu">60000</integer>
+</resources>
diff --git a/core/res/res/values/config_telephony.xml b/core/res/res/values/config_telephony.xml
index bda194a..6bb87f3 100644
--- a/core/res/res/values/config_telephony.xml
+++ b/core/res/res/values/config_telephony.xml
@@ -73,7 +73,7 @@
CarrierConfigManager#KEY_AUTO_DATA_SWITCH_RAT_SIGNAL_SCORE_STRING_ARRAY.
If 0, the device always switch to the higher score SIM.
If < 0, the network type and signal strength based auto switch is disabled. -->
- <integer name="auto_data_switch_score_tolerance">3000</integer>
+ <integer name="auto_data_switch_score_tolerance">-1</integer>
<java-symbol type="integer" name="auto_data_switch_score_tolerance" />
<!-- Boolean indicating whether the Iwlan data service supports persistence of iwlan ipsec
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index c5aa8b0..207927a 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -1895,22 +1895,22 @@
<!-- Content description which should be used for the fingerprint icon. -->
<string name="fingerprint_icon_content_description">Fingerprint icon</string>
+ <!-- Notification name shown when the system requires the user to set up device unlock. [CHAR LIMIT=NONE] -->
+ <string name="device_unlock_notification_name">Device unlock</string>
+ <!-- Notification title shown when the system suggests the user to set up another way to unlock. [CHAR LIMIT=NONE] -->
+ <string name="alternative_unlock_setup_notification_title">Try another way to unlock</string>
+ <!-- Notification content shown when the system suggests the user to enroll their face. [CHAR LIMIT=NONE] -->
+ <string name="alternative_face_setup_notification_content">Use Face Unlock when your fingerprint isn\'t recognized, like when your fingers are wet</string>
+ <!-- Notification content shown when the system suggests the user to enroll their fingerprint. [CHAR LIMIT=NONE] -->
+ <string name="alternative_fp_setup_notification_content">Use Fingerprint Unlock when your face isn\'t recognized, like when there\'s not enough light</string>
<!-- Notification name shown when the system requires the user to re-enroll their face. [CHAR LIMIT=NONE] -->
<string name="face_recalibrate_notification_name">Face Unlock</string>
<!-- Notification title shown when the system requires the user to re-enroll their face. [CHAR LIMIT=NONE] -->
<string name="face_recalibrate_notification_title">Issue with Face Unlock</string>
<!-- Notification content shown when the system requires the user to re-enroll their face. [CHAR LIMIT=NONE] -->
<string name="face_recalibrate_notification_content">Tap to delete your face model, then add your face again</string>
- <!-- Title of a notification that directs the user to set up Face Unlock by enrolling their face. [CHAR LIMIT=NONE] -->
- <string name="face_setup_notification_title">Set up Face Unlock</string>
- <!-- Contents of a notification that directs the user to set up face unlock by enrolling their face. [CHAR LIMIT=NONE] -->
- <string name="face_setup_notification_content">Unlock your phone by looking at it</string>
<!-- Error message indicating that the camera privacy sensor has been turned on [CHAR LIMIT=NONE] -->
<string name="face_sensor_privacy_enabled">To use Face Unlock, turn on <b>Camera access</b> in Settings > Privacy</string>
- <!-- Title of a notification that directs the user to enroll a fingerprint. [CHAR LIMIT=NONE] -->
- <string name="fingerprint_setup_notification_title">Set up more ways to unlock</string>
- <!-- Contents of a notification that directs the user to enroll a fingerprint. [CHAR LIMIT=NONE] -->
- <string name="fingerprint_setup_notification_content">Tap to add a fingerprint</string>
<!-- Notification name shown when the system requires the user to re-calibrate their fingerprint. [CHAR LIMIT=NONE] -->
<string name="fingerprint_recalibrate_notification_name">Fingerprint Unlock</string>
@@ -5561,7 +5561,7 @@
<!-- Title for the autofill update dialog shown when the the contents of the activity can be updated
in an autofill service, and the service knows what the activity represents, and it represents 3 types of
data (for example, username, password and credit card info) [CHAR LIMIT=NONE] -->
- <string name="autofill_update_title_with_3types">Update these items in <b><xliff:g id="label" example="MyPass">%4$s</xliff:g></b>: <xliff:g id="type" example="Username">%1$s</xliff:g>, <xliff:g id="type" example="Password">%2$s</xliff:g>, and <xliff:g id="type" example="Credit Card">%3$s</xliff:g> ?</string>
+ <string name="autofill_update_title_with_3types">Update these items in <b><xliff:g id="label" example="MyPass">%4$s</xliff:g></b>: <xliff:g id="type" example="Username">%1$s</xliff:g>, <xliff:g id="type" example="Password">%2$s</xliff:g>, and <xliff:g id="type" example="Credit Card">%3$s</xliff:g>?</string>
<!-- Label for the autofill save button [CHAR LIMIT=NONE] -->
<string name="autofill_save_yes">Save</string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 038cce3..aa0cbfa 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1969,6 +1969,7 @@
<java-symbol type="integer" name="config_keyguardDrawnTimeout" />
<java-symbol type="bool" name="config_goToSleepOnButtonPressTheaterMode" />
<java-symbol type="bool" name="config_supportLongPressPowerWhenNonInteractive" />
+ <java-symbol type="bool" name="config_supportShortPressPowerWhenDefaultDisplayOn" />
<java-symbol type="bool" name="config_wimaxEnabled" />
<java-symbol type="bool" name="show_ongoing_ime_switcher" />
<java-symbol type="color" name="config_defaultNotificationColor" />
@@ -2598,6 +2599,12 @@
<!-- Biometric FRR config -->
<java-symbol type="fraction" name="config_biometricNotificationFrrThreshold" />
+ <!-- Biometric FRR notification messages -->
+ <java-symbol type="string" name="device_unlock_notification_name" />
+ <java-symbol type="string" name="alternative_unlock_setup_notification_title" />
+ <java-symbol type="string" name="alternative_face_setup_notification_content" />
+ <java-symbol type="string" name="alternative_fp_setup_notification_content" />
+
<!-- Device credential strings for BiometricManager -->
<java-symbol type="string" name="screen_lock_app_setting_name" />
<java-symbol type="string" name="screen_lock_dialog_default_subtitle" />
@@ -4168,11 +4175,17 @@
<java-symbol type="array" name="config_displayWhiteBalanceIncreaseThresholds" />
<java-symbol type="array" name="config_displayWhiteBalanceDecreaseThresholds" />
<java-symbol type="array" name="config_displayWhiteBalanceLowLightAmbientBrightnesses" />
+ <java-symbol type="array" name="config_displayWhiteBalanceLowLightAmbientBrightnessesStrong" />
<java-symbol type="array" name="config_displayWhiteBalanceLowLightAmbientBiases" />
+ <java-symbol type="array" name="config_displayWhiteBalanceLowLightAmbientBiasesStrong" />
<java-symbol type="dimen" name="config_displayWhiteBalanceLowLightAmbientColorTemperature" />
+ <java-symbol type="dimen" name="config_displayWhiteBalanceLowLightAmbientColorTemperatureStrong" />
<java-symbol type="array" name="config_displayWhiteBalanceHighLightAmbientBrightnesses" />
+ <java-symbol type="array" name="config_displayWhiteBalanceHighLightAmbientBrightnessesStrong" />
<java-symbol type="array" name="config_displayWhiteBalanceHighLightAmbientBiases" />
+ <java-symbol type="array" name="config_displayWhiteBalanceHighLightAmbientBiasesStrong" />
<java-symbol type="dimen" name="config_displayWhiteBalanceHighLightAmbientColorTemperature" />
+ <java-symbol type="dimen" name="config_displayWhiteBalanceHighLightAmbientColorTemperatureStrong" />
<java-symbol type="array" name="config_displayWhiteBalanceAmbientColorTemperatures" />
<java-symbol type="array" name="config_displayWhiteBalanceDisplayColorTemperatures" />
<java-symbol type="array" name="config_displayWhiteBalanceStrongAmbientColorTemperatures" />
@@ -4896,6 +4909,8 @@
<java-symbol type="bool" name="config_assistLongPressHomeEnabledDefault" />
<java-symbol type="bool" name="config_assistTouchGestureEnabledDefault" />
+ <java-symbol type="bool" name="config_searchPressHoldNavHandleEnabledDefault" />
+
<java-symbol type="integer" name="config_hotwordDetectedResultMaxBundleSize" />
<java-symbol type="dimen" name="config_wallpaperDimAmount" />
@@ -5075,6 +5090,7 @@
<java-symbol type="bool" name="config_batteryStatsResetOnUnplugHighBatteryLevel" />
<java-symbol type="bool" name="config_batteryStatsResetOnUnplugAfterSignificantCharge" />
+ <java-symbol type="integer" name="config_defaultPowerStatsThrottlePeriodCpu" />
<java-symbol name="materialColorOnSecondaryFixedVariant" type="attr"/>
<java-symbol name="materialColorOnTertiaryFixedVariant" type="attr"/>
@@ -5186,6 +5202,7 @@
<java-symbol type="style" name="ThemeOverlay.DeviceDefault.Dark.ActionBar.Accent" />
<java-symbol type="drawable" name="focus_event_pressed_key_background" />
+ <java-symbol type="drawable" name="focus_event_rotary_input_background" />
<java-symbol type="string" name="config_defaultShutdownVibrationFile" />
<java-symbol type="string" name="lockscreen_too_many_failed_attempts_countdown" />
diff --git a/core/tests/coretests/Android.bp b/core/tests/coretests/Android.bp
index c14da29..7f56eb7 100644
--- a/core/tests/coretests/Android.bp
+++ b/core/tests/coretests/Android.bp
@@ -88,7 +88,7 @@
resource_dirs: ["res"],
resource_zips: [":FrameworksCoreTests_apks_as_resources"],
- java_resources: [":ApkVerityTestCertDer"],
+ java_resources: [":FrameworksCoreTests_unit_test_cert_der"],
data: [
":BinderDeathRecipientHelperApp1",
diff --git a/core/tests/coretests/AndroidManifest.xml b/core/tests/coretests/AndroidManifest.xml
index 31755ef..a358c4f 100644
--- a/core/tests/coretests/AndroidManifest.xml
+++ b/core/tests/coretests/AndroidManifest.xml
@@ -1749,6 +1749,15 @@
<category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
</intent-filter>
</activity>
+
+ <activity android:name="android.view.ViewGroupTestActivity"
+ android:label="ViewGroup Test"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.FRAMEWORK_INSTRUMENTATION_TEST" />
+ </intent-filter>
+ </activity>
</application>
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
diff --git a/core/tests/coretests/certs/Android.bp b/core/tests/coretests/certs/Android.bp
index 8d4ecf4..cefdc4d 100644
--- a/core/tests/coretests/certs/Android.bp
+++ b/core/tests/coretests/certs/Android.bp
@@ -13,3 +13,8 @@
name: "FrameworksCoreTests_unit_test_cert",
certificate: "unit_test",
}
+
+filegroup {
+ name: "FrameworksCoreTests_unit_test_cert_der",
+ srcs: ["unit_test.der"],
+}
diff --git a/core/tests/coretests/certs/README b/core/tests/coretests/certs/README
index 00917a1..b5c096e 100644
--- a/core/tests/coretests/certs/README
+++ b/core/tests/coretests/certs/README
@@ -2,3 +2,5 @@
development/tools/make_key unit_test '/CN=unit_test'
development/tools/make_key unit_test_diff '/CN=unit_test_diff'
+
+openssl x509 -in unit_test.x509.pem -out unit_test.der -outform der
diff --git a/core/tests/coretests/certs/unit_test.der b/core/tests/coretests/certs/unit_test.der
new file mode 100644
index 0000000..4dbbc49
--- /dev/null
+++ b/core/tests/coretests/certs/unit_test.der
Binary files differ
diff --git a/core/tests/coretests/res/layout/viewgroup_test.xml b/core/tests/coretests/res/layout/viewgroup_test.xml
new file mode 100644
index 0000000..04f4f52
--- /dev/null
+++ b/core/tests/coretests/res/layout/viewgroup_test.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!-- Demonstrates adding/removing views from ViewGroup. See corresponding Java code. -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/linear_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ <EditText
+ android:id="@+id/view"
+ android:layout_width="20dp"
+ android:layout_height="10dp"
+ android:text="Hello World!"
+ android:background="#2F00FF00" />
+ <EditText
+ android:id="@+id/view_scale"
+ android:layout_width="20dp"
+ android:layout_height="10dp"
+ android:scaleX="0.5"
+ android:scaleY="2"
+ android:transformPivotX="0dp"
+ android:transformPivotY="0dp"
+ android:text="Hello World!"
+ android:background="#2F00FF00" />
+ <EditText
+ android:id="@+id/view_translate"
+ android:layout_width="20dp"
+ android:layout_height="10dp"
+ android:translationX="10dp"
+ android:translationY="20dp"
+ android:text="Hello World!"
+ android:background="#2F00FF00" />
+ <FrameLayout
+ android:layout_width="20dp"
+ android:layout_height="10dp">
+ <EditText
+ android:id="@+id/view_overlap_bottom"
+ android:layout_width="20dp"
+ android:layout_height="10dp"
+ android:text="Hello World!"/>
+ <Button
+ android:id="@+id/view_overlap_top"
+ android:layout_width="10dp"
+ android:layout_height="10dp"/>
+ </FrameLayout>
+
+ <FrameLayout
+ android:layout_width="20dp"
+ android:layout_height="10dp">
+ <EditText
+ android:id="@+id/view_cover_bottom"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:text="Hello World!"/>
+ <Button
+ android:id="@+id/view_cover_top"
+ android:layout_width="10dp"
+ android:layout_height="10dp"/>
+ </FrameLayout>
+
+</LinearLayout>
diff --git a/core/tests/coretests/res/raw/fsverity_sig b/core/tests/coretests/res/raw/fsverity_sig
index b2f335d..2c28f0b 100644
--- a/core/tests/coretests/res/raw/fsverity_sig
+++ b/core/tests/coretests/res/raw/fsverity_sig
Binary files differ
diff --git a/core/tests/coretests/res/values-id/strings.xml b/core/tests/coretests/res/values-id/strings.xml
new file mode 100644
index 0000000..6d71c90
--- /dev/null
+++ b/core/tests/coretests/res/values-id/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Used in ResourcesLocaleTest. -->
+ <string name="locale_test_res_1">Pengujian ID</string>
+</resources>
diff --git a/core/tests/coretests/res/values-in/strings.xml b/core/tests/coretests/res/values-in/strings.xml
new file mode 100644
index 0000000..6384660
--- /dev/null
+++ b/core/tests/coretests/res/values-in/strings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <!-- Used in ResourcesLocaleTest. -->
+ <string name="locale_test_res_2">Pengujian IN</string>
+</resources>
diff --git a/core/tests/coretests/res/values/strings.xml b/core/tests/coretests/res/values/strings.xml
index e51eab6..09e1c69 100644
--- a/core/tests/coretests/res/values/strings.xml
+++ b/core/tests/coretests/res/values/strings.xml
@@ -131,6 +131,13 @@
<string name="textview_hebrew_text">םמab?!</string>
+ <!-- Used in ResourcesLocaleTest. Also defined in values-id. "id" is the new ISO code for Indonesian. -->
+ <string name="locale_test_res_1">Testing ID</string>
+ <!-- Used in ResourcesLocaleTest. Also defined in values-in. "in" is the deprecated ISO code for Indonesian. -->
+ <string name="locale_test_res_2">Testing IN</string>
+ <!-- Used in ResourcesLocaleTest. -->
+ <string name="locale_test_res_3">Testing EN</string>
+
<!-- SizeAdaptiveLayout -->
<string name="first">Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.</string>
<string name="actor">Abe Lincoln</string>
diff --git a/core/tests/coretests/src/android/app/NotificationTest.java b/core/tests/coretests/src/android/app/NotificationTest.java
index a936cea..f9377fc 100644
--- a/core/tests/coretests/src/android/app/NotificationTest.java
+++ b/core/tests/coretests/src/android/app/NotificationTest.java
@@ -19,6 +19,8 @@
import static android.app.Notification.CarExtender.UnreadConversation.KEY_ON_READ;
import static android.app.Notification.CarExtender.UnreadConversation.KEY_ON_REPLY;
import static android.app.Notification.CarExtender.UnreadConversation.KEY_REMOTE_INPUT;
+import static android.app.Notification.DEFAULT_SOUND;
+import static android.app.Notification.DEFAULT_VIBRATE;
import static android.app.Notification.EXTRA_ANSWER_INTENT;
import static android.app.Notification.EXTRA_BUILDER_APPLICATION_INFO;
import static android.app.Notification.EXTRA_CALL_PERSON;
@@ -35,6 +37,9 @@
import static android.app.Notification.EXTRA_PICTURE_ICON;
import static android.app.Notification.EXTRA_SUMMARY_TEXT;
import static android.app.Notification.EXTRA_TITLE;
+import static android.app.Notification.GROUP_ALERT_CHILDREN;
+import static android.app.Notification.GROUP_ALERT_SUMMARY;
+import static android.app.Notification.GROUP_KEY_SILENT;
import static android.app.Notification.MessagingStyle.Message.KEY_DATA_URI;
import static android.app.Notification.MessagingStyle.Message.KEY_SENDER_PERSON;
import static android.app.Notification.MessagingStyle.Message.KEY_TEXT;
@@ -511,6 +516,75 @@
}
@Test
+ public void testBuilder_setSilent_summaryBehavior_groupAlertChildren() {
+ Notification summaryNotif = new Notification.Builder(mContext, "channelId")
+ .setGroupSummary(true)
+ .setGroup("groupKey")
+ .setSilent(true)
+ .build();
+ assertEquals(GROUP_ALERT_CHILDREN, summaryNotif.getGroupAlertBehavior());
+ }
+
+ @Test
+ public void testBuilder_setSilent_childBehavior_groupAlertSummary() {
+ Notification childNotif = new Notification.Builder(mContext, "channelId")
+ .setGroupSummary(false)
+ .setGroup("groupKey")
+ .setSilent(true)
+ .build();
+ assertEquals(GROUP_ALERT_SUMMARY, childNotif.getGroupAlertBehavior());
+ }
+
+ @Test
+ public void testBuilder_setSilent_emptyGroupKey_groupKeySilent() {
+ Notification emptyGroupKeyNotif = new Notification.Builder(mContext, "channelId")
+ .setGroup("")
+ .setSilent(true)
+ .build();
+ assertEquals(GROUP_KEY_SILENT, emptyGroupKeyNotif.getGroup());
+ }
+
+ @Test
+ public void testBuilder_setSilent_vibrateNull() {
+ Notification silentNotif = new Notification.Builder(mContext, "channelId")
+ .setGroup("")
+ .setSilent(true)
+ .build();
+
+ assertNull(silentNotif.vibrate);
+ }
+
+ @Test
+ public void testBuilder_setSilent_soundNull() {
+ Notification silentNotif = new Notification.Builder(mContext, "channelId")
+ .setGroup("")
+ .setSilent(true)
+ .build();
+
+ assertNull(silentNotif.sound);
+ }
+
+ @Test
+ public void testBuilder_setSilent_noDefaultSound() {
+ Notification silentNotif = new Notification.Builder(mContext, "channelId")
+ .setGroup("")
+ .setSilent(true)
+ .build();
+
+ assertEquals(0, (silentNotif.defaults & DEFAULT_SOUND));
+ }
+
+ @Test
+ public void testBuilder_setSilent_noDefaultVibrate() {
+ Notification silentNotif = new Notification.Builder(mContext, "channelId")
+ .setGroup("")
+ .setSilent(true)
+ .build();
+
+ assertEquals(0, (silentNotif.defaults & DEFAULT_VIBRATE));
+ }
+
+ @Test
public void testCallStyle_getSystemActions_forIncomingCall() {
PendingIntent answerIntent = createPendingIntent("answer");
PendingIntent declineIntent = createPendingIntent("decline");
diff --git a/core/tests/coretests/src/android/app/activity/ActivityThreadTest.java b/core/tests/coretests/src/android/app/activity/ActivityThreadTest.java
index 91c4dde..a923479 100644
--- a/core/tests/coretests/src/android/app/activity/ActivityThreadTest.java
+++ b/core/tests/coretests/src/android/app/activity/ActivityThreadTest.java
@@ -67,6 +67,7 @@
import android.window.WindowContextInfo;
import android.window.WindowTokenClientController;
+import androidx.test.filters.FlakyTest;
import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -629,6 +630,7 @@
});
}
+ @FlakyTest(bugId = 295234586)
@Test
public void testHandleConfigurationChanged_DoesntOverrideActivityConfig() {
final TestActivity activity = mActivityTestRule.launchActivity(new Intent());
@@ -643,7 +645,8 @@
new Configuration(oldAppResources.getConfiguration());
final DisplayMetrics oldApplicationMetrics = new DisplayMetrics();
oldApplicationMetrics.setTo(oldAppResources.getDisplayMetrics());
- assertEquals("Process config must match the top activity config by default",
+ assertEquals("Process config must match the top activity config by default"
+ + ", activity=" + oldActivityConfig + ", app=" + oldAppConfig,
0, oldActivityConfig.diffPublicOnly(oldAppConfig));
assertEquals("Process config must match the top activity config by default",
oldActivityMetrics, oldApplicationMetrics);
diff --git a/core/tests/coretests/src/android/app/activity/BroadcastTest.java b/core/tests/coretests/src/android/app/activity/BroadcastTest.java
index 10452fd..bc69901 100644
--- a/core/tests/coretests/src/android/app/activity/BroadcastTest.java
+++ b/core/tests/coretests/src/android/app/activity/BroadcastTest.java
@@ -110,6 +110,7 @@
public Intent makeBroadcastIntent(String action) {
Intent intent = new Intent(action, null);
intent.putExtra("caller", mCallTarget);
+ intent.setPackage(getContext().getPackageName());
return intent;
}
@@ -179,7 +180,8 @@
public void registerMyReceiver(IntentFilter filter, String permission) {
mReceiverRegistered = true;
//System.out.println("Registering: " + mReceiver);
- getContext().registerReceiver(mReceiver, filter, permission, null);
+ getContext().registerReceiver(mReceiver, filter, permission, null,
+ Context.RECEIVER_EXPORTED);
}
public void unregisterMyReceiver() {
@@ -255,7 +257,7 @@
}
@FlakyTest
- public void testMulti() throws Exception {
+ public void ignore_testMulti() throws Exception {
runLaunchpad(LaunchpadActivity.BROADCAST_MULTI);
}
@@ -278,8 +280,11 @@
Bundle map = new Bundle();
map.putString("foo", "you");
map.putString("remove", "me");
+ final Intent intent = new Intent(
+ "com.android.frameworks.coretests.activity.BROADCAST_RESULT")
+ .setPackage(getContext().getPackageName());
getContext().sendOrderedBroadcast(
- new Intent("com.android.frameworks.coretests.activity.BROADCAST_RESULT"),
+ intent,
null, broadcastReceiver, null, 1, "foo", map);
while (!broadcastReceiver.mHaveResult) {
try {
@@ -313,7 +318,7 @@
addIntermediate("finished-broadcast");
IntentFilter filter = new IntentFilter(LaunchpadActivity.BROADCAST_STICKY1);
- Intent sticky = getContext().registerReceiver(null, filter);
+ Intent sticky = getContext().registerReceiver(null, filter, Context.RECEIVER_EXPORTED);
assertNotNull("Sticky not found", sticky);
assertEquals(LaunchpadActivity.DATA_1, sticky.getStringExtra("test"));
}
@@ -329,7 +334,7 @@
addIntermediate("finished-unbroadcast");
IntentFilter filter = new IntentFilter(LaunchpadActivity.BROADCAST_STICKY1);
- Intent sticky = getContext().registerReceiver(null, filter);
+ Intent sticky = getContext().registerReceiver(null, filter, Context.RECEIVER_EXPORTED);
assertNull("Sticky not found", sticky);
}
@@ -343,7 +348,7 @@
addIntermediate("finished-broadcast");
IntentFilter filter = new IntentFilter(LaunchpadActivity.BROADCAST_STICKY1);
- Intent sticky = getContext().registerReceiver(null, filter);
+ Intent sticky = getContext().registerReceiver(null, filter, Context.RECEIVER_EXPORTED);
assertNotNull("Sticky not found", sticky);
assertEquals(LaunchpadActivity.DATA_2, sticky.getStringExtra("test"));
}
@@ -371,7 +376,7 @@
runLaunchpad(LaunchpadActivity.BROADCAST_STICKY2);
}
- public void testRegisteredReceivePermissionGranted() throws Exception {
+ public void ignore_testRegisteredReceivePermissionGranted() throws Exception {
setExpectedReceivers(new String[]{RECEIVER_REG});
registerMyReceiver(new IntentFilter(BROADCAST_REGISTERED), PERMISSION_GRANTED);
addIntermediate("after-register");
@@ -396,7 +401,7 @@
waitForResultOrThrow(BROADCAST_TIMEOUT);
}
- public void testRegisteredBroadcastPermissionGranted() throws Exception {
+ public void ignore_testRegisteredBroadcastPermissionGranted() throws Exception {
setExpectedReceivers(new String[]{RECEIVER_REG});
registerMyReceiver(new IntentFilter(BROADCAST_REGISTERED), null);
addIntermediate("after-register");
@@ -430,7 +435,7 @@
waitForResultOrThrow(BROADCAST_TIMEOUT);
}
- public void testLocalReceivePermissionDenied() throws Exception {
+ public void ignore_testLocalReceivePermissionDenied() throws Exception {
setExpectedReceivers(new String[]{RECEIVER_RESULTS});
BroadcastReceiver finish = new BroadcastReceiver() {
@@ -446,7 +451,7 @@
waitForResultOrThrow(BROADCAST_TIMEOUT);
}
- public void testLocalBroadcastPermissionGranted() throws Exception {
+ public void ignore_testLocalBroadcastPermissionGranted() throws Exception {
setExpectedReceivers(new String[]{RECEIVER_LOCAL});
getContext().sendBroadcast(
makeBroadcastIntent(BROADCAST_LOCAL),
@@ -476,7 +481,7 @@
waitForResultOrThrow(BROADCAST_TIMEOUT);
}
- public void testRemoteReceivePermissionDenied() throws Exception {
+ public void ignore_testRemoteReceivePermissionDenied() throws Exception {
setExpectedReceivers(new String[]{RECEIVER_RESULTS});
BroadcastReceiver finish = new BroadcastReceiver() {
@@ -492,7 +497,7 @@
waitForResultOrThrow(BROADCAST_TIMEOUT);
}
- public void testRemoteBroadcastPermissionGranted() throws Exception {
+ public void ignore_testRemoteBroadcastPermissionGranted() throws Exception {
setExpectedReceivers(new String[]{RECEIVER_REMOTE});
getContext().sendBroadcast(
makeBroadcastIntent(BROADCAST_REMOTE),
@@ -516,7 +521,7 @@
waitForResultOrThrow(BROADCAST_TIMEOUT);
}
- public void testReceiverCanNotRegister() throws Exception {
+ public void ignore_testReceiverCanNotRegister() throws Exception {
setExpectedReceivers(new String[]{RECEIVER_LOCAL});
getContext().sendBroadcast(makeBroadcastIntent(BROADCAST_FAIL_REGISTER));
waitForResultOrThrow(BROADCAST_TIMEOUT);
diff --git a/core/tests/coretests/src/android/app/activity/IntentSenderTest.java b/core/tests/coretests/src/android/app/activity/IntentSenderTest.java
index 1b52f80..a0645ce 100644
--- a/core/tests/coretests/src/android/app/activity/IntentSenderTest.java
+++ b/core/tests/coretests/src/android/app/activity/IntentSenderTest.java
@@ -27,7 +27,7 @@
@LargeTest
public class IntentSenderTest extends BroadcastTest {
- public void testRegisteredReceivePermissionGranted() throws Exception {
+ public void ignore_testRegisteredReceivePermissionGranted() throws Exception {
setExpectedReceivers(new String[]{RECEIVER_REG});
registerMyReceiver(new IntentFilter(BROADCAST_REGISTERED), PERMISSION_GRANTED);
addIntermediate("after-register");
@@ -71,7 +71,7 @@
is.cancel();
}
- public void testLocalReceivePermissionDenied() throws Exception {
+ public void ignore_testLocalReceivePermissionDenied() throws Exception {
final Intent intent = makeBroadcastIntent(BROADCAST_LOCAL_DENIED)
.setPackage(getContext().getPackageName());
diff --git a/core/tests/coretests/src/android/app/activity/LaunchpadActivity.java b/core/tests/coretests/src/android/app/activity/LaunchpadActivity.java
index 7662456..fda249f 100644
--- a/core/tests/coretests/src/android/app/activity/LaunchpadActivity.java
+++ b/core/tests/coretests/src/android/app/activity/LaunchpadActivity.java
@@ -438,6 +438,7 @@
private Intent makeBroadcastIntent(String action) {
Intent intent = new Intent(action, null);
intent.putExtra("caller", mCallTarget);
+ intent.setPackage(getPackageName());
return intent;
}
@@ -466,7 +467,7 @@
private void registerMyReceiver(IntentFilter filter) {
mReceiverRegistered = true;
//System.out.println("Registering: " + mReceiver);
- registerReceiver(mReceiver, filter);
+ registerReceiver(mReceiver, filter, Context.RECEIVER_EXPORTED);
}
private void unregisterMyReceiver() {
diff --git a/core/tests/coretests/src/android/app/activity/LocalDeniedReceiver.java b/core/tests/coretests/src/android/app/activity/LocalDeniedReceiver.java
index 2120a1d..3271b8f 100644
--- a/core/tests/coretests/src/android/app/activity/LocalDeniedReceiver.java
+++ b/core/tests/coretests/src/android/app/activity/LocalDeniedReceiver.java
@@ -19,11 +19,11 @@
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
-import android.os.RemoteException;
import android.os.IBinder;
import android.os.Parcel;
+import android.os.RemoteException;
-class LocalDeniedReceiver extends BroadcastReceiver {
+public class LocalDeniedReceiver extends BroadcastReceiver {
public LocalDeniedReceiver() {
}
diff --git a/core/tests/coretests/src/android/content/res/ResourcesLocaleTest.java b/core/tests/coretests/src/android/content/res/ResourcesLocaleTest.java
index 25c3db5..26e4349 100644
--- a/core/tests/coretests/src/android/content/res/ResourcesLocaleTest.java
+++ b/core/tests/coretests/src/android/content/res/ResourcesLocaleTest.java
@@ -16,6 +16,7 @@
package android.content.res;
+import android.content.Context;
import android.os.FileUtils;
import android.os.LocaleList;
import android.platform.test.annotations.Presubmit;
@@ -97,4 +98,24 @@
assertEquals(Locale.forLanguageTag("pl-PL"),
resources.getConfiguration().getLocales().get(0));
}
+
+ @SmallTest
+ public void testDeprecatedISOLanguageCode() {
+ assertResGetString(Locale.US, R.string.locale_test_res_1, "Testing ID");
+ assertResGetString(Locale.forLanguageTag("id"), R.string.locale_test_res_2, "Pengujian IN");
+ assertResGetString(Locale.forLanguageTag("id"), R.string.locale_test_res_3, "Testing EN");
+ assertResGetString(new Locale("id"), R.string.locale_test_res_2, "Pengujian IN");
+ assertResGetString(new Locale("id"), R.string.locale_test_res_3, "Testing EN");
+ // The new ISO code "id" isn't supported yet, and thus the values-id are ignored.
+ assertResGetString(new Locale("id"), R.string.locale_test_res_1, "Testing ID");
+ assertResGetString(Locale.forLanguageTag("id"), R.string.locale_test_res_1, "Testing ID");
+ }
+
+ private void assertResGetString(Locale locale, int resId, String expectedString) {
+ LocaleList locales = new LocaleList(locale);
+ final Configuration config = new Configuration();
+ config.setLocales(locales);
+ Context newContext = getContext().createConfigurationContext(config);
+ assertEquals(expectedString, newContext.getResources().getString(resId));
+ }
}
diff --git a/core/tests/coretests/src/android/security/keystore/OWNERS b/core/tests/coretests/src/android/security/keystore/OWNERS
new file mode 100644
index 0000000..d9e0116
--- /dev/null
+++ b/core/tests/coretests/src/android/security/keystore/OWNERS
@@ -0,0 +1 @@
+include /keystore/OWNERS
diff --git a/core/tests/coretests/src/android/service/TEST_MAPPING b/core/tests/coretests/src/android/service/TEST_MAPPING
new file mode 100644
index 0000000..fbf8a92
--- /dev/null
+++ b/core/tests/coretests/src/android/service/TEST_MAPPING
@@ -0,0 +1,18 @@
+{
+ "postsubmit": [
+ {
+ "name": "FrameworksCoreTests",
+ "options": [
+ {"include-filter": "android.service.controls"},
+ {"include-filter": "android.service.controls.actions"},
+ {"include-filter": "android.service.controls.templates"},
+ {"include-filter": "android.service.euicc"},
+ {"include-filter": "android.service.notification"},
+ {"include-filter": "android.service.quicksettings"},
+ {"include-filter": "android.service.settings.suggestions"},
+ {"include-filter": "android.service.timezone"},
+ {"exclude-annotation": "org.junit.Ignore"}
+ ]
+ }
+ ]
+}
diff --git a/core/tests/coretests/src/android/service/euicc/EuiccProfileInfoTest.java b/core/tests/coretests/src/android/service/euicc/EuiccProfileInfoTest.java
index 0af8c72..6792d0b 100644
--- a/core/tests/coretests/src/android/service/euicc/EuiccProfileInfoTest.java
+++ b/core/tests/coretests/src/android/service/euicc/EuiccProfileInfoTest.java
@@ -239,7 +239,7 @@
assertNotEquals(p.hashCode(), t.hashCode());
}
- @Test(expected = IllegalStateException.class)
+ @Test(expected = IllegalArgumentException.class)
public void testBuilderBuild_IllegalIccid() {
new EuiccProfileInfo.Builder("abc").build();
}
diff --git a/core/tests/coretests/src/android/service/euicc/OWNERS b/core/tests/coretests/src/android/service/euicc/OWNERS
new file mode 100644
index 0000000..41fc56b4
--- /dev/null
+++ b/core/tests/coretests/src/android/service/euicc/OWNERS
@@ -0,0 +1 @@
+include platform/frameworks/base:/telephony/java/android/service/euicc/OWNERS
diff --git a/core/tests/coretests/src/android/service/notification/NotificationRankingUpdateTest.java b/core/tests/coretests/src/android/service/notification/NotificationRankingUpdateTest.java
index a84ac55..55ded9c 100644
--- a/core/tests/coretests/src/android/service/notification/NotificationRankingUpdateTest.java
+++ b/core/tests/coretests/src/android/service/notification/NotificationRankingUpdateTest.java
@@ -136,7 +136,11 @@
NotificationListenerService.RankingMap retrievedRankings =
retrievedRankingUpdate.getRankingMap();
assertNotNull(retrievedRankings);
- assertTrue(retrievedRankingUpdate.isFdNotNullAndClosed());
+ // The rankingUpdate file descriptor is only non-null in the new path.
+ if (SystemUiSystemPropertiesFlags.getResolver().isEnabled(
+ SystemUiSystemPropertiesFlags.NotificationFlags.RANKING_UPDATE_ASHMEM)) {
+ assertTrue(retrievedRankingUpdate.isFdNotNullAndClosed());
+ }
NotificationListenerService.Ranking retrievedRanking =
new NotificationListenerService.Ranking();
assertTrue(retrievedRankings.getRanking(TEST_KEY, retrievedRanking));
diff --git a/core/tests/coretests/src/android/service/quicksettings/TileTest.java b/core/tests/coretests/src/android/service/quicksettings/TileTest.java
new file mode 100644
index 0000000..ca6c3b4
--- /dev/null
+++ b/core/tests/coretests/src/android/service/quicksettings/TileTest.java
@@ -0,0 +1,67 @@
+/*
+ * 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.service.quicksettings;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class TileTest {
+
+ private static final String DEFAULT_LABEL = "DEFAULT_LABEL";
+ private static final String CUSTOM_APP_LABEL = "CUSTOM_LABEL";
+
+ @Test
+ public void testGetLabel_labelSet_usesCustomLabel() {
+ Tile tile = new Tile();
+ tile.setDefaultLabel(DEFAULT_LABEL);
+ tile.setLabel(CUSTOM_APP_LABEL);
+
+ assertThat(tile.getLabel()).isEqualTo(CUSTOM_APP_LABEL);
+ }
+
+ @Test
+ public void testGetLabel_labelNotSet_usesDefaultLabel() {
+ Tile tile = new Tile();
+ tile.setDefaultLabel(DEFAULT_LABEL);
+
+ assertThat(tile.getLabel()).isEqualTo(DEFAULT_LABEL);
+ }
+
+ @Test
+ public void testGetCustomLabel_labelSet() {
+ Tile tile = new Tile();
+ tile.setDefaultLabel(DEFAULT_LABEL);
+ tile.setLabel(CUSTOM_APP_LABEL);
+
+ assertThat(tile.getCustomLabel()).isEqualTo(CUSTOM_APP_LABEL);
+ }
+
+ @Test
+ public void testGetCustomLabel_labelNotSet() {
+ Tile tile = new Tile();
+ tile.setDefaultLabel(DEFAULT_LABEL);
+
+ assertThat(tile.getCustomLabel()).isNull();
+ }
+}
diff --git a/core/tests/coretests/src/android/view/ViewGroupGetChildLocalHitRegionTest.java b/core/tests/coretests/src/android/view/ViewGroupGetChildLocalHitRegionTest.java
new file mode 100644
index 0000000..60a0a2a
--- /dev/null
+++ b/core/tests/coretests/src/android/view/ViewGroupGetChildLocalHitRegionTest.java
@@ -0,0 +1,216 @@
+/*
+ * 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.view;
+
+import static com.google.common.truth.Truth.assertThat;
+
+
+import android.graphics.Matrix;
+import android.graphics.Region;
+import android.platform.test.annotations.Presubmit;
+import android.widget.LinearLayout;
+
+import androidx.test.ext.junit.rules.ActivityScenarioRule;
+import androidx.test.filters.SmallTest;
+
+import com.android.frameworks.coretests.R;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+/**
+ * Test basic functions of ViewGroup.
+ *
+ * Build/Install/Run:
+ * atest FrameworksCoreTests:ViewGroupTest
+ */
+@Presubmit
+@SmallTest
+public class ViewGroupGetChildLocalHitRegionTest {
+ @Rule
+ public ActivityScenarioRule<ViewGroupTestActivity> mScenarioRule =
+ new ActivityScenarioRule<>(ViewGroupTestActivity.class);
+
+ private LinearLayout mRoot;
+ private final int[] mRootLocation = new int[2];
+
+ @Before
+ public void setup() {
+ mScenarioRule.getScenario().onActivity(activity -> {
+ mRoot = activity.findViewById(R.id.linear_layout);
+ mRoot.getLocationInWindow(mRootLocation);
+ });
+ }
+
+ @Test
+ public void testGetChildLocalHitRegion() {
+ assertGetChildLocalHitRegion(R.id.view);
+ }
+
+ @Test
+ public void testGetChildLocalHitRegion_withScale() {
+ assertGetChildLocalHitRegion(R.id.view_scale);
+ }
+
+ @Test
+ public void testGetChildLocalHitRegion_withTranslate() {
+ assertGetChildLocalHitRegion(R.id.view_translate);
+ }
+
+ @Test
+ public void testGetChildLocalHitRegion_overlap_noMotionEvent() {
+ assertGetChildLocalHitRegion(R.id.view_overlap_bottom);
+ }
+ @Test
+ public void testGetChildLocalHitRegion_overlap_withMotionEvent() {
+ // In this case, view_cover_bottom is partially covered by the view_cover_top.
+ // The returned region is the bounds of the bottom view subtract the bounds of the top view.
+ assertGetChildLocalHitRegion(R.id.view_overlap_top, R.id.view_overlap_bottom);
+ }
+
+ @Test
+ public void testGetChildLocalHitRegion_cover_withMotionEvent() {
+ // In this case, view_cover_bottom is completely covered by the view_cover_top.
+ // The returned region is expected to be empty.
+ assertGetChildLocalHitRegionEmpty(R.id.view_cover_top, R.id.view_cover_bottom);
+ }
+
+ private void injectMotionEvent(View view, boolean isHover) {
+ int[] location = new int[2];
+ view.getLocationInWindow(location);
+
+ float x = location[0] + view.getWidth() / 2f;
+ float y = location[1] + view.getHeight() / 2f;
+
+ int action = isHover ? MotionEvent.ACTION_HOVER_ENTER : MotionEvent.ACTION_DOWN;
+ MotionEvent motionEvent = MotionEvent.obtain(/* downtime= */ 0, /* eventTime= */ 0, action,
+ x, y, /* pressure= */ 0, /* size= */ 0, /* metaState= */ 0,
+ /* xPrecision= */ 1, /* yPrecision= */ 1, /* deviceId= */0, /* edgeFlags= */0);
+
+ View rootView = view.getRootView();
+ rootView.dispatchPointerEvent(motionEvent);
+ }
+
+ private void assertGetChildLocalHitRegion(int viewId) {
+ assertGetChildLocalHitRegion(viewId, /* isHover= */ true);
+ assertGetChildLocalHitRegion(viewId, /* isHover= */ false);
+ }
+
+ /**
+ * Assert ViewParent#getChildLocalHitRegion for a single view.
+ * @param viewId the viewId of the tested view.
+ * @param isHover if true, check the hit region of the hover events. Otherwise, check the hit
+ * region of the touch events.
+ */
+ private void assertGetChildLocalHitRegion(int viewId, boolean isHover) {
+ mScenarioRule.getScenario().onActivity(activity -> {
+ View view = activity.findViewById(viewId);
+
+ Matrix actualMatrix = new Matrix();
+ Region actualRegion = new Region(0, 0, view.getWidth(), view.getHeight());
+ boolean actualNotEmpty = view.getParent()
+ .getChildLocalHitRegion(view, actualRegion, actualMatrix, isHover);
+
+ int[] windowLocation = new int[2];
+ view.getLocationInWindow(windowLocation);
+ Matrix expectMatrix = new Matrix();
+ expectMatrix.preScale(1 / view.getScaleX(), 1 / view.getScaleY());
+ expectMatrix.preTranslate(-windowLocation[0], -windowLocation[1]);
+
+ Region expectRegion = new Region(0, 0, view.getWidth(), view.getHeight());
+
+ assertThat(actualNotEmpty).isTrue();
+ assertThat(actualMatrix).isEqualTo(expectMatrix);
+ assertThat(actualRegion).isEqualTo(expectRegion);
+ });
+ }
+
+ private void assertGetChildLocalHitRegion(int viewIdTop, int viewIdBottom) {
+ assertGetChildLocalHitRegion(viewIdTop, viewIdBottom, /* isHover= */ true);
+ assertGetChildLocalHitRegion(viewIdTop, viewIdBottom, /* isHover= */ false);
+ }
+
+ /**
+ * Assert ViewParent#getChildLocalHitRegion of a view that is covered by another view. It will
+ * inject {@link MotionEvent}s to the view on top first and then get the hit region of the
+ * bottom view.
+ *
+ * @param viewIdTop the view id of the test view on top.
+ * @param viewIdBottom the view id of the test view at the bottom.
+ * @param isHover if true, check the hit region of the hover events. Otherwise, check the hit
+ * region of the touch events.
+ */
+ private void assertGetChildLocalHitRegion(int viewIdTop, int viewIdBottom, boolean isHover) {
+ mScenarioRule.getScenario().onActivity(activity -> {
+ View viewTop = activity.findViewById(viewIdTop);
+ View viewBottom = activity.findViewById(viewIdBottom);
+
+ injectMotionEvent(viewTop, isHover);
+
+ Matrix actualMatrix = new Matrix();
+ Region actualRegion = new Region(0, 0, viewBottom.getWidth(), viewBottom.getHeight());
+ boolean actualNotEmpty = viewBottom.getParent()
+ .getChildLocalHitRegion(viewBottom, actualRegion, actualMatrix, isHover);
+
+ int[] windowLocation = new int[2];
+ viewBottom.getLocationInWindow(windowLocation);
+ Matrix expectMatrix = new Matrix();
+ expectMatrix.preTranslate(-windowLocation[0], -windowLocation[1]);
+
+ Region expectRegion = new Region(0, 0, viewBottom.getWidth(), viewBottom.getHeight());
+ expectRegion.op(0, 0, viewTop.getWidth(), viewTop.getHeight(), Region.Op.DIFFERENCE);
+
+ assertThat(actualNotEmpty).isTrue();
+ assertThat(actualMatrix).isEqualTo(expectMatrix);
+ assertThat(actualRegion).isEqualTo(expectRegion);
+ });
+ }
+
+ private void assertGetChildLocalHitRegionEmpty(int viewIdTop, int viewIdBottom) {
+ assertGetChildLocalHitRegionEmpty(viewIdTop, viewIdBottom, /* isHover= */ true);
+ assertGetChildLocalHitRegionEmpty(viewIdTop, viewIdBottom, /* isHover= */ false);
+ }
+
+ /**
+ * Assert ViewParent#getChildLocalHitRegion returns an empty region for a view that is
+ * completely covered by another view. It will inject {@link MotionEvent}s to the view on top
+ * first and then get the hit region of the
+ * bottom view.
+ *
+ * @param viewIdTop the view id of the test view on top.
+ * @param viewIdBottom the view id of the test view at the bottom.
+ * @param isHover if true, check the hit region of the hover events. Otherwise, check the hit
+ * region of the touch events.
+ */
+ private void assertGetChildLocalHitRegionEmpty(int viewIdTop, int viewIdBottom,
+ boolean isHover) {
+ mScenarioRule.getScenario().onActivity(activity -> {
+ View viewTop = activity.findViewById(viewIdTop);
+ View viewBottom = activity.findViewById(viewIdBottom);
+
+ injectMotionEvent(viewTop, isHover);
+
+ Region actualRegion = new Region(0, 0, viewBottom.getWidth(), viewBottom.getHeight());
+ boolean actualNotEmpty = viewBottom.getParent()
+ .getChildLocalHitRegion(viewBottom, actualRegion, new Matrix(), isHover);
+
+ assertThat(actualNotEmpty).isFalse();
+ assertThat(actualRegion.isEmpty()).isTrue();
+ });
+ }
+}
diff --git a/core/tests/coretests/src/android/view/ViewGroupTestActivity.java b/core/tests/coretests/src/android/view/ViewGroupTestActivity.java
new file mode 100644
index 0000000..b94bda5
--- /dev/null
+++ b/core/tests/coretests/src/android/view/ViewGroupTestActivity.java
@@ -0,0 +1,31 @@
+/*
+ * 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.view;
+
+import android.annotation.Nullable;
+import android.app.Activity;
+import android.os.Bundle;
+
+import com.android.frameworks.coretests.R;
+
+public class ViewGroupTestActivity extends Activity {
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.viewgroup_test);
+ }
+}
diff --git a/core/tests/coretests/src/android/view/stylus/HandwritingTestUtil.java b/core/tests/coretests/src/android/view/stylus/HandwritingTestUtil.java
index 388a996..b4c72ca 100644
--- a/core/tests/coretests/src/android/view/stylus/HandwritingTestUtil.java
+++ b/core/tests/coretests/src/android/view/stylus/HandwritingTestUtil.java
@@ -21,7 +21,9 @@
import android.app.Instrumentation;
import android.content.Context;
+import android.graphics.Matrix;
import android.graphics.Rect;
+import android.graphics.Region;
import android.view.View;
import android.view.ViewGroup;
@@ -45,7 +47,7 @@
float handwritingBoundsOffsetRight, float handwritingBoundsOffsetBottom) {
final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
final Context context = instrumentation.getTargetContext();
- // mock a parent so that HandwritingInitiator can get
+ // mock a parent so that HandwritingInitiator can get visible rect and hit region.
final ViewGroup parent = new ViewGroup(context) {
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
@@ -56,6 +58,14 @@
r.set(handwritingArea);
return true;
}
+
+ @Override
+ public boolean getChildLocalHitRegion(View child, Region region, Matrix matrix,
+ boolean isHover) {
+ matrix.reset();
+ region.set(handwritingArea);
+ return true;
+ }
};
View view = spy(new View(context));
diff --git a/core/tests/coretests/src/android/window/flags/WindowFlagsTest.java b/core/tests/coretests/src/android/window/flags/WindowFlagsTest.java
new file mode 100644
index 0000000..a8b4032
--- /dev/null
+++ b/core/tests/coretests/src/android/window/flags/WindowFlagsTest.java
@@ -0,0 +1,45 @@
+/*
+ * 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.window.flags;
+
+import static com.android.window.flags.Flags.syncWindowConfigUpdateFlag;
+
+import android.platform.test.annotations.Presubmit;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Tests for {@link com.android.window.flags.Flags}
+ *
+ * Build/Install/Run:
+ * atest FrameworksCoreTests:WindowFlagsTest
+ */
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+@Presubmit
+public class WindowFlagsTest {
+
+ @Test
+ public void testSyncWindowConfigUpdateFlag() {
+ // No crash when accessing the flag.
+ syncWindowConfigUpdateFlag();
+ }
+}
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
index 38c3aa0..2cbeaa1 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
@@ -35,8 +35,9 @@
LongArrayMultiStateCounterTest.class,
LongMultiStateCounterTest.class,
PowerProfileTest.class,
+ PowerStatsTest.class,
EnergyConsumerStatsTest.class
})
public class BatteryStatsTests {
-}
\ No newline at end of file
+}
diff --git a/core/tests/coretests/src/com/android/internal/os/PowerStatsTest.java b/core/tests/coretests/src/com/android/internal/os/PowerStatsTest.java
new file mode 100644
index 0000000..29da231
--- /dev/null
+++ b/core/tests/coretests/src/com/android/internal/os/PowerStatsTest.java
@@ -0,0 +1,132 @@
+/*
+ * 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.internal.os;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.os.BatteryConsumer;
+import android.os.Parcel;
+import android.os.PersistableBundle;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class PowerStatsTest {
+
+ private PowerStats.DescriptorRegistry mRegistry;
+ private PowerStats.Descriptor mDescriptor;
+
+ @Before
+ public void setup() {
+ mRegistry = new PowerStats.DescriptorRegistry();
+ PersistableBundle extras = new PersistableBundle();
+ extras.putBoolean("hasPowerMonitor", true);
+ mDescriptor = new PowerStats.Descriptor(BatteryConsumer.POWER_COMPONENT_CPU, 3, 2, extras);
+ mRegistry.register(mDescriptor);
+ }
+
+ @Test
+ public void parceling_compatibleParcel() {
+ PowerStats stats = new PowerStats(mDescriptor);
+ stats.durationMs = 1234;
+ stats.stats[0] = 10;
+ stats.stats[1] = 20;
+ stats.stats[2] = 30;
+ stats.uidStats.put(42, new long[]{40, 50});
+ stats.uidStats.put(99, new long[]{60, 70});
+
+ Parcel parcel = Parcel.obtain();
+ mDescriptor.writeSummaryToParcel(parcel);
+ stats.writeToParcel(parcel);
+ parcel.writeString("END");
+
+ Parcel newParcel = marshallAndUnmarshall(parcel);
+
+ PowerStats.Descriptor newDescriptor =
+ PowerStats.Descriptor.readSummaryFromParcel(newParcel);
+ assertThat(newDescriptor.powerComponentId).isEqualTo(BatteryConsumer.POWER_COMPONENT_CPU);
+ assertThat(newDescriptor.name).isEqualTo("cpu");
+ assertThat(newDescriptor.statsArrayLength).isEqualTo(3);
+ assertThat(newDescriptor.uidStatsArrayLength).isEqualTo(2);
+ assertThat(newDescriptor.extras.getBoolean("hasPowerMonitor")).isTrue();
+
+ mRegistry.register(newDescriptor);
+
+ PowerStats newStats = PowerStats.readFromParcel(newParcel, mRegistry);
+ assertThat(newStats.durationMs).isEqualTo(1234);
+ assertThat(newStats.stats).isEqualTo(new long[]{10, 20, 30});
+ assertThat(newStats.uidStats.size()).isEqualTo(2);
+ assertThat(newStats.uidStats.get(42)).isEqualTo(new long[]{40, 50});
+ assertThat(newStats.uidStats.get(99)).isEqualTo(new long[]{60, 70});
+
+ String end = newParcel.readString();
+ assertThat(end).isEqualTo("END");
+ }
+
+ @Test
+ public void parceling_unrecognizedPowerComponent() {
+ PowerStats stats = new PowerStats(
+ new PowerStats.Descriptor(777, "luck", 3, 2, new PersistableBundle()));
+ stats.durationMs = 1234;
+
+ Parcel parcel = Parcel.obtain();
+ stats.writeToParcel(parcel);
+ parcel.writeString("END");
+
+ Parcel newParcel = marshallAndUnmarshall(parcel);
+
+ PowerStats newStats = PowerStats.readFromParcel(newParcel, mRegistry);
+ assertThat(newStats).isNull();
+
+ String end = newParcel.readString();
+ assertThat(end).isEqualTo("END");
+ }
+
+ @Test
+ public void parceling_wrongArrayLength() {
+ PowerStats stats = new PowerStats(mDescriptor);
+ stats.stats = new long[5]; // Is expected to be 3
+
+ Parcel parcel = Parcel.obtain();
+ stats.writeToParcel(parcel);
+ parcel.writeString("END");
+
+ Parcel newParcel = marshallAndUnmarshall(parcel);
+
+ PowerStats newStats = PowerStats.readFromParcel(newParcel, mRegistry);
+ assertThat(newStats).isNull();
+
+ String end = newParcel.readString();
+ assertThat(end).isEqualTo("END");
+ }
+
+ private static Parcel marshallAndUnmarshall(Parcel parcel) {
+ byte[] bytes = parcel.marshall();
+ parcel.recycle();
+
+ Parcel newParcel = Parcel.obtain();
+ newParcel.unmarshall(bytes, 0, bytes.length);
+ newParcel.setDataPosition(0);
+ return newParcel;
+ }
+}
diff --git a/core/tests/coretests/src/com/android/internal/security/VerityUtilsTest.java b/core/tests/coretests/src/com/android/internal/security/VerityUtilsTest.java
index 1513654..a978e3b 100644
--- a/core/tests/coretests/src/com/android/internal/security/VerityUtilsTest.java
+++ b/core/tests/coretests/src/com/android/internal/security/VerityUtilsTest.java
@@ -229,11 +229,12 @@
@Test
public void testSignatureGeneratedExternally() throws Exception {
var context = InstrumentationRegistry.getInstrumentation().getContext();
- byte[] cert = getClass().getClassLoader().getResourceAsStream("ApkVerityTestCert.der")
+ byte[] cert = getClass().getClassLoader().getResourceAsStream("unit_test.der")
.readAllBytes();
// The signature is generated by:
- // fsverity sign <(echo -n fs-verity) fsverity_sig --key=ApkVerityTestKey.pem \
- // --cert=ApkVerityTestCert.pem
+ // openssl pkcs8 -topk8 -nocrypt -in certs/unit_test.pk8 -out certs/unit_test.key.pem
+ // fsverity sign <(echo -n fs-verity) fsverity_sig --key=certs/unit_test.key.pem \
+ // --cert=certs/unit_test.x509.pem
byte[] sig = context.getResources().openRawResource(R.raw.fsverity_sig).readAllBytes();
// The fs-verity digest is generated by:
// fsverity digest --compact <(echo -n fs-verity)
diff --git a/core/tests/packagemonitortests/src/com/android/internal/content/PackageMonitorVisibilityTest.java b/core/tests/packagemonitortests/src/com/android/internal/content/PackageMonitorVisibilityTest.java
index a310edc..da8e4cc 100644
--- a/core/tests/packagemonitortests/src/com/android/internal/content/PackageMonitorVisibilityTest.java
+++ b/core/tests/packagemonitortests/src/com/android/internal/content/PackageMonitorVisibilityTest.java
@@ -20,9 +20,12 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assert.assertThrows;
+
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Handler;
+import android.os.IRemoteCallback;
import android.os.Looper;
import android.os.UserHandle;
@@ -45,6 +48,25 @@
TEST_DATA_PATH + "TestVisibilityApp.apk";
private static final String TEAT_APK_PACKAGE_NAME = "com.example.android.testvisibilityapp";
private static final int WAIT_CALLBACK_CALLED_IN_SECONDS = 1;
+
+ @Test
+ public void testPackageMonitorCallbackMultipleRegisterThrowsException() throws Exception {
+ Context context = InstrumentationRegistry.getInstrumentation().getContext();
+ final IRemoteCallback callback = new IRemoteCallback.Stub() {
+ @Override
+ public void sendResult(android.os.Bundle bundle) {
+ // do-nothing
+ }
+ };
+ try {
+ context.getPackageManager().registerPackageMonitorCallback(callback, 0);
+ assertThrows(IllegalStateException.class,
+ () -> context.getPackageManager().registerPackageMonitorCallback(callback, 0));
+ } finally {
+ context.getPackageManager().unregisterPackageMonitorCallback(callback);
+ }
+ }
+
@Test
public void testPackageMonitorPackageVisible() throws Exception {
TestVisibilityPackageMonitor testPackageMonitor = new TestVisibilityPackageMonitor();
diff --git a/core/tests/utiltests/src/android/util/IntArrayTest.java b/core/tests/utiltests/src/android/util/IntArrayTest.java
index caa7312..ad5c4ee 100644
--- a/core/tests/utiltests/src/android/util/IntArrayTest.java
+++ b/core/tests/utiltests/src/android/util/IntArrayTest.java
@@ -55,9 +55,11 @@
a.add(5, 20);
assertThat(a.get(5)).isEqualTo(20);
assertThat(a.indexOf(20)).isEqualTo(5);
+ assertThat(a.contains(20)).isTrue();
verify(a, 1, 2, 0, 0, 0, 20, 10, 0, 0);
assertThat(a.indexOf(99)).isEqualTo(-1);
+ assertThat(a.contains(99)).isFalse();
a.resize(15);
a.set(14, 30);
@@ -71,6 +73,7 @@
backingArray[2] = 30;
verify(a, backingArray);
assertThat(a.indexOf(30)).isEqualTo(2);
+ assertThat(a.contains(30)).isTrue();
a.resize(2);
assertThat(backingArray[2]).isEqualTo(0);
diff --git a/core/tests/vibrator/src/android/os/VibrationEffectTest.java b/core/tests/vibrator/src/android/os/VibrationEffectTest.java
index 8be489e..e875875 100644
--- a/core/tests/vibrator/src/android/os/VibrationEffectTest.java
+++ b/core/tests/vibrator/src/android/os/VibrationEffectTest.java
@@ -41,8 +41,6 @@
import android.os.vibrator.PrimitiveSegment;
import android.os.vibrator.StepSegment;
-import androidx.test.InstrumentationRegistry;
-
import com.android.internal.R;
import org.jetbrains.annotations.NotNull;
@@ -838,31 +836,29 @@
@Test
public void testAreVibrationFeaturesSupported_allSegmentsSupported() {
- Vibrator vibrator =
- createVibratorWithCustomInfo(new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_AMPLITUDE_CONTROL)
- .build());
+ VibratorInfo info = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_AMPLITUDE_CONTROL)
+ .build();
assertTrue(VibrationEffect.createWaveform(
/* timings= */ new long[] {1, 2, 3}, /* repeatIndex= */ -1)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(VibrationEffect.createWaveform(
/* timings= */ new long[] {1, 2, 3},
/* amplitudes= */ new int[] {10, 20, 40},
/* repeatIndex= */ 2)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(
VibrationEffect.startComposition()
.addEffect(VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK))
.repeatEffectIndefinitely(TEST_ONE_SHOT)
.compose()
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
}
@Test
public void testAreVibrationFeaturesSupported_withUnsupportedSegments() {
- Vibrator vibrator =
- createVibratorWithCustomInfo(new VibratorInfo.Builder(/* id= */ 1).build());
+ VibratorInfo info = new VibratorInfo.Builder(/* id= */ 1).build();
assertFalse(
VibrationEffect.startComposition()
@@ -872,7 +868,7 @@
/* amplitudes= */ new int[] {10, 20, 40},
/* repeatIndex= */ -1))
.compose()
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
}
@Test
@@ -996,13 +992,4 @@
return context;
}
-
- private Vibrator createVibratorWithCustomInfo(VibratorInfo info) {
- return new SystemVibrator(InstrumentationRegistry.getContext()) {
- @Override
- public VibratorInfo getInfo() {
- return info;
- }
- };
- }
}
diff --git a/core/tests/vibrator/src/android/os/VibratorInfoTest.java b/core/tests/vibrator/src/android/os/VibratorInfoTest.java
index ff917aa..73cd464 100644
--- a/core/tests/vibrator/src/android/os/VibratorInfoTest.java
+++ b/core/tests/vibrator/src/android/os/VibratorInfoTest.java
@@ -57,6 +57,17 @@
}
@Test
+ public void testHasFrequencyControl() {
+ VibratorInfo noCapabilities = new VibratorInfo.Builder(TEST_VIBRATOR_ID).build();
+ assertFalse(noCapabilities.hasFrequencyControl());
+ VibratorInfo composeAndFrequencyControl = new VibratorInfo.Builder(TEST_VIBRATOR_ID)
+ .setCapabilities(
+ IVibrator.CAP_FREQUENCY_CONTROL | IVibrator.CAP_COMPOSE_PWLE_EFFECTS)
+ .build();
+ assertTrue(composeAndFrequencyControl.hasFrequencyControl());
+ }
+
+ @Test
public void testHasCapabilities() {
VibratorInfo info = new VibratorInfo.Builder(TEST_VIBRATOR_ID)
.setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
@@ -246,8 +257,13 @@
@Test
public void testEquals() {
- VibratorInfo.Builder completeBuilder = new VibratorInfo.Builder(TEST_VIBRATOR_ID)
- .setCapabilities(IVibrator.CAP_AMPLITUDE_CONTROL)
+ VibratorInfo.Builder completeBuilder = new VibratorInfo.Builder(TEST_VIBRATOR_ID);
+ // Create a builder with a different ID, but same properties the same as the first one.
+ VibratorInfo.Builder completeBuilder2 = new VibratorInfo.Builder(TEST_VIBRATOR_ID + 2);
+
+ for (VibratorInfo.Builder builder :
+ new VibratorInfo.Builder[] {completeBuilder, completeBuilder2}) {
+ builder.setCapabilities(IVibrator.CAP_AMPLITUDE_CONTROL)
.setSupportedEffects(VibrationEffect.EFFECT_CLICK)
.setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 20)
.setPrimitiveDelayMax(100)
@@ -257,31 +273,43 @@
.setPwleSizeMax(20)
.setQFactor(2f)
.setFrequencyProfile(TEST_FREQUENCY_PROFILE);
+ }
VibratorInfo complete = completeBuilder.build();
assertEquals(complete, complete);
+ assertTrue(complete.equalContent(complete));
assertEquals(complete, completeBuilder.build());
+ assertTrue(complete.equalContent(completeBuilder.build()));
assertEquals(complete.hashCode(), completeBuilder.build().hashCode());
+ // The infos from the two builders should have equal content, but should not be equal due to
+ // their different IDs.
+ assertNotEquals(complete, completeBuilder2.build());
+ assertTrue(complete.equalContent(completeBuilder2.build()));
+
VibratorInfo completeWithComposeControl = completeBuilder
.setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
.build();
assertNotEquals(complete, completeWithComposeControl);
+ assertFalse(complete.equalContent(completeWithComposeControl));
VibratorInfo completeWithNoEffects = completeBuilder
.setSupportedEffects(new int[0])
.build();
assertNotEquals(complete, completeWithNoEffects);
+ assertFalse(complete.equalContent(completeWithNoEffects));
VibratorInfo completeWithUnknownEffects = completeBuilder
.setSupportedEffects(null)
.build();
assertNotEquals(complete, completeWithUnknownEffects);
+ assertFalse(complete.equalContent(completeWithUnknownEffects));
VibratorInfo completeWithDifferentPrimitiveDuration = completeBuilder
.setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
.build();
assertNotEquals(complete, completeWithDifferentPrimitiveDuration);
+ assertFalse(complete.equalContent(completeWithDifferentPrimitiveDuration));
VibratorInfo completeWithDifferentFrequencyProfile = completeBuilder
.setFrequencyProfile(new VibratorInfo.FrequencyProfile(
@@ -291,31 +319,37 @@
TEST_AMPLITUDE_MAP))
.build();
assertNotEquals(complete, completeWithDifferentFrequencyProfile);
+ assertFalse(complete.equalContent(completeWithDifferentFrequencyProfile));
VibratorInfo completeWithEmptyFrequencyProfile = completeBuilder
.setFrequencyProfile(EMPTY_FREQUENCY_PROFILE)
.build();
assertNotEquals(complete, completeWithEmptyFrequencyProfile);
+ assertFalse(complete.equalContent(completeWithEmptyFrequencyProfile));
VibratorInfo completeWithUnknownQFactor = completeBuilder.setQFactor(Float.NaN).build();
assertNotEquals(complete, completeWithUnknownQFactor);
+ assertFalse(complete.equalContent(completeWithUnknownQFactor));
VibratorInfo completeWithDifferentQFactor = completeBuilder
.setQFactor(complete.getQFactor() + 3f)
.build();
assertNotEquals(complete, completeWithDifferentQFactor);
+ assertFalse(complete.equalContent(completeWithDifferentQFactor));
VibratorInfo unknownEffectSupport = new VibratorInfo.Builder(TEST_VIBRATOR_ID).build();
VibratorInfo knownEmptyEffectSupport = new VibratorInfo.Builder(TEST_VIBRATOR_ID)
.setSupportedEffects(new int[0])
.build();
assertNotEquals(unknownEffectSupport, knownEmptyEffectSupport);
+ assertFalse(unknownEffectSupport.equalContent(knownEmptyEffectSupport));
VibratorInfo unknownBrakingSupport = new VibratorInfo.Builder(TEST_VIBRATOR_ID).build();
VibratorInfo knownEmptyBrakingSupport = new VibratorInfo.Builder(TEST_VIBRATOR_ID)
.setSupportedBraking(new int[0])
.build();
assertNotEquals(unknownBrakingSupport, knownEmptyBrakingSupport);
+ assertFalse(unknownBrakingSupport.equalContent(knownEmptyBrakingSupport));
}
@Test
@@ -335,4 +369,186 @@
assertEquals(original, restored);
assertEquals(original.hashCode(), restored.hashCode());
}
+
+ @Test
+ public void areVibrationFeaturesSupported_noAmplitudeControl_fractionalAmplitudeUnsupported() {
+ VibratorInfo info = new VibratorInfo.Builder(/* id= */ 1).build();
+
+ // Have at least one fractional amplitude (amplitude not min (0) or max (255) or DEFAULT).
+ assertFalse(info.areVibrationFeaturesSupported(waveformWithAmplitudes(10, 30)));
+ assertFalse(info.areVibrationFeaturesSupported(waveformWithAmplitudes(10, 255)));
+ assertFalse(info.areVibrationFeaturesSupported(
+ VibrationEffect.createOneShot(20, /* amplitude= */ 40)));
+ }
+
+ @Test
+ public void areVibrationFeaturesSupported_noAmplitudeControl_nonFractionalAmplitudeSupported() {
+ VibratorInfo info = new VibratorInfo.Builder(/* id= */ 1).build();
+
+ // All amplitudes are min, max, or default. Requires no amplitude control.
+ assertTrue(info.areVibrationFeaturesSupported(
+ waveformWithAmplitudes(255, 0, VibrationEffect.DEFAULT_AMPLITUDE, 255)));
+ assertTrue(info.areVibrationFeaturesSupported(
+ VibrationEffect.createWaveform(
+ /* timings= */ new long[] {1, 2, 3}, /* repeatIndex= */ -1)));
+ assertTrue(info.areVibrationFeaturesSupported(
+ VibrationEffect.createOneShot(20, VibrationEffect.DEFAULT_AMPLITUDE)));
+ assertTrue(info.areVibrationFeaturesSupported(
+ VibrationEffect.createOneShot(20, /* amplitude= */ 255)));
+ }
+
+ @Test
+ public void areVibrationFeaturesSupported_withAmplitudeControl_allWaveformsSupported() {
+ VibratorInfo info = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_AMPLITUDE_CONTROL)
+ .build();
+
+ // All forms of amplitudes are valid when amplitude control is available.
+ assertTrue(info.areVibrationFeaturesSupported(
+ waveformWithAmplitudes(255, 0, VibrationEffect.DEFAULT_AMPLITUDE, 255)));
+ assertTrue(info.areVibrationFeaturesSupported(
+ VibrationEffect.createWaveform(
+ /* timings= */ new long[] {1, 2, 3}, /* repeatIndex= */ -1)));
+ assertTrue(info.areVibrationFeaturesSupported(waveformWithAmplitudes(10, 30, 50)));
+ assertTrue(info.areVibrationFeaturesSupported(
+ waveformWithAmplitudes(7, 255, 0, 0, 60)));
+ assertTrue(info.areVibrationFeaturesSupported(
+ VibrationEffect.createOneShot(20, VibrationEffect.DEFAULT_AMPLITUDE)));
+ assertTrue(info.areVibrationFeaturesSupported(
+ VibrationEffect.createOneShot(20, /* amplitude= */ 255)));
+ assertTrue(info.areVibrationFeaturesSupported(
+ VibrationEffect.createOneShot(20, /* amplitude= */ 40)));
+ }
+
+ @Test
+ public void areVibrationFeaturesSupported_compositionsWithSupportedPrimitivesSupported() {
+ VibratorInfo info = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
+ .build();
+
+ assertTrue(info.areVibrationFeaturesSupported(
+ VibrationEffect.startComposition()
+ .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK)
+ .compose()));
+ assertTrue(info.areVibrationFeaturesSupported(
+ VibrationEffect.startComposition()
+ .addPrimitive(
+ VibrationEffect.Composition.PRIMITIVE_CLICK,
+ /* scale= */ 0.2f,
+ /* delay= */ 200)
+ .compose()));
+ }
+
+ @Test
+ public void areVibrationFeaturesSupported_compositionsWithUnupportedPrimitivesUnsupported() {
+ VibratorInfo info = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
+ .build();
+
+ assertFalse(info.areVibrationFeaturesSupported(
+ VibrationEffect.startComposition()
+ .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK)
+ .addPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD)
+ .compose()));
+ assertFalse(info.areVibrationFeaturesSupported(
+ VibrationEffect.startComposition()
+ .addPrimitive(VibrationEffect.Composition.PRIMITIVE_LOW_TICK)
+ .compose()));
+ }
+
+ @Test
+ public void areVibrationFeaturesSupported_composedEffects_allComponentsSupported() {
+ VibratorInfo info = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS | IVibrator.CAP_AMPLITUDE_CONTROL)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
+ .setSupportedEffects(VibrationEffect.EFFECT_TICK, VibrationEffect.EFFECT_POP)
+ .build();
+
+ assertTrue(info.areVibrationFeaturesSupported(
+ VibrationEffect.startComposition()
+ .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK)
+ .addEffect(VibrationEffect.createWaveform(
+ /* timings= */ new long[] {1, 2, 3},
+ /* amplitudes= */ new int[] {10, 20, 255},
+ /* repeatIndex= */ -1))
+ .addEffect(VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK))
+ .addEffect(VibrationEffect.createPredefined(VibrationEffect.EFFECT_POP))
+ .compose()));
+
+ info = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD, 10)
+ .setSupportedEffects(VibrationEffect.EFFECT_POP, VibrationEffect.EFFECT_CLICK)
+ .build();
+
+ assertTrue(info.areVibrationFeaturesSupported(
+ VibrationEffect.startComposition()
+ .addPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD)
+ .addEffect(VibrationEffect.createWaveform(
+ // These timings are given either 0 or default amplitudes, which
+ // do not require vibrator's amplitude control.
+ /* timings= */ new long[] {1, 2, 3},
+ /* repeatIndex= */ -1))
+ .addEffect(VibrationEffect.createPredefined(VibrationEffect.EFFECT_POP))
+ .addEffect(VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK))
+ .compose()));
+ }
+
+ @Test
+ public void areVibrationFeaturesSupported_composedEffects_someComponentsUnupported() {
+ VibratorInfo info = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS | IVibrator.CAP_AMPLITUDE_CONTROL)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
+ .setSupportedEffects(VibrationEffect.EFFECT_TICK, VibrationEffect.EFFECT_POP)
+ .build();
+
+ // Not supported due to the TICK primitive, which the vibrator has no support for.
+ assertFalse(info.areVibrationFeaturesSupported(
+ VibrationEffect.startComposition()
+ .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK)
+ .addPrimitive(VibrationEffect.Composition.PRIMITIVE_TICK)
+ .addEffect(VibrationEffect.createWaveform(
+ /* timings= */ new long[] {1, 2, 3},
+ /* amplitudes= */ new int[] {10, 20, 255},
+ /* repeatIndex= */ -1))
+ .compose()));
+ // Not supported due to the THUD effect, which the vibrator has no support for.
+ assertFalse(info.areVibrationFeaturesSupported(
+ VibrationEffect.startComposition()
+ .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK)
+ .addEffect(VibrationEffect.createWaveform(
+ /* timings= */ new long[] {1, 2, 3},
+ /* amplitudes= */ new int[] {10, 20, 255},
+ /* repeatIndex= */ -1))
+ .addEffect(VibrationEffect.createPredefined(VibrationEffect.EFFECT_THUD))
+ .compose()));
+
+ info = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD, 10)
+ .setSupportedEffects(VibrationEffect.EFFECT_POP)
+ .build();
+
+ // Not supported due to fractional amplitudes (amplitudes not min (0) or max (255) or
+ // DEFAULT), because the vibrator has no amplitude control.
+ assertFalse(info.areVibrationFeaturesSupported(
+ VibrationEffect.startComposition()
+ .addPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD)
+ .addEffect(VibrationEffect.createWaveform(
+ /* timings= */ new long[] {1, 2, 3},
+ /* amplitudes= */ new int[] {10, 20, 255},
+ /* repeatIndex= */ -1))
+ .addEffect(VibrationEffect.createPredefined(VibrationEffect.EFFECT_POP))
+ .compose()));
+ }
+
+ private static VibrationEffect waveformWithAmplitudes(int...amplitudes) {
+ long[] timings = new long[amplitudes.length];
+ for (int i = 0; i < timings.length; i++) {
+ timings[i] = i * 2; // Arbitrary timings.
+ }
+ return VibrationEffect.createWaveform(timings, amplitudes, /* repeatIndex= */ -1);
+ }
}
diff --git a/core/tests/vibrator/src/android/os/VibratorTest.java b/core/tests/vibrator/src/android/os/VibratorTest.java
index c559e34..cfa12bb 100644
--- a/core/tests/vibrator/src/android/os/VibratorTest.java
+++ b/core/tests/vibrator/src/android/os/VibratorTest.java
@@ -37,7 +37,6 @@
import android.content.ContentResolver;
import android.content.Context;
import android.content.ContextWrapper;
-import android.hardware.vibrator.IVibrator;
import android.media.AudioAttributes;
import android.os.test.TestLooper;
@@ -60,8 +59,6 @@
@Rule
public FakeSettingsProviderRule mSettingsProviderRule = FakeSettingsProvider.rule();
- private static final float TEST_TOLERANCE = 1e-5f;
-
private Context mContextSpy;
private Vibrator mVibratorSpy;
private TestLooper mTestLooper;
@@ -79,9 +76,6 @@
@Test
public void getId_returnsDefaultId() {
assertEquals(-1, mVibratorSpy.getId());
- assertEquals(-1, new SystemVibrator.NoVibratorInfo().getId());
- assertEquals(-1, new SystemVibrator.MultiVibratorInfo(new VibratorInfo[] {
- VibratorInfo.EMPTY_VIBRATOR_INFO, VibratorInfo.EMPTY_VIBRATOR_INFO }).getId());
}
@Test
@@ -95,53 +89,6 @@
}
@Test
- public void areEffectsSupported_noVibrator_returnsAlwaysNo() {
- VibratorInfo info = new SystemVibrator.NoVibratorInfo();
- assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_NO,
- info.isEffectSupported(VibrationEffect.EFFECT_CLICK));
- }
-
- @Test
- public void areEffectsSupported_unsupportedInOneVibrator_returnsNo() {
- VibratorInfo supportedVibrator = new VibratorInfo.Builder(/* id= */ 1)
- .setSupportedEffects(VibrationEffect.EFFECT_CLICK)
- .build();
- VibratorInfo unsupportedVibrator = new VibratorInfo.Builder(/* id= */ 2)
- .setSupportedEffects(new int[0])
- .build();
- VibratorInfo info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{supportedVibrator, unsupportedVibrator});
- assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_NO,
- info.isEffectSupported(VibrationEffect.EFFECT_CLICK));
- }
-
- @Test
- public void areEffectsSupported_unknownInOneVibrator_returnsUnknown() {
- VibratorInfo supportedVibrator = new VibratorInfo.Builder(/* id= */ 1)
- .setSupportedEffects(VibrationEffect.EFFECT_CLICK)
- .build();
- VibratorInfo unknownSupportVibrator = VibratorInfo.EMPTY_VIBRATOR_INFO;
- VibratorInfo info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{supportedVibrator, unknownSupportVibrator});
- assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_UNKNOWN,
- info.isEffectSupported(VibrationEffect.EFFECT_CLICK));
- }
-
- @Test
- public void arePrimitivesSupported_supportedInAllVibrators_returnsYes() {
- VibratorInfo firstVibrator = new VibratorInfo.Builder(/* id= */ 1)
- .setSupportedEffects(VibrationEffect.EFFECT_CLICK)
- .build();
- VibratorInfo secondVibrator = new VibratorInfo.Builder(/* id= */ 2)
- .setSupportedEffects(VibrationEffect.EFFECT_CLICK)
- .build();
- VibratorInfo info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, secondVibrator});
- assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_YES,
- info.isEffectSupported(VibrationEffect.EFFECT_CLICK));
- }
-
- @Test
public void arePrimitivesSupported_returnsArrayOfSameSize() {
assertEquals(0, mVibratorSpy.arePrimitivesSupported(new int[0]).length);
assertEquals(1, mVibratorSpy.arePrimitivesSupported(
@@ -152,39 +99,6 @@
}
@Test
- public void arePrimitivesSupported_noVibrator_returnsAlwaysFalse() {
- VibratorInfo info = new SystemVibrator.NoVibratorInfo();
- assertFalse(info.isPrimitiveSupported(VibrationEffect.Composition.PRIMITIVE_CLICK));
- }
-
- @Test
- public void arePrimitivesSupported_unsupportedInOneVibrator_returnsFalse() {
- VibratorInfo supportedVibrator = new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
- .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
- .build();
- VibratorInfo unsupportedVibrator = VibratorInfo.EMPTY_VIBRATOR_INFO;
- VibratorInfo info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{supportedVibrator, unsupportedVibrator});
- assertFalse(info.isPrimitiveSupported(VibrationEffect.Composition.PRIMITIVE_CLICK));
- }
-
- @Test
- public void arePrimitivesSupported_supportedInAllVibrators_returnsTrue() {
- VibratorInfo firstVibrator = new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
- .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 5)
- .build();
- VibratorInfo secondVibrator = new VibratorInfo.Builder(/* id= */ 2)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
- .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 15)
- .build();
- VibratorInfo info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, secondVibrator});
- assertTrue(info.isPrimitiveSupported(VibrationEffect.Composition.PRIMITIVE_CLICK));
- }
-
- @Test
public void getPrimitivesDurations_returnsArrayOfSameSize() {
assertEquals(0, mVibratorSpy.getPrimitiveDurations(new int[0]).length);
assertEquals(1, mVibratorSpy.getPrimitiveDurations(
@@ -195,245 +109,6 @@
}
@Test
- public void getPrimitivesDurations_noVibrator_returnsAlwaysZero() {
- VibratorInfo info = new SystemVibrator.NoVibratorInfo();
- assertEquals(0, info.getPrimitiveDuration(VibrationEffect.Composition.PRIMITIVE_CLICK));
- }
-
- @Test
- public void getPrimitivesDurations_unsupportedInOneVibrator_returnsZero() {
- VibratorInfo supportedVibrator = new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
- .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
- .build();
- VibratorInfo unsupportedVibrator = VibratorInfo.EMPTY_VIBRATOR_INFO;
- VibratorInfo info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{supportedVibrator, unsupportedVibrator});
- assertEquals(0, info.getPrimitiveDuration(VibrationEffect.Composition.PRIMITIVE_CLICK));
- }
-
- @Test
- public void getPrimitivesDurations_supportedInAllVibrators_returnsMaxDuration() {
- VibratorInfo firstVibrator = new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
- .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
- .build();
- VibratorInfo secondVibrator = new VibratorInfo.Builder(/* id= */ 2)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
- .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 20)
- .build();
- VibratorInfo info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, secondVibrator});
- assertEquals(20, info.getPrimitiveDuration(VibrationEffect.Composition.PRIMITIVE_CLICK));
- }
-
- @Test
- public void getQFactorAndResonantFrequency_noVibrator_returnsNaN() {
- VibratorInfo info = new SystemVibrator.NoVibratorInfo();
-
- assertTrue(Float.isNaN(info.getQFactor()));
- assertTrue(Float.isNaN(info.getResonantFrequencyHz()));
- }
-
- @Test
- public void getQFactorAndResonantFrequency_differentValues_returnsNaN() {
- VibratorInfo firstVibrator = new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setQFactor(1f)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, 1, 1, null))
- .build();
- VibratorInfo secondVibrator = new VibratorInfo.Builder(/* id= */ 2)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setQFactor(2f)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(2, 2, 2, null))
- .build();
- VibratorInfo info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, secondVibrator});
-
- assertTrue(Float.isNaN(info.getQFactor()));
- assertTrue(Float.isNaN(info.getResonantFrequencyHz()));
- assertEmptyFrequencyProfileAndControl(info);
-
- // One vibrator with values undefined.
- VibratorInfo thirdVibrator = new VibratorInfo.Builder(/* id= */ 3).build();
- info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, thirdVibrator});
-
- assertTrue(Float.isNaN(info.getQFactor()));
- assertTrue(Float.isNaN(info.getResonantFrequencyHz()));
- assertEmptyFrequencyProfileAndControl(info);
- }
-
- @Test
- public void getQFactorAndResonantFrequency_sameValues_returnsValue() {
- VibratorInfo firstVibrator = new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setQFactor(10f)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(
- /* resonantFrequencyHz= */ 11, 10, 0.5f, null))
- .build();
- VibratorInfo secondVibrator = new VibratorInfo.Builder(/* id= */ 2)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setQFactor(10f)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(
- /* resonantFrequencyHz= */ 11, 5, 1, null))
- .build();
- VibratorInfo info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, secondVibrator});
-
- assertEquals(10f, info.getQFactor(), TEST_TOLERANCE);
- assertEquals(11f, info.getResonantFrequencyHz(), TEST_TOLERANCE);
-
- // No frequency range defined.
- assertTrue(info.getFrequencyProfile().isEmpty());
- assertEquals(false, info.hasCapability(IVibrator.CAP_FREQUENCY_CONTROL));
- }
-
- @Test
- public void getFrequencyProfile_noVibrator_returnsEmpty() {
- VibratorInfo info = new SystemVibrator.NoVibratorInfo();
-
- assertEmptyFrequencyProfileAndControl(info);
- }
-
- @Test
- public void getFrequencyProfile_differentResonantFrequencyOrResolutionValues_returnsEmpty() {
- VibratorInfo firstVibrator = new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, 1, 1,
- new float[] { 0, 1 }))
- .build();
- VibratorInfo differentResonantFrequency = new VibratorInfo.Builder(/* id= */ 2)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(2, 1, 1,
- new float[] { 0, 1 }))
- .build();
- VibratorInfo info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, differentResonantFrequency});
-
- assertEmptyFrequencyProfileAndControl(info);
-
- VibratorInfo differentFrequencyResolution = new VibratorInfo.Builder(/* id= */ 2)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, 1, 2,
- new float[] { 0, 1 }))
- .build();
- info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, differentFrequencyResolution});
-
- assertEmptyFrequencyProfileAndControl(info);
- }
-
- @Test
- public void getFrequencyProfile_missingValues_returnsEmpty() {
- VibratorInfo firstVibrator = new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, 1, 1,
- new float[] { 0, 1 }))
- .build();
- VibratorInfo missingResonantFrequency = new VibratorInfo.Builder(/* id= */ 2)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(Float.NaN, 1, 1,
- new float[] { 0, 1 }))
- .build();
- VibratorInfo info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, missingResonantFrequency});
-
- assertEmptyFrequencyProfileAndControl(info);
-
- VibratorInfo missingMinFrequency = new VibratorInfo.Builder(/* id= */ 2)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, Float.NaN, 1,
- new float[] { 0, 1 }))
- .build();
- info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, missingMinFrequency});
-
- assertEmptyFrequencyProfileAndControl(info);
-
- VibratorInfo missingFrequencyResolution = new VibratorInfo.Builder(/* id= */ 2)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, 1, Float.NaN,
- new float[] { 0, 1 }))
- .build();
- info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, missingFrequencyResolution});
-
- assertEmptyFrequencyProfileAndControl(info);
-
- VibratorInfo missingMaxAmplitudes = new VibratorInfo.Builder(/* id= */ 2)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, 1, 1, null))
- .build();
- info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, missingMaxAmplitudes});
-
- assertEmptyFrequencyProfileAndControl(info);
- }
-
- @Test
- public void getFrequencyProfile_unalignedMaxAmplitudes_returnsEmpty() {
- VibratorInfo firstVibrator = new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10, 0.5f,
- new float[] { 0, 1, 1, 0 }))
- .build();
- VibratorInfo unalignedMinFrequency = new VibratorInfo.Builder(/* id= */ 2)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10.1f, 0.5f,
- new float[] { 0, 1, 1, 0 }))
- .build();
- VibratorInfo thirdVibrator = new VibratorInfo.Builder(/* id= */ 2)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10.5f, 0.5f,
- new float[] { 0, 1, 1, 0 }))
- .build();
- VibratorInfo info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, unalignedMinFrequency, thirdVibrator});
-
- assertEmptyFrequencyProfileAndControl(info);
- }
-
- @Test
- public void getFrequencyProfile_alignedProfiles_returnsIntersection() {
- VibratorInfo firstVibrator = new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10, 0.5f,
- new float[] { 0.5f, 1, 1, 0.5f }))
- .build();
- VibratorInfo secondVibrator = new VibratorInfo.Builder(/* id= */ 2)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10.5f, 0.5f,
- new float[] { 1, 1, 1 }))
- .build();
- VibratorInfo thirdVibrator = new VibratorInfo.Builder(/* id= */ 3)
- .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10.5f, 0.5f,
- new float[] { 0.8f, 1, 0.8f, 0.5f }))
- .build();
- VibratorInfo info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, secondVibrator, thirdVibrator});
-
- assertEquals(
- new VibratorInfo.FrequencyProfile(11, 10.5f, 0.5f, new float[] { 0.8f, 1, 0.5f }),
- info.getFrequencyProfile());
- assertEquals(true, info.hasCapability(IVibrator.CAP_FREQUENCY_CONTROL));
-
- // Third vibrator without frequency control capability.
- thirdVibrator = new VibratorInfo.Builder(/* id= */ 3)
- .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10.5f, 0.5f,
- new float[] { 0.8f, 1, 0.8f, 0.5f }))
- .build();
- info = new SystemVibrator.MultiVibratorInfo(
- new VibratorInfo[]{firstVibrator, secondVibrator, thirdVibrator});
-
- assertEquals(
- new VibratorInfo.FrequencyProfile(11, 10.5f, 0.5f, new float[] { 0.8f, 1, 0.5f }),
- info.getFrequencyProfile());
- assertEquals(false, info.hasCapability(IVibrator.CAP_FREQUENCY_CONTROL));
- }
-
- @Test
public void onVibratorStateChanged_noVibrator_registersNoListenerToVibratorManager() {
VibratorManager mockVibratorManager = mock(VibratorManager.class);
when(mockVibratorManager.getVibratorIds()).thenReturn(new int[0]);
@@ -577,212 +252,4 @@
VibrationAttributes vibrationAttributes = captor.getValue();
assertEquals(new VibrationAttributes.Builder().build(), vibrationAttributes);
}
-
- @Test
- public void areVibrationFeaturesSupported_noAmplitudeControl_fractionalAmplitudes() {
- Vibrator vibrator =
- createVibratorWithCustomInfo(new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
- .setSupportedEffects(VibrationEffect.EFFECT_THUD)
- .build());
-
- // Have at least one fractional amplitude (amplitude not min (0) or max (255) or DEFAULT).
- assertFalse(vibrator.areVibrationFeaturesSupported(waveformWithAmplitudes(10, 30)));
- assertFalse(vibrator.areVibrationFeaturesSupported(waveformWithAmplitudes(10, 255)));
- assertFalse(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.createOneShot(20, /* amplitude= */ 40)));
- }
-
- @Test
- public void areVibrationFeaturesSupported_noAmplitudeControl_nonFractionalAmplitudes() {
- Vibrator vibrator =
- createVibratorWithCustomInfo(new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
- .setSupportedEffects(VibrationEffect.EFFECT_THUD)
- .build());
-
- // All amplitudes are min, max, or default. Requires no amplitude control.
- assertTrue(vibrator.areVibrationFeaturesSupported(
- waveformWithAmplitudes(255, 0, VibrationEffect.DEFAULT_AMPLITUDE, 255)));
- assertTrue(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.createWaveform(
- /* timings= */ new long[] {1, 2, 3}, /* repeatIndex= */ -1)));
- assertTrue(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.createOneShot(20, VibrationEffect.DEFAULT_AMPLITUDE)));
- assertTrue(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.createOneShot(20, /* amplitude= */ 255)));
- }
-
- @Test
- public void areVibrationFeaturesSupported_withAmplitudeControl() {
- Vibrator vibrator =
- createVibratorWithCustomInfo(new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_AMPLITUDE_CONTROL)
- .build());
-
- // All forms of amplitudes are valid when amplitude control is available.
- assertTrue(vibrator.areVibrationFeaturesSupported(
- waveformWithAmplitudes(255, 0, VibrationEffect.DEFAULT_AMPLITUDE, 255)));
- assertTrue(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.createWaveform(
- /* timings= */ new long[] {1, 2, 3}, /* repeatIndex= */ -1)));
- assertTrue(vibrator.areVibrationFeaturesSupported(waveformWithAmplitudes(10, 30, 50)));
- assertTrue(vibrator.areVibrationFeaturesSupported(
- waveformWithAmplitudes(7, 255, 0, 0, 60)));
- assertTrue(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.createOneShot(20, VibrationEffect.DEFAULT_AMPLITUDE)));
- assertTrue(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.createOneShot(20, /* amplitude= */ 255)));
- assertTrue(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.createOneShot(20, /* amplitude= */ 40)));
- }
-
- @Test
- public void areVibrationFeaturesSupported_primitiveCompositionsWithSupportedPrimitives() {
- Vibrator vibrator = createVibratorWithCustomInfo(new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
- .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
- .build());
-
- assertTrue(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.startComposition()
- .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK)
- .compose()));
- assertTrue(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.startComposition()
- .addPrimitive(
- VibrationEffect.Composition.PRIMITIVE_CLICK,
- /* scale= */ 0.2f,
- /* delay= */ 200)
- .compose()));
- }
-
- @Test
- public void areVibrationFeaturesSupported_primitiveCompositionsWithUnupportedPrimitives() {
- Vibrator vibrator = createVibratorWithCustomInfo(new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
- .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
- .build());
-
- assertFalse(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.startComposition()
- .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK)
- .addPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD)
- .compose()));
- assertFalse(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.startComposition()
- .addPrimitive(VibrationEffect.Composition.PRIMITIVE_LOW_TICK)
- .compose()));
- }
-
- @Test
- public void areVibrationFeaturesSupported_composedEffects_allComponentsSupported() {
- Vibrator vibrator = createVibratorWithCustomInfo(new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS | IVibrator.CAP_AMPLITUDE_CONTROL)
- .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
- .setSupportedEffects(VibrationEffect.EFFECT_TICK, VibrationEffect.EFFECT_POP)
- .build());
-
- assertTrue(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.startComposition()
- .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK)
- .addEffect(VibrationEffect.createWaveform(
- /* timings= */ new long[] {1, 2, 3},
- /* amplitudes= */ new int[] {10, 20, 255},
- /* repeatIndex= */ -1))
- .addEffect(VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK))
- .addEffect(VibrationEffect.createPredefined(VibrationEffect.EFFECT_POP))
- .compose()));
-
- vibrator = createVibratorWithCustomInfo(new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
- .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD, 10)
- .setSupportedEffects(VibrationEffect.EFFECT_POP, VibrationEffect.EFFECT_CLICK)
- .build());
-
- assertTrue(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.startComposition()
- .addPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD)
- .addEffect(VibrationEffect.createWaveform(
- // These timings are given either 0 or default amplitudes, which
- // do not require vibrator's amplitude control.
- /* timings= */ new long[] {1, 2, 3},
- /* repeatIndex= */ -1))
- .addEffect(VibrationEffect.createPredefined(VibrationEffect.EFFECT_POP))
- .addEffect(VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK))
- .compose()));
- }
-
- @Test
- public void areVibrationFeaturesSupported_composedEffects_someComponentsUnupported() {
- Vibrator vibrator = createVibratorWithCustomInfo(new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS | IVibrator.CAP_AMPLITUDE_CONTROL)
- .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
- .setSupportedEffects(VibrationEffect.EFFECT_TICK, VibrationEffect.EFFECT_POP)
- .build());
-
- // Not supported due to the TICK primitive, which the vibrator has no support for.
- assertFalse(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.startComposition()
- .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK)
- .addPrimitive(VibrationEffect.Composition.PRIMITIVE_TICK)
- .addEffect(VibrationEffect.createWaveform(
- /* timings= */ new long[] {1, 2, 3},
- /* amplitudes= */ new int[] {10, 20, 255},
- /* repeatIndex= */ -1))
- .compose()));
- // Not supported due to the THUD effect, which the vibrator has no support for.
- assertFalse(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.startComposition()
- .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK)
- .addEffect(VibrationEffect.createWaveform(
- /* timings= */ new long[] {1, 2, 3},
- /* amplitudes= */ new int[] {10, 20, 255},
- /* repeatIndex= */ -1))
- .addEffect(VibrationEffect.createPredefined(VibrationEffect.EFFECT_THUD))
- .compose()));
-
- vibrator = createVibratorWithCustomInfo(new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
- .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD, 10)
- .setSupportedEffects(VibrationEffect.EFFECT_POP)
- .build());
-
- // Not supported due to fractional amplitudes (amplitudes not min (0) or max (255) or
- // DEFAULT), because the vibrator has no amplitude control.
- assertFalse(vibrator.areVibrationFeaturesSupported(
- VibrationEffect.startComposition()
- .addPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD)
- .addEffect(VibrationEffect.createWaveform(
- /* timings= */ new long[] {1, 2, 3},
- /* amplitudes= */ new int[] {10, 20, 255},
- /* repeatIndex= */ -1))
- .addEffect(VibrationEffect.createPredefined(VibrationEffect.EFFECT_POP))
- .compose()));
- }
-
- /**
- * Asserts that the frequency profile is empty, and therefore frequency control isn't supported.
- */
- void assertEmptyFrequencyProfileAndControl(VibratorInfo info) {
- assertTrue(info.getFrequencyProfile().isEmpty());
- assertEquals(false, info.hasCapability(IVibrator.CAP_FREQUENCY_CONTROL));
- }
-
- private Vibrator createVibratorWithCustomInfo(VibratorInfo info) {
- return new SystemVibrator(mContextSpy) {
- @Override
- public VibratorInfo getInfo() {
- return info;
- }
- };
- }
-
- private static VibrationEffect waveformWithAmplitudes(int...amplitudes) {
- long[] timings = new long[amplitudes.length];
- for (int i = 0; i < timings.length; i++) {
- timings[i] = i * 2; // Arbitrary timings.
- }
- return VibrationEffect.createWaveform(timings, amplitudes, /* repeatIndex= */ -1);
- }
}
diff --git a/core/tests/vibrator/src/android/os/vibrator/MultiVibratorInfoTest.java b/core/tests/vibrator/src/android/os/vibrator/MultiVibratorInfoTest.java
new file mode 100644
index 0000000..fc31ac4
--- /dev/null
+++ b/core/tests/vibrator/src/android/os/vibrator/MultiVibratorInfoTest.java
@@ -0,0 +1,361 @@
+/*
+ * Copyright 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.os.vibrator;
+
+import static junit.framework.Assert.assertFalse;
+import static junit.framework.Assert.assertTrue;
+import static junit.framework.TestCase.assertEquals;
+
+import android.hardware.vibrator.IVibrator;
+import android.os.VibrationEffect;
+import android.os.Vibrator;
+import android.os.VibratorInfo;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class MultiVibratorInfoTest {
+ private static final float TEST_TOLERANCE = 1e-5f;
+
+ @Test
+ public void testGetId() {
+ VibratorInfo firstInfo = new VibratorInfo.Builder(/* id= */ 1)
+ .setSupportedEffects(VibrationEffect.EFFECT_CLICK)
+ .build();
+ VibratorInfo secondInfo = new VibratorInfo.Builder(/* id= */ 2)
+ .setSupportedEffects(new int[0])
+ .build();
+
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 3,
+ new VibratorInfo[]{firstInfo, secondInfo});
+
+ assertEquals(3, info.getId());
+ }
+
+ @Test
+ public void testIsEffectSupported_supportedInAllVibrators_returnsYes() {
+ VibratorInfo firstInfo = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedEffects(VibrationEffect.EFFECT_CLICK)
+ .build();
+ VibratorInfo secondInfo = new VibratorInfo.Builder(/* id= */ 2)
+ .setSupportedEffects(VibrationEffect.EFFECT_CLICK, VibrationEffect.EFFECT_TICK)
+ .build();
+
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, secondInfo});
+
+ assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_YES,
+ info.isEffectSupported(VibrationEffect.EFFECT_CLICK));
+ }
+
+ @Test
+ public void testIsEffectSupported_unsupportedInOneVibrator_returnsNo() {
+ VibratorInfo supportedVibrator = new VibratorInfo.Builder(/* id= */ 1)
+ .setSupportedEffects(VibrationEffect.EFFECT_CLICK)
+ .build();
+ VibratorInfo unsupportedVibrator = new VibratorInfo.Builder(/* id= */ 2)
+ .setSupportedEffects(new int[0])
+ .build();
+
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{supportedVibrator, unsupportedVibrator});
+
+ assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_NO,
+ info.isEffectSupported(VibrationEffect.EFFECT_CLICK));
+ }
+
+ @Test
+ public void testIsEffectSupported_unknownInOneVibrator_returnsUnknown() {
+ VibratorInfo supportedVibrator = new VibratorInfo.Builder(/* id= */ 1)
+ .setSupportedEffects(VibrationEffect.EFFECT_CLICK)
+ .build();
+ VibratorInfo unknownSupportVibrator = VibratorInfo.EMPTY_VIBRATOR_INFO;
+
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{supportedVibrator, unknownSupportVibrator});
+ assertEquals(Vibrator.VIBRATION_EFFECT_SUPPORT_UNKNOWN,
+ info.isEffectSupported(VibrationEffect.EFFECT_CLICK));
+ }
+
+ @Test
+ public void testIsPrimitiveSupported_unsupportedInOneVibrator_returnsFalse() {
+ VibratorInfo supportedVibrator = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
+ .build();
+ VibratorInfo unsupportedVibrator = VibratorInfo.EMPTY_VIBRATOR_INFO;
+
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{supportedVibrator, unsupportedVibrator});
+
+ assertFalse(info.isPrimitiveSupported(VibrationEffect.Composition.PRIMITIVE_CLICK));
+ }
+
+ @Test
+ public void testIsPrimitiveSupported_supportedInAllVibrators_returnsTrue() {
+ VibratorInfo firstInfo = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 5)
+ .build();
+ VibratorInfo secondInfo = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 15)
+ .build();
+
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, secondInfo});
+
+ assertTrue(info.isPrimitiveSupported(VibrationEffect.Composition.PRIMITIVE_CLICK));
+ }
+
+ @Test
+ public void testGetPrimitiveDuration_unsupportedInOneVibrator_returnsZero() {
+ VibratorInfo supportedVibrator = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
+ .build();
+ VibratorInfo unsupportedVibrator = VibratorInfo.EMPTY_VIBRATOR_INFO;
+
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{supportedVibrator, unsupportedVibrator});
+
+ assertEquals(0, info.getPrimitiveDuration(VibrationEffect.Composition.PRIMITIVE_CLICK));
+ }
+
+ @Test
+ public void testGetPrimitiveDuration_supportedInAllVibrators_returnsMaxDuration() {
+ VibratorInfo firstInfo = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
+ .build();
+ VibratorInfo secondInfo = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 20)
+ .build();
+
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, secondInfo});
+
+ assertEquals(20, info.getPrimitiveDuration(VibrationEffect.Composition.PRIMITIVE_CLICK));
+ }
+
+ @Test
+ public void testGetQFactorAndResonantFrequency_differentValues_returnsNaN() {
+ VibratorInfo firstInfo = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setQFactor(1f)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, 1, 1, null))
+ .build();
+ VibratorInfo secondInfo = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setQFactor(2f)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(2, 2, 2, null))
+ .build();
+
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, secondInfo});
+
+ assertTrue(Float.isNaN(info.getQFactor()));
+ assertTrue(Float.isNaN(info.getResonantFrequencyHz()));
+ assertEmptyFrequencyProfileAndControl(info);
+
+ // One vibrator with values undefined.
+ VibratorInfo thirdVibrator = new VibratorInfo.Builder(/* id= */ 3).build();
+ info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, thirdVibrator});
+
+ assertTrue(Float.isNaN(info.getQFactor()));
+ assertTrue(Float.isNaN(info.getResonantFrequencyHz()));
+ assertEmptyFrequencyProfileAndControl(info);
+ }
+
+ @Test
+ public void testGetQFactorAndResonantFrequency_sameValues_returnsValue() {
+ VibratorInfo firstInfo = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setQFactor(10f)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(
+ /* resonantFrequencyHz= */ 11, 10, 0.5f, null))
+ .build();
+ VibratorInfo secondInfo = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setQFactor(10f)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(
+ /* resonantFrequencyHz= */ 11, 5, 1, null))
+ .build();
+
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, secondInfo});
+
+ assertEquals(10f, info.getQFactor(), TEST_TOLERANCE);
+ assertEquals(11f, info.getResonantFrequencyHz(), TEST_TOLERANCE);
+ // No frequency range defined.
+ assertTrue(info.getFrequencyProfile().isEmpty());
+ assertEquals(false, info.hasCapability(IVibrator.CAP_FREQUENCY_CONTROL));
+ }
+
+ @Test
+ public void testGetFrequencyProfile_differentResonantFrequencyOrResolutions_returnsEmpty() {
+ VibratorInfo firstInfo = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, 1, 1,
+ new float[] { 0, 1 }))
+ .build();
+ VibratorInfo differentResonantFrequency = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(2, 1, 1,
+ new float[] { 0, 1 }))
+ .build();
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, differentResonantFrequency});
+
+ assertEmptyFrequencyProfileAndControl(info);
+
+ VibratorInfo differentFrequencyResolution = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, 1, 2,
+ new float[] { 0, 1 }))
+ .build();
+ info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, differentFrequencyResolution});
+
+ assertEmptyFrequencyProfileAndControl(info);
+ }
+
+ @Test
+ public void testGetFrequencyProfile_missingValues_returnsEmpty() {
+ VibratorInfo firstInfo = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, 1, 1,
+ new float[] { 0, 1 }))
+ .build();
+ VibratorInfo missingResonantFrequency = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(Float.NaN, 1, 1,
+ new float[] { 0, 1 }))
+ .build();
+
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, missingResonantFrequency});
+
+ assertEmptyFrequencyProfileAndControl(info);
+
+ VibratorInfo missingMinFrequency = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, Float.NaN, 1,
+ new float[] { 0, 1 }))
+ .build();
+ info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, missingMinFrequency});
+
+ assertEmptyFrequencyProfileAndControl(info);
+
+ VibratorInfo missingFrequencyResolution = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, 1, Float.NaN,
+ new float[] { 0, 1 }))
+ .build();
+ info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, missingFrequencyResolution});
+
+ assertEmptyFrequencyProfileAndControl(info);
+
+ VibratorInfo missingMaxAmplitudes = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(1, 1, 1, null))
+ .build();
+ info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, missingMaxAmplitudes});
+
+ assertEmptyFrequencyProfileAndControl(info);
+ }
+
+ @Test
+ public void testGetFrequencyProfile_unalignedMaxAmplitudes_returnsEmpty() {
+ VibratorInfo firstInfo = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10, 0.5f,
+ new float[] { 0, 1, 1, 0 }))
+ .build();
+ VibratorInfo unalignedMinFrequency = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10.1f, 0.5f,
+ new float[] { 0, 1, 1, 0 }))
+ .build();
+ VibratorInfo thirdVibrator = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10.5f, 0.5f,
+ new float[] { 0, 1, 1, 0 }))
+ .build();
+
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, unalignedMinFrequency, thirdVibrator});
+
+ assertEmptyFrequencyProfileAndControl(info);
+ }
+
+ @Test
+ public void testGetFrequencyProfile_alignedProfiles_returnsIntersection() {
+ VibratorInfo firstInfo = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10, 0.5f,
+ new float[] { 0.5f, 1, 1, 0.5f }))
+ .build();
+ VibratorInfo secondInfo = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10.5f, 0.5f,
+ new float[] { 1, 1, 1 }))
+ .build();
+ VibratorInfo thirdVibrator = new VibratorInfo.Builder(/* id= */ 3)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10.5f, 0.5f,
+ new float[] { 0.8f, 1, 0.8f, 0.5f }))
+ .build();
+
+ VibratorInfo info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, secondInfo, thirdVibrator});
+
+ assertEquals(
+ new VibratorInfo.FrequencyProfile(11, 10.5f, 0.5f, new float[] { 0.8f, 1, 0.5f }),
+ info.getFrequencyProfile());
+ assertEquals(true, info.hasCapability(IVibrator.CAP_FREQUENCY_CONTROL));
+
+ // Third vibrator without frequency control capability.
+ thirdVibrator = new VibratorInfo.Builder(/* id= */ 3)
+ .setFrequencyProfile(new VibratorInfo.FrequencyProfile(11, 10.5f, 0.5f,
+ new float[] { 0.8f, 1, 0.8f, 0.5f }))
+ .build();
+ info = new MultiVibratorInfo(/* id= */ 1,
+ new VibratorInfo[]{firstInfo, secondInfo, thirdVibrator});
+
+ assertEquals(
+ new VibratorInfo.FrequencyProfile(11, 10.5f, 0.5f, new float[] { 0.8f, 1, 0.5f }),
+ info.getFrequencyProfile());
+ assertEquals(false, info.hasCapability(IVibrator.CAP_FREQUENCY_CONTROL));
+ }
+
+ /**
+ * Asserts that the frequency profile is empty, and therefore frequency control isn't supported.
+ */
+ private void assertEmptyFrequencyProfileAndControl(VibratorInfo info) {
+ assertTrue(info.getFrequencyProfile().isEmpty());
+ assertEquals(false, info.hasCapability(IVibrator.CAP_FREQUENCY_CONTROL));
+ }
+}
diff --git a/core/tests/vibrator/src/android/os/vibrator/PrebakedSegmentTest.java b/core/tests/vibrator/src/android/os/vibrator/PrebakedSegmentTest.java
index 8268077..4f5f3c0 100644
--- a/core/tests/vibrator/src/android/os/vibrator/PrebakedSegmentTest.java
+++ b/core/tests/vibrator/src/android/os/vibrator/PrebakedSegmentTest.java
@@ -25,18 +25,14 @@
import static org.testng.Assert.assertThrows;
import android.os.Parcel;
-import android.os.SystemVibrator;
import android.os.VibrationEffect;
-import android.os.Vibrator;
import android.os.VibratorInfo;
-import androidx.test.InstrumentationRegistry;
-
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.junit.runners.JUnit4;
-@RunWith(MockitoJUnitRunner.class)
+@RunWith(JUnit4.class)
public class PrebakedSegmentTest {
@Test
@@ -149,121 +145,121 @@
@Test
public void testVibrationFeaturesSupport_idsWithFallback_fallbackEnabled_vibratorSupport() {
- Vibrator vibrator = createVibratorWithSupportedEffects(
+ VibratorInfo info = createVibratorInfoWithSupportedEffects(
VibrationEffect.EFFECT_TICK,
VibrationEffect.EFFECT_CLICK,
VibrationEffect.EFFECT_DOUBLE_CLICK,
VibrationEffect.EFFECT_HEAVY_CLICK);
assertTrue(createSegmentWithFallback(VibrationEffect.EFFECT_TICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(createSegmentWithFallback(VibrationEffect.EFFECT_CLICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(createSegmentWithFallback(VibrationEffect.EFFECT_DOUBLE_CLICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(createSegmentWithFallback(VibrationEffect.EFFECT_HEAVY_CLICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_idsWithFallback_fallbackEnabled_noVibratorSupport() {
- Vibrator vibrator = createVibratorWithSupportedEffects(new int[0]);
+ VibratorInfo info = createVibratorInfoWithSupportedEffects(new int[0]);
assertTrue(createSegmentWithFallback(VibrationEffect.EFFECT_TICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(createSegmentWithFallback(VibrationEffect.EFFECT_CLICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(createSegmentWithFallback(VibrationEffect.EFFECT_DOUBLE_CLICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(createSegmentWithFallback(VibrationEffect.EFFECT_HEAVY_CLICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_idsWithFallback_fallbackDisabled_vibratorSupport() {
- Vibrator vibrator = createVibratorWithSupportedEffects(
+ VibratorInfo info = createVibratorInfoWithSupportedEffects(
VibrationEffect.EFFECT_TICK,
VibrationEffect.EFFECT_CLICK,
VibrationEffect.EFFECT_DOUBLE_CLICK,
VibrationEffect.EFFECT_HEAVY_CLICK);
assertTrue(createSegmentWithoutFallback(VibrationEffect.EFFECT_TICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(createSegmentWithoutFallback(VibrationEffect.EFFECT_CLICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(createSegmentWithoutFallback(VibrationEffect.EFFECT_DOUBLE_CLICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(createSegmentWithoutFallback(VibrationEffect.EFFECT_HEAVY_CLICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_idsWithFallback_fallbackDisabled_noVibratorSupport() {
- Vibrator vibrator = createVibratorWithSupportedEffects(new int[0]);
+ VibratorInfo info = createVibratorInfoWithSupportedEffects(new int[0]);
assertFalse(createSegmentWithoutFallback(VibrationEffect.EFFECT_TICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertFalse(createSegmentWithoutFallback(VibrationEffect.EFFECT_CLICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertFalse(createSegmentWithoutFallback(VibrationEffect.EFFECT_DOUBLE_CLICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertFalse(createSegmentWithoutFallback(VibrationEffect.EFFECT_HEAVY_CLICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_idsWithNoFallback_fallbackEnabled_vibratorSupport() {
- Vibrator vibrator = createVibratorWithSupportedEffects(
+ VibratorInfo info = createVibratorInfoWithSupportedEffects(
VibrationEffect.EFFECT_THUD,
VibrationEffect.EFFECT_POP,
VibrationEffect.EFFECT_TEXTURE_TICK);
assertTrue(createSegmentWithFallback(VibrationEffect.EFFECT_THUD)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(createSegmentWithFallback(VibrationEffect.EFFECT_POP)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(createSegmentWithFallback(VibrationEffect.EFFECT_TEXTURE_TICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_idsWithNoFallback_fallbackEnabled_noVibratorSupport() {
- Vibrator vibrator = createVibratorWithSupportedEffects(new int[0]);
+ VibratorInfo info = createVibratorInfoWithSupportedEffects(new int[0]);
assertFalse(createSegmentWithFallback(VibrationEffect.EFFECT_THUD)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertFalse(createSegmentWithFallback(VibrationEffect.EFFECT_POP)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertFalse(createSegmentWithFallback(VibrationEffect.EFFECT_TEXTURE_TICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_idsWithNoFallback_fallbackDisabled_vibratorSupport() {
- Vibrator vibrator = createVibratorWithSupportedEffects(
+ VibratorInfo info = createVibratorInfoWithSupportedEffects(
VibrationEffect.EFFECT_THUD,
VibrationEffect.EFFECT_POP,
VibrationEffect.EFFECT_TEXTURE_TICK);
assertTrue(createSegmentWithoutFallback(VibrationEffect.EFFECT_THUD)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(createSegmentWithoutFallback(VibrationEffect.EFFECT_POP)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertTrue(createSegmentWithoutFallback(VibrationEffect.EFFECT_TEXTURE_TICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_idsWithNoFallback_fallbackDisabled_noVibSupport() {
- Vibrator vibrator = createVibratorWithSupportedEffects(new int[0]);
+ VibratorInfo info = createVibratorInfoWithSupportedEffects(new int[0]);
assertFalse(createSegmentWithoutFallback(VibrationEffect.EFFECT_THUD)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertFalse(createSegmentWithoutFallback(VibrationEffect.EFFECT_POP)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
assertFalse(createSegmentWithoutFallback(VibrationEffect.EFFECT_TEXTURE_TICK)
- .areVibrationFeaturesSupported(vibrator));
+ .areVibrationFeaturesSupported(info));
}
@Test
@@ -283,14 +279,9 @@
return new PrebakedSegment(effectId, false, VibrationEffect.EFFECT_STRENGTH_MEDIUM);
}
- private static Vibrator createVibratorWithSupportedEffects(int... supportedEffects) {
- return new SystemVibrator(InstrumentationRegistry.getContext()) {
- @Override
- public VibratorInfo getInfo() {
- return new VibratorInfo.Builder(/* id= */ 1)
- .setSupportedEffects(supportedEffects)
- .build();
- }
- };
+ private static VibratorInfo createVibratorInfoWithSupportedEffects(int... supportedEffects) {
+ return new VibratorInfo.Builder(/* id= */ 1)
+ .setSupportedEffects(supportedEffects)
+ .build();
}
}
diff --git a/core/tests/vibrator/src/android/os/vibrator/PrimitiveSegmentTest.java b/core/tests/vibrator/src/android/os/vibrator/PrimitiveSegmentTest.java
index 6f5adcd..ec5a084 100644
--- a/core/tests/vibrator/src/android/os/vibrator/PrimitiveSegmentTest.java
+++ b/core/tests/vibrator/src/android/os/vibrator/PrimitiveSegmentTest.java
@@ -25,18 +25,14 @@
import android.hardware.vibrator.IVibrator;
import android.os.Parcel;
-import android.os.SystemVibrator;
import android.os.VibrationEffect;
-import android.os.Vibrator;
import android.os.VibratorInfo;
-import androidx.test.InstrumentationRegistry;
-
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.junit.runners.JUnit4;
-@RunWith(MockitoJUnitRunner.class)
+@RunWith(JUnit4.class)
public class PrimitiveSegmentTest {
private static final float TOLERANCE = 1e-2f;
@@ -146,15 +142,15 @@
public void testVibrationFeaturesSupport_primitiveSupportedByVibrator() {
assertTrue(createSegment(VibrationEffect.Composition.PRIMITIVE_CLICK)
.areVibrationFeaturesSupported(
- createVibratorWithSupportedPrimitive(
+ createVibratorInfoWithSupportedPrimitive(
VibrationEffect.Composition.PRIMITIVE_CLICK)));
assertTrue(createSegment(VibrationEffect.Composition.PRIMITIVE_THUD)
.areVibrationFeaturesSupported(
- createVibratorWithSupportedPrimitive(
+ createVibratorInfoWithSupportedPrimitive(
VibrationEffect.Composition.PRIMITIVE_THUD)));
assertTrue(createSegment(VibrationEffect.Composition.PRIMITIVE_QUICK_RISE)
.areVibrationFeaturesSupported(
- createVibratorWithSupportedPrimitive(
+ createVibratorInfoWithSupportedPrimitive(
VibrationEffect.Composition.PRIMITIVE_QUICK_RISE)));
}
@@ -162,15 +158,15 @@
public void testVibrationFeaturesSupport_primitiveNotSupportedByVibrator() {
assertFalse(createSegment(VibrationEffect.Composition.PRIMITIVE_CLICK)
.areVibrationFeaturesSupported(
- createVibratorWithSupportedPrimitive(
+ createVibratorInfoWithSupportedPrimitive(
VibrationEffect.Composition.PRIMITIVE_THUD)));
assertFalse(createSegment(VibrationEffect.Composition.PRIMITIVE_THUD)
.areVibrationFeaturesSupported(
- createVibratorWithSupportedPrimitive(
+ createVibratorInfoWithSupportedPrimitive(
VibrationEffect.Composition.PRIMITIVE_CLICK)));
assertFalse(createSegment(VibrationEffect.Composition.PRIMITIVE_THUD)
.areVibrationFeaturesSupported(
- createVibratorWithSupportedPrimitive(
+ createVibratorInfoWithSupportedPrimitive(
VibrationEffect.Composition.PRIMITIVE_QUICK_RISE)));
}
@@ -193,15 +189,10 @@
return new PrimitiveSegment(primitiveId, 0.2f, 10);
}
- private static Vibrator createVibratorWithSupportedPrimitive(int primitiveId) {
- return new SystemVibrator(InstrumentationRegistry.getContext()) {
- @Override
- public VibratorInfo getInfo() {
- return new VibratorInfo.Builder(/* id= */ 1)
- .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
- .setSupportedPrimitive(primitiveId, 10)
- .build();
- }
- };
+ private static VibratorInfo createVibratorInfoWithSupportedPrimitive(int primitiveId) {
+ return new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedPrimitive(primitiveId, 10)
+ .build();
}
}
diff --git a/core/tests/vibrator/src/android/os/vibrator/RampSegmentTest.java b/core/tests/vibrator/src/android/os/vibrator/RampSegmentTest.java
index 68870e5..5caa86b 100644
--- a/core/tests/vibrator/src/android/os/vibrator/RampSegmentTest.java
+++ b/core/tests/vibrator/src/android/os/vibrator/RampSegmentTest.java
@@ -23,31 +23,21 @@
import static junit.framework.Assert.assertSame;
import static junit.framework.Assert.assertTrue;
-import static org.mockito.Mockito.when;
import static org.testng.Assert.assertThrows;
+import android.hardware.vibrator.IVibrator;
import android.os.Parcel;
import android.os.VibrationEffect;
-import android.os.Vibrator;
+import android.os.VibratorInfo;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnit;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.mockito.junit.MockitoRule;
+import org.junit.runners.JUnit4;
-@RunWith(MockitoJUnitRunner.class)
+@RunWith(JUnit4.class)
public class RampSegmentTest {
private static final float TOLERANCE = 1e-2f;
- @Rule
- public MockitoRule mMockitoRule = MockitoJUnit.rule();
-
- @Mock
- private Vibrator mVibrator;
-
@Test
public void testCreation() {
RampSegment ramp = new RampSegment(/* startAmplitude= */ 1, /* endAmplitude= */ 0,
@@ -147,71 +137,71 @@
@Test
public void testVibrationFeaturesSupport_amplitudeAndFrequencyControls_supported() {
- when(mVibrator.hasAmplitudeControl()).thenReturn(true);
- when(mVibrator.hasFrequencyControl()).thenReturn(true);
+ VibratorInfo info =
+ createVibInfo(/* hasAmplitudeControl= */ true, /* hasFrequencyControl= */ true);
// Increasing amplitude
- assertTrue(new RampSegment(0.5f, 1, 0, 0, 10).areVibrationFeaturesSupported(mVibrator));
+ assertTrue(new RampSegment(0.5f, 1, 0, 0, 10).areVibrationFeaturesSupported(info));
// Increasing frequency
- assertTrue(new RampSegment(0.5f, 0.5f, 0, 1, 10).areVibrationFeaturesSupported(mVibrator));
+ assertTrue(new RampSegment(0.5f, 0.5f, 0, 1, 10).areVibrationFeaturesSupported(info));
// Decreasing amplitude
- assertTrue(new RampSegment(1, 0.5f, 0, 0, 10).areVibrationFeaturesSupported(mVibrator));
+ assertTrue(new RampSegment(1, 0.5f, 0, 0, 10).areVibrationFeaturesSupported(info));
// Decreasing frequency
- assertTrue(new RampSegment(0.5f, 0.5f, 1, 0, 10).areVibrationFeaturesSupported(mVibrator));
+ assertTrue(new RampSegment(0.5f, 0.5f, 1, 0, 10).areVibrationFeaturesSupported(info));
// Zero duration
- assertTrue(new RampSegment(0.5f, 0.5f, 1, 0, 0).areVibrationFeaturesSupported(mVibrator));
+ assertTrue(new RampSegment(0.5f, 0.5f, 1, 0, 0).areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_noAmplitudeControl_unsupportedForChangingAmplitude() {
- when(mVibrator.hasAmplitudeControl()).thenReturn(false);
- when(mVibrator.hasFrequencyControl()).thenReturn(true);
+ VibratorInfo info =
+ createVibInfo(/* hasAmplitudeControl= */ false, /* hasFrequencyControl= */ true);
// Test with increasing/decreasing amplitudes.
- assertFalse(new RampSegment(0.5f, 1, 0, 0, 10).areVibrationFeaturesSupported(mVibrator));
- assertFalse(new RampSegment(1, 0.5f, 0, 0, 10).areVibrationFeaturesSupported(mVibrator));
+ assertFalse(new RampSegment(0.5f, 1, 0, 0, 10).areVibrationFeaturesSupported(info));
+ assertFalse(new RampSegment(1, 0.5f, 0, 0, 10).areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_noAmplitudeControl_fractionalAmplitudeUnsupported() {
- when(mVibrator.hasAmplitudeControl()).thenReturn(false);
- when(mVibrator.hasFrequencyControl()).thenReturn(true);
+ VibratorInfo info =
+ createVibInfo(/* hasAmplitudeControl= */ false, /* hasFrequencyControl= */ true);
- assertFalse(new RampSegment(0.2f, 0.2f, 0, 0, 10).areVibrationFeaturesSupported(mVibrator));
- assertFalse(new RampSegment(0, 0.2f, 0, 0, 10).areVibrationFeaturesSupported(mVibrator));
- assertFalse(new RampSegment(0.2f, 0, 0, 0, 10).areVibrationFeaturesSupported(mVibrator));
+ assertFalse(new RampSegment(0.2f, 0.2f, 0, 0, 10).areVibrationFeaturesSupported(info));
+ assertFalse(new RampSegment(0, 0.2f, 0, 0, 10).areVibrationFeaturesSupported(info));
+ assertFalse(new RampSegment(0.2f, 0, 0, 0, 10).areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_unchangingZeroAmplitude_supported() {
RampSegment amplitudeZeroWithIncreasingFrequency = new RampSegment(1, 1, 0.5f, 0.8f, 10);
RampSegment amplitudeZeroWithDecreasingFrequency = new RampSegment(1, 1, 0.8f, 0.5f, 10);
- when(mVibrator.hasFrequencyControl()).thenReturn(true);
- when(mVibrator.hasAmplitudeControl()).thenReturn(false);
+ VibratorInfo info =
+ createVibInfo(/* hasAmplitudeControl= */ false, /* hasFrequencyControl= */ true);
- assertTrue(amplitudeZeroWithIncreasingFrequency.areVibrationFeaturesSupported(mVibrator));
- assertTrue(amplitudeZeroWithDecreasingFrequency.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(amplitudeZeroWithIncreasingFrequency.areVibrationFeaturesSupported(info));
+ assertTrue(amplitudeZeroWithDecreasingFrequency.areVibrationFeaturesSupported(info));
- when(mVibrator.hasAmplitudeControl()).thenReturn(true);
+ info = createVibInfo(/* hasAmplitudeControl= */ true, /* hasFrequencyControl= */ true);
- assertTrue(amplitudeZeroWithIncreasingFrequency.areVibrationFeaturesSupported(mVibrator));
- assertTrue(amplitudeZeroWithDecreasingFrequency.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(amplitudeZeroWithIncreasingFrequency.areVibrationFeaturesSupported(info));
+ assertTrue(amplitudeZeroWithDecreasingFrequency.areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_unchangingOneAmplitude_supported() {
RampSegment amplitudeOneWithIncreasingFrequency = new RampSegment(1, 1, 0.5f, 0.8f, 10);
RampSegment amplitudeOneWithDecreasingFrequency = new RampSegment(1, 1, 0.8f, 0.5f, 10);
- when(mVibrator.hasFrequencyControl()).thenReturn(true);
- when(mVibrator.hasAmplitudeControl()).thenReturn(false);
+ VibratorInfo info =
+ createVibInfo(/* hasAmplitudeControl= */ false, /* hasFrequencyControl= */ true);
- assertTrue(amplitudeOneWithIncreasingFrequency.areVibrationFeaturesSupported(mVibrator));
- assertTrue(amplitudeOneWithDecreasingFrequency.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(amplitudeOneWithIncreasingFrequency.areVibrationFeaturesSupported(info));
+ assertTrue(amplitudeOneWithDecreasingFrequency.areVibrationFeaturesSupported(info));
- when(mVibrator.hasAmplitudeControl()).thenReturn(true);
+ info = createVibInfo(/* hasAmplitudeControl= */ true, /* hasFrequencyControl= */ true);
- assertTrue(amplitudeOneWithIncreasingFrequency.areVibrationFeaturesSupported(mVibrator));
- assertTrue(amplitudeOneWithDecreasingFrequency.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(amplitudeOneWithIncreasingFrequency.areVibrationFeaturesSupported(info));
+ assertTrue(amplitudeOneWithDecreasingFrequency.areVibrationFeaturesSupported(info));
}
@Test
@@ -220,52 +210,52 @@
new RampSegment(DEFAULT_AMPLITUDE, DEFAULT_AMPLITUDE, 0.5f, 0.8f, 10);
RampSegment defaultAmplitudeDecreasingFrequency =
new RampSegment(DEFAULT_AMPLITUDE, DEFAULT_AMPLITUDE, 0.8f, 0.5f, 10);
- when(mVibrator.hasFrequencyControl()).thenReturn(true);
- when(mVibrator.hasAmplitudeControl()).thenReturn(false);
+ VibratorInfo info =
+ createVibInfo(/* hasAmplitudeControl= */ false, /* hasFrequencyControl= */ true);
- assertTrue(defaultAmplitudeIncreasingFrequency.areVibrationFeaturesSupported(mVibrator));
- assertTrue(defaultAmplitudeDecreasingFrequency.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(defaultAmplitudeIncreasingFrequency.areVibrationFeaturesSupported(info));
+ assertTrue(defaultAmplitudeDecreasingFrequency.areVibrationFeaturesSupported(info));
- when(mVibrator.hasAmplitudeControl()).thenReturn(true);
+ info = createVibInfo(/* hasAmplitudeControl= */ true, /* hasFrequencyControl= */ true);
- assertTrue(defaultAmplitudeIncreasingFrequency.areVibrationFeaturesSupported(mVibrator));
- assertTrue(defaultAmplitudeDecreasingFrequency.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(defaultAmplitudeIncreasingFrequency.areVibrationFeaturesSupported(info));
+ assertTrue(defaultAmplitudeDecreasingFrequency.areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_noFrequencyControl_unsupportedForChangingFrequency() {
- when(mVibrator.hasAmplitudeControl()).thenReturn(true);
- when(mVibrator.hasFrequencyControl()).thenReturn(false);
+ VibratorInfo info =
+ createVibInfo(/* hasAmplitudeControl= */ true, /* hasFrequencyControl= */ false);
// Test with increasing/decreasing frequencies.
- assertFalse(new RampSegment(0, 0, 0.2f, 0.4f, 10).areVibrationFeaturesSupported(mVibrator));
- assertFalse(new RampSegment(0, 0, 0.4f, 0.2f, 10).areVibrationFeaturesSupported(mVibrator));
+ assertFalse(new RampSegment(0, 0, 0.2f, 0.4f, 10).areVibrationFeaturesSupported(info));
+ assertFalse(new RampSegment(0, 0, 0.4f, 0.2f, 10).areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_noFrequencyControl_fractionalFrequencyUnsupported() {
- when(mVibrator.hasAmplitudeControl()).thenReturn(true);
- when(mVibrator.hasFrequencyControl()).thenReturn(false);
+ VibratorInfo info =
+ createVibInfo(/* hasAmplitudeControl= */ true, /* hasFrequencyControl= */ false);
- assertFalse(new RampSegment(0, 0, 0.2f, 0.2f, 10).areVibrationFeaturesSupported(mVibrator));
- assertFalse(new RampSegment(0, 0, 0.2f, 0, 10).areVibrationFeaturesSupported(mVibrator));
- assertFalse(new RampSegment(0, 0, 0, 0.2f, 10).areVibrationFeaturesSupported(mVibrator));
+ assertFalse(new RampSegment(0, 0, 0.2f, 0.2f, 10).areVibrationFeaturesSupported(info));
+ assertFalse(new RampSegment(0, 0, 0.2f, 0, 10).areVibrationFeaturesSupported(info));
+ assertFalse(new RampSegment(0, 0, 0, 0.2f, 10).areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_unchangingZeroFrequency_supported() {
RampSegment frequencyZeroWithIncreasingAmplitude = new RampSegment(0.1f, 1, 0, 0, 10);
RampSegment frequencyZeroWithDecreasingAmplitude = new RampSegment(1, 0.1f, 0, 0, 10);
- when(mVibrator.hasAmplitudeControl()).thenReturn(true);
- when(mVibrator.hasFrequencyControl()).thenReturn(false);
+ VibratorInfo info =
+ createVibInfo(/* hasAmplitudeControl= */ true, /* hasFrequencyControl= */ false);
- assertTrue(frequencyZeroWithIncreasingAmplitude.areVibrationFeaturesSupported(mVibrator));
- assertTrue(frequencyZeroWithDecreasingAmplitude.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(frequencyZeroWithIncreasingAmplitude.areVibrationFeaturesSupported(info));
+ assertTrue(frequencyZeroWithDecreasingAmplitude.areVibrationFeaturesSupported(info));
- when(mVibrator.hasFrequencyControl()).thenReturn(true);
+ info = createVibInfo(/* hasAmplitudeControl= */ true, /* hasFrequencyControl= */ true);
- assertTrue(frequencyZeroWithIncreasingAmplitude.areVibrationFeaturesSupported(mVibrator));
- assertTrue(frequencyZeroWithDecreasingAmplitude.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(frequencyZeroWithIncreasingAmplitude.areVibrationFeaturesSupported(info));
+ assertTrue(frequencyZeroWithDecreasingAmplitude.areVibrationFeaturesSupported(info));
}
@Test
@@ -274,4 +264,17 @@
// duration checked in VibrationEffect implementations.
assertTrue(new RampSegment(0.5f, 1, 0, 0, 5_000).isHapticFeedbackCandidate());
}
+
+ private static VibratorInfo createVibInfo(
+ boolean hasAmplitudeControl, boolean hasFrequencyControl) {
+ VibratorInfo.Builder builder = new VibratorInfo.Builder(/* id= */ 1);
+ long capabilities = 0;
+ if (hasAmplitudeControl) {
+ capabilities |= IVibrator.CAP_AMPLITUDE_CONTROL;
+ }
+ if (hasFrequencyControl) {
+ capabilities |= (IVibrator.CAP_FREQUENCY_CONTROL | IVibrator.CAP_COMPOSE_PWLE_EFFECTS);
+ }
+ return builder.setCapabilities(capabilities).build();
+ }
}
diff --git a/core/tests/vibrator/src/android/os/vibrator/StepSegmentTest.java b/core/tests/vibrator/src/android/os/vibrator/StepSegmentTest.java
index 34bb892..44db306 100644
--- a/core/tests/vibrator/src/android/os/vibrator/StepSegmentTest.java
+++ b/core/tests/vibrator/src/android/os/vibrator/StepSegmentTest.java
@@ -21,31 +21,20 @@
import static junit.framework.Assert.assertSame;
import static junit.framework.Assert.assertTrue;
-import static org.mockito.Mockito.when;
import static org.testng.Assert.assertThrows;
+import android.hardware.vibrator.IVibrator;
import android.os.Parcel;
import android.os.VibrationEffect;
-import android.os.Vibrator;
+import android.os.VibratorInfo;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnit;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.mockito.junit.MockitoRule;
+import org.junit.runners.JUnit4;
-@RunWith(MockitoJUnitRunner.class)
+@RunWith(JUnit4.class)
public class StepSegmentTest {
private static final float TOLERANCE = 1e-2f;
-
- @Rule
- public MockitoRule mMockitoRule = MockitoJUnit.rule();
-
- @Mock
- private Vibrator mVibrator;
-
@Test
public void testCreation() {
StepSegment step = new StepSegment(/* amplitude= */ 1f, /* frequencyHz= */ 1f,
@@ -160,26 +149,26 @@
public void testVibrationFeaturesSupport_zeroAmplitude_supported() {
StepSegment segment =
new StepSegment(/* amplitude= */ 0, /* frequencyHz= */ 0, /* duration= */ 0);
- when(mVibrator.hasAmplitudeControl()).thenReturn(true);
+ VibratorInfo info = createVibInfoForAmplitude(/* hasAmplitudeControl= */ true);
- assertTrue(segment.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(segment.areVibrationFeaturesSupported(info));
- when(mVibrator.hasAmplitudeControl()).thenReturn(false);
+ info = createVibInfoForAmplitude(/* hasAmplitudeControl= */ false);
- assertTrue(segment.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(segment.areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_maxAmplitude_supported() {
StepSegment segment =
new StepSegment(/* amplitude= */ 1, /* frequencyHz= */ 0, /* duration= */ 0);
- when(mVibrator.hasAmplitudeControl()).thenReturn(true);
+ VibratorInfo info = createVibInfoForAmplitude(/* hasAmplitudeControl= */ true);
- assertTrue(segment.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(segment.areVibrationFeaturesSupported(info));
- when(mVibrator.hasAmplitudeControl()).thenReturn(false);
+ info = createVibInfoForAmplitude(/* hasAmplitudeControl= */ false);
- assertTrue(segment.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(segment.areVibrationFeaturesSupported(info));
}
@Test
@@ -189,60 +178,60 @@
/* amplitude= */ VibrationEffect.DEFAULT_AMPLITUDE,
/* frequencyHz= */ 0,
/* duration= */ 0);
- when(mVibrator.hasAmplitudeControl()).thenReturn(true);
+ VibratorInfo info = createVibInfoForAmplitude(/* hasAmplitudeControl= */ true);
- assertTrue(segment.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(segment.areVibrationFeaturesSupported(info));
- when(mVibrator.hasAmplitudeControl()).thenReturn(false);
+ info = createVibInfoForAmplitude(/* hasAmplitudeControl= */ false);
- assertTrue(segment.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(segment.areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_fractionalAmplitude_hasAmplitudeCtrl_supported() {
- when(mVibrator.hasAmplitudeControl()).thenReturn(true);
+ VibratorInfo info = createVibInfoForAmplitude(/* hasAmplitudeControl= */ true);
assertTrue(new StepSegment(/* amplitude= */ 0.2f, /* frequencyHz= */ 0, /* duration= */ 0)
- .areVibrationFeaturesSupported(mVibrator));
+ .areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_fractionalAmplitude_hasNoAmplitudeCtrl_notSupported() {
- when(mVibrator.hasAmplitudeControl()).thenReturn(false);
+ VibratorInfo info = createVibInfoForAmplitude(/* hasAmplitudeControl= */ false);
assertFalse(new StepSegment(/* amplitude= */ 0.2f, /* frequencyHz= */ 0, /* duration= */ 0)
- .areVibrationFeaturesSupported(mVibrator));
+ .areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_zeroFrequency_supported() {
StepSegment segment =
new StepSegment(/* amplitude= */ 0f, /* frequencyHz= */ 0, /* duration= */ 0);
- when(mVibrator.hasFrequencyControl()).thenReturn(false);
+ VibratorInfo info = createVibInfoForFrequency(/* hasFrequencyControl= */ false);
- assertTrue(segment.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(segment.areVibrationFeaturesSupported(info));
- when(mVibrator.hasFrequencyControl()).thenReturn(true);
+ info = createVibInfoForFrequency(/* hasFrequencyControl= */ true);
- assertTrue(segment.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(segment.areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_nonZeroFrequency_hasFrequencyCtrl_supported() {
StepSegment segment =
new StepSegment(/* amplitude= */ 0f, /* frequencyHz= */ 0.2f, /* duration= */ 0);
- when(mVibrator.hasFrequencyControl()).thenReturn(true);
+ VibratorInfo info = createVibInfoForFrequency(/* hasFrequencyControl= */ true);
- assertTrue(segment.areVibrationFeaturesSupported(mVibrator));
+ assertTrue(segment.areVibrationFeaturesSupported(info));
}
@Test
public void testVibrationFeaturesSupport_nonZeroFrequency_hasNoFrequencyCtrl_notSupported() {
StepSegment segment =
new StepSegment(/* amplitude= */ 0f, /* frequencyHz= */ 0.2f, /* duration= */ 0);
- when(mVibrator.hasFrequencyControl()).thenReturn(false);
+ VibratorInfo info = createVibInfoForFrequency(/* hasFrequencyControl= */ false);
- assertFalse(segment.areVibrationFeaturesSupported(mVibrator));
+ assertFalse(segment.areVibrationFeaturesSupported(info));
}
@Test
@@ -251,4 +240,21 @@
// duration checked in VibrationEffect implementations.
assertTrue(new StepSegment(0, 0, 5_000).isHapticFeedbackCandidate());
}
+
+ private static VibratorInfo createVibInfoForAmplitude(boolean hasAmplitudeControl) {
+ VibratorInfo.Builder builder = new VibratorInfo.Builder(/* id= */ 1);
+ if (hasAmplitudeControl) {
+ builder.setCapabilities(IVibrator.CAP_AMPLITUDE_CONTROL);
+ }
+ return builder.build();
+ }
+
+ private static VibratorInfo createVibInfoForFrequency(boolean hasFrequencyControl) {
+ VibratorInfo.Builder builder = new VibratorInfo.Builder(/* id= */ 1);
+ if (hasFrequencyControl) {
+ builder.setCapabilities(
+ IVibrator.CAP_FREQUENCY_CONTROL | IVibrator.CAP_COMPOSE_PWLE_EFFECTS);
+ }
+ return builder.build();
+ }
}
diff --git a/core/tests/vibrator/src/android/os/vibrator/VibratorInfoFactoryTest.java b/core/tests/vibrator/src/android/os/vibrator/VibratorInfoFactoryTest.java
new file mode 100644
index 0000000..df4822f
--- /dev/null
+++ b/core/tests/vibrator/src/android/os/vibrator/VibratorInfoFactoryTest.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright 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.os.vibrator;
+
+import static junit.framework.Assert.assertTrue;
+import static junit.framework.TestCase.assertEquals;
+
+import android.hardware.vibrator.IVibrator;
+import android.os.VibrationEffect;
+import android.os.VibratorInfo;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class VibratorInfoFactoryTest {
+
+ @Test
+ public void testCreatedInfo_hasTheRequestedId() {
+ // Empty info list.
+ VibratorInfo infoFromEmptyInfos =
+ VibratorInfoFactory.create(/* id= */ 3, new VibratorInfo[] {});
+ VibratorInfo info1 = new VibratorInfo.Builder(/* id= */ 1)
+ .setSupportedEffects(VibrationEffect.EFFECT_CLICK)
+ .build();
+ VibratorInfo info2 = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
+ .build();
+ VibratorInfo infoFromOneInfo =
+ VibratorInfoFactory.create(/* id= */ -1, new VibratorInfo[] {info1});
+ VibratorInfo infoFromTwoInfos =
+ VibratorInfoFactory.create(/* id= */ -3, new VibratorInfo[] {info1, info2});
+
+ assertEquals(3, infoFromEmptyInfos.getId());
+ assertEquals(-1, infoFromOneInfo.getId());
+ assertEquals(-3, infoFromTwoInfos.getId());
+ }
+
+ @Test
+ public void testCreatedInfo_fromEmptyVibratorInfos_returnsEmptyVibratorInfo() {
+ VibratorInfo info = VibratorInfoFactory.create(/* id= */ 2, new VibratorInfo[] {});
+
+ assertEqualContent(VibratorInfo.EMPTY_VIBRATOR_INFO, info);
+ }
+
+ @Test
+ public void testCreatedInfo_fromSingleVibratorInfo_hasEqualContent() {
+ VibratorInfo info = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS | IVibrator.CAP_FREQUENCY_CONTROL)
+ .setSupportedEffects(VibrationEffect.EFFECT_TICK, VibrationEffect.EFFECT_THUD)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 20)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_TICK, 30)
+ .build();
+
+ VibratorInfo createdInfo =
+ VibratorInfoFactory.create(/* id= */ -1, new VibratorInfo[] {info});
+
+ assertEqualContent(info, createdInfo);
+ }
+
+ @Test
+ public void testCreatedInfo_hasEqualContentRegardlessOfSourceInfoOrder() {
+ VibratorInfo info1 = new VibratorInfo.Builder(/* id= */ 1)
+ .setCapabilities(IVibrator.CAP_FREQUENCY_CONTROL)
+ .setSupportedEffects(VibrationEffect.EFFECT_CLICK)
+ .build();
+ VibratorInfo info2 = new VibratorInfo.Builder(/* id= */ 2)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
+ .build();
+
+ assertEqualContent(
+ VibratorInfoFactory.create(/* id= */ -1, new VibratorInfo[] {info1, info2}),
+ VibratorInfoFactory.create(/* id= */ -1, new VibratorInfo[] {info2, info1}));
+ }
+
+ @Test
+ public void testCreatedInfoContents() {
+ VibratorInfo info1 = new VibratorInfo.Builder(/* id= */ -1)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS | IVibrator.CAP_FREQUENCY_CONTROL)
+ .setSupportedEffects(VibrationEffect.EFFECT_CLICK, VibrationEffect.EFFECT_POP)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD, 5)
+ .build();
+ VibratorInfo info2 = new VibratorInfo.Builder(/* id= */ -2)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS | IVibrator.CAP_AMPLITUDE_CONTROL)
+ .setSupportedEffects(VibrationEffect.EFFECT_POP, VibrationEffect.EFFECT_THUD)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 10)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD, 20)
+ .build();
+ VibratorInfo info3 = new VibratorInfo.Builder(/* id= */ -3)
+ .setCapabilities(IVibrator.CAP_AMPLITUDE_CONTROL)
+ .build();
+
+ assertEquals(
+ new VibratorInfo.Builder(/* id= */ 3)
+ .setCapabilities(IVibrator.CAP_COMPOSE_EFFECTS)
+ .setSupportedEffects(VibrationEffect.EFFECT_POP)
+ .setSupportedPrimitive(VibrationEffect.Composition.PRIMITIVE_THUD, 20)
+ .build(),
+ VibratorInfoFactory.create(/* id= */ 3, new VibratorInfo[] {info1, info2}));
+ assertEquals(
+ new VibratorInfo.Builder(/* id= */ 3)
+ .setCapabilities(IVibrator.CAP_AMPLITUDE_CONTROL)
+ .build(),
+ VibratorInfoFactory.create(/* id= */ 3, new VibratorInfo[] {info2, info3}));
+ assertEquals(
+ new VibratorInfo.Builder(/* id= */ 3).build(),
+ VibratorInfoFactory.create(/* id= */ 3, new VibratorInfo[] {info1, info3}));
+ }
+
+ private static void assertEqualContent(VibratorInfo info1, VibratorInfo info2) {
+ assertTrue(info1.equalContent(info2));
+ }
+}
diff --git a/graphics/java/android/graphics/Gainmap.java b/graphics/java/android/graphics/Gainmap.java
index f639521..b5fb13d 100644
--- a/graphics/java/android/graphics/Gainmap.java
+++ b/graphics/java/android/graphics/Gainmap.java
@@ -124,8 +124,6 @@
/**
* Creates a new gainmap using the provided gainmap as the metadata source and the provided
* bitmap as the replacement for the gainmapContents
- * TODO: Make public, it's useful
- * @hide
*/
public Gainmap(@NonNull Gainmap gainmap, @NonNull Bitmap gainmapContents) {
this(gainmapContents, nCreateCopy(gainmap.mNativePtr));
diff --git a/graphics/java/android/graphics/fonts/SystemFonts.java b/graphics/java/android/graphics/fonts/SystemFonts.java
index 98629a2..36bfb98 100644
--- a/graphics/java/android/graphics/fonts/SystemFonts.java
+++ b/graphics/java/android/graphics/fonts/SystemFonts.java
@@ -235,6 +235,22 @@
}
/**
+ * Get the updated FontConfig.
+ *
+ * @param updatableFontMap a font mapping of updated font files.
+ * @hide
+ */
+ public static @NonNull FontConfig getSystemFontConfigForTesting(
+ @NonNull String fontsXml,
+ @Nullable Map<String, File> updatableFontMap,
+ long lastModifiedDate,
+ int configVersion
+ ) {
+ return getSystemFontConfigInternal(fontsXml, SYSTEM_FONT_DIR, OEM_XML, OEM_FONT_DIR,
+ updatableFontMap, lastModifiedDate, configVersion);
+ }
+
+ /**
* Get the system preinstalled FontConfig.
* @hide
*/
diff --git a/keystore/OWNERS b/keystore/OWNERS
index 7ab9d76..913f655 100644
--- a/keystore/OWNERS
+++ b/keystore/OWNERS
@@ -1,4 +1,4 @@
+# Bug component: 189335
eranm@google.com
jbires@google.com
-jdanis@google.com
swillden@google.com
diff --git a/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java b/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java
index 54955c6..1394bd4 100644
--- a/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java
+++ b/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java
@@ -325,32 +325,25 @@
args.add(KeyStore2ParameterUtils.makeBool(
KeymasterDefs.KM_TAG_NO_AUTH_REQUIRED));
} else {
- if (spec.getUserAuthenticationValidityDurationSeconds() == 0) {
- // Every use of this key needs to be authorized by the user.
- addSids(args, spec);
- args.add(KeyStore2ParameterUtils.makeEnum(
- KeymasterDefs.KM_TAG_USER_AUTH_TYPE, spec.getUserAuthenticationType()
- ));
-
- if (spec.isUserAuthenticationValidWhileOnBody()) {
- throw new ProviderException(
- "Key validity extension while device is on-body is not "
- + "supported for keys requiring fingerprint authentication");
- }
- } else {
- addSids(args, spec);
- args.add(KeyStore2ParameterUtils.makeEnum(
- KeymasterDefs.KM_TAG_USER_AUTH_TYPE, spec.getUserAuthenticationType()
- ));
+ addSids(args, spec);
+ args.add(KeyStore2ParameterUtils.makeEnum(
+ KeymasterDefs.KM_TAG_USER_AUTH_TYPE, spec.getUserAuthenticationType()
+ ));
+ if (spec.getUserAuthenticationValidityDurationSeconds() != 0) {
args.add(KeyStore2ParameterUtils.makeInt(
KeymasterDefs.KM_TAG_AUTH_TIMEOUT,
spec.getUserAuthenticationValidityDurationSeconds()
));
- if (spec.isUserAuthenticationValidWhileOnBody()) {
- args.add(KeyStore2ParameterUtils.makeBool(
- KeymasterDefs.KM_TAG_ALLOW_WHILE_ON_BODY
- ));
+ }
+ if (spec.isUserAuthenticationValidWhileOnBody()) {
+ if (spec.getUserAuthenticationValidityDurationSeconds() == 0) {
+ throw new ProviderException(
+ "Key validity extension while device is on-body is not "
+ + "supported for keys requiring fingerprint authentication");
}
+ args.add(KeyStore2ParameterUtils.makeBool(
+ KeymasterDefs.KM_TAG_ALLOW_WHILE_ON_BODY
+ ));
}
}
}
diff --git a/libs/WindowManager/Shell/res/drawable/user_aspect_ratio_settings_button.xml b/libs/WindowManager/Shell/res/drawable/user_aspect_ratio_settings_button.xml
new file mode 100644
index 0000000..6e4752c
--- /dev/null
+++ b/libs/WindowManager/Shell/res/drawable/user_aspect_ratio_settings_button.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="48dp"
+ android:height="48dp"
+ android:viewportWidth="48"
+ android:viewportHeight="48">
+ <path
+ android:fillColor="@color/compat_controls_background"
+ android:strokeAlpha="0.8"
+ android:fillAlpha="0.8"
+ android:pathData="M0,24 a24,24 0 1,0 48,0 a24,24 0 1,0 -48,0"/>
+ <group
+ android:translateX="12"
+ android:translateY="12">
+ <path
+ android:fillColor="@color/compat_controls_text"
+ android:pathData="M19,12h-2v3h-3v2h5v-5zM7,9h3L10,7L5,7v5h2L7,9zM21,3L3,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM21,19.01L3,19.01L3,4.99h18v14.02z"/>
+ </group>
+</vector>
diff --git a/libs/WindowManager/Shell/res/drawable/user_aspect_ratio_settings_button_ripple.xml b/libs/WindowManager/Shell/res/drawable/user_aspect_ratio_settings_button_ripple.xml
new file mode 100644
index 0000000..141a1ce
--- /dev/null
+++ b/libs/WindowManager/Shell/res/drawable/user_aspect_ratio_settings_button_ripple.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="@color/compat_background_ripple">
+ <item android:drawable="@drawable/user_aspect_ratio_settings_button"/>
+</ripple>
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/res/layout/bubble_bar_manage_education.xml b/libs/WindowManager/Shell/res/layout/bubble_bar_manage_education.xml
new file mode 100644
index 0000000..a0a06f1
--- /dev/null
+++ b/libs/WindowManager/Shell/res/layout/bubble_bar_manage_education.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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
+ -->
+<com.android.wm.shell.common.bubbles.BubblePopupView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginHorizontal="@dimen/bubble_popup_margin_horizontal"
+ android:layout_marginTop="@dimen/bubble_popup_margin_top"
+ android:elevation="@dimen/bubble_manage_menu_elevation"
+ android:gravity="center_horizontal"
+ android:orientation="vertical">
+
+ <ImageView
+ android:layout_width="32dp"
+ android:layout_height="32dp"
+ android:tint="?android:attr/colorAccent"
+ android:contentDescription="@null"
+ android:src="@drawable/pip_ic_settings"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:maxWidth="@dimen/bubble_popup_content_max_width"
+ android:maxLines="1"
+ android:ellipsize="end"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault.Headline"
+ android:textColor="?android:attr/textColorPrimary"
+ android:text="@string/bubble_bar_education_manage_title"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:maxWidth="@dimen/bubble_popup_content_max_width"
+ android:textAppearance="@android:style/TextAppearance.DeviceDefault"
+ android:textColor="?android:attr/textColorSecondary"
+ android:textAlignment="center"
+ android:text="@string/bubble_bar_education_manage_text"/>
+
+</com.android.wm.shell.common.bubbles.BubblePopupView>
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/res/layout/compat_ui_layout.xml b/libs/WindowManager/Shell/res/layout/compat_ui_layout.xml
index dfaeeeb..257fe15 100644
--- a/libs/WindowManager/Shell/res/layout/compat_ui_layout.xml
+++ b/libs/WindowManager/Shell/res/layout/compat_ui_layout.xml
@@ -55,7 +55,7 @@
<include android:id="@+id/size_compat_hint"
android:visibility="gone"
- android:layout_width="@dimen/size_compat_hint_width"
+ android:layout_width="@dimen/compat_hint_width"
android:layout_height="wrap_content"
layout="@layout/compat_mode_hint"/>
diff --git a/libs/WindowManager/Shell/res/layout/user_aspect_ratio_settings_layout.xml b/libs/WindowManager/Shell/res/layout/user_aspect_ratio_settings_layout.xml
new file mode 100644
index 0000000..433d854
--- /dev/null
+++ b/libs/WindowManager/Shell/res/layout/user_aspect_ratio_settings_layout.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+<com.android.wm.shell.compatui.UserAspectRatioSettingsLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:gravity="bottom|end">
+
+ <include android:id="@+id/user_aspect_ratio_settings_hint"
+ android:visibility="gone"
+ android:layout_width="@dimen/compat_hint_width"
+ android:layout_height="wrap_content"
+ layout="@layout/compat_mode_hint"/>
+
+ <ImageButton
+ android:id="@+id/user_aspect_ratio_settings_button"
+ android:visibility="gone"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="@dimen/compat_button_margin"
+ android:layout_marginBottom="@dimen/compat_button_margin"
+ android:src="@drawable/user_aspect_ratio_settings_button_ripple"
+ android:background="@android:color/transparent"
+ android:contentDescription="@string/user_aspect_ratio_settings_button_description"/>
+
+</com.android.wm.shell.compatui.UserAspectRatioSettingsLayout>
diff --git a/libs/WindowManager/Shell/res/values/dimen.xml b/libs/WindowManager/Shell/res/values/dimen.xml
index ac73e1d..20bf81d 100644
--- a/libs/WindowManager/Shell/res/values/dimen.xml
+++ b/libs/WindowManager/Shell/res/values/dimen.xml
@@ -226,6 +226,20 @@
<dimen name="bubble_user_education_padding_end">58dp</dimen>
<!-- Padding between the bubble and the user education text. -->
<dimen name="bubble_user_education_stack_padding">16dp</dimen>
+ <!-- Max width for the bubble popup view. -->
+ <dimen name="bubble_popup_content_max_width">300dp</dimen>
+ <!-- Horizontal margin for the bubble popup view. -->
+ <dimen name="bubble_popup_margin_horizontal">32dp</dimen>
+ <!-- Top margin for the bubble popup view. -->
+ <dimen name="bubble_popup_margin_top">16dp</dimen>
+ <!-- Width for the bubble popup view arrow. -->
+ <dimen name="bubble_popup_arrow_width">12dp</dimen>
+ <!-- Height for the bubble popup view arrow. -->
+ <dimen name="bubble_popup_arrow_height">10dp</dimen>
+ <!-- Corner radius for the bubble popup view arrow. -->
+ <dimen name="bubble_popup_arrow_corner_radius">2dp</dimen>
+ <!-- Padding for the bubble popup view contents. -->
+ <dimen name="bubble_popup_padding">24dp</dimen>
<!-- The size of the caption bar inset at the top of bubble bar expanded view. -->
<dimen name="bubble_bar_expanded_view_caption_height">32dp</dimen>
<!-- The height of the dots shown for the caption menu in the bubble bar expanded view.. -->
@@ -260,8 +274,8 @@
+ compat_button_margin - compat_hint_corner_radius - compat_hint_point_width / 2). -->
<dimen name="compat_hint_padding_end">7dp</dimen>
- <!-- The width of the size compat hint. -->
- <dimen name="size_compat_hint_width">188dp</dimen>
+ <!-- The width of the compat hint. -->
+ <dimen name="compat_hint_width">188dp</dimen>
<!-- The width of the camera compat hint. -->
<dimen name="camera_compat_hint_width">143dp</dimen>
diff --git a/libs/WindowManager/Shell/res/values/strings.xml b/libs/WindowManager/Shell/res/values/strings.xml
index b192fdf..00c63d7 100644
--- a/libs/WindowManager/Shell/res/values/strings.xml
+++ b/libs/WindowManager/Shell/res/values/strings.xml
@@ -163,6 +163,11 @@
<!-- [CHAR LIMIT=NONE] Empty overflow subtitle -->
<string name="bubble_overflow_empty_subtitle">Recent bubbles and dismissed bubbles will appear here</string>
+ <!-- Title text for the bubble bar "manage" button tool tip highlighting where users can go to control bubble settings. [CHAR LIMIT=60]-->
+ <string name="bubble_bar_education_manage_title">Control bubbles anytime</string>
+ <!-- Descriptive text for the bubble bar "manage" button tool tip highlighting where users can go to control bubble settings. [CHAR LIMIT=80]-->
+ <string name="bubble_bar_education_manage_text">Tap here to manage which apps and conversations can bubble</string>
+
<!-- [CHAR LIMIT=100] Notification Importance title -->
<string name="notification_bubble_title">Bubble</string>
@@ -173,7 +178,13 @@
<string name="accessibility_bubble_dismissed">Bubble dismissed.</string>
<!-- Description of the restart button in the hint of size compatibility mode. [CHAR LIMIT=NONE] -->
- <string name="restart_button_description">Tap to restart this app for a better view.</string>
+ <string name="restart_button_description">Tap to restart this app for a better view</string>
+
+ <!-- Tooltip text of the button for the user aspect ratio settings. [CHAR LIMIT=NONE] -->
+ <string name="user_aspect_ratio_settings_button_hint">Change this app\'s aspect ratio in Settings</string>
+
+ <!-- Content description of the button for the user aspect ratio settings. [CHAR LIMIT=NONE] -->
+ <string name="user_aspect_ratio_settings_button_description">Change aspect ratio</string>
<!-- Description of the camera compat button for applying stretched issues treatment in the hint for
compatibility control. [CHAR LIMIT=NONE] -->
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java
index 7e09c98..ff67110 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubble.java
@@ -60,7 +60,6 @@
/**
* Encapsulates the data and UI elements of a bubble.
*/
-@VisibleForTesting
public class Bubble implements BubbleViewProvider {
private static final String TAG = "Bubble";
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleEducationController.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleEducationController.kt
new file mode 100644
index 0000000..e57f02c
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleEducationController.kt
@@ -0,0 +1,74 @@
+/*
+ * 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.wm.shell.bubbles
+
+import android.content.Context
+import android.util.Log
+import androidx.core.content.edit
+import com.android.wm.shell.bubbles.BubbleDebugConfig.DEBUG_USER_EDUCATION
+import com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES
+import com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME
+
+/** Manages bubble education flags. Provides convenience methods to check the education state */
+class BubbleEducationController(private val context: Context) {
+ private val prefs = context.getSharedPreferences(context.packageName, Context.MODE_PRIVATE)
+
+ /** Whether the user has seen the stack education */
+ @get:JvmName(name = "hasSeenStackEducation")
+ var hasSeenStackEducation: Boolean
+ get() = prefs.getBoolean(PREF_STACK_EDUCATION, false)
+ set(value) = prefs.edit { putBoolean(PREF_STACK_EDUCATION, value) }
+
+ /** Whether the user has seen the expanded view "manage" menu education */
+ @get:JvmName(name = "hasSeenManageEducation")
+ var hasSeenManageEducation: Boolean
+ get() = prefs.getBoolean(PREF_MANAGED_EDUCATION, false)
+ set(value) = prefs.edit { putBoolean(PREF_MANAGED_EDUCATION, value) }
+
+ /** Whether education view should show for the collapsed stack. */
+ fun shouldShowStackEducation(bubble: BubbleViewProvider?): Boolean {
+ val shouldShow = bubble != null &&
+ bubble.isConversationBubble && // show education for conversation bubbles only
+ (!hasSeenStackEducation || BubbleDebugConfig.forceShowUserEducation(context))
+ logDebug("Show stack edu: $shouldShow")
+ return shouldShow
+ }
+
+ /** Whether the educational view should show for the expanded view "manage" menu. */
+ fun shouldShowManageEducation(bubble: BubbleViewProvider?): Boolean {
+ val shouldShow = bubble != null &&
+ bubble.isConversationBubble && // show education for conversation bubbles only
+ (!hasSeenManageEducation || BubbleDebugConfig.forceShowUserEducation(context))
+ logDebug("Show manage edu: $shouldShow")
+ return shouldShow
+ }
+
+ private fun logDebug(message: String) {
+ if (DEBUG_USER_EDUCATION) {
+ Log.d(TAG, message)
+ }
+ }
+
+ companion object {
+ private val TAG = if (TAG_WITH_CLASS_NAME) "BubbleEducationController" else TAG_BUBBLES
+ const val PREF_STACK_EDUCATION: String = "HasSeenBubblesOnboarding"
+ const val PREF_MANAGED_EDUCATION: String = "HasSeenBubblesManageOnboarding"
+ }
+}
+
+/** Convenience extension method to check if the bubble is a conversation bubble */
+private val BubbleViewProvider.isConversationBubble: Boolean
+ get() = if (this is Bubble) isConversation else false
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePopupViewExt.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePopupViewExt.kt
new file mode 100644
index 0000000..bdb09e1
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePopupViewExt.kt
@@ -0,0 +1,47 @@
+/*
+ * 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.wm.shell.bubbles
+
+import android.graphics.Color
+import com.android.wm.shell.R
+import com.android.wm.shell.common.bubbles.BubblePopupDrawable
+import com.android.wm.shell.common.bubbles.BubblePopupView
+
+/**
+ * A convenience method to setup the [BubblePopupView] with the correct config using local resources
+ */
+fun BubblePopupView.setup() {
+ val attrs =
+ context.obtainStyledAttributes(
+ intArrayOf(
+ com.android.internal.R.attr.materialColorSurface,
+ android.R.attr.dialogCornerRadius
+ )
+ )
+
+ val res = context.resources
+ val config =
+ BubblePopupDrawable.Config(
+ color = attrs.getColor(0, Color.WHITE),
+ cornerRadius = attrs.getDimension(1, 0f),
+ contentPadding = res.getDimensionPixelSize(R.dimen.bubble_popup_padding),
+ arrowWidth = res.getDimension(R.dimen.bubble_popup_arrow_width),
+ arrowHeight = res.getDimension(R.dimen.bubble_popup_arrow_height),
+ arrowRadius = res.getDimension(R.dimen.bubble_popup_arrow_corner_radius)
+ )
+ attrs.recycle()
+ setupBackground(config)
+}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java
index da5974f..8ae12c7 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java
@@ -46,7 +46,6 @@
import android.graphics.RectF;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
-import android.os.SystemProperties;
import android.provider.Settings;
import android.util.Log;
import android.view.Choreographer;
@@ -108,12 +107,6 @@
*/
public class BubbleStackView extends FrameLayout
implements ViewTreeObserver.OnComputeInternalInsetsListener {
-
- // LINT.IfChange
- public static final boolean ENABLE_FLING_TO_DISMISS_BUBBLE =
- SystemProperties.getBoolean("persist.wm.debug.fling_to_dismiss_bubble", true);
- // LINT.ThenChange(com/android/launcher3/taskbar/bubbles/BubbleDismissController.java)
-
private static final String TAG = TAG_WITH_CLASS_NAME ? "BubbleStackView" : TAG_BUBBLES;
/** How far the flyout needs to be dragged before it's dismissed regardless of velocity. */
@@ -138,7 +131,7 @@
private static final int EXPANDED_VIEW_ALPHA_ANIMATION_DURATION = 150;
- private static final float SCRIM_ALPHA = 0.6f;
+ private static final float SCRIM_ALPHA = 0.32f;
/** Minimum alpha value for scrim when alpha is being changed via drag */
private static final float MIN_SCRIM_ALPHA_FOR_DRAG = 0.2f;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/ExpandedAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/ExpandedAnimationController.java
index 33629f9..c20733a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/ExpandedAnimationController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/ExpandedAnimationController.java
@@ -19,7 +19,6 @@
import static android.view.View.LAYOUT_DIRECTION_RTL;
import static com.android.wm.shell.bubbles.BubblePositioner.NUM_VISIBLE_WHEN_RESTING;
-import static com.android.wm.shell.bubbles.BubbleStackView.ENABLE_FLING_TO_DISMISS_BUBBLE;
import android.content.res.Resources;
import android.graphics.Path;
@@ -355,7 +354,6 @@
mMagnetizedBubbleDraggingOut.setMagnetListener(listener);
mMagnetizedBubbleDraggingOut.setHapticsEnabled(true);
mMagnetizedBubbleDraggingOut.setFlingToTargetMinVelocity(FLING_TO_DISMISS_MIN_VELOCITY);
- mMagnetizedBubbleDraggingOut.setFlingToTargetEnabled(ENABLE_FLING_TO_DISMISS_BUBBLE);
}
private void springBubbleTo(View bubble, float x, float y) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/StackAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/StackAnimationController.java
index 5533842..4bb1ab4 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/StackAnimationController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/StackAnimationController.java
@@ -17,7 +17,6 @@
package com.android.wm.shell.bubbles.animation;
import static com.android.wm.shell.bubbles.BubblePositioner.NUM_VISIBLE_WHEN_RESTING;
-import static com.android.wm.shell.bubbles.BubbleStackView.ENABLE_FLING_TO_DISMISS_BUBBLE;
import android.content.ContentResolver;
import android.content.res.Resources;
@@ -1026,7 +1025,6 @@
};
mMagnetizedStack.setHapticsEnabled(true);
mMagnetizedStack.setFlingToTargetMinVelocity(FLING_TO_DISMISS_MIN_VELOCITY);
- mMagnetizedStack.setFlingToTargetEnabled(ENABLE_FLING_TO_DISMISS_BUBBLE);
}
final ContentResolver contentResolver = mLayout.getContext().getContentResolver();
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java
index 6b6d6ba..79f188a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarExpandedView.java
@@ -39,7 +39,6 @@
import com.android.wm.shell.bubbles.Bubbles;
import com.android.wm.shell.taskview.TaskView;
-import java.util.function.Consumer;
import java.util.function.Supplier;
/**
@@ -48,6 +47,18 @@
* {@link BubbleController#isShowingAsBubbleBar()}
*/
public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskViewHelper.Listener {
+ /**
+ * The expanded view listener notifying the {@link BubbleBarLayerView} about the internal
+ * actions and events
+ */
+ public interface Listener {
+ /** Called when the task view task is first created. */
+ void onTaskCreated();
+ /** Called when expanded view needs to un-bubble the given conversation */
+ void onUnBubbleConversation(String bubbleKey);
+ /** Called when expanded view task view back button pressed */
+ void onBackPressed();
+ }
private static final String TAG = BubbleBarExpandedView.class.getSimpleName();
private static final int INVALID_TASK_ID = -1;
@@ -57,7 +68,7 @@
private BubbleTaskViewHelper mBubbleTaskViewHelper;
private BubbleBarMenuViewController mMenuViewController;
private @Nullable Supplier<Rect> mLayerBoundsSupplier;
- private @Nullable Consumer<String> mUnBubbleConversationCallback;
+ private @Nullable Listener mListener;
private BubbleBarHandleView mHandleView = new BubbleBarHandleView(getContext());
private @Nullable TaskView mTaskView;
@@ -145,15 +156,13 @@
mMenuViewController.setListener(new BubbleBarMenuViewController.Listener() {
@Override
public void onMenuVisibilityChanged(boolean visible) {
- if (mTaskView == null || mLayerBoundsSupplier == null) return;
- // Updates the obscured touchable region for the task surface.
- mTaskView.setObscuredTouchRect(visible ? mLayerBoundsSupplier.get() : null);
+ setObscured(visible);
}
@Override
public void onUnBubbleConversation(Bubble bubble) {
- if (mUnBubbleConversationCallback != null) {
- mUnBubbleConversationCallback.accept(bubble.getKey());
+ if (mListener != null) {
+ mListener.onUnBubbleConversation(bubble.getKey());
}
}
@@ -231,6 +240,9 @@
public void onTaskCreated() {
setContentVisibility(true);
updateHandleColor(false /* animated */);
+ if (mListener != null) {
+ mListener.onTaskCreated();
+ }
}
@Override
@@ -240,7 +252,8 @@
@Override
public void onBackPressed() {
- mController.collapseStack();
+ if (mListener == null) return;
+ mListener.onBackPressed();
}
/** Cleans up task view, should be called when the bubble is no longer active. */
@@ -254,6 +267,18 @@
mMenuViewController.hideMenu(false /* animated */);
}
+ /**
+ * Hides the current modal menu view or collapses the bubble stack.
+ * Called from {@link BubbleBarLayerView}
+ */
+ public void hideMenuOrCollapse() {
+ if (mMenuViewController.isMenuVisible()) {
+ mMenuViewController.hideMenu(/* animated = */ true);
+ } else {
+ mController.collapseStack();
+ }
+ }
+
/** Updates the bubble shown in the expanded view. */
public void update(Bubble bubble) {
mBubbleTaskViewHelper.update(bubble);
@@ -270,10 +295,16 @@
mLayerBoundsSupplier = supplier;
}
- /** Sets the function to call to un-bubble the given conversation. */
- public void setUnBubbleConversationCallback(
- @Nullable Consumer<String> unBubbleConversationCallback) {
- mUnBubbleConversationCallback = unBubbleConversationCallback;
+ /** Sets expanded view listener */
+ void setListener(@Nullable Listener listener) {
+ mListener = listener;
+ }
+
+ /** Sets whether the view is obscured by some modal view */
+ void setObscured(boolean obscured) {
+ if (mTaskView == null || mLayerBoundsSupplier == null) return;
+ // Updates the obscured touchable region for the task surface.
+ mTaskView.setObscuredTouchRect(obscured ? mLayerBoundsSupplier.get() : null);
}
/**
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java
index bc04bfc..8f11253 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarLayerView.java
@@ -52,6 +52,7 @@
private final BubbleController mBubbleController;
private final BubblePositioner mPositioner;
private final BubbleBarAnimationHelper mAnimationHelper;
+ private final BubbleEducationViewController mEducationViewController;
private final View mScrimView;
@Nullable
@@ -80,6 +81,10 @@
mAnimationHelper = new BubbleBarAnimationHelper(context,
this, mPositioner);
+ mEducationViewController = new BubbleEducationViewController(context, (boolean visible) -> {
+ if (mExpandedView == null) return;
+ mExpandedView.setObscured(visible);
+ });
mScrimView = new View(getContext());
mScrimView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
@@ -90,9 +95,7 @@
mScrimView.setBackgroundDrawable(new ColorDrawable(
getResources().getColor(android.R.color.system_neutral1_1000)));
- setOnClickListener(view -> {
- mBubbleController.collapseStack();
- });
+ setOnClickListener(view -> hideMenuOrCollapse());
}
@Override
@@ -108,6 +111,7 @@
getViewTreeObserver().removeOnComputeInternalInsetsListener(this);
if (mExpandedView != null) {
+ mEducationViewController.hideManageEducation(/* animated = */ false);
removeView(mExpandedView);
mExpandedView = null;
}
@@ -162,14 +166,27 @@
final int width = mPositioner.getExpandedViewWidthForBubbleBar(isOverflowExpanded);
final int height = mPositioner.getExpandedViewHeightForBubbleBar(isOverflowExpanded);
mExpandedView.setVisibility(GONE);
- mExpandedView.setUnBubbleConversationCallback(mUnBubbleConversationCallback);
+ mExpandedView.setY(mPositioner.getExpandedViewBottomForBubbleBar() - height);
mExpandedView.setLayerBoundsSupplier(() -> new Rect(0, 0, getWidth(), getHeight()));
- mExpandedView.setUnBubbleConversationCallback(bubbleKey -> {
- if (mUnBubbleConversationCallback != null) {
- mUnBubbleConversationCallback.accept(bubbleKey);
+ mExpandedView.setListener(new BubbleBarExpandedView.Listener() {
+ @Override
+ public void onTaskCreated() {
+ mEducationViewController.maybeShowManageEducation(b, mExpandedView);
+ }
+
+ @Override
+ public void onUnBubbleConversation(String bubbleKey) {
+ if (mUnBubbleConversationCallback != null) {
+ mUnBubbleConversationCallback.accept(bubbleKey);
+ }
+ }
+
+ @Override
+ public void onBackPressed() {
+ hideMenuOrCollapse();
}
});
- mExpandedView.setY(mPositioner.getExpandedViewBottomForBubbleBar() - height);
+
addView(mExpandedView, new FrameLayout.LayoutParams(width, height));
}
@@ -193,6 +210,7 @@
public void collapse() {
mIsExpanded = false;
final BubbleBarExpandedView viewToRemove = mExpandedView;
+ mEducationViewController.hideManageEducation(/* animated = */ true);
mAnimationHelper.animateCollapse(() -> removeView(viewToRemove));
mBubbleController.getSysuiProxy().onStackExpandChanged(false);
mExpandedView = null;
@@ -206,6 +224,17 @@
mUnBubbleConversationCallback = unBubbleConversationCallback;
}
+ /** Hides the current modal education/menu view, expanded view or collapses the bubble stack */
+ private void hideMenuOrCollapse() {
+ if (mEducationViewController.isManageEducationVisible()) {
+ mEducationViewController.hideManageEducation(/* animated = */ true);
+ } else if (isExpanded() && mExpandedView != null) {
+ mExpandedView.hideMenuOrCollapse();
+ } else {
+ mBubbleController.collapseStack();
+ }
+ }
+
/** Updates the expanded view size and position. */
private void updateExpandedView() {
if (mExpandedView == null) return;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarMenuViewController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarMenuViewController.java
index 8be140c..81e7582 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarMenuViewController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarMenuViewController.java
@@ -56,6 +56,11 @@
SpringForce.STIFFNESS_MEDIUM, SpringForce.DAMPING_RATIO_LOW_BOUNCY);
}
+ /** Tells if the menu is visible or being animated */
+ boolean isMenuVisible() {
+ return mMenuView != null && mMenuView.getVisibility() == View.VISIBLE;
+ }
+
/** Sets menu actions listener */
void setListener(@Nullable Listener listener) {
mListener = listener;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleEducationViewController.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleEducationViewController.kt
new file mode 100644
index 0000000..7b39c6f
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleEducationViewController.kt
@@ -0,0 +1,148 @@
+/*
+ * 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.wm.shell.bubbles.bar
+
+import android.content.Context
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.core.view.doOnLayout
+import androidx.dynamicanimation.animation.DynamicAnimation
+import androidx.dynamicanimation.animation.SpringForce
+import com.android.wm.shell.R
+import com.android.wm.shell.animation.PhysicsAnimator
+import com.android.wm.shell.bubbles.BubbleEducationController
+import com.android.wm.shell.bubbles.BubbleViewProvider
+import com.android.wm.shell.bubbles.setup
+import com.android.wm.shell.common.bubbles.BubblePopupView
+
+/** Manages bubble education presentation and animation */
+class BubbleEducationViewController(private val context: Context, private val listener: Listener) {
+ interface Listener {
+ fun onManageEducationVisibilityChanged(isVisible: Boolean)
+ }
+
+ private var rootView: ViewGroup? = null
+ private var educationView: BubblePopupView? = null
+ private var animator: PhysicsAnimator<BubblePopupView>? = null
+
+ private val springConfig by lazy {
+ PhysicsAnimator.SpringConfig(
+ SpringForce.STIFFNESS_MEDIUM,
+ SpringForce.DAMPING_RATIO_LOW_BOUNCY
+ )
+ }
+
+ private val controller by lazy { BubbleEducationController(context) }
+
+ /** Whether the education view is visible or being animated */
+ val isManageEducationVisible: Boolean
+ get() = educationView != null && rootView != null
+
+ /**
+ * Show manage bubble education if hasn't been shown before
+ *
+ * @param bubble the bubble used for the manage education check
+ * @param root the view to show manage education in
+ */
+ fun maybeShowManageEducation(bubble: BubbleViewProvider, root: ViewGroup) {
+ if (!controller.shouldShowManageEducation(bubble)) return
+ showManageEducation(root)
+ }
+
+ /**
+ * Hide the manage education view if visible
+ *
+ * @param animated whether should hide with animation
+ */
+ fun hideManageEducation(animated: Boolean) {
+ rootView?.let {
+ fun cleanUp() {
+ it.removeView(educationView)
+ rootView = null
+ listener.onManageEducationVisibilityChanged(isVisible = false)
+ }
+
+ if (animated) {
+ animateTransition(show = false, ::cleanUp)
+ } else {
+ cleanUp()
+ }
+ }
+ }
+
+ /**
+ * Show manage education with animation
+ *
+ * @param root the view to show manage education in
+ */
+ private fun showManageEducation(root: ViewGroup) {
+ hideManageEducation(animated = false)
+ if (educationView == null) {
+ val eduView = createEducationView(root)
+ educationView = eduView
+ animator = createAnimation(eduView)
+ }
+ root.addView(educationView)
+ rootView = root
+ animateTransition(show = true) {
+ controller.hasSeenManageEducation = true
+ listener.onManageEducationVisibilityChanged(isVisible = true)
+ }
+ }
+
+ /**
+ * Animate show/hide transition for the education view
+ *
+ * @param show whether to show or hide the view
+ * @param endActions a closure to be called when the animation completes
+ */
+ private fun animateTransition(show: Boolean, endActions: () -> Unit) {
+ animator?.let { animator ->
+ animator
+ .spring(DynamicAnimation.ALPHA, if (show) 1f else 0f)
+ .spring(DynamicAnimation.SCALE_X, if (show) 1f else EDU_SCALE_HIDDEN)
+ .spring(DynamicAnimation.SCALE_Y, if (show) 1f else EDU_SCALE_HIDDEN)
+ .withEndActions(endActions)
+ .start()
+ } ?: endActions()
+ }
+
+ private fun createEducationView(root: ViewGroup): BubblePopupView {
+ val view =
+ LayoutInflater.from(context).inflate(R.layout.bubble_bar_manage_education, root, false)
+ as BubblePopupView
+
+ return view.apply {
+ setup()
+ alpha = 0f
+ pivotY = 0f
+ scaleX = EDU_SCALE_HIDDEN
+ scaleY = EDU_SCALE_HIDDEN
+ doOnLayout { it.pivotX = it.width / 2f }
+ setOnClickListener { hideManageEducation(animated = true) }
+ }
+ }
+
+ private fun createAnimation(view: BubblePopupView): PhysicsAnimator<BubblePopupView> {
+ val animator = PhysicsAnimator.getInstance(view)
+ animator.setDefaultSpringConfig(springConfig)
+ return animator
+ }
+
+ companion object {
+ private const val EDU_SCALE_HIDDEN = 0.5f
+ }
+}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/bubbles/BubblePopupDrawable.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/common/bubbles/BubblePopupDrawable.kt
new file mode 100644
index 0000000..8b5283d
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/bubbles/BubblePopupDrawable.kt
@@ -0,0 +1,232 @@
+/*
+ * 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.wm.shell.common.bubbles
+
+import android.annotation.ColorInt
+import android.graphics.Canvas
+import android.graphics.ColorFilter
+import android.graphics.Matrix
+import android.graphics.Outline
+import android.graphics.Paint
+import android.graphics.Path
+import android.graphics.Rect
+import android.graphics.RectF
+import android.graphics.drawable.Drawable
+import kotlin.math.atan
+import kotlin.math.cos
+import kotlin.math.sin
+import kotlin.properties.Delegates
+
+/** A drawable for the [BubblePopupView] that draws a popup background with a directional arrow */
+class BubblePopupDrawable(private val config: Config) : Drawable() {
+ /** The direction of the arrow in the popup drawable */
+ enum class ArrowDirection {
+ UP,
+ DOWN
+ }
+
+ /** The arrow position on the side of the popup bubble */
+ sealed class ArrowPosition {
+ object Start : ArrowPosition()
+ object Center : ArrowPosition()
+ object End : ArrowPosition()
+ class Custom(val value: Float) : ArrowPosition()
+ }
+
+ /** The configuration for drawable features */
+ data class Config(
+ @ColorInt val color: Int,
+ val cornerRadius: Float,
+ val contentPadding: Int,
+ val arrowWidth: Float,
+ val arrowHeight: Float,
+ val arrowRadius: Float
+ )
+
+ /**
+ * The direction of the arrow in the popup drawable. It affects the content padding and requires
+ * it to be updated in the view.
+ */
+ var arrowDirection: ArrowDirection by
+ Delegates.observable(ArrowDirection.UP) { _, _, _ -> requestPathUpdate() }
+
+ /**
+ * Arrow position along the X axis and its direction. The position is adjusted to the content
+ * corner radius when applied so it doesn't go into rounded corner area
+ */
+ var arrowPosition: ArrowPosition by
+ Delegates.observable(ArrowPosition.Center) { _, _, _ -> requestPathUpdate() }
+
+ private val path = Path()
+ private val paint = Paint()
+ private var shouldUpdatePath = true
+
+ init {
+ paint.color = config.color
+ paint.style = Paint.Style.FILL
+ paint.isAntiAlias = true
+ }
+
+ override fun draw(canvas: Canvas) {
+ updatePathIfNeeded()
+ canvas.drawPath(path, paint)
+ }
+
+ override fun onBoundsChange(bounds: Rect?) {
+ requestPathUpdate()
+ }
+
+ /** Should be applied to the view padding if arrow direction changes */
+ override fun getPadding(padding: Rect): Boolean {
+ padding.set(
+ config.contentPadding,
+ config.contentPadding,
+ config.contentPadding,
+ config.contentPadding
+ )
+ when (arrowDirection) {
+ ArrowDirection.UP -> padding.top += config.arrowHeight.toInt()
+ ArrowDirection.DOWN -> padding.bottom += config.arrowHeight.toInt()
+ }
+ return true
+ }
+
+ override fun getOutline(outline: Outline) {
+ updatePathIfNeeded()
+ outline.setPath(path)
+ }
+
+ override fun getOpacity(): Int {
+ return paint.alpha
+ }
+
+ override fun setAlpha(alpha: Int) {
+ paint.alpha = alpha
+ }
+
+ override fun setColorFilter(colorFilter: ColorFilter?) {
+ paint.colorFilter = colorFilter
+ }
+
+ /** Schedules path update for the next redraw */
+ private fun requestPathUpdate() {
+ shouldUpdatePath = true
+ }
+
+ /** Updates the path if required, when bounds or arrow direction/position changes */
+ private fun updatePathIfNeeded() {
+ if (shouldUpdatePath) {
+ updatePath()
+ shouldUpdatePath = false
+ }
+ }
+
+ /** Updates the path value using the current bounds, config, arrow direction and position */
+ private fun updatePath() {
+ if (bounds.isEmpty) return
+ // Reset the path state
+ path.reset()
+ // The content rect where the filled rounded rect will be drawn
+ val contentRect = RectF(bounds)
+ when (arrowDirection) {
+ ArrowDirection.UP -> {
+ // Add rounded arrow pointing up to the path
+ addRoundedArrowPositioned(path, arrowPosition)
+ // Inset content rect by the arrow size from the top
+ contentRect.top += config.arrowHeight
+ }
+ ArrowDirection.DOWN -> {
+ val matrix = Matrix()
+ // Flip the path with the matrix to draw arrow pointing down
+ matrix.setScale(1f, -1f, bounds.width() / 2f, bounds.height() / 2f)
+ path.transform(matrix)
+ // Add rounded arrow with the flipped matrix applied, will point down
+ addRoundedArrowPositioned(path, arrowPosition)
+ // Restore the path matrix to the original state with inverted matrix
+ matrix.invert(matrix)
+ path.transform(matrix)
+ // Inset content rect by the arrow size from the bottom
+ contentRect.bottom -= config.arrowHeight
+ }
+ }
+ // Add the content area rounded rect
+ path.addRoundRect(contentRect, config.cornerRadius, config.cornerRadius, Path.Direction.CW)
+ }
+
+ /** Add a rounded arrow pointing up in the horizontal position on the canvas */
+ private fun addRoundedArrowPositioned(path: Path, position: ArrowPosition) {
+ val matrix = Matrix()
+ var translationX = positionValue(position) - config.arrowWidth / 2
+ // Offset to position between rounded corners of the content view
+ translationX = translationX.coerceIn(config.cornerRadius,
+ bounds.width() - config.cornerRadius - config.arrowWidth)
+ // Translate to add the arrow in the center horizontally
+ matrix.setTranslate(-translationX, 0f)
+ path.transform(matrix)
+ // Add rounded arrow
+ addRoundedArrow(path)
+ // Restore the path matrix to the original state with inverted matrix
+ matrix.invert(matrix)
+ path.transform(matrix)
+ }
+
+ /** Adds a rounded arrow pointing up to the path, can be flipped if needed */
+ private fun addRoundedArrow(path: Path) {
+ // Theta is half of the angle inside the triangle tip
+ val thetaTan = config.arrowWidth / (config.arrowHeight * 2f)
+ val theta = atan(thetaTan)
+ val thetaDeg = Math.toDegrees(theta.toDouble()).toFloat()
+ // The center Y value of the circle for the triangle tip
+ val tipCircleCenterY = config.arrowRadius / sin(theta)
+ // The length from triangle tip to intersection point with the circle
+ val tipIntersectionSideLength = config.arrowRadius / thetaTan
+ // The offset from the top to the point of intersection
+ val intersectionTopOffset = tipIntersectionSideLength * cos(theta)
+ // The offset from the center to the point of intersection
+ val intersectionCenterOffset = tipIntersectionSideLength * sin(theta)
+ // The center X of the triangle
+ val arrowCenterX = config.arrowWidth / 2f
+
+ // Set initial position in bottom left of the arrow
+ path.moveTo(0f, config.arrowHeight)
+ // Add the left side of the triangle
+ path.lineTo(arrowCenterX - intersectionCenterOffset, intersectionTopOffset)
+ // Add the arc from the left to the right side of the triangle
+ path.arcTo(
+ /* left = */ arrowCenterX - config.arrowRadius,
+ /* top = */ tipCircleCenterY - config.arrowRadius,
+ /* right = */ arrowCenterX + config.arrowRadius,
+ /* bottom = */ tipCircleCenterY + config.arrowRadius,
+ /* startAngle = */ 180 + thetaDeg,
+ /* sweepAngle = */ 180 - (2 * thetaDeg),
+ /* forceMoveTo = */ false
+ )
+ // Add the right side of the triangle
+ path.lineTo(config.arrowWidth, config.arrowHeight)
+ // Close the path
+ path.close()
+ }
+
+ /** The value of the arrow position provided the position and current bounds */
+ private fun positionValue(position: ArrowPosition): Float {
+ return when (position) {
+ is ArrowPosition.Start -> 0f
+ is ArrowPosition.Center -> bounds.width().toFloat() / 2f
+ is ArrowPosition.End -> bounds.width().toFloat()
+ is ArrowPosition.Custom -> position.value
+ }
+ }
+}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/bubbles/BubblePopupView.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/common/bubbles/BubblePopupView.kt
new file mode 100644
index 0000000..f8a4946
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/bubbles/BubblePopupView.kt
@@ -0,0 +1,65 @@
+/*
+ * 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.wm.shell.common.bubbles
+
+import android.content.Context
+import android.graphics.Rect
+import android.util.AttributeSet
+import android.widget.LinearLayout
+
+/** A popup container view that uses [BubblePopupDrawable] as a background */
+open class BubblePopupView
+@JvmOverloads
+constructor(
+ context: Context,
+ attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0,
+ defStyleRes: Int = 0
+) : LinearLayout(context, attrs, defStyleAttr, defStyleRes) {
+ private var popupDrawable: BubblePopupDrawable? = null
+
+ /**
+ * Sets up the popup drawable with the config provided. Required to remove dependency on local
+ * resources
+ */
+ fun setupBackground(config: BubblePopupDrawable.Config) {
+ popupDrawable = BubblePopupDrawable(config)
+ background = popupDrawable
+ forceLayout()
+ }
+
+ /**
+ * Sets the arrow direction for the background drawable and updates the padding to fit the
+ * content inside of the popup drawable
+ */
+ fun setArrowDirection(direction: BubblePopupDrawable.ArrowDirection) {
+ popupDrawable?.let {
+ it.arrowDirection = direction
+ val padding = Rect()
+ if (it.getPadding(padding)) {
+ setPadding(padding.left, padding.top, padding.right, padding.bottom)
+ }
+ }
+ }
+
+ /** Sets the arrow position for the background drawable and triggers redraw */
+ fun setArrowPosition(position: BubblePopupDrawable.ArrowPosition) {
+ popupDrawable?.let {
+ it.arrowPosition = position
+ invalidate()
+ }
+ }
+}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipMediaController.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipMediaController.kt
new file mode 100644
index 0000000..2719cd2
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipMediaController.kt
@@ -0,0 +1,365 @@
+/*
+ * 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.wm.shell.common.pip
+
+import android.annotation.DrawableRes
+import android.annotation.StringRes
+import android.app.PendingIntent
+import android.app.RemoteAction
+import android.content.BroadcastReceiver
+import android.content.Context
+import android.content.Intent
+import android.content.IntentFilter
+import android.graphics.drawable.Icon
+import android.media.MediaMetadata
+import android.media.session.MediaController
+import android.media.session.MediaSession
+import android.media.session.MediaSessionManager
+import android.media.session.PlaybackState
+import android.os.Handler
+import android.os.HandlerExecutor
+import android.os.UserHandle
+import com.android.wm.shell.R
+import com.android.wm.shell.pip.PipUtils
+import java.util.function.Consumer
+
+/**
+ * Interfaces with the [MediaSessionManager] to compose the right set of actions to show (only
+ * if there are no actions from the PiP activity itself). The active media controller is only set
+ * when there is a media session from the top PiP activity.
+ */
+class PipMediaController(private val mContext: Context, private val mMainHandler: Handler) {
+ /**
+ * A listener interface to receive notification on changes to the media actions.
+ */
+ interface ActionListener {
+ /**
+ * Called when the media actions changed.
+ */
+ fun onMediaActionsChanged(actions: List<RemoteAction?>?)
+ }
+
+ /**
+ * A listener interface to receive notification on changes to the media metadata.
+ */
+ interface MetadataListener {
+ /**
+ * Called when the media metadata changed.
+ */
+ fun onMediaMetadataChanged(metadata: MediaMetadata?)
+ }
+
+ /**
+ * A listener interface to receive notification on changes to the media session token.
+ */
+ interface TokenListener {
+ /**
+ * Called when the media session token changed.
+ */
+ fun onMediaSessionTokenChanged(token: MediaSession.Token?)
+ }
+
+ private val mHandlerExecutor: HandlerExecutor = HandlerExecutor(mMainHandler)
+ private val mMediaSessionManager: MediaSessionManager?
+ private var mMediaController: MediaController? = null
+ private val mPauseAction: RemoteAction
+ private val mPlayAction: RemoteAction
+ private val mNextAction: RemoteAction
+ private val mPrevAction: RemoteAction
+ private val mMediaActionReceiver: BroadcastReceiver = object : BroadcastReceiver() {
+ override fun onReceive(context: Context, intent: Intent) {
+ if (mMediaController == null) {
+ // no active media session, bail early.
+ return
+ }
+ when (intent.action) {
+ ACTION_PLAY -> mMediaController!!.transportControls.play()
+ ACTION_PAUSE -> mMediaController!!.transportControls.pause()
+ ACTION_NEXT -> mMediaController!!.transportControls.skipToNext()
+ ACTION_PREV -> mMediaController!!.transportControls.skipToPrevious()
+ }
+ }
+ }
+ private val mPlaybackChangedListener: MediaController.Callback =
+ object : MediaController.Callback() {
+ override fun onPlaybackStateChanged(state: PlaybackState?) {
+ notifyActionsChanged()
+ }
+
+ override fun onMetadataChanged(metadata: MediaMetadata?) {
+ notifyMetadataChanged(metadata)
+ }
+ }
+ private val mSessionsChangedListener =
+ MediaSessionManager.OnActiveSessionsChangedListener { controllers: List<MediaController>? ->
+ resolveActiveMediaController(controllers)
+ }
+ private val mActionListeners = ArrayList<ActionListener>()
+ private val mMetadataListeners = ArrayList<MetadataListener>()
+ private val mTokenListeners = ArrayList<TokenListener>()
+
+ init {
+ val mediaControlFilter = IntentFilter()
+ mediaControlFilter.addAction(ACTION_PLAY)
+ mediaControlFilter.addAction(ACTION_PAUSE)
+ mediaControlFilter.addAction(ACTION_NEXT)
+ mediaControlFilter.addAction(ACTION_PREV)
+ mContext.registerReceiverForAllUsers(
+ mMediaActionReceiver, mediaControlFilter,
+ SYSTEMUI_PERMISSION, mMainHandler, Context.RECEIVER_EXPORTED
+ )
+
+ // Creates the standard media buttons that we may show.
+ mPauseAction = getDefaultRemoteAction(
+ R.string.pip_pause,
+ R.drawable.pip_ic_pause_white, ACTION_PAUSE
+ )
+ mPlayAction = getDefaultRemoteAction(
+ R.string.pip_play,
+ R.drawable.pip_ic_play_arrow_white, ACTION_PLAY
+ )
+ mNextAction = getDefaultRemoteAction(
+ R.string.pip_skip_to_next,
+ R.drawable.pip_ic_skip_next_white, ACTION_NEXT
+ )
+ mPrevAction = getDefaultRemoteAction(
+ R.string.pip_skip_to_prev,
+ R.drawable.pip_ic_skip_previous_white, ACTION_PREV
+ )
+ mMediaSessionManager = mContext.getSystemService(
+ MediaSessionManager::class.java
+ )
+ }
+
+ /**
+ * Handles when an activity is pinned.
+ */
+ fun onActivityPinned() {
+ // Once we enter PiP, try to find the active media controller for the top most activity
+ resolveActiveMediaController(
+ mMediaSessionManager!!.getActiveSessionsForUser(
+ null,
+ UserHandle.CURRENT
+ )
+ )
+ }
+
+ /**
+ * Adds a new media action listener.
+ */
+ fun addActionListener(listener: ActionListener) {
+ if (!mActionListeners.contains(listener)) {
+ mActionListeners.add(listener)
+ listener.onMediaActionsChanged(mediaActions)
+ }
+ }
+
+ /**
+ * Removes a media action listener.
+ */
+ fun removeActionListener(listener: ActionListener) {
+ listener.onMediaActionsChanged(emptyList<RemoteAction>())
+ mActionListeners.remove(listener)
+ }
+
+ /**
+ * Adds a new media metadata listener.
+ */
+ fun addMetadataListener(listener: MetadataListener) {
+ if (!mMetadataListeners.contains(listener)) {
+ mMetadataListeners.add(listener)
+ listener.onMediaMetadataChanged(mediaMetadata)
+ }
+ }
+
+ /**
+ * Removes a media metadata listener.
+ */
+ fun removeMetadataListener(listener: MetadataListener) {
+ listener.onMediaMetadataChanged(null)
+ mMetadataListeners.remove(listener)
+ }
+
+ /**
+ * Adds a new token listener.
+ */
+ fun addTokenListener(listener: TokenListener) {
+ if (!mTokenListeners.contains(listener)) {
+ mTokenListeners.add(listener)
+ listener.onMediaSessionTokenChanged(token)
+ }
+ }
+
+ /**
+ * Removes a token listener.
+ */
+ fun removeTokenListener(listener: TokenListener) {
+ listener.onMediaSessionTokenChanged(null)
+ mTokenListeners.remove(listener)
+ }
+
+ private val token: MediaSession.Token?
+ get() = if (mMediaController == null) {
+ null
+ } else mMediaController!!.sessionToken
+ private val mediaMetadata: MediaMetadata?
+ get() = if (mMediaController != null) mMediaController!!.metadata else null
+
+ private val mediaActions: List<RemoteAction?>
+ /**
+ * Gets the set of media actions currently available.
+ */
+ get() {
+ if (mMediaController == null) {
+ return emptyList<RemoteAction>()
+ }
+ // Cache the PlaybackState since it's a Binder call.
+ // Safe because mMediaController is guaranteed non-null here.
+ val playbackState: PlaybackState = mMediaController!!.playbackState
+ ?: return emptyList<RemoteAction>()
+ val mediaActions = ArrayList<RemoteAction?>()
+ val isPlaying = playbackState.isActive
+ val actions = playbackState.actions
+
+ // Prev action
+ mPrevAction.isEnabled =
+ actions and PlaybackState.ACTION_SKIP_TO_PREVIOUS != 0L
+ mediaActions.add(mPrevAction)
+
+ // Play/pause action
+ if (!isPlaying && actions and PlaybackState.ACTION_PLAY != 0L) {
+ mediaActions.add(mPlayAction)
+ } else if (isPlaying && actions and PlaybackState.ACTION_PAUSE != 0L) {
+ mediaActions.add(mPauseAction)
+ }
+
+ // Next action
+ mNextAction.isEnabled =
+ actions and PlaybackState.ACTION_SKIP_TO_NEXT != 0L
+ mediaActions.add(mNextAction)
+ return mediaActions
+ }
+
+ /** @return Default [RemoteAction] sends broadcast back to SysUI.
+ */
+ private fun getDefaultRemoteAction(
+ @StringRes titleAndDescription: Int,
+ @DrawableRes icon: Int,
+ action: String
+ ): RemoteAction {
+ val titleAndDescriptionStr = mContext.getString(titleAndDescription)
+ val intent = Intent(action)
+ intent.setPackage(mContext.packageName)
+ return RemoteAction(
+ Icon.createWithResource(mContext, icon),
+ titleAndDescriptionStr, titleAndDescriptionStr,
+ PendingIntent.getBroadcast(
+ mContext, 0 /* requestCode */, intent,
+ PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
+ )
+ )
+ }
+
+ /**
+ * Re-registers the session listener for the current user.
+ */
+ fun registerSessionListenerForCurrentUser() {
+ mMediaSessionManager!!.removeOnActiveSessionsChangedListener(mSessionsChangedListener)
+ mMediaSessionManager.addOnActiveSessionsChangedListener(
+ null, UserHandle.CURRENT,
+ mHandlerExecutor, mSessionsChangedListener
+ )
+ }
+
+ /**
+ * Tries to find and set the active media controller for the top PiP activity.
+ */
+ private fun resolveActiveMediaController(controllers: List<MediaController>?) {
+ if (controllers != null) {
+ val topActivity = PipUtils.getTopPipActivity(mContext).first
+ if (topActivity != null) {
+ for (i in controllers.indices) {
+ val controller = controllers[i]
+ if (controller.packageName == topActivity.packageName) {
+ setActiveMediaController(controller)
+ return
+ }
+ }
+ }
+ }
+ setActiveMediaController(null)
+ }
+
+ /**
+ * Sets the active media controller for the top PiP activity.
+ */
+ private fun setActiveMediaController(controller: MediaController?) {
+ if (controller != mMediaController) {
+ if (mMediaController != null) {
+ mMediaController!!.unregisterCallback(mPlaybackChangedListener)
+ }
+ mMediaController = controller
+ controller?.registerCallback(mPlaybackChangedListener, mMainHandler)
+ notifyActionsChanged()
+ notifyMetadataChanged(mediaMetadata)
+ notifyTokenChanged(token)
+
+ // TODO(winsonc): Consider if we want to close the PIP after a timeout (like on TV)
+ }
+ }
+
+ /**
+ * Notifies all listeners that the actions have changed.
+ */
+ private fun notifyActionsChanged() {
+ if (mActionListeners.isNotEmpty()) {
+ val actions = mediaActions
+ mActionListeners.forEach(
+ Consumer { l: ActionListener -> l.onMediaActionsChanged(actions) })
+ }
+ }
+
+ /**
+ * Notifies all listeners that the metadata have changed.
+ */
+ private fun notifyMetadataChanged(metadata: MediaMetadata?) {
+ if (mMetadataListeners.isNotEmpty()) {
+ mMetadataListeners.forEach(Consumer { l: MetadataListener ->
+ l.onMediaMetadataChanged(
+ metadata
+ )
+ })
+ }
+ }
+
+ private fun notifyTokenChanged(token: MediaSession.Token?) {
+ if (mTokenListeners.isNotEmpty()) {
+ mTokenListeners.forEach(Consumer { l: TokenListener ->
+ l.onMediaSessionTokenChanged(
+ token
+ )
+ })
+ }
+ }
+
+ companion object {
+ private const val SYSTEMUI_PERMISSION = "com.android.systemui.permission.SELF"
+ private const val ACTION_PLAY = "com.android.wm.shell.pip.PLAY"
+ private const val ACTION_PAUSE = "com.android.wm.shell.pip.PAUSE"
+ private const val ACTION_NEXT = "com.android.wm.shell.pip.NEXT"
+ private const val ACTION_PREV = "com.android.wm.shell.pip.PREV"
+ }
+}
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipUiEventLogger.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipUiEventLogger.kt
new file mode 100644
index 0000000..642dacc
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipUiEventLogger.kt
@@ -0,0 +1,125 @@
+/*
+ * 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.wm.shell.common.pip
+
+import android.app.TaskInfo
+import android.content.pm.PackageManager
+import com.android.internal.logging.UiEvent
+import com.android.internal.logging.UiEventLogger
+
+/**
+ * Helper class that ends PiP log to UiEvent, see also go/uievent
+ */
+class PipUiEventLogger(
+ private val mUiEventLogger: UiEventLogger,
+ private val mPackageManager: PackageManager
+) {
+ private var mPackageName: String? = null
+ private var mPackageUid = INVALID_PACKAGE_UID
+ fun setTaskInfo(taskInfo: TaskInfo?) {
+ if (taskInfo?.topActivity != null) {
+ // safe because topActivity is guaranteed non-null here
+ mPackageName = taskInfo.topActivity!!.packageName
+ mPackageUid = getUid(mPackageName!!, taskInfo.userId)
+ } else {
+ mPackageName = null
+ mPackageUid = INVALID_PACKAGE_UID
+ }
+ }
+
+ /**
+ * Sends log via UiEvent, reference go/uievent for how to debug locally
+ */
+ fun log(event: PipUiEventEnum?) {
+ if (mPackageName == null || mPackageUid == INVALID_PACKAGE_UID) {
+ return
+ }
+ mUiEventLogger.log(event!!, mPackageUid, mPackageName)
+ }
+
+ private fun getUid(packageName: String, userId: Int): Int {
+ var uid = INVALID_PACKAGE_UID
+ try {
+ uid = mPackageManager.getApplicationInfoAsUser(
+ packageName, 0 /* ApplicationInfoFlags */, userId
+ ).uid
+ } catch (e: PackageManager.NameNotFoundException) {
+ // do nothing.
+ }
+ return uid
+ }
+
+ /**
+ * Enums for logging the PiP events to UiEvent
+ */
+ enum class PipUiEventEnum(private val mId: Int) : UiEventLogger.UiEventEnum {
+ @UiEvent(doc = "Activity enters picture-in-picture mode")
+ PICTURE_IN_PICTURE_ENTER(603),
+
+ @UiEvent(doc = "Activity enters picture-in-picture mode with auto-enter-pip API")
+ PICTURE_IN_PICTURE_AUTO_ENTER(1313),
+
+ @UiEvent(doc = "Activity enters picture-in-picture mode from content-pip API")
+ PICTURE_IN_PICTURE_ENTER_CONTENT_PIP(1314),
+
+ @UiEvent(doc = "Expands from picture-in-picture to fullscreen")
+ PICTURE_IN_PICTURE_EXPAND_TO_FULLSCREEN(604),
+
+ @UiEvent(doc = "Removes picture-in-picture by tap close button")
+ PICTURE_IN_PICTURE_TAP_TO_REMOVE(605),
+
+ @UiEvent(doc = "Removes picture-in-picture by drag to dismiss area")
+ PICTURE_IN_PICTURE_DRAG_TO_REMOVE(606),
+
+ @UiEvent(doc = "Shows picture-in-picture menu")
+ PICTURE_IN_PICTURE_SHOW_MENU(607),
+
+ @UiEvent(doc = "Hides picture-in-picture menu")
+ PICTURE_IN_PICTURE_HIDE_MENU(608),
+
+ @UiEvent(
+ doc = "Changes the aspect ratio of picture-in-picture window. This is inherited" +
+ " from previous Tron-based logging and currently not in use."
+ )
+ PICTURE_IN_PICTURE_CHANGE_ASPECT_RATIO(609),
+
+ @UiEvent(doc = "User resize of the picture-in-picture window")
+ PICTURE_IN_PICTURE_RESIZE(610),
+
+ @UiEvent(doc = "User unstashed picture-in-picture")
+ PICTURE_IN_PICTURE_STASH_UNSTASHED(709),
+
+ @UiEvent(doc = "User stashed picture-in-picture to the left side")
+ PICTURE_IN_PICTURE_STASH_LEFT(710),
+
+ @UiEvent(doc = "User stashed picture-in-picture to the right side")
+ PICTURE_IN_PICTURE_STASH_RIGHT(711),
+
+ @UiEvent(doc = "User taps on the settings button in PiP menu")
+ PICTURE_IN_PICTURE_SHOW_SETTINGS(933),
+
+ @UiEvent(doc = "Closes PiP with app-provided close action")
+ PICTURE_IN_PICTURE_CUSTOM_CLOSE(1058);
+
+ override fun getId(): Int {
+ return mId
+ }
+ }
+
+ companion object {
+ private const val INVALID_PACKAGE_UID = -1
+ }
+}
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitScreenConstants.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitScreenConstants.java
index ef93a33..be1b9b1 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitScreenConstants.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitScreenConstants.java
@@ -16,6 +16,7 @@
package com.android.wm.shell.common.split;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
@@ -60,7 +61,8 @@
public static final int[] CONTROLLED_WINDOWING_MODES =
{WINDOWING_MODE_FULLSCREEN, WINDOWING_MODE_UNDEFINED};
public static final int[] CONTROLLED_WINDOWING_MODES_WHEN_ACTIVE =
- {WINDOWING_MODE_FULLSCREEN, WINDOWING_MODE_UNDEFINED, WINDOWING_MODE_MULTI_WINDOW};
+ {WINDOWING_MODE_FULLSCREEN, WINDOWING_MODE_UNDEFINED, WINDOWING_MODE_MULTI_WINDOW,
+ WINDOWING_MODE_FREEFORM};
/** Flag applied to a transition change to identify it as a divider bar for animation. */
public static final int FLAG_IS_DIVIDER_BAR = FLAG_FIRST_CUSTOM;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIController.java
index 0998e71..7bf0893 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIController.java
@@ -16,12 +16,17 @@
package com.android.wm.shell.compatui;
+import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
+
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.TaskInfo;
import android.app.TaskInfo.CameraCompatControlState;
import android.content.Context;
+import android.content.Intent;
import android.content.res.Configuration;
import android.hardware.display.DisplayManager;
+import android.provider.Settings;
import android.util.ArraySet;
import android.util.Log;
import android.util.Pair;
@@ -41,7 +46,6 @@
import com.android.wm.shell.common.DockStateReader;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.SyncTransactionQueue;
-import com.android.wm.shell.compatui.CompatUIWindowManager.CompatUIHintsState;
import com.android.wm.shell.sysui.KeyguardChangeListener;
import com.android.wm.shell.sysui.ShellController;
import com.android.wm.shell.sysui.ShellInit;
@@ -104,6 +108,13 @@
private Set<Integer> mSetOfTaskIdsShowingRestartDialog = new HashSet<>();
/**
+ * The active user aspect ratio settings button layout if there is one (there can be at most
+ * one active).
+ */
+ @Nullable
+ private UserAspectRatioSettingsWindowManager mUserAspectRatioSettingsLayout;
+
+ /**
* The active Letterbox Education layout if there is one (there can be at most one active).
*
* <p>An active layout is a layout that is eligible to be shown for the associated task but
@@ -121,38 +132,51 @@
/** Avoid creating display context frequently for non-default display. */
private final SparseArray<WeakReference<Context>> mDisplayContextCache = new SparseArray<>(0);
+ @NonNull
private final Context mContext;
+ @NonNull
private final ShellController mShellController;
+ @NonNull
private final DisplayController mDisplayController;
+ @NonNull
private final DisplayInsetsController mDisplayInsetsController;
+ @NonNull
private final DisplayImeController mImeController;
+ @NonNull
private final SyncTransactionQueue mSyncQueue;
+ @NonNull
private final ShellExecutor mMainExecutor;
+ @NonNull
private final Lazy<Transitions> mTransitionsLazy;
+ @NonNull
private final DockStateReader mDockStateReader;
+ @NonNull
private final CompatUIConfiguration mCompatUIConfiguration;
// Only show each hint once automatically in the process life.
+ @NonNull
private final CompatUIHintsState mCompatUIHintsState;
+ @NonNull
private final CompatUIShellCommandHandler mCompatUIShellCommandHandler;
- private CompatUICallback mCallback;
+ @Nullable
+ private CompatUICallback mCompatUICallback;
// Indicates if the keyguard is currently showing, in which case compat UIs shouldn't
// be shown.
private boolean mKeyguardShowing;
- public CompatUIController(Context context,
- ShellInit shellInit,
- ShellController shellController,
- DisplayController displayController,
- DisplayInsetsController displayInsetsController,
- DisplayImeController imeController,
- SyncTransactionQueue syncQueue,
- ShellExecutor mainExecutor,
- Lazy<Transitions> transitionsLazy,
- DockStateReader dockStateReader,
- CompatUIConfiguration compatUIConfiguration,
- CompatUIShellCommandHandler compatUIShellCommandHandler) {
+ public CompatUIController(@NonNull Context context,
+ @NonNull ShellInit shellInit,
+ @NonNull ShellController shellController,
+ @NonNull DisplayController displayController,
+ @NonNull DisplayInsetsController displayInsetsController,
+ @NonNull DisplayImeController imeController,
+ @NonNull SyncTransactionQueue syncQueue,
+ @NonNull ShellExecutor mainExecutor,
+ @NonNull Lazy<Transitions> transitionsLazy,
+ @NonNull DockStateReader dockStateReader,
+ @NonNull CompatUIConfiguration compatUIConfiguration,
+ @NonNull CompatUIShellCommandHandler compatUIShellCommandHandler) {
mContext = context;
mShellController = shellController;
mDisplayController = displayController;
@@ -175,9 +199,9 @@
mCompatUIShellCommandHandler.onInit();
}
- /** Sets the callback for UI interactions. */
- public void setCompatUICallback(CompatUICallback callback) {
- mCallback = callback;
+ /** Sets the callback for Compat UI interactions. */
+ public void setCompatUICallback(@NonNull CompatUICallback compatUiCallback) {
+ mCompatUICallback = compatUiCallback;
}
/**
@@ -187,7 +211,7 @@
* @param taskInfo {@link TaskInfo} task the activity is in.
* @param taskListener listener to handle the Task Surface placement.
*/
- public void onCompatInfoChanged(TaskInfo taskInfo,
+ public void onCompatInfoChanged(@NonNull TaskInfo taskInfo,
@Nullable ShellTaskOrganizer.TaskListener taskListener) {
if (taskInfo != null && !taskInfo.topActivityInSizeCompat) {
mSetOfTaskIdsShowingRestartDialog.remove(taskInfo.taskId);
@@ -203,6 +227,18 @@
createOrUpdateRestartDialogLayout(taskInfo, taskListener);
if (mCompatUIConfiguration.getHasSeenLetterboxEducation(taskInfo.userId)) {
createOrUpdateReachabilityEduLayout(taskInfo, taskListener);
+ // The user aspect ratio button should not be handled when a new TaskInfo is
+ // sent because of a double tap or when in multi-window mode.
+ if (taskInfo.getWindowingMode() != WINDOWING_MODE_FULLSCREEN) {
+ if (mUserAspectRatioSettingsLayout != null) {
+ mUserAspectRatioSettingsLayout.release();
+ mUserAspectRatioSettingsLayout = null;
+ }
+ return;
+ }
+ if (!taskInfo.isFromLetterboxDoubleTap) {
+ createOrUpdateUserAspectRatioSettingsLayout(taskInfo, taskListener);
+ }
}
}
@@ -280,8 +316,8 @@
return mDisplaysWithIme.contains(displayId);
}
- private void createOrUpdateCompatLayout(TaskInfo taskInfo,
- ShellTaskOrganizer.TaskListener taskListener) {
+ private void createOrUpdateCompatLayout(@NonNull TaskInfo taskInfo,
+ @Nullable ShellTaskOrganizer.TaskListener taskListener) {
CompatUIWindowManager layout = mActiveCompatLayouts.get(taskInfo.taskId);
if (layout != null) {
if (layout.needsToBeRecreated(taskInfo, taskListener)) {
@@ -314,7 +350,7 @@
CompatUIWindowManager createCompatUiWindowManager(Context context, TaskInfo taskInfo,
ShellTaskOrganizer.TaskListener taskListener) {
return new CompatUIWindowManager(context,
- taskInfo, mSyncQueue, mCallback, taskListener,
+ taskInfo, mSyncQueue, mCompatUICallback, taskListener,
mDisplayController.getDisplayLayout(taskInfo.displayId), mCompatUIHintsState,
mCompatUIConfiguration, this::onRestartButtonClicked);
}
@@ -328,12 +364,12 @@
mSetOfTaskIdsShowingRestartDialog.add(taskInfoState.first.taskId);
onCompatInfoChanged(taskInfoState.first, taskInfoState.second);
} else {
- mCallback.onSizeCompatRestartButtonClicked(taskInfoState.first.taskId);
+ mCompatUICallback.onSizeCompatRestartButtonClicked(taskInfoState.first.taskId);
}
}
- private void createOrUpdateLetterboxEduLayout(TaskInfo taskInfo,
- ShellTaskOrganizer.TaskListener taskListener) {
+ private void createOrUpdateLetterboxEduLayout(@NonNull TaskInfo taskInfo,
+ @Nullable ShellTaskOrganizer.TaskListener taskListener) {
if (mActiveLetterboxEduLayout != null) {
if (mActiveLetterboxEduLayout.needsToBeRecreated(taskInfo, taskListener)) {
mActiveLetterboxEduLayout.release();
@@ -377,8 +413,8 @@
mDockStateReader, mCompatUIConfiguration);
}
- private void createOrUpdateRestartDialogLayout(TaskInfo taskInfo,
- ShellTaskOrganizer.TaskListener taskListener) {
+ private void createOrUpdateRestartDialogLayout(@NonNull TaskInfo taskInfo,
+ @Nullable ShellTaskOrganizer.TaskListener taskListener) {
RestartDialogWindowManager layout =
mTaskIdToRestartDialogWindowManagerMap.get(taskInfo.taskId);
if (layout != null) {
@@ -423,7 +459,7 @@
private void onRestartDialogCallback(
Pair<TaskInfo, ShellTaskOrganizer.TaskListener> stateInfo) {
mTaskIdToRestartDialogWindowManagerMap.remove(stateInfo.first.taskId);
- mCallback.onSizeCompatRestartButtonClicked(stateInfo.first.taskId);
+ mCompatUICallback.onSizeCompatRestartButtonClicked(stateInfo.first.taskId);
}
private void onRestartDialogDismissCallback(
@@ -432,8 +468,8 @@
onCompatInfoChanged(stateInfo.first, stateInfo.second);
}
- private void createOrUpdateReachabilityEduLayout(TaskInfo taskInfo,
- ShellTaskOrganizer.TaskListener taskListener) {
+ private void createOrUpdateReachabilityEduLayout(@NonNull TaskInfo taskInfo,
+ @Nullable ShellTaskOrganizer.TaskListener taskListener) {
if (mActiveReachabilityEduLayout != null) {
if (mActiveReachabilityEduLayout.needsToBeRecreated(taskInfo, taskListener)) {
mActiveReachabilityEduLayout.release();
@@ -474,14 +510,67 @@
ShellTaskOrganizer.TaskListener taskListener) {
return new ReachabilityEduWindowManager(context, taskInfo, mSyncQueue,
taskListener, mDisplayController.getDisplayLayout(taskInfo.displayId),
- mCompatUIConfiguration, mMainExecutor);
+ mCompatUIConfiguration, mMainExecutor, this::onInitialReachabilityEduDismissed);
}
+ private void onInitialReachabilityEduDismissed(@NonNull TaskInfo taskInfo,
+ @NonNull ShellTaskOrganizer.TaskListener taskListener) {
+ // We need to update the UI otherwise it will not be shown until the user relaunches the app
+ createOrUpdateUserAspectRatioSettingsLayout(taskInfo, taskListener);
+ }
+
+ private void createOrUpdateUserAspectRatioSettingsLayout(@NonNull TaskInfo taskInfo,
+ @Nullable ShellTaskOrganizer.TaskListener taskListener) {
+ if (mUserAspectRatioSettingsLayout != null) {
+ if (mUserAspectRatioSettingsLayout.needsToBeRecreated(taskInfo, taskListener)) {
+ mUserAspectRatioSettingsLayout.release();
+ mUserAspectRatioSettingsLayout = null;
+ } else {
+ // UI already exists, update the UI layout.
+ if (!mUserAspectRatioSettingsLayout.updateCompatInfo(taskInfo, taskListener,
+ showOnDisplay(mUserAspectRatioSettingsLayout.getDisplayId()))) {
+ mUserAspectRatioSettingsLayout.release();
+ mUserAspectRatioSettingsLayout = null;
+ }
+ return;
+ }
+ }
+
+ // Create a new UI layout.
+ final Context context = getOrCreateDisplayContext(taskInfo.displayId);
+ if (context == null) {
+ return;
+ }
+ final UserAspectRatioSettingsWindowManager newLayout =
+ createUserAspectRatioSettingsWindowManager(context, taskInfo, taskListener);
+ if (newLayout.createLayout(showOnDisplay(taskInfo.displayId))) {
+ // The new layout is eligible to be shown, add it the active layouts.
+ mUserAspectRatioSettingsLayout = newLayout;
+ }
+ }
+
+ @VisibleForTesting
+ @NonNull
+ UserAspectRatioSettingsWindowManager createUserAspectRatioSettingsWindowManager(
+ @NonNull Context context, @NonNull TaskInfo taskInfo,
+ @Nullable ShellTaskOrganizer.TaskListener taskListener) {
+ return new UserAspectRatioSettingsWindowManager(context, taskInfo, mSyncQueue,
+ taskListener, mDisplayController.getDisplayLayout(taskInfo.displayId),
+ mCompatUIHintsState, this::launchUserAspectRatioSettings, mMainExecutor);
+ }
+
+ private void launchUserAspectRatioSettings(
+ @NonNull TaskInfo taskInfo, @NonNull ShellTaskOrganizer.TaskListener taskListener) {
+ final Intent intent = new Intent(Settings.ACTION_MANAGE_USER_ASPECT_RATIO_SETTINGS);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
+ mContext.startActivity(intent);
+ }
private void removeLayouts(int taskId) {
- final CompatUIWindowManager layout = mActiveCompatLayouts.get(taskId);
- if (layout != null) {
- layout.release();
+ final CompatUIWindowManager compatLayout = mActiveCompatLayouts.get(taskId);
+ if (compatLayout != null) {
+ compatLayout.release();
mActiveCompatLayouts.remove(taskId);
}
@@ -502,6 +591,12 @@
mActiveReachabilityEduLayout.release();
mActiveReachabilityEduLayout = null;
}
+
+ if (mUserAspectRatioSettingsLayout != null
+ && mUserAspectRatioSettingsLayout.getTaskId() == taskId) {
+ mUserAspectRatioSettingsLayout.release();
+ mUserAspectRatioSettingsLayout = null;
+ }
}
private Context getOrCreateDisplayContext(int displayId) {
@@ -557,6 +652,10 @@
if (mActiveReachabilityEduLayout != null && condition.test(mActiveReachabilityEduLayout)) {
callback.accept(mActiveReachabilityEduLayout);
}
+ if (mUserAspectRatioSettingsLayout != null && condition.test(
+ mUserAspectRatioSettingsLayout)) {
+ callback.accept(mUserAspectRatioSettingsLayout);
+ }
}
/** An implementation of {@link OnInsetsChangedListener} for a given display id. */
@@ -591,4 +690,14 @@
insetsChanged(insetsState);
}
}
+
+ /**
+ * A class holding the state of the compat UI hints, which is shared between all compat UI
+ * window managers.
+ */
+ static class CompatUIHintsState {
+ boolean mHasShownSizeCompatHint;
+ boolean mHasShownCameraCompatHint;
+ boolean mHasShownUserAspectRatioSettingsButtonHint;
+ }
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIWindowManager.java b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIWindowManager.java
index 065806d..ce3c509 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIWindowManager.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/CompatUIWindowManager.java
@@ -38,6 +38,7 @@
import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.compatui.CompatUIController.CompatUICallback;
+import com.android.wm.shell.compatui.CompatUIController.CompatUIHintsState;
import java.util.function.Consumer;
@@ -235,15 +236,4 @@
return mCameraCompatControlState != CAMERA_COMPAT_CONTROL_HIDDEN
&& mCameraCompatControlState != CAMERA_COMPAT_CONTROL_DISMISSED;
}
-
- /**
- * A class holding the state of the compat UI hints, which is shared between all compat UI
- * window managers.
- */
- static class CompatUIHintsState {
- @VisibleForTesting
- boolean mHasShownSizeCompatHint;
- @VisibleForTesting
- boolean mHasShownCameraCompatHint;
- }
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/ReachabilityEduWindowManager.java b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/ReachabilityEduWindowManager.java
index 95bb1fe..9de3f9d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/ReachabilityEduWindowManager.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/ReachabilityEduWindowManager.java
@@ -36,6 +36,8 @@
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.SyncTransactionQueue;
+import java.util.function.BiConsumer;
+
/**
* Window manager for the reachability education
*/
@@ -73,6 +75,8 @@
// we need to animate them.
private boolean mHasLetterboxSizeChanged;
+ private final BiConsumer<TaskInfo, ShellTaskOrganizer.TaskListener> mOnDismissCallback;
+
@Nullable
@VisibleForTesting
ReachabilityEduLayout mLayout;
@@ -80,7 +84,8 @@
ReachabilityEduWindowManager(Context context, TaskInfo taskInfo,
SyncTransactionQueue syncQueue,
ShellTaskOrganizer.TaskListener taskListener, DisplayLayout displayLayout,
- CompatUIConfiguration compatUIConfiguration, ShellExecutor mainExecutor) {
+ CompatUIConfiguration compatUIConfiguration, ShellExecutor mainExecutor,
+ BiConsumer<TaskInfo, ShellTaskOrganizer.TaskListener> onDismissCallback) {
super(context, taskInfo, syncQueue, taskListener, displayLayout);
mIsActivityLetterboxed = taskInfo.isLetterboxDoubleTapEnabled;
mLetterboxVerticalPosition = taskInfo.topActivityLetterboxVerticalPosition;
@@ -89,6 +94,7 @@
mTopActivityLetterboxHeight = taskInfo.topActivityLetterboxHeight;
mCompatUIConfiguration = compatUIConfiguration;
mMainExecutor = mainExecutor;
+ mOnDismissCallback = onDismissCallback;
}
@Override
@@ -217,13 +223,17 @@
return;
}
final TaskInfo lastTaskInfo = getLastTaskInfo();
+ final boolean hasSeenHorizontalReachabilityEdu =
+ mCompatUIConfiguration.hasSeenHorizontalReachabilityEducation(lastTaskInfo);
+ final boolean hasSeenVerticalReachabilityEdu =
+ mCompatUIConfiguration.hasSeenVerticalReachabilityEducation(lastTaskInfo);
final boolean eligibleForDisplayHorizontalEducation = mForceUpdate
- || !mCompatUIConfiguration.hasSeenHorizontalReachabilityEducation(lastTaskInfo)
+ || !hasSeenHorizontalReachabilityEdu
|| (mHasUserDoubleTapped
&& (mLetterboxHorizontalPosition == REACHABILITY_LEFT_OR_UP_POSITION
|| mLetterboxHorizontalPosition == REACHABILITY_RIGHT_OR_BOTTOM_POSITION));
final boolean eligibleForDisplayVerticalEducation = mForceUpdate
- || !mCompatUIConfiguration.hasSeenVerticalReachabilityEducation(lastTaskInfo)
+ || !hasSeenVerticalReachabilityEdu
|| (mHasUserDoubleTapped
&& (mLetterboxVerticalPosition == REACHABILITY_LEFT_OR_UP_POSITION
|| mLetterboxVerticalPosition == REACHABILITY_RIGHT_OR_BOTTOM_POSITION));
@@ -239,6 +249,14 @@
if (!mHasLetterboxSizeChanged) {
updateHideTime();
mMainExecutor.executeDelayed(this::hideReachability, DISAPPEAR_DELAY_MS);
+ // If reachability education has been seen for the first time, trigger callback to
+ // display aspect ratio settings button once reachability education disappears
+ if (hasShownHorizontalReachabilityEduFirstTime(hasSeenHorizontalReachabilityEdu)
+ || hasShownVerticalReachabilityEduFirstTime(
+ hasSeenVerticalReachabilityEdu)) {
+ mMainExecutor.executeDelayed(this::triggerOnDismissCallback,
+ DISAPPEAR_DELAY_MS);
+ }
}
mHasUserDoubleTapped = false;
} else {
@@ -246,6 +264,38 @@
}
}
+ /**
+ * Compares the value of
+ * {@link CompatUIConfiguration#hasSeenHorizontalReachabilityEducation} before and after the
+ * layout is shown. Horizontal reachability education is considered seen for the first time if
+ * prior to viewing the layout,
+ * {@link CompatUIConfiguration#hasSeenHorizontalReachabilityEducation} is {@code false}
+ * but becomes {@code true} once the current layout is shown.
+ */
+ private boolean hasShownHorizontalReachabilityEduFirstTime(
+ boolean previouslyShownHorizontalReachabilityEducation) {
+ return !previouslyShownHorizontalReachabilityEducation
+ && mCompatUIConfiguration.hasSeenHorizontalReachabilityEducation(getLastTaskInfo());
+ }
+
+ /**
+ * Compares the value of
+ * {@link CompatUIConfiguration#hasSeenVerticalReachabilityEducation} before and after the
+ * layout is shown. Horizontal reachability education is considered seen for the first time if
+ * prior to viewing the layout,
+ * {@link CompatUIConfiguration#hasSeenVerticalReachabilityEducation} is {@code false}
+ * but becomes {@code true} once the current layout is shown.
+ */
+ private boolean hasShownVerticalReachabilityEduFirstTime(
+ boolean previouslyShownVerticalReachabilityEducation) {
+ return !previouslyShownVerticalReachabilityEducation
+ && mCompatUIConfiguration.hasSeenVerticalReachabilityEducation(getLastTaskInfo());
+ }
+
+ private void triggerOnDismissCallback() {
+ mOnDismissCallback.accept(getLastTaskInfo(), getTaskListener());
+ }
+
private void hideReachability() {
if (mLayout == null || !shouldHideEducation()) {
return;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/UserAspectRatioSettingsLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/UserAspectRatioSettingsLayout.java
new file mode 100644
index 0000000..5eeb3b6
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/UserAspectRatioSettingsLayout.java
@@ -0,0 +1,136 @@
+/*
+ * 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.wm.shell.compatui;
+
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ObjectAnimator;
+import android.annotation.IdRes;
+import android.annotation.NonNull;
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.android.wm.shell.R;
+
+/**
+ * Layout for the user aspect ratio button which opens the app list page in settings
+ * and allows users to change apps aspect ratio.
+ */
+public class UserAspectRatioSettingsLayout extends LinearLayout {
+
+ private static final float ALPHA_FULL_TRANSPARENT = 0f;
+
+ private static final float ALPHA_FULL_OPAQUE = 1f;
+
+ private static final long VISIBILITY_ANIMATION_DURATION_MS = 50;
+
+ private static final String ALPHA_PROPERTY_NAME = "alpha";
+
+ private UserAspectRatioSettingsWindowManager mWindowManager;
+
+ public UserAspectRatioSettingsLayout(Context context) {
+ this(context, null);
+ }
+
+ public UserAspectRatioSettingsLayout(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public UserAspectRatioSettingsLayout(Context context, AttributeSet attrs, int defStyleAttr) {
+ this(context, attrs, defStyleAttr, 0);
+ }
+
+ public UserAspectRatioSettingsLayout(Context context, AttributeSet attrs, int defStyleAttr,
+ int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+ }
+
+ void inject(@NonNull UserAspectRatioSettingsWindowManager windowManager) {
+ mWindowManager = windowManager;
+ }
+
+ void setUserAspectRatioSettingsHintVisibility(boolean show) {
+ setViewVisibility(R.id.user_aspect_ratio_settings_hint, show);
+ }
+
+ void setUserAspectRatioButtonVisibility(boolean show) {
+ setViewVisibility(R.id.user_aspect_ratio_settings_button, show);
+ // Hint should never be visible without button.
+ if (!show) {
+ setUserAspectRatioSettingsHintVisibility(/* show= */ false);
+ }
+ }
+
+ private void setViewVisibility(@IdRes int resId, boolean show) {
+ final View view = findViewById(resId);
+ int visibility = show ? View.VISIBLE : View.GONE;
+ if (view.getVisibility() == visibility) {
+ return;
+ }
+ if (show) {
+ showItem(view);
+ } else {
+ view.setVisibility(visibility);
+ }
+ }
+
+ @Override
+ protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ super.onLayout(changed, left, top, right, bottom);
+ // Need to relayout after changes like hiding / showing a hint since they affect size.
+ // Doing this directly in setUserAspectRatioButtonVisibility can result in flaky animation.
+ mWindowManager.relayout();
+ }
+
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+
+ final ImageButton userAspectRatioButton =
+ findViewById(R.id.user_aspect_ratio_settings_button);
+ userAspectRatioButton.setOnClickListener(
+ view -> mWindowManager.onUserAspectRatioSettingsButtonClicked());
+ userAspectRatioButton.setOnLongClickListener(view -> {
+ mWindowManager.onUserAspectRatioSettingsButtonLongClicked();
+ return true;
+ });
+
+ final LinearLayout sizeCompatHint = findViewById(R.id.user_aspect_ratio_settings_hint);
+ ((TextView) sizeCompatHint.findViewById(R.id.compat_mode_hint_text))
+ .setText(R.string.user_aspect_ratio_settings_button_hint);
+ sizeCompatHint.setOnClickListener(
+ view -> setUserAspectRatioSettingsHintVisibility(/* show= */ false));
+ }
+
+ private void showItem(@NonNull View view) {
+ view.setVisibility(View.VISIBLE);
+ final ObjectAnimator fadeIn = ObjectAnimator.ofFloat(view, ALPHA_PROPERTY_NAME,
+ ALPHA_FULL_TRANSPARENT, ALPHA_FULL_OPAQUE);
+ fadeIn.setDuration(VISIBILITY_ANIMATION_DURATION_MS);
+ fadeIn.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ view.setVisibility(View.VISIBLE);
+ }
+ });
+ fadeIn.start();
+ }
+}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/UserAspectRatioSettingsWindowManager.java b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/UserAspectRatioSettingsWindowManager.java
new file mode 100644
index 0000000..bd53dc7
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/compatui/UserAspectRatioSettingsWindowManager.java
@@ -0,0 +1,211 @@
+/*
+ * 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.wm.shell.compatui;
+
+import static android.window.TaskConstants.TASK_CHILD_LAYER_COMPAT_UI;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.app.TaskInfo;
+import android.content.Context;
+import android.graphics.Rect;
+import android.os.SystemClock;
+import android.view.LayoutInflater;
+import android.view.View;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.wm.shell.R;
+import com.android.wm.shell.ShellTaskOrganizer;
+import com.android.wm.shell.common.DisplayLayout;
+import com.android.wm.shell.common.ShellExecutor;
+import com.android.wm.shell.common.SyncTransactionQueue;
+import com.android.wm.shell.compatui.CompatUIController.CompatUIHintsState;
+
+import java.util.function.BiConsumer;
+
+/**
+ * Window manager for the user aspect ratio settings button which allows users to go to
+ * app settings and change apps aspect ratio.
+ */
+class UserAspectRatioSettingsWindowManager extends CompatUIWindowManagerAbstract {
+
+ private static final long SHOW_USER_ASPECT_RATIO_BUTTON_DELAY_MS = 500L;
+
+ private static final long HIDE_USER_ASPECT_RATIO_BUTTON_DELAY_MS = 4000L;
+
+ private long mNextButtonHideTimeMs = -1L;
+
+ private final BiConsumer<TaskInfo, ShellTaskOrganizer.TaskListener> mOnButtonClicked;
+
+ private final ShellExecutor mShellExecutor;
+
+ @VisibleForTesting
+ @NonNull
+ final CompatUIHintsState mCompatUIHintsState;
+
+ @Nullable
+ private UserAspectRatioSettingsLayout mLayout;
+
+ // Remember the last reported states in case visibility changes due to keyguard or IME updates.
+ @VisibleForTesting
+ boolean mHasUserAspectRatioSettingsButton;
+
+ UserAspectRatioSettingsWindowManager(@NonNull Context context, @NonNull TaskInfo taskInfo,
+ @NonNull SyncTransactionQueue syncQueue,
+ @Nullable ShellTaskOrganizer.TaskListener taskListener,
+ @NonNull DisplayLayout displayLayout, @NonNull CompatUIHintsState compatUIHintsState,
+ @NonNull BiConsumer<TaskInfo, ShellTaskOrganizer.TaskListener> onButtonClicked,
+ @NonNull ShellExecutor shellExecutor) {
+ super(context, taskInfo, syncQueue, taskListener, displayLayout);
+ mShellExecutor = shellExecutor;
+ mHasUserAspectRatioSettingsButton = getHasUserAspectRatioSettingsButton(taskInfo);
+ mCompatUIHintsState = compatUIHintsState;
+ mOnButtonClicked = onButtonClicked;
+ }
+
+ @Override
+ protected int getZOrder() {
+ return TASK_CHILD_LAYER_COMPAT_UI + 1;
+ }
+
+ @Override
+ protected @Nullable View getLayout() {
+ return mLayout;
+ }
+
+ @Override
+ protected void removeLayout() {
+ mLayout = null;
+ }
+
+ @Override
+ protected boolean eligibleToShowLayout() {
+ return mHasUserAspectRatioSettingsButton;
+ }
+
+ @Override
+ protected View createLayout() {
+ mLayout = inflateLayout();
+ mLayout.inject(this);
+
+ updateVisibilityOfViews();
+
+ return mLayout;
+ }
+
+ @VisibleForTesting
+ UserAspectRatioSettingsLayout inflateLayout() {
+ return (UserAspectRatioSettingsLayout) LayoutInflater.from(mContext).inflate(
+ R.layout.user_aspect_ratio_settings_layout, null);
+ }
+
+ @Override
+ public boolean updateCompatInfo(@NonNull TaskInfo taskInfo,
+ @NonNull ShellTaskOrganizer.TaskListener taskListener, boolean canShow) {
+ final boolean prevHasUserAspectRatioSettingsButton = mHasUserAspectRatioSettingsButton;
+ mHasUserAspectRatioSettingsButton = getHasUserAspectRatioSettingsButton(taskInfo);
+
+ if (!super.updateCompatInfo(taskInfo, taskListener, canShow)) {
+ return false;
+ }
+
+ if (prevHasUserAspectRatioSettingsButton != mHasUserAspectRatioSettingsButton) {
+ updateVisibilityOfViews();
+ }
+ return true;
+ }
+
+ /** Called when the user aspect ratio settings button is clicked. */
+ void onUserAspectRatioSettingsButtonClicked() {
+ mOnButtonClicked.accept(getLastTaskInfo(), getTaskListener());
+ }
+
+ /** Called when the user aspect ratio settings button is long clicked. */
+ void onUserAspectRatioSettingsButtonLongClicked() {
+ if (mLayout == null) {
+ return;
+ }
+ mLayout.setUserAspectRatioSettingsHintVisibility(/* show= */ true);
+ mNextButtonHideTimeMs = updateHideTime(HIDE_USER_ASPECT_RATIO_BUTTON_DELAY_MS);
+ mShellExecutor.executeDelayed(this::hideUserAspectRatioButton,
+ HIDE_USER_ASPECT_RATIO_BUTTON_DELAY_MS);
+ }
+
+ @Override
+ @VisibleForTesting
+ public void updateSurfacePosition() {
+ if (mLayout == null) {
+ return;
+ }
+ // Position of the button in the container coordinate.
+ final Rect taskBounds = getTaskBounds();
+ final Rect taskStableBounds = getTaskStableBounds();
+ final int positionX = getLayoutDirection() == View.LAYOUT_DIRECTION_RTL
+ ? taskStableBounds.left - taskBounds.left
+ : taskStableBounds.right - taskBounds.left - mLayout.getMeasuredWidth();
+ final int positionY = taskStableBounds.bottom - taskBounds.top
+ - mLayout.getMeasuredHeight();
+ updateSurfacePosition(positionX, positionY);
+ }
+
+ @VisibleForTesting
+ void updateVisibilityOfViews() {
+ if (mHasUserAspectRatioSettingsButton) {
+ mShellExecutor.executeDelayed(this::showUserAspectRatioButton,
+ SHOW_USER_ASPECT_RATIO_BUTTON_DELAY_MS);
+ mNextButtonHideTimeMs = updateHideTime(HIDE_USER_ASPECT_RATIO_BUTTON_DELAY_MS);
+ mShellExecutor.executeDelayed(this::hideUserAspectRatioButton,
+ HIDE_USER_ASPECT_RATIO_BUTTON_DELAY_MS);
+ } else {
+ mShellExecutor.removeCallbacks(this::showUserAspectRatioButton);
+ mShellExecutor.execute(this::hideUserAspectRatioButton);
+ }
+ }
+
+ private void showUserAspectRatioButton() {
+ if (mLayout == null) {
+ return;
+ }
+ mLayout.setUserAspectRatioButtonVisibility(true);
+ // Only show by default for the first time.
+ if (!mCompatUIHintsState.mHasShownUserAspectRatioSettingsButtonHint) {
+ mLayout.setUserAspectRatioSettingsHintVisibility(/* show= */ true);
+ mCompatUIHintsState.mHasShownUserAspectRatioSettingsButtonHint = true;
+ }
+ }
+
+ private void hideUserAspectRatioButton() {
+ if (mLayout == null || !isHideDelayReached(mNextButtonHideTimeMs)) {
+ return;
+ }
+ mLayout.setUserAspectRatioButtonVisibility(false);
+ }
+
+ private boolean isHideDelayReached(long nextHideTime) {
+ return SystemClock.uptimeMillis() >= nextHideTime;
+ }
+
+ private long updateHideTime(long hideDelay) {
+ return SystemClock.uptimeMillis() + hideDelay;
+ }
+
+ private boolean getHasUserAspectRatioSettingsButton(@NonNull TaskInfo taskInfo) {
+ return taskInfo.topActivityEligibleForUserAspectRatioButton
+ && (taskInfo.topActivityBoundsLetterboxed
+ || taskInfo.isUserFullscreenOverrideEnabled);
+ }
+}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java
index c06b22c..9472341 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java
@@ -20,6 +20,7 @@
import android.app.ActivityTaskManager;
import android.content.Context;
+import android.content.pm.PackageManager;
import android.os.Handler;
import android.os.SystemProperties;
import android.view.IWindowManager;
@@ -57,6 +58,8 @@
import com.android.wm.shell.common.annotations.ShellBackgroundThread;
import com.android.wm.shell.common.annotations.ShellMainThread;
import com.android.wm.shell.common.annotations.ShellSplashscreenThread;
+import com.android.wm.shell.common.pip.PipMediaController;
+import com.android.wm.shell.common.pip.PipUiEventLogger;
import com.android.wm.shell.compatui.CompatUIConfiguration;
import com.android.wm.shell.compatui.CompatUIController;
import com.android.wm.shell.compatui.CompatUIShellCommandHandler;
@@ -331,6 +334,25 @@
abstract ShellBackAnimationRegistry optionalBackAnimationRegistry();
//
+ // PiP (optional feature)
+ //
+
+ @WMSingleton
+ @Provides
+ static PipUiEventLogger providePipUiEventLogger(UiEventLogger uiEventLogger,
+ PackageManager packageManager) {
+ return new PipUiEventLogger(uiEventLogger, packageManager);
+ }
+
+ @WMSingleton
+ @Provides
+ static PipMediaController providePipMediaController(Context context,
+ @ShellMainThread Handler mainHandler) {
+ return new PipMediaController(context, mainHandler);
+ }
+
+
+ //
// Bubbles (optional feature)
//
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java
index 9bf973f..24ef44a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java
@@ -32,6 +32,8 @@
import com.android.wm.shell.common.annotations.ShellMainThread;
import com.android.wm.shell.common.pip.PhoneSizeSpecSource;
import com.android.wm.shell.common.pip.PipAppOpsListener;
+import com.android.wm.shell.common.pip.PipMediaController;
+import com.android.wm.shell.common.pip.PipUiEventLogger;
import com.android.wm.shell.common.pip.SizeSpecSource;
import com.android.wm.shell.dagger.WMShellBaseModule;
import com.android.wm.shell.dagger.WMSingleton;
@@ -41,7 +43,6 @@
import com.android.wm.shell.pip.PipBoundsAlgorithm;
import com.android.wm.shell.pip.PipBoundsState;
import com.android.wm.shell.pip.PipDisplayLayoutState;
-import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipParamsChangedForwarder;
import com.android.wm.shell.pip.PipSnapAlgorithm;
import com.android.wm.shell.pip.PipSurfaceTransactionHelper;
@@ -49,7 +50,6 @@
import com.android.wm.shell.pip.PipTransition;
import com.android.wm.shell.pip.PipTransitionController;
import com.android.wm.shell.pip.PipTransitionState;
-import com.android.wm.shell.pip.PipUiEventLogger;
import com.android.wm.shell.pip.PipUtils;
import com.android.wm.shell.pip.phone.PhonePipKeepClearAlgorithm;
import com.android.wm.shell.pip.phone.PhonePipMenuController;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1SharedModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1SharedModule.java
index e8fae24..c4ca501 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1SharedModule.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1SharedModule.java
@@ -17,15 +17,9 @@
package com.android.wm.shell.dagger.pip;
import android.content.Context;
-import android.content.pm.PackageManager;
-import android.os.Handler;
-import com.android.internal.logging.UiEventLogger;
-import com.android.wm.shell.common.annotations.ShellMainThread;
import com.android.wm.shell.dagger.WMSingleton;
-import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipSurfaceTransactionHelper;
-import com.android.wm.shell.pip.PipUiEventLogger;
import dagger.Module;
import dagger.Provides;
@@ -36,24 +30,9 @@
*/
@Module
public abstract class Pip1SharedModule {
- // Needs handler for registering broadcast receivers
- @WMSingleton
- @Provides
- static PipMediaController providePipMediaController(Context context,
- @ShellMainThread Handler mainHandler) {
- return new PipMediaController(context, mainHandler);
- }
-
@WMSingleton
@Provides
static PipSurfaceTransactionHelper providePipSurfaceTransactionHelper(Context context) {
return new PipSurfaceTransactionHelper(context);
}
-
- @WMSingleton
- @Provides
- static PipUiEventLogger providePipUiEventLogger(UiEventLogger uiEventLogger,
- PackageManager packageManager) {
- return new PipUiEventLogger(uiEventLogger, packageManager);
- }
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip2Module.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip2Module.java
index c7c6e8a..8dec4ea 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip2Module.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip2Module.java
@@ -18,6 +18,7 @@
import android.annotation.Nullable;
+import com.android.wm.shell.dagger.WMShellBaseModule;
import com.android.wm.shell.dagger.WMSingleton;
import com.android.wm.shell.pip2.PipTransition;
@@ -26,9 +27,9 @@
/**
* Provides dependencies from {@link com.android.wm.shell.pip2}, this implementation is meant to be
- * the successor of its sibling {@link Pip1SharedModule}.
+ * the successor of its sibling {@link Pip1Module}.
*/
-@Module
+@Module(includes = WMShellBaseModule.class)
public abstract class Pip2Module {
@WMSingleton
@Provides
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/TvPipModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/TvPipModule.java
index 80ffbb0..a6ff9ec 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/TvPipModule.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/TvPipModule.java
@@ -30,20 +30,20 @@
import com.android.wm.shell.common.annotations.ShellMainThread;
import com.android.wm.shell.common.pip.LegacySizeSpecSource;
import com.android.wm.shell.common.pip.PipAppOpsListener;
+import com.android.wm.shell.common.pip.PipMediaController;
+import com.android.wm.shell.common.pip.PipUiEventLogger;
import com.android.wm.shell.common.pip.SizeSpecSource;
import com.android.wm.shell.dagger.WMShellBaseModule;
import com.android.wm.shell.dagger.WMSingleton;
import com.android.wm.shell.pip.Pip;
import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipDisplayLayoutState;
-import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipParamsChangedForwarder;
import com.android.wm.shell.pip.PipSnapAlgorithm;
import com.android.wm.shell.pip.PipSurfaceTransactionHelper;
import com.android.wm.shell.pip.PipTaskOrganizer;
import com.android.wm.shell.pip.PipTransitionController;
import com.android.wm.shell.pip.PipTransitionState;
-import com.android.wm.shell.pip.PipUiEventLogger;
import com.android.wm.shell.pip.tv.TvPipBoundsAlgorithm;
import com.android.wm.shell.pip.tv.TvPipBoundsController;
import com.android.wm.shell.pip.tv.TvPipBoundsState;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt
index 1d46e75..633f627 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt
@@ -18,6 +18,7 @@
import android.R
import android.app.ActivityManager.RunningTaskInfo
+import android.app.WindowConfiguration
import android.app.WindowConfiguration.ACTIVITY_TYPE_HOME
import android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD
import android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM
@@ -301,6 +302,24 @@
}
}
+ /** Move a desktop app to split screen. */
+ fun moveToSplit(task: RunningTaskInfo) {
+ KtProtoLog.v(
+ WM_SHELL_DESKTOP_MODE,
+ "DesktopTasksController: moveToSplit taskId=%d",
+ task.taskId
+ )
+ val wct = WindowContainerTransaction()
+ wct.setWindowingMode(task.token, WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW)
+ wct.setBounds(task.token, null)
+ wct.setDensityDpi(task.token, getDefaultDensityDpi())
+ if (Transitions.ENABLE_SHELL_TRANSITIONS) {
+ transitions.startTransition(TRANSIT_CHANGE, wct, null /* handler */)
+ } else {
+ shellTaskOrganizer.applyTransaction(wct)
+ }
+ }
+
/**
* The second part of the animated move to desktop transition, called after
* {@link startMoveToDesktop}. Move a task to fullscreen after being dragged from fullscreen
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipMediaController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipMediaController.java
deleted file mode 100644
index ddffb5b..0000000
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipMediaController.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.wm.shell.pip;
-
-import static android.app.PendingIntent.FLAG_IMMUTABLE;
-import static android.app.PendingIntent.FLAG_UPDATE_CURRENT;
-
-import android.annotation.DrawableRes;
-import android.annotation.StringRes;
-import android.annotation.SuppressLint;
-import android.app.PendingIntent;
-import android.app.RemoteAction;
-import android.content.BroadcastReceiver;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.graphics.drawable.Icon;
-import android.media.MediaMetadata;
-import android.media.session.MediaController;
-import android.media.session.MediaSession;
-import android.media.session.MediaSessionManager;
-import android.media.session.PlaybackState;
-import android.os.Handler;
-import android.os.HandlerExecutor;
-import android.os.UserHandle;
-
-import androidx.annotation.Nullable;
-
-import com.android.wm.shell.R;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Interfaces with the {@link MediaSessionManager} to compose the right set of actions to show (only
- * if there are no actions from the PiP activity itself). The active media controller is only set
- * when there is a media session from the top PiP activity.
- */
-public class PipMediaController {
- private static final String SYSTEMUI_PERMISSION = "com.android.systemui.permission.SELF";
-
- private static final String ACTION_PLAY = "com.android.wm.shell.pip.PLAY";
- private static final String ACTION_PAUSE = "com.android.wm.shell.pip.PAUSE";
- private static final String ACTION_NEXT = "com.android.wm.shell.pip.NEXT";
- private static final String ACTION_PREV = "com.android.wm.shell.pip.PREV";
-
- /**
- * A listener interface to receive notification on changes to the media actions.
- */
- public interface ActionListener {
- /**
- * Called when the media actions changed.
- */
- void onMediaActionsChanged(List<RemoteAction> actions);
- }
-
- /**
- * A listener interface to receive notification on changes to the media metadata.
- */
- public interface MetadataListener {
- /**
- * Called when the media metadata changed.
- */
- void onMediaMetadataChanged(MediaMetadata metadata);
- }
-
- /**
- * A listener interface to receive notification on changes to the media session token.
- */
- public interface TokenListener {
- /**
- * Called when the media session token changed.
- */
- void onMediaSessionTokenChanged(MediaSession.Token token);
- }
-
- private final Context mContext;
- private final Handler mMainHandler;
- private final HandlerExecutor mHandlerExecutor;
-
- private final MediaSessionManager mMediaSessionManager;
- private MediaController mMediaController;
-
- private RemoteAction mPauseAction;
- private RemoteAction mPlayAction;
- private RemoteAction mNextAction;
- private RemoteAction mPrevAction;
-
- private final BroadcastReceiver mMediaActionReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- if (mMediaController == null || mMediaController.getTransportControls() == null) {
- // no active media session, bail early.
- return;
- }
- switch (intent.getAction()) {
- case ACTION_PLAY:
- mMediaController.getTransportControls().play();
- break;
- case ACTION_PAUSE:
- mMediaController.getTransportControls().pause();
- break;
- case ACTION_NEXT:
- mMediaController.getTransportControls().skipToNext();
- break;
- case ACTION_PREV:
- mMediaController.getTransportControls().skipToPrevious();
- break;
- }
- }
- };
-
- private final MediaController.Callback mPlaybackChangedListener =
- new MediaController.Callback() {
- @Override
- public void onPlaybackStateChanged(PlaybackState state) {
- notifyActionsChanged();
- }
-
- @Override
- public void onMetadataChanged(@Nullable MediaMetadata metadata) {
- notifyMetadataChanged(metadata);
- }
- };
-
- private final MediaSessionManager.OnActiveSessionsChangedListener mSessionsChangedListener =
- this::resolveActiveMediaController;
-
- private final ArrayList<ActionListener> mActionListeners = new ArrayList<>();
- private final ArrayList<MetadataListener> mMetadataListeners = new ArrayList<>();
- private final ArrayList<TokenListener> mTokenListeners = new ArrayList<>();
-
- public PipMediaController(Context context, Handler mainHandler) {
- mContext = context;
- mMainHandler = mainHandler;
- mHandlerExecutor = new HandlerExecutor(mMainHandler);
- if (!PipUtils.isPip2ExperimentEnabled()) {
- IntentFilter mediaControlFilter = new IntentFilter();
- mediaControlFilter.addAction(ACTION_PLAY);
- mediaControlFilter.addAction(ACTION_PAUSE);
- mediaControlFilter.addAction(ACTION_NEXT);
- mediaControlFilter.addAction(ACTION_PREV);
- mContext.registerReceiverForAllUsers(mMediaActionReceiver, mediaControlFilter,
- SYSTEMUI_PERMISSION, mainHandler, Context.RECEIVER_EXPORTED);
- }
-
- // Creates the standard media buttons that we may show.
- mPauseAction = getDefaultRemoteAction(R.string.pip_pause,
- R.drawable.pip_ic_pause_white, ACTION_PAUSE);
- mPlayAction = getDefaultRemoteAction(R.string.pip_play,
- R.drawable.pip_ic_play_arrow_white, ACTION_PLAY);
- mNextAction = getDefaultRemoteAction(R.string.pip_skip_to_next,
- R.drawable.pip_ic_skip_next_white, ACTION_NEXT);
- mPrevAction = getDefaultRemoteAction(R.string.pip_skip_to_prev,
- R.drawable.pip_ic_skip_previous_white, ACTION_PREV);
-
- mMediaSessionManager = context.getSystemService(MediaSessionManager.class);
- }
-
- /**
- * Handles when an activity is pinned.
- */
- public void onActivityPinned() {
- // Once we enter PiP, try to find the active media controller for the top most activity
- resolveActiveMediaController(mMediaSessionManager.getActiveSessionsForUser(null,
- UserHandle.CURRENT));
- }
-
- /**
- * Adds a new media action listener.
- */
- public void addActionListener(ActionListener listener) {
- if (!mActionListeners.contains(listener)) {
- mActionListeners.add(listener);
- listener.onMediaActionsChanged(getMediaActions());
- }
- }
-
- /**
- * Removes a media action listener.
- */
- public void removeActionListener(ActionListener listener) {
- listener.onMediaActionsChanged(Collections.emptyList());
- mActionListeners.remove(listener);
- }
-
- /**
- * Adds a new media metadata listener.
- */
- public void addMetadataListener(MetadataListener listener) {
- if (!mMetadataListeners.contains(listener)) {
- mMetadataListeners.add(listener);
- listener.onMediaMetadataChanged(getMediaMetadata());
- }
- }
-
- /**
- * Removes a media metadata listener.
- */
- public void removeMetadataListener(MetadataListener listener) {
- listener.onMediaMetadataChanged(null);
- mMetadataListeners.remove(listener);
- }
-
- /**
- * Adds a new token listener.
- */
- public void addTokenListener(TokenListener listener) {
- if (!mTokenListeners.contains(listener)) {
- mTokenListeners.add(listener);
- listener.onMediaSessionTokenChanged(getToken());
- }
- }
-
- /**
- * Removes a token listener.
- */
- public void removeTokenListener(TokenListener listener) {
- listener.onMediaSessionTokenChanged(null);
- mTokenListeners.remove(listener);
- }
-
- private MediaSession.Token getToken() {
- if (mMediaController == null) {
- return null;
- }
- return mMediaController.getSessionToken();
- }
-
- private MediaMetadata getMediaMetadata() {
- return mMediaController != null ? mMediaController.getMetadata() : null;
- }
-
- /**
- * Gets the set of media actions currently available.
- */
- // This is due to using PlaybackState#isActive, which is added in API 31.
- // It can be removed when min_sdk of the app is set to 31 or greater.
- @SuppressLint("NewApi")
- private List<RemoteAction> getMediaActions() {
- // Cache the PlaybackState since it's a Binder call.
- final PlaybackState playbackState;
- if (mMediaController == null
- || (playbackState = mMediaController.getPlaybackState()) == null) {
- return Collections.emptyList();
- }
-
- ArrayList<RemoteAction> mediaActions = new ArrayList<>();
- boolean isPlaying = playbackState.isActive();
- long actions = playbackState.getActions();
-
- // Prev action
- mPrevAction.setEnabled((actions & PlaybackState.ACTION_SKIP_TO_PREVIOUS) != 0);
- mediaActions.add(mPrevAction);
-
- // Play/pause action
- if (!isPlaying && ((actions & PlaybackState.ACTION_PLAY) != 0)) {
- mediaActions.add(mPlayAction);
- } else if (isPlaying && ((actions & PlaybackState.ACTION_PAUSE) != 0)) {
- mediaActions.add(mPauseAction);
- }
-
- // Next action
- mNextAction.setEnabled((actions & PlaybackState.ACTION_SKIP_TO_NEXT) != 0);
- mediaActions.add(mNextAction);
- return mediaActions;
- }
-
- /** @return Default {@link RemoteAction} sends broadcast back to SysUI. */
- private RemoteAction getDefaultRemoteAction(@StringRes int titleAndDescription,
- @DrawableRes int icon, String action) {
- final String titleAndDescriptionStr = mContext.getString(titleAndDescription);
- final Intent intent = new Intent(action);
- intent.setPackage(mContext.getPackageName());
- return new RemoteAction(Icon.createWithResource(mContext, icon),
- titleAndDescriptionStr, titleAndDescriptionStr,
- PendingIntent.getBroadcast(mContext, 0 /* requestCode */, intent,
- FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE));
- }
-
- /**
- * Re-registers the session listener for the current user.
- */
- public void registerSessionListenerForCurrentUser() {
- mMediaSessionManager.removeOnActiveSessionsChangedListener(mSessionsChangedListener);
- mMediaSessionManager.addOnActiveSessionsChangedListener(null, UserHandle.CURRENT,
- mHandlerExecutor, mSessionsChangedListener);
- }
-
- /**
- * Tries to find and set the active media controller for the top PiP activity.
- */
- private void resolveActiveMediaController(List<MediaController> controllers) {
- if (controllers != null) {
- final ComponentName topActivity = PipUtils.getTopPipActivity(mContext).first;
- if (topActivity != null) {
- for (int i = 0; i < controllers.size(); i++) {
- final MediaController controller = controllers.get(i);
- if (controller.getPackageName().equals(topActivity.getPackageName())) {
- setActiveMediaController(controller);
- return;
- }
- }
- }
- }
- setActiveMediaController(null);
- }
-
- /**
- * Sets the active media controller for the top PiP activity.
- */
- private void setActiveMediaController(MediaController controller) {
- if (controller != mMediaController) {
- if (mMediaController != null) {
- mMediaController.unregisterCallback(mPlaybackChangedListener);
- }
- mMediaController = controller;
- if (controller != null) {
- controller.registerCallback(mPlaybackChangedListener, mMainHandler);
- }
- notifyActionsChanged();
- notifyMetadataChanged(getMediaMetadata());
- notifyTokenChanged(getToken());
-
- // TODO(winsonc): Consider if we want to close the PIP after a timeout (like on TV)
- }
- }
-
- /**
- * Notifies all listeners that the actions have changed.
- */
- private void notifyActionsChanged() {
- if (!mActionListeners.isEmpty()) {
- List<RemoteAction> actions = getMediaActions();
- mActionListeners.forEach(l -> l.onMediaActionsChanged(actions));
- }
- }
-
- /**
- * Notifies all listeners that the metadata have changed.
- */
- private void notifyMetadataChanged(MediaMetadata metadata) {
- if (!mMetadataListeners.isEmpty()) {
- mMetadataListeners.forEach(l -> l.onMediaMetadataChanged(metadata));
- }
- }
-
- private void notifyTokenChanged(MediaSession.Token token) {
- if (!mTokenListeners.isEmpty()) {
- mTokenListeners.forEach(l -> l.onMediaSessionTokenChanged(token));
- }
- }
-}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
index 0d55018..296857b 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTaskOrganizer.java
@@ -63,7 +63,6 @@
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.RemoteException;
-import android.os.SystemProperties;
import android.view.Choreographer;
import android.view.Display;
import android.view.Surface;
@@ -83,6 +82,7 @@
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.common.annotations.ShellMainThread;
+import com.android.wm.shell.common.pip.PipUiEventLogger;
import com.android.wm.shell.pip.phone.PipMotionHelper;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
import com.android.wm.shell.splitscreen.SplitScreenController;
@@ -1735,17 +1735,13 @@
// animation.
// TODO(b/272819817): cleanup the null-check and extra logging.
final boolean hasTopActivityInfo = mTaskInfo.topActivityInfo != null;
- if (!hasTopActivityInfo) {
- ProtoLog.w(ShellProtoLogGroup.WM_SHELL_TRANSITIONS,
- "%s: TaskInfo.topActivityInfo is null", TAG);
- }
- if (SystemProperties.getBoolean(
- "persist.wm.debug.enable_pip_app_icon_overlay", true)
- && hasTopActivityInfo) {
+ if (hasTopActivityInfo) {
animator.setAppIconContentOverlay(
mContext, currentBounds, mTaskInfo.topActivityInfo,
mPipBoundsState.getLauncherState().getAppIconSizePx());
} else {
+ ProtoLog.w(ShellProtoLogGroup.WM_SHELL_TRANSITIONS,
+ "%s: TaskInfo.topActivityInfo is null", TAG);
animator.setColorContentOverlay(mContext);
}
} else {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
index 2563d98..db7e2c0 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
@@ -49,7 +49,6 @@
import android.graphics.Point;
import android.graphics.Rect;
import android.os.IBinder;
-import android.os.SystemProperties;
import android.view.Surface;
import android.view.SurfaceControl;
import android.view.WindowManager;
@@ -902,17 +901,13 @@
// animation.
// TODO(b/272819817): cleanup the null-check and extra logging.
final boolean hasTopActivityInfo = taskInfo.topActivityInfo != null;
- if (!hasTopActivityInfo) {
- ProtoLog.w(ShellProtoLogGroup.WM_SHELL_TRANSITIONS,
- "%s: TaskInfo.topActivityInfo is null", TAG);
- }
- if (SystemProperties.getBoolean(
- "persist.wm.debug.enable_pip_app_icon_overlay", true)
- && hasTopActivityInfo) {
+ if (hasTopActivityInfo) {
animator.setAppIconContentOverlay(
mContext, currentBounds, taskInfo.topActivityInfo,
mPipBoundsState.getLauncherState().getAppIconSizePx());
} else {
+ ProtoLog.w(ShellProtoLogGroup.WM_SHELL_TRANSITIONS,
+ "%s: TaskInfo.topActivityInfo is null", TAG);
animator.setColorContentOverlay(mContext);
}
} else {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipUiEventLogger.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipUiEventLogger.java
deleted file mode 100644
index 3e5a19b..0000000
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipUiEventLogger.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.wm.shell.pip;
-
-import android.app.TaskInfo;
-import android.content.pm.PackageManager;
-
-import com.android.internal.logging.UiEvent;
-import com.android.internal.logging.UiEventLogger;
-
-/**
- * Helper class that ends PiP log to UiEvent, see also go/uievent
- */
-public class PipUiEventLogger {
-
- private static final int INVALID_PACKAGE_UID = -1;
-
- private final UiEventLogger mUiEventLogger;
- private final PackageManager mPackageManager;
-
- private String mPackageName;
- private int mPackageUid = INVALID_PACKAGE_UID;
-
- public PipUiEventLogger(UiEventLogger uiEventLogger, PackageManager packageManager) {
- mUiEventLogger = uiEventLogger;
- mPackageManager = packageManager;
- }
-
- public void setTaskInfo(TaskInfo taskInfo) {
- if (taskInfo != null && taskInfo.topActivity != null) {
- mPackageName = taskInfo.topActivity.getPackageName();
- mPackageUid = getUid(mPackageName, taskInfo.userId);
- } else {
- mPackageName = null;
- mPackageUid = INVALID_PACKAGE_UID;
- }
- }
-
- /**
- * Sends log via UiEvent, reference go/uievent for how to debug locally
- */
- public void log(PipUiEventEnum event) {
- if (mPackageName == null || mPackageUid == INVALID_PACKAGE_UID) {
- return;
- }
- mUiEventLogger.log(event, mPackageUid, mPackageName);
- }
-
- private int getUid(String packageName, int userId) {
- int uid = INVALID_PACKAGE_UID;
- try {
- uid = mPackageManager.getApplicationInfoAsUser(
- packageName, 0 /* ApplicationInfoFlags */, userId).uid;
- } catch (PackageManager.NameNotFoundException e) {
- // do nothing.
- }
- return uid;
- }
-
- /**
- * Enums for logging the PiP events to UiEvent
- */
- public enum PipUiEventEnum implements UiEventLogger.UiEventEnum {
- @UiEvent(doc = "Activity enters picture-in-picture mode")
- PICTURE_IN_PICTURE_ENTER(603),
-
- @UiEvent(doc = "Activity enters picture-in-picture mode with auto-enter-pip API")
- PICTURE_IN_PICTURE_AUTO_ENTER(1313),
-
- @UiEvent(doc = "Activity enters picture-in-picture mode from content-pip API")
- PICTURE_IN_PICTURE_ENTER_CONTENT_PIP(1314),
-
- @UiEvent(doc = "Expands from picture-in-picture to fullscreen")
- PICTURE_IN_PICTURE_EXPAND_TO_FULLSCREEN(604),
-
- @UiEvent(doc = "Removes picture-in-picture by tap close button")
- PICTURE_IN_PICTURE_TAP_TO_REMOVE(605),
-
- @UiEvent(doc = "Removes picture-in-picture by drag to dismiss area")
- PICTURE_IN_PICTURE_DRAG_TO_REMOVE(606),
-
- @UiEvent(doc = "Shows picture-in-picture menu")
- PICTURE_IN_PICTURE_SHOW_MENU(607),
-
- @UiEvent(doc = "Hides picture-in-picture menu")
- PICTURE_IN_PICTURE_HIDE_MENU(608),
-
- @UiEvent(doc = "Changes the aspect ratio of picture-in-picture window. This is inherited"
- + " from previous Tron-based logging and currently not in use.")
- PICTURE_IN_PICTURE_CHANGE_ASPECT_RATIO(609),
-
- @UiEvent(doc = "User resize of the picture-in-picture window")
- PICTURE_IN_PICTURE_RESIZE(610),
-
- @UiEvent(doc = "User unstashed picture-in-picture")
- PICTURE_IN_PICTURE_STASH_UNSTASHED(709),
-
- @UiEvent(doc = "User stashed picture-in-picture to the left side")
- PICTURE_IN_PICTURE_STASH_LEFT(710),
-
- @UiEvent(doc = "User stashed picture-in-picture to the right side")
- PICTURE_IN_PICTURE_STASH_RIGHT(711),
-
- @UiEvent(doc = "User taps on the settings button in PiP menu")
- PICTURE_IN_PICTURE_SHOW_SETTINGS(933),
-
- @UiEvent(doc = "Closes PiP with app-provided close action")
- PICTURE_IN_PICTURE_CUSTOM_CLOSE(1058);
-
- private final int mId;
-
- PipUiEventEnum(int id) {
- mId = id;
- }
-
- @Override
- public int getId() {
- return mId;
- }
- }
-}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipKeepClearAlgorithm.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipKeepClearAlgorithm.java
index f9332e4..2d34035 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipKeepClearAlgorithm.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipKeepClearAlgorithm.java
@@ -40,6 +40,7 @@
"persist.wm.debug.enable_pip_keep_clear_algorithm_gravity", false);
protected int mKeepClearAreasPadding;
+ private int mImeOffset;
public PhonePipKeepClearAlgorithm(Context context) {
reloadResources(context);
@@ -48,6 +49,7 @@
private void reloadResources(Context context) {
final Resources res = context.getResources();
mKeepClearAreasPadding = res.getDimensionPixelSize(R.dimen.pip_keep_clear_areas_padding);
+ mImeOffset = res.getDimensionPixelSize(R.dimen.pip_ime_offset);
}
/**
@@ -61,7 +63,7 @@
Rect insets = new Rect();
pipBoundsAlgorithm.getInsetBounds(insets);
if (pipBoundsState.isImeShowing()) {
- insets.bottom -= pipBoundsState.getImeHeight();
+ insets.bottom -= (pipBoundsState.getImeHeight() + mImeOffset);
}
// if PiP is stashed we only adjust the vertical position if it's outside of insets and
// ignore all keep clear areas, since it's already on the side
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java
index 5e1b6be..cc182ba 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java
@@ -38,12 +38,12 @@
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.SystemWindows;
+import com.android.wm.shell.common.pip.PipMediaController;
+import com.android.wm.shell.common.pip.PipMediaController.ActionListener;
+import com.android.wm.shell.common.pip.PipUiEventLogger;
import com.android.wm.shell.pip.PipBoundsState;
-import com.android.wm.shell.pip.PipMediaController;
-import com.android.wm.shell.pip.PipMediaController.ActionListener;
import com.android.wm.shell.pip.PipMenuController;
import com.android.wm.shell.pip.PipSurfaceTransactionHelper;
-import com.android.wm.shell.pip.PipUiEventLogger;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
import com.android.wm.shell.splitscreen.SplitScreenController;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
index b872267..5c65d78 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
@@ -76,6 +76,7 @@
import com.android.wm.shell.common.TaskStackListenerCallback;
import com.android.wm.shell.common.TaskStackListenerImpl;
import com.android.wm.shell.common.pip.PipAppOpsListener;
+import com.android.wm.shell.common.pip.PipMediaController;
import com.android.wm.shell.onehanded.OneHandedController;
import com.android.wm.shell.onehanded.OneHandedTransitionCallback;
import com.android.wm.shell.pip.IPip;
@@ -87,7 +88,6 @@
import com.android.wm.shell.pip.PipBoundsState;
import com.android.wm.shell.pip.PipDisplayLayoutState;
import com.android.wm.shell.pip.PipKeepClearAlgorithmInterface;
-import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipParamsChangedForwarder;
import com.android.wm.shell.pip.PipSnapAlgorithm;
import com.android.wm.shell.pip.PipTaskOrganizer;
@@ -123,14 +123,6 @@
private static final long PIP_KEEP_CLEAR_AREAS_DELAY =
SystemProperties.getLong("persist.wm.debug.pip_keep_clear_areas_delay", 200);
- private boolean mEnablePipKeepClearAlgorithm =
- SystemProperties.getBoolean("persist.wm.debug.enable_pip_keep_clear_algorithm", true);
-
- @VisibleForTesting
- void setEnablePipKeepClearAlgorithm(boolean value) {
- mEnablePipKeepClearAlgorithm = value;
- }
-
private Context mContext;
protected ShellExecutor mMainExecutor;
private DisplayController mDisplayController;
@@ -166,10 +158,6 @@
// early bail out if the change was caused by keyguard showing up
return;
}
- if (!mEnablePipKeepClearAlgorithm) {
- // early bail out if the keep clear areas feature is disabled
- return;
- }
if (mPipBoundsState.isStashed()) {
// don't move when stashed
return;
@@ -187,10 +175,6 @@
}
private void updatePipPositionForKeepClearAreas() {
- if (!mEnablePipKeepClearAlgorithm) {
- // early bail out if the keep clear areas feature is disabled
- return;
- }
if (mIsKeyguardShowingOrAnimating) {
// early bail out if the change was caused by keyguard showing up
return;
@@ -343,19 +327,17 @@
public void onKeepClearAreasChanged(int displayId, Set<Rect> restricted,
Set<Rect> unrestricted) {
if (mPipDisplayLayoutState.getDisplayId() == displayId) {
- if (mEnablePipKeepClearAlgorithm) {
- mPipBoundsState.setKeepClearAreas(restricted, unrestricted);
+ mPipBoundsState.setKeepClearAreas(restricted, unrestricted);
- mMainExecutor.removeCallbacks(
- mMovePipInResponseToKeepClearAreasChangeCallback);
- mMainExecutor.executeDelayed(
- mMovePipInResponseToKeepClearAreasChangeCallback,
- PIP_KEEP_CLEAR_AREAS_DELAY);
+ mMainExecutor.removeCallbacks(
+ mMovePipInResponseToKeepClearAreasChangeCallback);
+ mMainExecutor.executeDelayed(
+ mMovePipInResponseToKeepClearAreasChangeCallback,
+ PIP_KEEP_CLEAR_AREAS_DELAY);
- ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
- "onKeepClearAreasChanged: restricted=%s, unrestricted=%s",
- restricted, unrestricted);
- }
+ ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
+ "onKeepClearAreasChanged: restricted=%s, unrestricted=%s",
+ restricted, unrestricted);
}
}
};
@@ -660,25 +642,9 @@
// there's a keyguard present
return;
}
- int oldMaxMovementBound = mPipBoundsState.getMovementBounds().bottom;
onDisplayChangedUncheck(mDisplayController
.getDisplayLayout(mPipDisplayLayoutState.getDisplayId()),
false /* saveRestoreSnapFraction */);
- int newMaxMovementBound = mPipBoundsState.getMovementBounds().bottom;
- if (!mEnablePipKeepClearAlgorithm) {
- // offset PiP to adjust for bottom inset change
- int pipTop = mPipBoundsState.getBounds().top;
- int diff = newMaxMovementBound - oldMaxMovementBound;
- if (diff < 0 && pipTop > newMaxMovementBound) {
- // bottom inset has increased, move PiP up if it is too low
- mPipMotionHelper.animateToOffset(mPipBoundsState.getBounds(),
- newMaxMovementBound - pipTop);
- }
- if (diff > 0 && oldMaxMovementBound == pipTop) {
- // bottom inset has decreased, move PiP down if it was by the edge
- mPipMotionHelper.animateToOffset(mPipBoundsState.getBounds(), diff);
- }
- }
}
});
@@ -947,14 +913,8 @@
* Sets both shelf visibility and its height.
*/
private void setShelfHeight(boolean visible, int height) {
- if (mEnablePipKeepClearAlgorithm) {
- // turn this into Launcher keep clear area registration instead
- setLauncherKeepClearAreaHeight(visible, height);
- return;
- }
- if (!mIsKeyguardShowingOrAnimating) {
- setShelfHeightLocked(visible, height);
- }
+ // turn this into Launcher keep clear area registration instead
+ setLauncherKeepClearAreaHeight(visible, height);
}
private void setLauncherKeepClearAreaHeight(boolean visible, int height) {
@@ -1015,16 +975,10 @@
private Rect startSwipePipToHome(ComponentName componentName, ActivityInfo activityInfo,
PictureInPictureParams pictureInPictureParams,
int launcherRotation, Rect hotseatKeepClearArea) {
-
- if (mEnablePipKeepClearAlgorithm) {
- // preemptively add the keep clear area for Hotseat, so that it is taken into account
- // when calculating the entry destination bounds of PiP window
- mPipBoundsState.addNamedUnrestrictedKeepClearArea(LAUNCHER_KEEP_CLEAR_AREA_TAG,
- hotseatKeepClearArea);
- } else {
- int shelfHeight = hotseatKeepClearArea.height();
- setShelfHeightLocked(shelfHeight > 0 /* visible */, shelfHeight);
- }
+ // preemptively add the keep clear area for Hotseat, so that it is taken into account
+ // when calculating the entry destination bounds of PiP window
+ mPipBoundsState.addNamedUnrestrictedKeepClearArea(LAUNCHER_KEEP_CLEAR_AREA_TAG,
+ hotseatKeepClearArea);
onDisplayRotationChangedNotInPip(mContext, launcherRotation);
final Rect entryBounds = mPipTaskOrganizer.startSwipePipToHome(componentName, activityInfo,
pictureInPictureParams);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java
index da455f8..4e75847 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java
@@ -38,7 +38,7 @@
import com.android.wm.shell.common.bubbles.DismissCircleView;
import com.android.wm.shell.common.bubbles.DismissView;
import com.android.wm.shell.common.magnetictarget.MagnetizedObject;
-import com.android.wm.shell.pip.PipUiEventLogger;
+import com.android.wm.shell.common.pip.PipUiEventLogger;
import kotlin.Unit;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
index 779c539..837426a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
@@ -66,7 +66,7 @@
import com.android.wm.shell.R;
import com.android.wm.shell.animation.Interpolators;
import com.android.wm.shell.common.ShellExecutor;
-import com.android.wm.shell.pip.PipUiEventLogger;
+import com.android.wm.shell.common.pip.PipUiEventLogger;
import com.android.wm.shell.pip.PipUtils;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
import com.android.wm.shell.splitscreen.SplitScreenController;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java
index b251f6f..8f0a8e1 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java
@@ -33,7 +33,6 @@
import android.graphics.PointF;
import android.graphics.Rect;
import android.os.Debug;
-import android.os.SystemProperties;
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.R;
@@ -48,19 +47,16 @@
import com.android.wm.shell.pip.PipTransitionController;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
-import java.util.function.Consumer;
-
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
+import java.util.function.Consumer;
+
/**
* A helper to animate and manipulate the PiP.
*/
public class PipMotionHelper implements PipAppOpsListener.Callback,
FloatingContentCoordinator.FloatingContent {
-
- public static final boolean ENABLE_FLING_TO_DISMISS_PIP =
- SystemProperties.getBoolean("persist.wm.debug.fling_to_dismiss_pip", false);
private static final String TAG = "PipMotionHelper";
private static final boolean DEBUG = false;
@@ -707,7 +703,7 @@
loc[1] = animatedPipBounds.top;
}
};
- mMagnetizedPip.setFlingToTargetEnabled(ENABLE_FLING_TO_DISMISS_PIP);
+ mMagnetizedPip.setFlingToTargetEnabled(false);
}
return mMagnetizedPip;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
index abe2db0..4e687dd 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
@@ -46,11 +46,11 @@
import com.android.internal.policy.TaskResizingAlgorithm;
import com.android.wm.shell.R;
import com.android.wm.shell.common.ShellExecutor;
+import com.android.wm.shell.common.pip.PipUiEventLogger;
import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipBoundsAlgorithm;
import com.android.wm.shell.pip.PipBoundsState;
import com.android.wm.shell.pip.PipTaskOrganizer;
-import com.android.wm.shell.pip.PipUiEventLogger;
import java.io.PrintWriter;
import java.util.function.Consumer;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java
index 3e95498a..6055fd9 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java
@@ -34,7 +34,6 @@
import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;
-import android.os.SystemProperties;
import android.provider.DeviceConfig;
import android.util.Size;
import android.view.DisplayCutout;
@@ -51,13 +50,13 @@
import com.android.wm.shell.R;
import com.android.wm.shell.common.FloatingContentCoordinator;
import com.android.wm.shell.common.ShellExecutor;
+import com.android.wm.shell.common.pip.PipUiEventLogger;
import com.android.wm.shell.common.pip.SizeSpecSource;
import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipBoundsAlgorithm;
import com.android.wm.shell.pip.PipBoundsState;
import com.android.wm.shell.pip.PipTaskOrganizer;
import com.android.wm.shell.pip.PipTransitionController;
-import com.android.wm.shell.pip.PipUiEventLogger;
import com.android.wm.shell.pip.PipUtils;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
import com.android.wm.shell.sysui.ShellInit;
@@ -73,14 +72,6 @@
private static final String TAG = "PipTouchHandler";
private static final float DEFAULT_STASH_VELOCITY_THRESHOLD = 18000.f;
- private boolean mEnablePipKeepClearAlgorithm =
- SystemProperties.getBoolean("persist.wm.debug.enable_pip_keep_clear_algorithm", true);
-
- @VisibleForTesting
- void setEnablePipKeepClearAlgorithm(boolean value) {
- mEnablePipKeepClearAlgorithm = value;
- }
-
// Allow PIP to resize to a slightly bigger state upon touch
private boolean mEnableResize;
private final Context mContext;
@@ -430,48 +421,6 @@
mIsImeShowing ? mImeOffset : 0,
!mIsImeShowing && mIsShelfShowing ? mShelfHeight : 0);
- // If this is from an IME or shelf adjustment, then we should move the PiP so that it is not
- // occluded by the IME or shelf.
- if (fromImeAdjustment || fromShelfAdjustment) {
- if (mTouchState.isUserInteracting() && mTouchState.isDragging()) {
- // Defer the update of the current movement bounds until after the user finishes
- // touching the screen
- } else if (mEnablePipKeepClearAlgorithm) {
- // Ignore moving PiP if keep clear algorithm is enabled, since IME and shelf height
- // now are accounted for in the keep clear algorithm calculations
- } else {
- final boolean isExpanded = mMenuState == MENU_STATE_FULL && willResizeMenu();
- final Rect toMovementBounds = new Rect();
- mPipBoundsAlgorithm.getMovementBounds(curBounds, insetBounds,
- toMovementBounds, mIsImeShowing ? mImeHeight : 0);
- final int prevBottom = mPipBoundsState.getMovementBounds().bottom
- - mMovementBoundsExtraOffsets;
- // This is to handle landscape fullscreen IMEs, don't apply the extra offset in this
- // case
- final int toBottom = toMovementBounds.bottom < toMovementBounds.top
- ? toMovementBounds.bottom
- : toMovementBounds.bottom - extraOffset;
-
- if (isExpanded) {
- curBounds.set(mPipBoundsState.getExpandedBounds());
- mPipBoundsAlgorithm.getSnapAlgorithm().applySnapFraction(curBounds,
- toMovementBounds, mSavedSnapFraction);
- }
-
- if (prevBottom < toBottom) {
- // The movement bounds are expanding
- if (curBounds.top > prevBottom - mBottomOffsetBufferPx) {
- mMotionHelper.animateToOffset(curBounds, toBottom - curBounds.top);
- }
- } else if (prevBottom > toBottom) {
- // The movement bounds are shrinking
- if (curBounds.top > toBottom - mBottomOffsetBufferPx) {
- mMotionHelper.animateToOffset(curBounds, toBottom - curBounds.top);
- }
- }
- }
- }
-
// Update the movement bounds after doing the calculations based on the old movement bounds
// above
mPipBoundsState.setNormalMovementBounds(normalMovementBounds);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipActionsProvider.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipActionsProvider.java
index 11c2665..f1606f6 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipActionsProvider.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipActionsProvider.java
@@ -35,7 +35,7 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.R;
-import com.android.wm.shell.pip.PipMediaController;
+import com.android.wm.shell.common.pip.PipMediaController;
import com.android.wm.shell.pip.PipUtils;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipController.java
index e3544c6..5f5d8ad 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipController.java
@@ -48,11 +48,11 @@
import com.android.wm.shell.common.TaskStackListenerCallback;
import com.android.wm.shell.common.TaskStackListenerImpl;
import com.android.wm.shell.common.pip.PipAppOpsListener;
+import com.android.wm.shell.common.pip.PipMediaController;
import com.android.wm.shell.pip.PinnedStackListenerForwarder;
import com.android.wm.shell.pip.Pip;
import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipDisplayLayoutState;
-import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipParamsChangedForwarder;
import com.android.wm.shell.pip.PipTaskOrganizer;
import com.android.wm.shell.pip.PipTransitionController;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipNotificationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipNotificationController.java
index f22ee59..39c7a4b 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipNotificationController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipNotificationController.java
@@ -36,7 +36,7 @@
import com.android.internal.protolog.common.ProtoLog;
import com.android.internal.util.ImageUtils;
import com.android.wm.shell.R;
-import com.android.wm.shell.pip.PipMediaController;
+import com.android.wm.shell.common.pip.PipMediaController;
import com.android.wm.shell.pip.PipParamsChangedForwarder;
import com.android.wm.shell.pip.PipUtils;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipTaskOrganizer.java
index 4819f66..dbec607 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipTaskOrganizer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipTaskOrganizer.java
@@ -25,6 +25,7 @@
import com.android.wm.shell.common.DisplayController;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.SyncTransactionQueue;
+import com.android.wm.shell.common.pip.PipUiEventLogger;
import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipBoundsAlgorithm;
import com.android.wm.shell.pip.PipBoundsState;
@@ -35,7 +36,6 @@
import com.android.wm.shell.pip.PipTaskOrganizer;
import com.android.wm.shell.pip.PipTransitionController;
import com.android.wm.shell.pip.PipTransitionState;
-import com.android.wm.shell.pip.PipUiEventLogger;
import com.android.wm.shell.pip.PipUtils;
import com.android.wm.shell.splitscreen.SplitScreenController;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java
index f35eda6..ac142e9 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentTasksController.java
@@ -203,6 +203,17 @@
}
}
+ @Nullable
+ public SplitBounds getSplitBoundsForTaskId(int taskId) {
+ if (taskId == INVALID_TASK_ID) {
+ return null;
+ }
+
+ // We could do extra verification of requiring both taskIds of a pair and verifying that
+ // the same split bounds object is returned... but meh. Seems unnecessary.
+ return mTaskSplitBoundsMap.get(taskId);
+ }
+
@Override
public Context getContext() {
return mContext;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java
index a11d952..dc6dc79 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/recents/RecentsTransitionHandler.java
@@ -16,6 +16,7 @@
package com.android.wm.shell.recents;
+import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.view.WindowManager.TRANSIT_CHANGE;
@@ -23,6 +24,8 @@
import static android.view.WindowManager.TRANSIT_SLEEP;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
+import static com.android.wm.shell.util.SplitBounds.KEY_EXTRA_SPLIT_BOUNDS;
+
import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
@@ -69,6 +72,8 @@
private final Transitions mTransitions;
private final ShellExecutor mExecutor;
+ @Nullable
+ private final RecentTasksController mRecentTasksController;
private IApplicationThread mAnimApp = null;
private final ArrayList<RecentsController> mControllers = new ArrayList<>();
@@ -82,6 +87,7 @@
@Nullable RecentTasksController recentTasksController) {
mTransitions = transitions;
mExecutor = transitions.getMainExecutor();
+ mRecentTasksController = recentTasksController;
if (!Transitions.ENABLE_SHELL_TRANSITIONS) return;
if (recentTasksController == null) return;
shellInit.addInitCallback(() -> {
@@ -417,6 +423,7 @@
mLeashMap = new ArrayMap<>();
mKeyguardLocked = (info.getFlags() & TRANSIT_FLAG_KEYGUARD_LOCKED) != 0;
+ int closingSplitTaskId = INVALID_TASK_ID;
final ArrayList<RemoteAnimationTarget> apps = new ArrayList<>();
final ArrayList<RemoteAnimationTarget> wallpapers = new ArrayList<>();
TransitionUtil.LeafTaskFilter leafTaskFilter = new TransitionUtil.LeafTaskFilter();
@@ -443,6 +450,7 @@
apps.add(target);
if (TransitionUtil.isClosingType(change.getMode())) {
mPausingTasks.add(new TaskState(change, target.leash));
+ closingSplitTaskId = change.getTaskInfo().taskId;
if (taskInfo.topActivityType == ACTIVITY_TYPE_HOME) {
ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION,
" adding pausing leaf home taskId=%d", taskInfo.taskId);
@@ -500,13 +508,16 @@
}
}
t.apply();
+ Bundle b = new Bundle(1 /*capacity*/);
+ b.putParcelable(KEY_EXTRA_SPLIT_BOUNDS,
+ mRecentTasksController.getSplitBoundsForTaskId(closingSplitTaskId));
try {
ProtoLog.v(ShellProtoLogGroup.WM_SHELL_RECENTS_TRANSITION,
"[%d] RecentsController.start: calling onAnimationStart", mInstanceId);
mListener.onAnimationStart(this,
apps.toArray(new RemoteAnimationTarget[apps.size()]),
wallpapers.toArray(new RemoteAnimationTarget[wallpapers.size()]),
- new Rect(0, 0, 0, 0), new Rect());
+ new Rect(0, 0, 0, 0), new Rect(), b);
} catch (RemoteException e) {
Slog.e(TAG, "Error starting recents animation", e);
cancel("onAnimationStart() failed");
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/util/SplitBounds.java b/libs/WindowManager/Shell/src/com/android/wm/shell/util/SplitBounds.java
index f209521..0edcff4 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/util/SplitBounds.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/util/SplitBounds.java
@@ -26,6 +26,8 @@
* tasks/leashes/etc in Launcher
*/
public class SplitBounds implements Parcelable {
+ public static final String KEY_EXTRA_SPLIT_BOUNDS = "key_SplitBounds";
+
public final Rect leftTopBounds;
public final Rect rightBottomBounds;
/** This rect represents the actual gap between the two apps */
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
index 2be7a49..29fff03 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
@@ -71,6 +71,7 @@
import com.android.wm.shell.desktopmode.DesktopModeStatus;
import com.android.wm.shell.desktopmode.DesktopTasksController;
import com.android.wm.shell.freeform.FreeformTaskTransitionStarter;
+import com.android.wm.shell.splitscreen.SplitScreen;
import com.android.wm.shell.splitscreen.SplitScreenController;
import com.android.wm.shell.sysui.KeyguardChangeListener;
import com.android.wm.shell.sysui.ShellController;
@@ -200,6 +201,19 @@
@Override
public void setSplitScreenController(SplitScreenController splitScreenController) {
mSplitScreenController = splitScreenController;
+ mSplitScreenController.registerSplitScreenListener(new SplitScreen.SplitScreenListener() {
+ @Override
+ public void onTaskStageChanged(int taskId, int stage, boolean visible) {
+ if (visible) {
+ DesktopModeWindowDecoration decor = mWindowDecorByTaskId.get(taskId);
+ if (decor != null && DesktopModeStatus.isActive(mContext)
+ && decor.mTaskInfo.getWindowingMode() == WINDOWING_MODE_FREEFORM) {
+ mDesktopModeController.ifPresent(c -> c.setDesktopModeActive(false));
+ mDesktopTasksController.ifPresent(c -> c.moveToSplit(decor.mTaskInfo));
+ }
+ }
+ }
+ });
}
@Override
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipDragThenSnapTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipDragThenSnapTest.kt
index 42be818..43e7696 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipDragThenSnapTest.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipDragThenSnapTest.kt
@@ -17,7 +17,6 @@
package com.android.wm.shell.flicker.pip
import android.graphics.Rect
-import android.platform.test.annotations.Presubmit
import android.tools.common.Rotation
import android.tools.device.flicker.junit.FlickerParametersRunnerFactory
import android.tools.device.flicker.legacy.FlickerBuilder
@@ -82,8 +81,8 @@
/**
* Checks that the visible region area of [pipApp] moves to closest edge during the animation.
*/
- @Presubmit
@Test
+ @FlakyTest(bugId = 294993100)
fun pipLayerMovesToClosestEdge() {
flicker.assertLayers {
val pipLayerList = layers { pipApp.layerMatchesAnyOf(it) && it.isVisible }
@@ -97,6 +96,90 @@
}
}
+ // Overridden to remove @Presubmit annotation
+ @Test
+ @FlakyTest(bugId = 294993100)
+ override fun entireScreenCovered() {
+ super.entireScreenCovered()
+ }
+
+ // Overridden to remove @Presubmit annotation
+ @Test
+ @FlakyTest(bugId = 294993100)
+ override fun hasAtMostOnePipDismissOverlayWindow() {
+ super.hasAtMostOnePipDismissOverlayWindow()
+ }
+
+ // Overridden to remove @Presubmit annotation
+ @Test
+ @FlakyTest(bugId = 294993100)
+ override fun navBarLayerIsVisibleAtStartAndEnd() {
+ super.navBarLayerIsVisibleAtStartAndEnd()
+ }
+
+ // Overridden to remove @Presubmit annotation
+ @Test
+ @FlakyTest(bugId = 294993100)
+ override fun navBarLayerPositionAtStartAndEnd() {
+ super.navBarLayerPositionAtStartAndEnd()
+ }
+
+ // Overridden to remove @Presubmit annotation
+ @Test
+ @FlakyTest(bugId = 294993100)
+ override fun navBarWindowIsAlwaysVisible() {
+ super.navBarWindowIsAlwaysVisible()
+ }
+
+ // Overridden to remove @Presubmit annotation
+ @Test
+ @FlakyTest(bugId = 294993100)
+ override fun statusBarLayerIsVisibleAtStartAndEnd() {
+ super.statusBarLayerIsVisibleAtStartAndEnd()
+ }
+
+ // Overridden to remove @Presubmit annotation
+ @Test
+ @FlakyTest(bugId = 294993100)
+ override fun statusBarLayerPositionAtStartAndEnd() {
+ super.statusBarLayerPositionAtStartAndEnd()
+ }
+
+ // Overridden to remove @Presubmit annotation
+ @Test
+ @FlakyTest(bugId = 294993100)
+ override fun statusBarWindowIsAlwaysVisible() {
+ super.statusBarWindowIsAlwaysVisible()
+ }
+
+ // Overridden to remove @Presubmit annotation
+ @Test
+ @FlakyTest(bugId = 294993100)
+ override fun visibleLayersShownMoreThanOneConsecutiveEntry() {
+ super.visibleLayersShownMoreThanOneConsecutiveEntry()
+ }
+
+ // Overridden to remove @Presubmit annotation
+ @Test
+ @FlakyTest(bugId = 294993100)
+ override fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
+ super.visibleWindowsShownMoreThanOneConsecutiveEntry()
+ }
+
+ // Overridden to remove @Presubmit annotation
+ @Test
+ @FlakyTest(bugId = 294993100)
+ override fun taskBarLayerIsVisibleAtStartAndEnd() {
+ super.taskBarLayerIsVisibleAtStartAndEnd()
+ }
+
+ // Overridden to remove @Presubmit annotation
+ @Test
+ @FlakyTest(bugId = 294993100)
+ override fun taskBarWindowIsAlwaysVisible() {
+ super.taskBarWindowIsAlwaysVisible()
+ }
+
companion object {
/**
* Creates the test configurations.
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipTransition.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipTransition.kt
index 096af39..2008d01 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipTransition.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipTransition.kt
@@ -92,7 +92,7 @@
@Presubmit
@Test
- fun hasAtMostOnePipDismissOverlayWindow() {
+ open fun hasAtMostOnePipDismissOverlayWindow() {
val matcher = ComponentNameMatcher("", "pip-dismiss-overlay")
flicker.assertWm {
val overlaysPerState =
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/Utils.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/Utils.kt
index 610cede..fa723e3 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/Utils.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/service/Utils.kt
@@ -23,6 +23,7 @@
import android.tools.common.NavBar
import android.tools.common.Rotation
import android.tools.device.apphelpers.MessagingAppHelper
+import android.tools.device.flicker.rules.ArtifactSaverRule
import android.tools.device.flicker.rules.ChangeDisplayOrientationRule
import android.tools.device.flicker.rules.LaunchAppRule
import android.tools.device.flicker.rules.RemoveAllTasksButHomeRule
@@ -33,9 +34,10 @@
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
fun testSetupRule(navigationMode: NavBar, rotation: Rotation): RuleChain {
- return RuleChain.outerRule(UnlockScreenRule())
+ return RuleChain.outerRule(ArtifactSaverRule())
+ .around(UnlockScreenRule())
.around(
- NavigationModeRule(navigationMode.value, /* changeNavigationModeAfterTest */ false)
+ NavigationModeRule(navigationMode.value, false)
)
.around(
LaunchAppRule(MessagingAppHelper(instrumentation), clearCacheAfterParsing = false)
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/CompatUIControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/CompatUIControllerTest.java
index a6501f0..efc69ebd 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/CompatUIControllerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/CompatUIControllerTest.java
@@ -58,6 +58,8 @@
import com.android.wm.shell.sysui.ShellInit;
import com.android.wm.shell.transition.Transitions;
+import dagger.Lazy;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -66,8 +68,6 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import dagger.Lazy;
-
/**
* Tests for {@link CompatUIController}.
*
@@ -82,21 +82,36 @@
private CompatUIController mController;
private ShellInit mShellInit;
- private @Mock ShellController mMockShellController;
- private @Mock DisplayController mMockDisplayController;
- private @Mock DisplayInsetsController mMockDisplayInsetsController;
- private @Mock DisplayLayout mMockDisplayLayout;
- private @Mock DisplayImeController mMockImeController;
- private @Mock ShellTaskOrganizer.TaskListener mMockTaskListener;
- private @Mock SyncTransactionQueue mMockSyncQueue;
- private @Mock ShellExecutor mMockExecutor;
- private @Mock Lazy<Transitions> mMockTransitionsLazy;
- private @Mock CompatUIWindowManager mMockCompatLayout;
- private @Mock LetterboxEduWindowManager mMockLetterboxEduLayout;
- private @Mock RestartDialogWindowManager mMockRestartDialogLayout;
- private @Mock DockStateReader mDockStateReader;
- private @Mock CompatUIConfiguration mCompatUIConfiguration;
- private @Mock CompatUIShellCommandHandler mCompatUIShellCommandHandler;
+ @Mock
+ private ShellController mMockShellController;
+ @Mock
+ private DisplayController mMockDisplayController;
+ @Mock
+ private DisplayInsetsController mMockDisplayInsetsController;
+ @Mock
+ private DisplayLayout mMockDisplayLayout;
+ @Mock
+ private DisplayImeController mMockImeController;
+ @Mock
+ private ShellTaskOrganizer.TaskListener mMockTaskListener;
+ @Mock
+ private SyncTransactionQueue mMockSyncQueue;
+ @Mock
+ private ShellExecutor mMockExecutor;
+ @Mock
+ private Lazy<Transitions> mMockTransitionsLazy;
+ @Mock
+ private CompatUIWindowManager mMockCompatLayout;
+ @Mock
+ private LetterboxEduWindowManager mMockLetterboxEduLayout;
+ @Mock
+ private RestartDialogWindowManager mMockRestartDialogLayout;
+ @Mock
+ private DockStateReader mDockStateReader;
+ @Mock
+ private CompatUIConfiguration mCompatUIConfiguration;
+ @Mock
+ private CompatUIShellCommandHandler mCompatUIShellCommandHandler;
@Captor
ArgumentCaptor<OnInsetsChangedListener> mOnInsetsChangedListenerCaptor;
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/CompatUILayoutTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/CompatUILayoutTest.java
index 5f294d5..3bce2b8 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/CompatUILayoutTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/CompatUILayoutTest.java
@@ -44,7 +44,7 @@
import com.android.wm.shell.ShellTestCase;
import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.SyncTransactionQueue;
-import com.android.wm.shell.compatui.CompatUIWindowManager.CompatUIHintsState;
+import com.android.wm.shell.compatui.CompatUIController.CompatUIHintsState;
import junit.framework.Assert;
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/CompatUIWindowManagerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/CompatUIWindowManagerTest.java
index 78c3cbd..4c837e6 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/CompatUIWindowManagerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/CompatUIWindowManagerTest.java
@@ -53,7 +53,7 @@
import com.android.wm.shell.ShellTestCase;
import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.SyncTransactionQueue;
-import com.android.wm.shell.compatui.CompatUIWindowManager.CompatUIHintsState;
+import com.android.wm.shell.compatui.CompatUIController.CompatUIHintsState;
import junit.framework.Assert;
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/ReachabilityEduWindowManagerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/ReachabilityEduWindowManagerTest.java
index 973a99c..a802f15a 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/ReachabilityEduWindowManagerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/ReachabilityEduWindowManagerTest.java
@@ -40,6 +40,8 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.function.BiConsumer;
+
/**
* Tests for {@link ReachabilityEduWindowManager}.
*
@@ -57,6 +59,8 @@
private CompatUIConfiguration mCompatUIConfiguration;
@Mock
private DisplayLayout mDisplayLayout;
+ @Mock
+ private BiConsumer<TaskInfo, ShellTaskOrganizer.TaskListener> mOnDismissCallback;
private TestShellExecutor mExecutor;
private TaskInfo mTaskInfo;
private ReachabilityEduWindowManager mWindowManager;
@@ -104,6 +108,7 @@
private ReachabilityEduWindowManager createReachabilityEduWindowManager(TaskInfo taskInfo) {
return new ReachabilityEduWindowManager(mContext, taskInfo, mSyncTransactionQueue,
- mTaskListener, mDisplayLayout, mCompatUIConfiguration, mExecutor);
+ mTaskListener, mDisplayLayout, mCompatUIConfiguration, mExecutor,
+ mOnDismissCallback);
}
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/UserAspectRatioSettingsLayoutTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/UserAspectRatioSettingsLayoutTest.java
new file mode 100644
index 0000000..1fee153
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/UserAspectRatioSettingsLayoutTest.java
@@ -0,0 +1,154 @@
+/*
+ * 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.wm.shell.compatui;
+
+import static android.app.TaskInfo.CAMERA_COMPAT_CONTROL_HIDDEN;
+
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
+
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.verify;
+
+import android.app.ActivityManager;
+import android.app.TaskInfo;
+import android.app.TaskInfo.CameraCompatControlState;
+import android.content.ComponentName;
+import android.testing.AndroidTestingRunner;
+import android.util.Pair;
+import android.view.LayoutInflater;
+import android.view.SurfaceControlViewHost;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
+
+import androidx.test.filters.SmallTest;
+
+import com.android.wm.shell.R;
+import com.android.wm.shell.ShellTaskOrganizer;
+import com.android.wm.shell.ShellTestCase;
+import com.android.wm.shell.TestShellExecutor;
+import com.android.wm.shell.common.DisplayLayout;
+import com.android.wm.shell.common.SyncTransactionQueue;
+
+import junit.framework.Assert;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import java.util.function.BiConsumer;
+
+/**
+ * Tests for {@link UserAspectRatioSettingsLayout}.
+ *
+ * Build/Install/Run:
+ * atest WMShellUnitTests:UserAspectRatioSettingsLayoutTest
+ */
+@RunWith(AndroidTestingRunner.class)
+@SmallTest
+public class UserAspectRatioSettingsLayoutTest extends ShellTestCase {
+
+ private static final int TASK_ID = 1;
+
+ @Mock
+ private SyncTransactionQueue mSyncTransactionQueue;
+ @Mock
+ private BiConsumer<TaskInfo, ShellTaskOrganizer.TaskListener>
+ mOnUserAspectRatioSettingsButtonClicked;
+ @Mock
+ private ShellTaskOrganizer.TaskListener mTaskListener;
+ @Mock
+ private SurfaceControlViewHost mViewHost;
+ @Captor
+ private ArgumentCaptor<ShellTaskOrganizer.TaskListener> mUserAspectRatioTaskListenerCaptor;
+ @Captor
+ private ArgumentCaptor<TaskInfo> mUserAspectRationTaskInfoCaptor;
+
+ private UserAspectRatioSettingsWindowManager mWindowManager;
+ private UserAspectRatioSettingsLayout mLayout;
+ private TaskInfo mTaskInfo;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ mTaskInfo = createTaskInfo(/* hasSizeCompat= */ false, CAMERA_COMPAT_CONTROL_HIDDEN);
+ mWindowManager = new UserAspectRatioSettingsWindowManager(mContext, mTaskInfo,
+ mSyncTransactionQueue, mTaskListener, new DisplayLayout(),
+ new CompatUIController.CompatUIHintsState(),
+ mOnUserAspectRatioSettingsButtonClicked, new TestShellExecutor());
+
+ mLayout = (UserAspectRatioSettingsLayout) LayoutInflater.from(mContext).inflate(
+ R.layout.user_aspect_ratio_settings_layout, null);
+ mLayout.inject(mWindowManager);
+
+ spyOn(mWindowManager);
+ spyOn(mLayout);
+ doReturn(mViewHost).when(mWindowManager).createSurfaceViewHost();
+ doReturn(mLayout).when(mWindowManager).inflateLayout();
+ }
+
+ @Test
+ public void testOnClickForUserAspectRatioSettingsButton() {
+ final ImageButton button = mLayout.findViewById(R.id.user_aspect_ratio_settings_button);
+ button.performClick();
+
+ verify(mWindowManager).onUserAspectRatioSettingsButtonClicked();
+ verify(mOnUserAspectRatioSettingsButtonClicked).accept(
+ mUserAspectRationTaskInfoCaptor.capture(),
+ mUserAspectRatioTaskListenerCaptor.capture());
+ final Pair<TaskInfo, ShellTaskOrganizer.TaskListener> result =
+ new Pair<>(mUserAspectRationTaskInfoCaptor.getValue(),
+ mUserAspectRatioTaskListenerCaptor.getValue());
+ Assert.assertEquals(mTaskInfo, result.first);
+ Assert.assertEquals(mTaskListener, result.second);
+ }
+
+ @Test
+ public void testOnLongClickForUserAspectRatioButton() {
+ doNothing().when(mWindowManager).onUserAspectRatioSettingsButtonLongClicked();
+
+ final ImageButton button = mLayout.findViewById(R.id.user_aspect_ratio_settings_button);
+ button.performLongClick();
+
+ verify(mWindowManager).onUserAspectRatioSettingsButtonLongClicked();
+ }
+
+ @Test
+ public void testOnClickForUserAspectRatioSettingsHint() {
+ mWindowManager.mHasUserAspectRatioSettingsButton = true;
+ mWindowManager.createLayout(/* canShow= */ true);
+ final LinearLayout sizeCompatHint = mLayout.findViewById(
+ R.id.user_aspect_ratio_settings_hint);
+ sizeCompatHint.performClick();
+
+ verify(mLayout).setUserAspectRatioSettingsHintVisibility(/* show= */ false);
+ }
+
+ private static TaskInfo createTaskInfo(boolean hasSizeCompat,
+ @CameraCompatControlState int cameraCompatControlState) {
+ ActivityManager.RunningTaskInfo taskInfo = new ActivityManager.RunningTaskInfo();
+ taskInfo.taskId = TASK_ID;
+ taskInfo.topActivityInSizeCompat = hasSizeCompat;
+ taskInfo.cameraCompatControlState = cameraCompatControlState;
+ taskInfo.realActivity = new ComponentName("com.mypackage.test", "TestActivity");
+ return taskInfo;
+ }
+}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/UserAspectRatioSettingsWindowManagerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/UserAspectRatioSettingsWindowManagerTest.java
new file mode 100644
index 0000000..b48538c
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/compatui/UserAspectRatioSettingsWindowManagerTest.java
@@ -0,0 +1,350 @@
+/*
+ * 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.wm.shell.compatui;
+
+import static android.view.WindowInsets.Type.navigationBars;
+
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.Mockito.clearInvocations;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+
+import android.app.ActivityManager;
+import android.app.TaskInfo;
+import android.content.ComponentName;
+import android.content.res.Configuration;
+import android.graphics.Rect;
+import android.testing.AndroidTestingRunner;
+import android.util.Pair;
+import android.view.DisplayInfo;
+import android.view.InsetsSource;
+import android.view.InsetsState;
+import android.view.SurfaceControl;
+import android.view.SurfaceControlViewHost;
+import android.view.View;
+
+import androidx.test.filters.SmallTest;
+
+import com.android.wm.shell.ShellTaskOrganizer;
+import com.android.wm.shell.ShellTestCase;
+import com.android.wm.shell.TestShellExecutor;
+import com.android.wm.shell.common.DisplayLayout;
+import com.android.wm.shell.common.SyncTransactionQueue;
+import com.android.wm.shell.compatui.CompatUIController.CompatUIHintsState;
+
+import junit.framework.Assert;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.function.BiConsumer;
+
+/**
+ * Tests for {@link UserAspectRatioSettingsWindowManager}.
+ *
+ * Build/Install/Run:
+ * atest WMShellUnitTests:UserAspectRatioSettingsWindowManagerTest
+ */
+@RunWith(AndroidTestingRunner.class)
+@SmallTest
+public class UserAspectRatioSettingsWindowManagerTest extends ShellTestCase {
+
+ private static final int TASK_ID = 1;
+
+ @Mock private SyncTransactionQueue mSyncTransactionQueue;
+ @Mock
+ private BiConsumer<TaskInfo, ShellTaskOrganizer.TaskListener>
+ mOnUserAspectRatioSettingsButtonClicked;
+ @Mock private ShellTaskOrganizer.TaskListener mTaskListener;
+ @Mock private UserAspectRatioSettingsLayout mLayout;
+ @Mock private SurfaceControlViewHost mViewHost;
+ @Captor
+ private ArgumentCaptor<ShellTaskOrganizer.TaskListener> mUserAspectRatioTaskListenerCaptor;
+ @Captor
+ private ArgumentCaptor<TaskInfo> mUserAspectRationTaskInfoCaptor;
+
+ private final Set<String> mPackageNameCache = new HashSet<>();
+
+ private UserAspectRatioSettingsWindowManager mWindowManager;
+ private TaskInfo mTaskInfo;
+
+ private TestShellExecutor mExecutor;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ mExecutor = new TestShellExecutor();
+ mTaskInfo = createTaskInfo(/* eligibleForUserAspectRatioButton= */
+ false, /* topActivityBoundsLetterboxed */ true);
+ mWindowManager = new UserAspectRatioSettingsWindowManager(mContext, mTaskInfo,
+ mSyncTransactionQueue, mTaskListener, new DisplayLayout(), new CompatUIHintsState(),
+ mOnUserAspectRatioSettingsButtonClicked, mExecutor);
+ spyOn(mWindowManager);
+ doReturn(mLayout).when(mWindowManager).inflateLayout();
+ doReturn(mViewHost).when(mWindowManager).createSurfaceViewHost();
+ }
+
+ @Test
+ public void testCreateUserAspectRatioButton() {
+ // Doesn't create layout if show is false.
+ mWindowManager.mHasUserAspectRatioSettingsButton = true;
+ assertTrue(mWindowManager.createLayout(/* canShow= */ false));
+
+ verify(mWindowManager, never()).inflateLayout();
+
+ // Doesn't create hint popup.
+ mWindowManager.mCompatUIHintsState.mHasShownUserAspectRatioSettingsButtonHint = true;
+ assertTrue(mWindowManager.createLayout(/* canShow= */ true));
+
+ verify(mWindowManager).inflateLayout();
+ mExecutor.flushAll();
+ verify(mLayout).setUserAspectRatioButtonVisibility(/* show= */ true);
+ verify(mLayout, never()).setUserAspectRatioSettingsHintVisibility(/* show= */ true);
+
+ // Creates hint popup.
+ clearInvocations(mWindowManager);
+ clearInvocations(mLayout);
+ mWindowManager.release();
+ mWindowManager.mCompatUIHintsState.mHasShownUserAspectRatioSettingsButtonHint = false;
+ assertTrue(mWindowManager.createLayout(/* canShow= */ true));
+
+ verify(mWindowManager).inflateLayout();
+ assertNotNull(mLayout);
+ mExecutor.flushAll();
+ verify(mLayout).setUserAspectRatioButtonVisibility(/* show= */ true);
+ verify(mLayout).setUserAspectRatioSettingsHintVisibility(/* show= */ true);
+ assertTrue(mWindowManager.mCompatUIHintsState.mHasShownUserAspectRatioSettingsButtonHint);
+
+ // Returns false and doesn't create layout if mHasUserAspectRatioSettingsButton is false.
+ clearInvocations(mWindowManager);
+ mWindowManager.release();
+ mWindowManager.mHasUserAspectRatioSettingsButton = false;
+ assertFalse(mWindowManager.createLayout(/* canShow= */ true));
+
+ verify(mWindowManager, never()).inflateLayout();
+ }
+
+ @Test
+ public void testRelease() {
+ mWindowManager.mHasUserAspectRatioSettingsButton = true;
+ mWindowManager.createLayout(/* canShow= */ true);
+
+ verify(mWindowManager).inflateLayout();
+
+ mWindowManager.release();
+
+ verify(mViewHost).release();
+ }
+
+ @Test
+ public void testUpdateCompatInfo() {
+ mWindowManager.mHasUserAspectRatioSettingsButton = true;
+ mWindowManager.createLayout(/* canShow= */ true);
+
+ // No diff
+ clearInvocations(mWindowManager);
+ TaskInfo taskInfo = createTaskInfo(/* eligibleForUserAspectRatioButton= */
+ true, /* topActivityBoundsLetterboxed */ true);
+ assertTrue(mWindowManager.updateCompatInfo(taskInfo, mTaskListener, /* canShow= */ true));
+
+ verify(mWindowManager, never()).updateSurfacePosition();
+ verify(mWindowManager, never()).release();
+ verify(mWindowManager, never()).createLayout(anyBoolean());
+
+
+ // Change task listener, recreate button.
+ clearInvocations(mWindowManager);
+ final ShellTaskOrganizer.TaskListener newTaskListener = mock(
+ ShellTaskOrganizer.TaskListener.class);
+ assertTrue(mWindowManager.updateCompatInfo(taskInfo, newTaskListener, /* canShow= */ true));
+
+ verify(mWindowManager).release();
+ verify(mWindowManager).createLayout(/* canShow= */ true);
+
+ // Change has eligibleForUserAspectRatioButton to false, dispose the component
+ clearInvocations(mWindowManager);
+ clearInvocations(mLayout);
+ taskInfo = createTaskInfo(/* eligibleForUserAspectRatioButton= */
+ false, /* topActivityBoundsLetterboxed */ true);
+ assertFalse(
+ mWindowManager.updateCompatInfo(taskInfo, newTaskListener, /* canShow= */ true));
+ verify(mWindowManager).release();
+ }
+
+ @Test
+ public void testUpdateCompatInfoLayoutNotInflatedYet() {
+ mWindowManager.mHasUserAspectRatioSettingsButton = true;
+ mWindowManager.createLayout(/* canShow= */ false);
+
+ verify(mWindowManager, never()).inflateLayout();
+
+ // Change topActivityInSizeCompat to false and pass canShow true, layout shouldn't be
+ // inflated
+ clearInvocations(mWindowManager);
+ TaskInfo taskInfo = createTaskInfo(/* eligibleForUserAspectRatioButton= */
+ false, /* topActivityBoundsLetterboxed */ true);
+ mWindowManager.updateCompatInfo(taskInfo, mTaskListener, /* canShow= */ true);
+
+ verify(mWindowManager, never()).inflateLayout();
+
+ // Change topActivityInSizeCompat to true and pass canShow true, layout should be inflated.
+ clearInvocations(mWindowManager);
+ taskInfo = createTaskInfo(/* eligibleForUserAspectRatioButton= */
+ true, /* topActivityBoundsLetterboxed */ true);
+ mWindowManager.updateCompatInfo(taskInfo, mTaskListener, /* canShow= */ true);
+
+ verify(mWindowManager).inflateLayout();
+ }
+
+ @Test
+ public void testUpdateDisplayLayout() {
+ final DisplayInfo displayInfo = new DisplayInfo();
+ displayInfo.logicalWidth = 1000;
+ displayInfo.logicalHeight = 2000;
+ final DisplayLayout displayLayout1 = new DisplayLayout(displayInfo,
+ mContext.getResources(), /* hasNavigationBar= */ false, /* hasStatusBar= */ false);
+
+ mWindowManager.updateDisplayLayout(displayLayout1);
+ verify(mWindowManager).updateSurfacePosition();
+
+ // No update if the display bounds is the same.
+ clearInvocations(mWindowManager);
+ final DisplayLayout displayLayout2 = new DisplayLayout(displayInfo,
+ mContext.getResources(), /* hasNavigationBar= */ false, /* hasStatusBar= */ false);
+ mWindowManager.updateDisplayLayout(displayLayout2);
+ verify(mWindowManager, never()).updateSurfacePosition();
+ }
+
+ @Test
+ public void testUpdateDisplayLayoutInsets() {
+ final DisplayInfo displayInfo = new DisplayInfo();
+ displayInfo.logicalWidth = 1000;
+ displayInfo.logicalHeight = 2000;
+ final DisplayLayout displayLayout = new DisplayLayout(displayInfo,
+ mContext.getResources(), /* hasNavigationBar= */ true, /* hasStatusBar= */ false);
+
+ mWindowManager.updateDisplayLayout(displayLayout);
+ verify(mWindowManager).updateSurfacePosition();
+
+ // Update if the insets change on the existing display layout
+ clearInvocations(mWindowManager);
+ InsetsState insetsState = new InsetsState();
+ insetsState.setDisplayFrame(new Rect(0, 0, 1000, 2000));
+ InsetsSource insetsSource = new InsetsSource(
+ InsetsSource.createId(null, 0, navigationBars()), navigationBars());
+ insetsSource.setFrame(0, 1800, 1000, 2000);
+ insetsState.addSource(insetsSource);
+ displayLayout.setInsets(mContext.getResources(), insetsState);
+ mWindowManager.updateDisplayLayout(displayLayout);
+ verify(mWindowManager).updateSurfacePosition();
+ }
+
+ @Test
+ public void testUpdateVisibility() {
+ // Create button if it is not created.
+ mWindowManager.removeLayout();
+ mWindowManager.mHasUserAspectRatioSettingsButton = true;
+ mWindowManager.updateVisibility(/* canShow= */ true);
+
+ verify(mWindowManager).createLayout(/* canShow= */ true);
+
+ // Hide button.
+ clearInvocations(mWindowManager);
+ doReturn(View.VISIBLE).when(mLayout).getVisibility();
+ mWindowManager.updateVisibility(/* canShow= */ false);
+
+ verify(mWindowManager, never()).createLayout(anyBoolean());
+ verify(mLayout).setVisibility(View.GONE);
+
+ // Show button.
+ doReturn(View.GONE).when(mLayout).getVisibility();
+ mWindowManager.updateVisibility(/* canShow= */ true);
+
+ verify(mWindowManager, never()).createLayout(anyBoolean());
+ verify(mLayout).setVisibility(View.VISIBLE);
+ }
+
+ @Test
+ public void testAttachToParentSurface() {
+ final SurfaceControl.Builder b = new SurfaceControl.Builder();
+ mWindowManager.attachToParentSurface(b);
+
+ verify(mTaskListener).attachChildSurfaceToTask(TASK_ID, b);
+ }
+
+ @Test
+ public void testOnUserAspectRatioButtonClicked() {
+ mWindowManager.onUserAspectRatioSettingsButtonClicked();
+
+ verify(mOnUserAspectRatioSettingsButtonClicked).accept(
+ mUserAspectRationTaskInfoCaptor.capture(),
+ mUserAspectRatioTaskListenerCaptor.capture());
+ final Pair<TaskInfo, ShellTaskOrganizer.TaskListener> result =
+ new Pair<>(mUserAspectRationTaskInfoCaptor.getValue(),
+ mUserAspectRatioTaskListenerCaptor.getValue());
+ Assert.assertEquals(mTaskInfo, result.first);
+ Assert.assertEquals(mTaskListener, result.second);
+ }
+
+ @Test
+ public void testOnUserAspectRatioButtonLongClicked_showHint() {
+ // Not create hint popup.
+ mWindowManager.mHasUserAspectRatioSettingsButton = true;
+ mWindowManager.mCompatUIHintsState.mHasShownUserAspectRatioSettingsButtonHint = true;
+ mWindowManager.createLayout(/* canShow= */ true);
+
+ verify(mWindowManager).inflateLayout();
+ verify(mLayout, never()).setUserAspectRatioSettingsHintVisibility(/* show= */ true);
+
+ mWindowManager.onUserAspectRatioSettingsButtonLongClicked();
+
+ verify(mLayout).setUserAspectRatioSettingsHintVisibility(/* show= */ true);
+ }
+
+ @Test
+ public void testWhenDockedStateHasChanged_needsToBeRecreated() {
+ ActivityManager.RunningTaskInfo newTaskInfo = new ActivityManager.RunningTaskInfo();
+ newTaskInfo.configuration.uiMode |= Configuration.UI_MODE_TYPE_DESK;
+
+ Assert.assertTrue(mWindowManager.needsToBeRecreated(newTaskInfo, mTaskListener));
+ }
+
+ private static TaskInfo createTaskInfo(boolean eligibleForUserAspectRatioButton,
+ boolean topActivityBoundsLetterboxed) {
+ ActivityManager.RunningTaskInfo taskInfo = new ActivityManager.RunningTaskInfo();
+ taskInfo.taskId = TASK_ID;
+ taskInfo.topActivityEligibleForUserAspectRatioButton = eligibleForUserAspectRatioButton;
+ taskInfo.topActivityBoundsLetterboxed = topActivityBoundsLetterboxed;
+ taskInfo.configuration.uiMode &= ~Configuration.UI_MODE_TYPE_DESK;
+ taskInfo.realActivity = new ComponentName("com.mypackage.test", "TestActivity");
+ return taskInfo;
+ }
+}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipTaskOrganizerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipTaskOrganizerTest.java
index 1e3fe42..248d665 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipTaskOrganizerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipTaskOrganizerTest.java
@@ -53,6 +53,7 @@
import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.common.pip.PhoneSizeSpecSource;
+import com.android.wm.shell.common.pip.PipUiEventLogger;
import com.android.wm.shell.common.pip.SizeSpecSource;
import com.android.wm.shell.pip.phone.PhonePipMenuController;
import com.android.wm.shell.splitscreen.SplitScreenController;
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java
index 0ae2908..911f5e1 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java
@@ -56,12 +56,12 @@
import com.android.wm.shell.common.TabletopModeController;
import com.android.wm.shell.common.TaskStackListenerImpl;
import com.android.wm.shell.common.pip.PipAppOpsListener;
+import com.android.wm.shell.common.pip.PipMediaController;
import com.android.wm.shell.onehanded.OneHandedController;
import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipBoundsAlgorithm;
import com.android.wm.shell.pip.PipBoundsState;
import com.android.wm.shell.pip.PipDisplayLayoutState;
-import com.android.wm.shell.pip.PipMediaController;
import com.android.wm.shell.pip.PipParamsChangedForwarder;
import com.android.wm.shell.pip.PipSnapAlgorithm;
import com.android.wm.shell.pip.PipTaskOrganizer;
@@ -76,7 +76,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
-import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import java.util.Optional;
@@ -329,21 +328,7 @@
}
@Test
- public void onKeepClearAreasChanged_featureDisabled_pipBoundsStateDoesntChange() {
- mPipController.setEnablePipKeepClearAlgorithm(false);
- final int displayId = 1;
- final Rect keepClearArea = new Rect(0, 0, 10, 10);
- when(mMockPipDisplayLayoutState.getDisplayId()).thenReturn(displayId);
-
- mPipController.mDisplaysChangedListener.onKeepClearAreasChanged(
- displayId, Set.of(keepClearArea), Set.of());
-
- verify(mMockPipBoundsState, never()).setKeepClearAreas(Mockito.anySet(), Mockito.anySet());
- }
-
- @Test
- public void onKeepClearAreasChanged_featureEnabled_updatesPipBoundsState() {
- mPipController.setEnablePipKeepClearAlgorithm(true);
+ public void onKeepClearAreasChanged_updatesPipBoundsState() {
final int displayId = 1;
final Rect keepClearArea = new Rect(0, 0, 10, 10);
when(mMockPipDisplayLayoutState.getDisplayId()).thenReturn(displayId);
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipResizeGestureHandlerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipResizeGestureHandlerTest.java
index 689b5c5..12b4f3e 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipResizeGestureHandlerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipResizeGestureHandlerTest.java
@@ -37,6 +37,7 @@
import com.android.wm.shell.common.FloatingContentCoordinator;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.pip.PhoneSizeSpecSource;
+import com.android.wm.shell.common.pip.PipUiEventLogger;
import com.android.wm.shell.common.pip.SizeSpecSource;
import com.android.wm.shell.pip.PipBoundsAlgorithm;
import com.android.wm.shell.pip.PipBoundsState;
@@ -45,7 +46,6 @@
import com.android.wm.shell.pip.PipSnapAlgorithm;
import com.android.wm.shell.pip.PipTaskOrganizer;
import com.android.wm.shell.pip.PipTransitionController;
-import com.android.wm.shell.pip.PipUiEventLogger;
import org.junit.Before;
import org.junit.Test;
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipTouchHandlerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipTouchHandlerTest.java
index 852183c..314f195d 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipTouchHandlerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipTouchHandlerTest.java
@@ -18,7 +18,6 @@
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -34,6 +33,7 @@
import com.android.wm.shell.common.FloatingContentCoordinator;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.pip.PhoneSizeSpecSource;
+import com.android.wm.shell.common.pip.PipUiEventLogger;
import com.android.wm.shell.common.pip.SizeSpecSource;
import com.android.wm.shell.pip.PipBoundsAlgorithm;
import com.android.wm.shell.pip.PipBoundsState;
@@ -42,7 +42,6 @@
import com.android.wm.shell.pip.PipSnapAlgorithm;
import com.android.wm.shell.pip.PipTaskOrganizer;
import com.android.wm.shell.pip.PipTransitionController;
-import com.android.wm.shell.pip.PipUiEventLogger;
import com.android.wm.shell.sysui.ShellInit;
import org.junit.Before;
@@ -174,16 +173,4 @@
verify(mPipResizeGestureHandler, times(1))
.updateMaxSize(expectedMaxSize.getWidth(), expectedMaxSize.getHeight());
}
-
- @Test
- public void updateMovementBounds_withImeAdjustment_movesPip() {
- mPipTouchHandler.setEnablePipKeepClearAlgorithm(false);
- mFromImeAdjustment = true;
- mPipTouchHandler.onImeVisibilityChanged(true /* imeVisible */, mImeHeight);
-
- mPipTouchHandler.onMovementBoundsChanged(mInsetBounds, mPipBounds, mCurBounds,
- mFromImeAdjustment, mFromShelfAdjustment, mDisplayRotation);
-
- verify(mMotionHelper, times(1)).animateToOffset(any(), anyInt());
- }
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/tv/TvPipActionProviderTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/tv/TvPipActionProviderTest.java
index ec84d7e..45f6c8c 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/tv/TvPipActionProviderTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/tv/TvPipActionProviderTest.java
@@ -38,7 +38,7 @@
import android.testing.TestableLooper;
import com.android.wm.shell.ShellTestCase;
-import com.android.wm.shell.pip.PipMediaController;
+import com.android.wm.shell.common.pip.PipMediaController;
import org.junit.Before;
import org.junit.Test;
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java
index 2c69522..9e9e1ca 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/RecentTasksControllerTest.java
@@ -17,6 +17,7 @@
package com.android.wm.shell.recents;
import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
+import static android.app.ActivityTaskManager.INVALID_TASK_ID;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
@@ -367,6 +368,37 @@
verify(mRecentTasksController).notifyRecentTasksChanged();
}
+ @Test
+ public void getNullSplitBoundsNonSplitTask() {
+ SplitBounds sb = mRecentTasksController.getSplitBoundsForTaskId(3);
+ assertNull("splitBounds should be null for non-split task", sb);
+ }
+
+ @Test
+ public void getNullSplitBoundsInvalidTask() {
+ SplitBounds sb = mRecentTasksController.getSplitBoundsForTaskId(INVALID_TASK_ID);
+ assertNull("splitBounds should be null for invalid taskID", sb);
+ }
+
+ @Test
+ public void getSplitBoundsForSplitTask() {
+ SplitBounds pair1Bounds = mock(SplitBounds.class);
+ SplitBounds pair2Bounds = mock(SplitBounds.class);
+
+ mRecentTasksController.addSplitPair(1, 2, pair1Bounds);
+ mRecentTasksController.addSplitPair(4, 3, pair2Bounds);
+
+ SplitBounds splitBounds2 = mRecentTasksController.getSplitBoundsForTaskId(2);
+ SplitBounds splitBounds1 = mRecentTasksController.getSplitBoundsForTaskId(1);
+ assertEquals("Different splitBounds for same pair", splitBounds1, splitBounds2);
+ assertEquals(splitBounds1, pair1Bounds);
+
+ SplitBounds splitBounds3 = mRecentTasksController.getSplitBoundsForTaskId(3);
+ SplitBounds splitBounds4 = mRecentTasksController.getSplitBoundsForTaskId(4);
+ assertEquals("Different splitBounds for same pair", splitBounds3, splitBounds4);
+ assertEquals(splitBounds4, pair2Bounds);
+ }
+
/**
* Helper to create a task with a given task id.
*/
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java
index 99a1ac6..a57a7bf 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java
@@ -99,6 +99,7 @@
import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.TransactionPool;
+import com.android.wm.shell.recents.RecentTasksController;
import com.android.wm.shell.recents.RecentsTransitionHandler;
import com.android.wm.shell.sysui.ShellController;
import com.android.wm.shell.sysui.ShellInit;
@@ -1061,7 +1062,8 @@
mTransactionPool, createTestDisplayController(), mMainExecutor,
mMainHandler, mAnimExecutor);
final RecentsTransitionHandler recentsHandler =
- new RecentsTransitionHandler(shellInit, transitions, null);
+ new RecentsTransitionHandler(shellInit, transitions,
+ mock(RecentTasksController.class));
transitions.replaceDefaultHandlerForTest(mDefaultHandler);
shellInit.init();
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp
index fb2b571..795bb3c 100644
--- a/libs/androidfw/AssetManager.cpp
+++ b/libs/androidfw/AssetManager.cpp
@@ -91,7 +91,7 @@
path.appendPath(kResourceCache);
char buf[256]; // 256 chars should be enough for anyone...
- strncpy(buf, pkgPath.string(), 255);
+ strncpy(buf, pkgPath.c_str(), 255);
buf[255] = '\0';
char* filename = buf;
while (*filename && *filename == '/') {
@@ -183,15 +183,15 @@
if (kAppZipName) {
realPath.appendPath(kAppZipName);
}
- ap.type = ::getFileType(realPath.string());
+ ap.type = ::getFileType(realPath.c_str());
if (ap.type == kFileTypeRegular) {
ap.path = realPath;
} else {
ap.path = path;
- ap.type = ::getFileType(path.string());
+ ap.type = ::getFileType(path.c_str());
if (ap.type != kFileTypeDirectory && ap.type != kFileTypeRegular) {
ALOGW("Asset path %s is neither a directory nor file (type=%d).",
- path.string(), (int)ap.type);
+ path.c_str(), (int)ap.type);
return false;
}
}
@@ -207,7 +207,7 @@
}
ALOGV("In %p Asset %s path: %s", this,
- ap.type == kFileTypeDirectory ? "dir" : "zip", ap.path.string());
+ ap.type == kFileTypeDirectory ? "dir" : "zip", ap.path.c_str());
ap.isSystemAsset = isSystemAsset;
ssize_t apPos = mAssetPaths.add(ap);
@@ -248,7 +248,7 @@
Asset* idmap = NULL;
if ((idmap = openAssetFromFileLocked(idmapPath, Asset::ACCESS_BUFFER)) == NULL) {
- ALOGW("failed to open idmap file %s\n", idmapPath.string());
+ ALOGW("failed to open idmap file %s\n", idmapPath.c_str());
return false;
}
@@ -256,7 +256,7 @@
String8 overlayPath;
if (!ResTable::getIdmapInfo(idmap->getBuffer(false), idmap->getLength(),
NULL, NULL, NULL, &targetPath, &overlayPath)) {
- ALOGW("failed to read idmap file %s\n", idmapPath.string());
+ ALOGW("failed to read idmap file %s\n", idmapPath.c_str());
delete idmap;
return false;
}
@@ -264,29 +264,29 @@
if (overlayPath != packagePath) {
ALOGW("idmap file %s inconcistent: expected path %s does not match actual path %s\n",
- idmapPath.string(), packagePath.string(), overlayPath.string());
+ idmapPath.c_str(), packagePath.c_str(), overlayPath.c_str());
return false;
}
- if (access(targetPath.string(), R_OK) != 0) {
- ALOGW("failed to access file %s: %s\n", targetPath.string(), strerror(errno));
+ if (access(targetPath.c_str(), R_OK) != 0) {
+ ALOGW("failed to access file %s: %s\n", targetPath.c_str(), strerror(errno));
return false;
}
- if (access(idmapPath.string(), R_OK) != 0) {
- ALOGW("failed to access file %s: %s\n", idmapPath.string(), strerror(errno));
+ if (access(idmapPath.c_str(), R_OK) != 0) {
+ ALOGW("failed to access file %s: %s\n", idmapPath.c_str(), strerror(errno));
return false;
}
- if (access(overlayPath.string(), R_OK) != 0) {
- ALOGW("failed to access file %s: %s\n", overlayPath.string(), strerror(errno));
+ if (access(overlayPath.c_str(), R_OK) != 0) {
+ ALOGW("failed to access file %s: %s\n", overlayPath.c_str(), strerror(errno));
return false;
}
asset_path oap;
oap.path = overlayPath;
- oap.type = ::getFileType(overlayPath.string());
+ oap.type = ::getFileType(overlayPath.c_str());
oap.idmap = idmapPath;
#if 0
ALOGD("Overlay added: targetPath=%s overlayPath=%s idmapPath=%s\n",
- targetPath.string(), overlayPath.string(), idmapPath.string());
+ targetPath.c_str(), overlayPath.c_str(), idmapPath.c_str());
#endif
mAssetPaths.add(oap);
*cookie = static_cast<int32_t>(mAssetPaths.size());
@@ -310,7 +310,7 @@
ap.type = kFileTypeRegular;
ap.assumeOwnership = assume_ownership;
- ALOGV("In %p Asset fd %d name: %s", this, fd, ap.path.string());
+ ALOGV("In %p Asset fd %d name: %s", this, fd, ap.path.c_str());
ssize_t apPos = mAssetPaths.add(ap);
@@ -343,11 +343,11 @@
assets[i] = openNonAssetInPathLocked("resources.arsc",
Asset::ACCESS_BUFFER, ap);
if (assets[i] == NULL) {
- ALOGW("failed to find resources.arsc in %s\n", ap.path.string());
+ ALOGW("failed to find resources.arsc in %s\n", ap.path.c_str());
goto exit;
}
if (tables[i].add(assets[i]) != NO_ERROR) {
- ALOGW("failed to add %s to resource table", paths[i].string());
+ ALOGW("failed to add %s to resource table", paths[i].c_str());
goto exit;
}
}
@@ -449,8 +449,8 @@
while (i > 0) {
i--;
ALOGV("Looking for asset '%s' in '%s'\n",
- assetName.string(), mAssetPaths.itemAt(i).path.string());
- Asset* pAsset = openNonAssetInPathLocked(assetName.string(), mode,
+ assetName.c_str(), mAssetPaths.itemAt(i).path.c_str());
+ Asset* pAsset = openNonAssetInPathLocked(assetName.c_str(), mode,
mAssetPaths.editItemAt(i));
if (pAsset != NULL) {
return pAsset != kExcludedAsset ? pAsset : NULL;
@@ -478,7 +478,7 @@
size_t i = mAssetPaths.size();
while (i > 0) {
i--;
- ALOGV("Looking for non-asset '%s' in '%s'\n", fileName, mAssetPaths.itemAt(i).path.string());
+ ALOGV("Looking for non-asset '%s' in '%s'\n", fileName, mAssetPaths.itemAt(i).path.c_str());
Asset* pAsset = openNonAssetInPathLocked(
fileName, mode, mAssetPaths.editItemAt(i));
if (pAsset != NULL) {
@@ -500,7 +500,7 @@
if (which < mAssetPaths.size()) {
ALOGV("Looking for non-asset '%s' in '%s'\n", fileName,
- mAssetPaths.itemAt(which).path.string());
+ mAssetPaths.itemAt(which).path.c_str());
Asset* pAsset = openNonAssetInPathLocked(
fileName, mode, mAssetPaths.editItemAt(which));
if (pAsset != NULL) {
@@ -546,10 +546,10 @@
ResTable* sharedRes = NULL;
bool shared = true;
bool onlyEmptyResources = true;
- ATRACE_NAME(ap.path.string());
+ ATRACE_NAME(ap.path.c_str());
Asset* idmap = openIdmapLocked(ap);
size_t nextEntryIdx = mResources->getTableCount();
- ALOGV("Looking for resource asset in '%s'\n", ap.path.string());
+ ALOGV("Looking for resource asset in '%s'\n", ap.path.c_str());
if (ap.type != kFileTypeDirectory && ap.rawFd < 0) {
if (nextEntryIdx == 0) {
// The first item is typically the framework resources,
@@ -565,7 +565,7 @@
ass = const_cast<AssetManager*>(this)->
mZipSet.getZipResourceTableAsset(ap.path);
if (ass == NULL) {
- ALOGV("loading resource table %s\n", ap.path.string());
+ ALOGV("loading resource table %s\n", ap.path.c_str());
ass = const_cast<AssetManager*>(this)->
openNonAssetInPathLocked("resources.arsc",
Asset::ACCESS_BUFFER,
@@ -580,7 +580,7 @@
// If this is the first resource table in the asset
// manager, then we are going to cache it so that we
// can quickly copy it out for others.
- ALOGV("Creating shared resources for %s", ap.path.string());
+ ALOGV("Creating shared resources for %s", ap.path.c_str());
sharedRes = new ResTable();
sharedRes->add(ass, idmap, nextEntryIdx + 1, false);
#ifdef __ANDROID__
@@ -589,14 +589,14 @@
String8 overlaysListPath(data);
overlaysListPath.appendPath(kResourceCache);
overlaysListPath.appendPath("overlays.list");
- addSystemOverlays(overlaysListPath.string(), ap.path, sharedRes, nextEntryIdx);
+ addSystemOverlays(overlaysListPath.c_str(), ap.path, sharedRes, nextEntryIdx);
#endif
sharedRes = const_cast<AssetManager*>(this)->
mZipSet.setZipResourceTable(ap.path, sharedRes);
}
}
} else {
- ALOGV("loading resource table %s\n", ap.path.string());
+ ALOGV("loading resource table %s\n", ap.path.c_str());
ass = const_cast<AssetManager*>(this)->
openNonAssetInPathLocked("resources.arsc",
Asset::ACCESS_BUFFER,
@@ -607,10 +607,10 @@
if ((ass != NULL || sharedRes != NULL) && ass != kExcludedAsset) {
ALOGV("Installing resource asset %p in to table %p\n", ass, mResources);
if (sharedRes != NULL) {
- ALOGV("Copying existing resources for %s", ap.path.string());
+ ALOGV("Copying existing resources for %s", ap.path.c_str());
mResources->add(sharedRes, ap.isSystemAsset);
} else {
- ALOGV("Parsing resources for %s", ap.path.string());
+ ALOGV("Parsing resources for %s", ap.path.c_str());
mResources->add(ass, idmap, nextEntryIdx + 1, !shared, appAsLib, ap.isSystemAsset);
}
onlyEmptyResources = false;
@@ -692,9 +692,9 @@
ass = const_cast<AssetManager*>(this)->
openAssetFromFileLocked(ap.idmap, Asset::ACCESS_BUFFER);
if (ass) {
- ALOGV("loading idmap %s\n", ap.idmap.string());
+ ALOGV("loading idmap %s\n", ap.idmap.c_str());
} else {
- ALOGW("failed to load idmap %s\n", ap.idmap.string());
+ ALOGW("failed to load idmap %s\n", ap.idmap.c_str());
}
}
return ass;
@@ -812,7 +812,7 @@
ZipFileRO* pZip = getZipFileLocked(ap);
if (pZip != NULL) {
ALOGV("GOT zip, checking NA '%s'", (const char*) path);
- ZipEntryRO entry = pZip->findEntryByName(path.string());
+ ZipEntryRO entry = pZip->findEntryByName(path.c_str());
if (entry != NULL) {
ALOGV("FOUND NA in Zip file for %s", (const char*) path);
pAsset = openAssetFromZipLocked(pZip, entry, mode, path);
@@ -823,7 +823,7 @@
if (pAsset != NULL) {
/* create a "source" name, for debug/display */
pAsset->setAssetSource(
- createZipSourceNameLocked(ZipSet::getPathName(ap.path.string()), String8(""),
+ createZipSourceNameLocked(ZipSet::getPathName(ap.path.c_str()), String8(""),
String8(fileName)));
}
}
@@ -870,7 +870,7 @@
}
if (ap.rawFd < 0) {
- ALOGV("getZipFileLocked: Creating new zip from path %s", ap.path.string());
+ ALOGV("getZipFileLocked: Creating new zip from path %s", ap.path.c_str());
ap.zip = mZipSet.getSharedZip(ap.path);
} else {
ALOGV("getZipFileLocked: Creating new zip from fd %d", ap.rawFd);
@@ -897,12 +897,12 @@
{
Asset* pAsset = NULL;
- if (strcasecmp(pathName.getPathExtension().string(), ".gz") == 0) {
+ if (strcasecmp(pathName.getPathExtension().c_str(), ".gz") == 0) {
//printf("TRYING '%s'\n", (const char*) pathName);
- pAsset = Asset::createFromCompressedFile(pathName.string(), mode);
+ pAsset = Asset::createFromCompressedFile(pathName.c_str(), mode);
} else {
//printf("TRYING '%s'\n", (const char*) pathName);
- pAsset = Asset::createFromFile(pathName.string(), mode);
+ pAsset = Asset::createFromFile(pathName.c_str(), mode);
}
return pAsset;
@@ -940,12 +940,12 @@
if (method == ZipFileRO::kCompressStored) {
pAsset = Asset::createFromUncompressedMap(std::move(*dataMap), mode);
- ALOGV("Opened uncompressed entry %s in zip %s mode %d: %p", entryName.string(),
+ ALOGV("Opened uncompressed entry %s in zip %s mode %d: %p", entryName.c_str(),
dataMap->file_name(), mode, pAsset.get());
} else {
pAsset = Asset::createFromCompressedMap(std::move(*dataMap),
static_cast<size_t>(uncompressedLen), mode);
- ALOGV("Opened compressed entry %s in zip %s mode %d: %p", entryName.string(),
+ ALOGV("Opened compressed entry %s in zip %s mode %d: %p", entryName.c_str(),
dataMap->file_name(), mode, pAsset.get());
}
if (pAsset == NULL) {
@@ -993,10 +993,10 @@
i--;
const asset_path& ap = mAssetPaths.itemAt(i);
if (ap.type == kFileTypeRegular) {
- ALOGV("Adding directory %s from zip %s", dirName, ap.path.string());
+ ALOGV("Adding directory %s from zip %s", dirName, ap.path.c_str());
scanAndMergeZipLocked(pMergedInfo, ap, kAssetsRoot, dirName);
} else {
- ALOGV("Adding directory %s from dir %s", dirName, ap.path.string());
+ ALOGV("Adding directory %s from dir %s", dirName, ap.path.c_str());
scanAndMergeDirLocked(pMergedInfo, ap, kAssetsRoot, dirName);
}
}
@@ -1042,10 +1042,10 @@
if (which < mAssetPaths.size()) {
const asset_path& ap = mAssetPaths.itemAt(which);
if (ap.type == kFileTypeRegular) {
- ALOGV("Adding directory %s from zip %s", dirName, ap.path.string());
+ ALOGV("Adding directory %s from zip %s", dirName, ap.path.c_str());
scanAndMergeZipLocked(pMergedInfo, ap, NULL, dirName);
} else {
- ALOGV("Adding directory %s from dir %s", dirName, ap.path.string());
+ ALOGV("Adding directory %s from dir %s", dirName, ap.path.c_str());
scanAndMergeDirLocked(pMergedInfo, ap, NULL, dirName);
}
}
@@ -1075,7 +1075,7 @@
{
assert(pMergedInfo != NULL);
- //printf("scanAndMergeDir: %s %s %s\n", ap.path.string(), rootDir, dirName);
+ //printf("scanAndMergeDir: %s %s %s\n", ap.path.c_str(), rootDir, dirName);
String8 path = createPathNameLocked(ap, rootDir);
if (dirName[0] != '\0')
@@ -1100,7 +1100,7 @@
const char* name;
int nameLen;
- name = pContents->itemAt(i).getFileName().string();
+ name = pContents->itemAt(i).getFileName().c_str();
nameLen = strlen(name);
if (nameLen > exclExtLen &&
strcmp(name + (nameLen - exclExtLen), kExcludeExtension) == 0)
@@ -1111,8 +1111,8 @@
matchIdx = AssetDir::FileInfo::findEntry(pMergedInfo, match);
if (matchIdx > 0) {
ALOGV("Excluding '%s' [%s]\n",
- pMergedInfo->itemAt(matchIdx).getFileName().string(),
- pMergedInfo->itemAt(matchIdx).getSourceName().string());
+ pMergedInfo->itemAt(matchIdx).getFileName().c_str(),
+ pMergedInfo->itemAt(matchIdx).getSourceName().c_str());
pMergedInfo->removeAt(matchIdx);
} else {
//printf("+++ no match on '%s'\n", (const char*) match);
@@ -1150,9 +1150,9 @@
struct dirent* entry;
FileType fileType;
- ALOGV("Scanning dir '%s'\n", path.string());
+ ALOGV("Scanning dir '%s'\n", path.c_str());
- dir = opendir(path.string());
+ dir = opendir(path.c_str());
if (dir == NULL)
return NULL;
@@ -1176,7 +1176,7 @@
fileType = kFileTypeUnknown;
#else
// stat the file
- fileType = ::getFileType(path.appendPathCopy(entry->d_name).string());
+ fileType = ::getFileType(path.appendPathCopy(entry->d_name).c_str());
#endif
if (fileType != kFileTypeRegular && fileType != kFileTypeDirectory)
@@ -1184,7 +1184,7 @@
AssetDir::FileInfo info;
info.set(String8(entry->d_name), fileType);
- if (strcasecmp(info.getFileName().getPathExtension().string(), ".gz") == 0)
+ if (strcasecmp(info.getFileName().getPathExtension().c_str(), ".gz") == 0)
info.setFileName(info.getFileName().getBasePath());
info.setSourceName(path.appendPathCopy(info.getFileName()));
pContents->add(info);
@@ -1212,11 +1212,11 @@
pZip = mZipSet.getZip(ap.path);
if (pZip == NULL) {
- ALOGW("Failure opening zip %s\n", ap.path.string());
+ ALOGW("Failure opening zip %s\n", ap.path.c_str());
return false;
}
- zipName = ZipSet::getPathName(ap.path.string());
+ zipName = ZipSet::getPathName(ap.path.c_str());
/* convert "sounds" to "rootDir/sounds" */
if (rootDir != NULL) dirName = rootDir;
@@ -1240,7 +1240,7 @@
*/
int dirNameLen = dirName.length();
void *iterationCookie;
- if (!pZip->startIteration(&iterationCookie, dirName.string(), NULL)) {
+ if (!pZip->startIteration(&iterationCookie, dirName.c_str(), NULL)) {
ALOGW("ZipFileRO::startIteration returned false");
return false;
}
@@ -1254,7 +1254,7 @@
ALOGE("ARGH: name too long?\n");
continue;
}
- //printf("Comparing %s in %s?\n", nameBuf, dirName.string());
+ //printf("Comparing %s in %s?\n", nameBuf, dirName.c_str());
if (dirNameLen == 0 || nameBuf[dirNameLen] == '/')
{
const char* cp;
@@ -1275,7 +1275,7 @@
createZipSourceNameLocked(zipName, dirName, info.getFileName()));
contents.add(info);
- //printf("FOUND: file '%s'\n", info.getFileName().string());
+ //printf("FOUND: file '%s'\n", info.getFileName().c_str());
} else {
/* this is a subdir; add it if we don't already have it*/
String8 subdirName(cp, nextSlash - cp);
@@ -1291,7 +1291,7 @@
dirs.add(subdirName);
}
- //printf("FOUND: dir '%s'\n", subdirName.string());
+ //printf("FOUND: dir '%s'\n", subdirName.c_str());
}
}
}
@@ -1427,10 +1427,10 @@
if (kIsDebug) {
ALOGI("Creating SharedZip %p %s\n", this, (const char*)mPath);
}
- ALOGV("+++ opening zip '%s'\n", mPath.string());
- mZipFile = ZipFileRO::open(mPath.string());
+ ALOGV("+++ opening zip '%s'\n", mPath.c_str());
+ mZipFile = ZipFileRO::open(mPath.c_str());
if (mZipFile == NULL) {
- ALOGD("failed to open Zip archive '%s'\n", mPath.string());
+ ALOGD("failed to open Zip archive '%s'\n", mPath.c_str());
}
}
@@ -1441,11 +1441,11 @@
if (kIsDebug) {
ALOGI("Creating SharedZip %p fd=%d %s\n", this, fd, (const char*)mPath);
}
- ALOGV("+++ opening zip fd=%d '%s'\n", fd, mPath.string());
- mZipFile = ZipFileRO::openFd(fd, mPath.string());
+ ALOGV("+++ opening zip fd=%d '%s'\n", fd, mPath.c_str());
+ mZipFile = ZipFileRO::openFd(fd, mPath.c_str());
if (mZipFile == NULL) {
::close(fd);
- ALOGD("failed to open Zip archive fd=%d '%s'\n", fd, mPath.string());
+ ALOGD("failed to open Zip archive fd=%d '%s'\n", fd, mPath.c_str());
}
}
@@ -1520,7 +1520,7 @@
bool AssetManager::SharedZip::isUpToDate()
{
- time_t modWhen = getFileModDate(mPath.string());
+ time_t modWhen = getFileModDate(mPath.c_str());
return mModWhen == modWhen;
}
@@ -1551,7 +1551,7 @@
}
if (mZipFile != NULL) {
delete mZipFile;
- ALOGV("Closed '%s'\n", mPath.string());
+ ALOGV("Closed '%s'\n", mPath.c_str());
}
}
diff --git a/libs/androidfw/BackupData.cpp b/libs/androidfw/BackupData.cpp
index 76a430e..fec0e77 100644
--- a/libs/androidfw/BackupData.cpp
+++ b/libs/androidfw/BackupData.cpp
@@ -106,8 +106,8 @@
k = key;
}
if (kIsDebug) {
- ALOGD("Writing header: prefix='%s' key='%s' dataSize=%zu", m_keyPrefix.string(),
- key.string(), dataSize);
+ ALOGD("Writing header: prefix='%s' key='%s' dataSize=%zu", m_keyPrefix.c_str(),
+ key.c_str(), dataSize);
}
entity_header_v1 header;
@@ -128,7 +128,7 @@
m_pos += amt;
if (kIsDebug) ALOGI("writing entity header key, %zd bytes", keyLen+1);
- amt = write(m_fd, k.string(), keyLen+1);
+ amt = write(m_fd, k.c_str(), keyLen+1);
if (amt != keyLen+1) {
m_status = errno;
return m_status;
diff --git a/libs/androidfw/BackupHelpers.cpp b/libs/androidfw/BackupHelpers.cpp
index e80e948..3582609 100644
--- a/libs/androidfw/BackupHelpers.cpp
+++ b/libs/androidfw/BackupHelpers.cpp
@@ -179,7 +179,7 @@
}
// filename is not NULL terminated, but it is padded
- amt = write(fd, name.string(), nameLen);
+ amt = write(fd, name.c_str(), nameLen);
if (amt != nameLen) {
ALOGW("write_snapshot_file error writing filename %s", strerror(errno));
return 1;
@@ -203,7 +203,7 @@
static int
write_delete_file(BackupDataWriter* dataStream, const String8& key)
{
- LOGP("write_delete_file %s\n", key.string());
+ LOGP("write_delete_file %s\n", key.c_str());
return dataStream->WriteEntityHeader(key, -1);
}
@@ -211,7 +211,7 @@
write_update_file(BackupDataWriter* dataStream, int fd, int mode, const String8& key,
char const* realFilename)
{
- LOGP("write_update_file %s (%s) : mode 0%o\n", realFilename, key.string(), mode);
+ LOGP("write_update_file %s (%s) : mode 0%o\n", realFilename, key.c_str(), mode);
const int bufsize = 4*1024;
int err;
@@ -365,7 +365,7 @@
r.s.size = st.st_size;
if (newSnapshot.indexOfKey(key) >= 0) {
- LOGP("back_up_files key already in use '%s'", key.string());
+ LOGP("back_up_files key already in use '%s'", key.c_str());
return -1;
}
@@ -390,30 +390,30 @@
int cmp = p.compare(q);
if (cmp < 0) {
// file present in oldSnapshot, but not present in newSnapshot
- LOGP("file removed: %s", p.string());
+ LOGP("file removed: %s", p.c_str());
write_delete_file(dataStream, p);
n++;
} else if (cmp > 0) {
// file added
- LOGP("file added: %s crc=0x%08x", g.file.string(), g.s.crc32);
- write_update_file(dataStream, q, g.file.string());
+ LOGP("file added: %s crc=0x%08x", g.file.c_str(), g.s.crc32);
+ write_update_file(dataStream, q, g.file.c_str());
m++;
} else {
// same file exists in both old and new; check whether to update
const FileState& f = oldSnapshot.valueAt(n);
- LOGP("%s", q.string());
+ LOGP("%s", q.c_str());
LOGP(" old: modTime=%d,%d mode=%04o size=%-3d crc32=0x%08x",
f.modTime_sec, f.modTime_nsec, f.mode, f.size, f.crc32);
LOGP(" new: modTime=%d,%d mode=%04o size=%-3d crc32=0x%08x",
g.s.modTime_sec, g.s.modTime_nsec, g.s.mode, g.s.size, g.s.crc32);
if (f.modTime_sec != g.s.modTime_sec || f.modTime_nsec != g.s.modTime_nsec
|| f.mode != g.s.mode || f.size != g.s.size || f.crc32 != g.s.crc32) {
- int fd = open(g.file.string(), O_RDONLY);
+ int fd = open(g.file.c_str(), O_RDONLY);
if (fd < 0) {
- ALOGE("Unable to read file for backup: %s", g.file.string());
+ ALOGE("Unable to read file for backup: %s", g.file.c_str());
} else {
- write_update_file(dataStream, fd, g.s.mode, p, g.file.string());
+ write_update_file(dataStream, fd, g.s.mode, p, g.file.c_str());
close(fd);
}
}
@@ -432,7 +432,7 @@
while (m<M) {
const String8& q = newSnapshot.keyAt(m);
FileRec& g = newSnapshot.editValueAt(m);
- write_update_file(dataStream, q, g.file.string());
+ write_update_file(dataStream, q, g.file.c_str());
m++;
}
@@ -483,7 +483,7 @@
BackupDataWriter* writer)
{
// In the output stream everything is stored relative to the root
- const char* relstart = filepath.string() + rootpath.length();
+ const char* relstart = filepath.c_str() + rootpath.length();
if (*relstart == '/') relstart++; // won't be true when path == rootpath
String8 relpath(relstart);
@@ -514,9 +514,9 @@
int err = 0;
struct stat64 s;
- if (lstat64(filepath.string(), &s) != 0) {
+ if (lstat64(filepath.c_str(), &s) != 0) {
err = errno;
- ALOGE("Error %d (%s) from lstat64(%s)", err, strerror(err), filepath.string());
+ ALOGE("Error %d (%s) from lstat64(%s)", err, strerror(err), filepath.c_str());
return err;
}
@@ -541,10 +541,10 @@
// !!! TODO: use mmap when possible to avoid churning the buffer cache
// !!! TODO: this will break with symlinks; need to use readlink(2)
- int fd = open(filepath.string(), O_RDONLY);
+ int fd = open(filepath.c_str(), O_RDONLY);
if (fd < 0) {
err = errno;
- ALOGE("Error %d (%s) from open(%s)", err, strerror(err), filepath.string());
+ ALOGE("Error %d (%s) from open(%s)", err, strerror(err), filepath.c_str());
return err;
}
@@ -592,7 +592,7 @@
} else if (S_ISREG(s.st_mode)) {
type = '0'; // tar magic: '0' == normal file
} else {
- ALOGW("Error: unknown file mode 0%o [%s]", s.st_mode, filepath.string());
+ ALOGW("Error: unknown file mode 0%o [%s]", s.st_mode, filepath.c_str());
goto cleanup;
}
buf[156] = type;
@@ -620,16 +620,16 @@
// [ 345 : 155 ] filename path prefix
// We only use the prefix area if fullname won't fit in the path
if (fullname.length() > 100) {
- strncpy(buf, relpath.string(), 100);
- strncpy(buf + 345, prefix.string(), 155);
+ strncpy(buf, relpath.c_str(), 100);
+ strncpy(buf + 345, prefix.c_str(), 155);
} else {
- strncpy(buf, fullname.string(), 100);
+ strncpy(buf, fullname.c_str(), 100);
}
}
// [ 329 : 8 ] and [ 337 : 8 ] devmajor/devminor, not used
- ALOGI(" Name: %s", fullname.string());
+ ALOGI(" Name: %s", fullname.c_str());
// If we're using a pax extended header, build & write that here; lengths are
// already preflighted
@@ -647,7 +647,7 @@
// fullname was generated above with the ustar paths
paxLen += write_pax_header_entry(paxData + paxLen, PAXDATA_SIZE - paxLen,
- "path", fullname.string());
+ "path", fullname.c_str());
// Now we know how big the pax data is
@@ -656,9 +656,9 @@
String8 leaf = fullname.getPathLeaf();
memset(paxHeader, 0, 100); // rewrite the name area
- snprintf(paxHeader, 100, "PaxHeader/%s", leaf.string());
+ snprintf(paxHeader, 100, "PaxHeader/%s", leaf.c_str());
memset(paxHeader + 345, 0, 155); // rewrite the prefix area
- strncpy(paxHeader + 345, prefix.string(), 155);
+ strncpy(paxHeader + 345, prefix.c_str(), 155);
paxHeader[156] = 'x'; // mark it as a pax extended header
@@ -691,12 +691,12 @@
ssize_t nRead = read(fd, buf, toRead);
if (nRead < 0) {
err = errno;
- ALOGE("Unable to read file [%s], err=%d (%s)", filepath.string(),
+ ALOGE("Unable to read file [%s], err=%d (%s)", filepath.c_str(),
err, strerror(err));
break;
} else if (nRead == 0) {
ALOGE("EOF but expect %lld more bytes in [%s]", (long long) toWrite,
- filepath.string());
+ filepath.c_str());
err = EIO;
break;
}
@@ -762,7 +762,7 @@
file_metadata_v1 metadata;
amt = in->ReadEntityData(&metadata, sizeof(metadata));
if (amt != sizeof(metadata)) {
- ALOGW("Could not read metadata for %s -- %ld / %s", filename.string(),
+ ALOGW("Could not read metadata for %s -- %ld / %s", filename.c_str(),
(long)amt, strerror(errno));
return EIO;
}
@@ -779,9 +779,9 @@
// Write the file and compute the crc
crc = crc32(0L, Z_NULL, 0);
- fd = open(filename.string(), O_CREAT|O_RDWR|O_TRUNC, mode);
+ fd = open(filename.c_str(), O_CREAT|O_RDWR|O_TRUNC, mode);
if (fd == -1) {
- ALOGW("Could not open file %s -- %s", filename.string(), strerror(errno));
+ ALOGW("Could not open file %s -- %s", filename.c_str(), strerror(errno));
return errno;
}
@@ -789,7 +789,7 @@
err = write(fd, buf, amt);
if (err != amt) {
close(fd);
- ALOGW("Error '%s' writing '%s'", strerror(errno), filename.string());
+ ALOGW("Error '%s' writing '%s'", strerror(errno), filename.c_str());
return errno;
}
crc = crc32(crc, (Bytef*)buf, amt);
@@ -798,9 +798,9 @@
close(fd);
// Record for the snapshot
- err = stat(filename.string(), &st);
+ err = stat(filename.c_str(), &st);
if (err != 0) {
- ALOGW("Error stating file that we just created %s", filename.string());
+ ALOGW("Error stating file that we just created %s", filename.c_str());
return errno;
}
@@ -1104,9 +1104,9 @@
fprintf(stderr, "state %zu expected={%d/%d, %04o, 0x%08x, 0x%08x, %3zu} '%s'\n"
" actual={%d/%d, %04o, 0x%08x, 0x%08x, %3d} '%s'\n", i,
states[i].modTime_sec, states[i].modTime_nsec, states[i].mode, states[i].size,
- states[i].crc32, name.length(), filenames[i].string(),
+ states[i].crc32, name.length(), filenames[i].c_str(),
state.modTime_sec, state.modTime_nsec, state.mode, state.size, state.crc32,
- state.nameLen, name.string());
+ state.nameLen, name.c_str());
matched = false;
}
}
@@ -1152,9 +1152,9 @@
return err;
}
- err = writer.WriteEntityData(text.string(), text.length()+1);
+ err = writer.WriteEntityData(text.c_str(), text.length()+1);
if (err != 0) {
- fprintf(stderr, "write failed for data '%s'\n", text.string());
+ fprintf(stderr, "write failed for data '%s'\n", text.c_str());
return errno;
}
@@ -1230,7 +1230,7 @@
goto finished;
}
if (string != str) {
- fprintf(stderr, "ReadEntityHeader expected key '%s' got '%s'\n", str, string.string());
+ fprintf(stderr, "ReadEntityHeader expected key '%s' got '%s'\n", str, string.c_str());
err = EINVAL;
goto finished;
}
diff --git a/libs/androidfw/ConfigDescription.cpp b/libs/androidfw/ConfigDescription.cpp
index cf2fd6f..e08030c 100644
--- a/libs/androidfw/ConfigDescription.cpp
+++ b/libs/androidfw/ConfigDescription.cpp
@@ -905,7 +905,7 @@
std::string ConfigDescription::to_string() const {
const String8 str = toString();
- return std::string(str.string(), str.size());
+ return std::string(str.c_str(), str.size());
}
bool ConfigDescription::Dominates(const ConfigDescription& o) const {
diff --git a/libs/androidfw/CursorWindow.cpp b/libs/androidfw/CursorWindow.cpp
index 2a6dc7b..5e645cc 100644
--- a/libs/androidfw/CursorWindow.cpp
+++ b/libs/androidfw/CursorWindow.cpp
@@ -84,7 +84,7 @@
String8 ashmemName("CursorWindow: ");
ashmemName.append(mName);
- ashmemFd = ashmem_create_region(ashmemName.string(), mInflatedSize);
+ ashmemFd = ashmem_create_region(ashmemName.c_str(), mInflatedSize);
if (ashmemFd < 0) {
PLOG(ERROR) << "Failed ashmem_create_region";
goto fail_silent;
diff --git a/libs/androidfw/OWNERS b/libs/androidfw/OWNERS
index 17f5164..436f107 100644
--- a/libs/androidfw/OWNERS
+++ b/libs/androidfw/OWNERS
@@ -4,4 +4,4 @@
patb@google.com
per-file CursorWindow.cpp=omakoto@google.com
-per-file LocaleDataTables.cpp=vichang@google.com,ngeoffray@google.com,nikitai@google.com
+per-file LocaleDataTables.cpp=vichang@google.com,ngeoffray@google.com
diff --git a/libs/androidfw/ObbFile.cpp b/libs/androidfw/ObbFile.cpp
index 95332a3..c6a9632 100644
--- a/libs/androidfw/ObbFile.cpp
+++ b/libs/androidfw/ObbFile.cpp
@@ -217,7 +217,7 @@
free(scanBuf);
#ifdef DEBUG
- ALOGI("Obb scan succeeded: packageName=%s, version=%d\n", mPackageName.string(), mVersion);
+ ALOGI("Obb scan succeeded: packageName=%s, version=%d\n", mPackageName.c_str(), mVersion);
#endif
return true;
@@ -288,7 +288,7 @@
return false;
}
- if (write(fd, mPackageName.string(), packageNameLen) != (ssize_t)packageNameLen) {
+ if (write(fd, mPackageName.c_str(), packageNameLen) != (ssize_t)packageNameLen) {
ALOGW("couldn't write package name: %s\n", strerror(errno));
return false;
}
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 5a63612..112058f 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -1042,7 +1042,7 @@
if ((mHeader->flags&ResStringPool_header::UTF8_FLAG) != 0) {
if (kDebugStringPoolNoisy) {
- ALOGI("indexOfString UTF-8: %s", String8(str, strLen).string());
+ ALOGI("indexOfString UTF-8: %s", String8(str, strLen).c_str());
}
// The string pool contains UTF 8 strings; we don't want to cause
@@ -1103,7 +1103,7 @@
ALOGI("Looking at %s, i=%d\n", s->data(), i);
}
if (str8Len == s->size()
- && memcmp(s->data(), str8.string(), str8Len) == 0) {
+ && memcmp(s->data(), str8.c_str(), str8Len) == 0) {
if (kDebugStringPoolNoisy) {
ALOGI("MATCH!");
}
@@ -1115,7 +1115,7 @@
} else {
if (kDebugStringPoolNoisy) {
- ALOGI("indexOfString UTF-16: %s", String8(str, strLen).string());
+ ALOGI("indexOfString UTF-16: %s", String8(str, strLen).c_str());
}
if (mHeader->flags&ResStringPool_header::SORTED_FLAG) {
@@ -1133,7 +1133,7 @@
int c = s.has_value() ? strzcmp16(s->data(), s->size(), str, strLen) : -1;
if (kDebugStringPoolNoisy) {
ALOGI("Looking at %s, cmp=%d, l/mid/h=%d/%d/%d\n",
- String8(s->data(), s->size()).string(), c, (int)l, (int)mid, (int)h);
+ String8(s->data(), s->size()).c_str(), c, (int)l, (int)mid, (int)h);
}
if (c == 0) {
if (kDebugStringPoolNoisy) {
@@ -1157,7 +1157,7 @@
return base::unexpected(s.error());
}
if (kDebugStringPoolNoisy) {
- ALOGI("Looking at %s, i=%d\n", String8(s->data(), s->size()).string(), i);
+ ALOGI("Looking at %s, i=%d\n", String8(s->data(), s->size()).c_str(), i);
}
if (s.has_value() && strLen == s->size() &&
strzcmp16(s->data(), s->size(), str, strLen) == 0) {
@@ -1525,8 +1525,8 @@
{
String16 nsStr(ns != NULL ? ns : "");
String16 attrStr(attr);
- return indexOfAttribute(ns ? nsStr.string() : NULL, ns ? nsStr.size() : 0,
- attrStr.string(), attrStr.size());
+ return indexOfAttribute(ns ? nsStr.c_str() : NULL, ns ? nsStr.size() : 0,
+ attrStr.c_str(), attrStr.size());
}
ssize_t ResXMLParser::indexOfAttribute(const char16_t* ns, size_t nsLen,
@@ -1544,8 +1544,8 @@
}
attr8 = String8(attr, attrLen);
if (kDebugStringPoolNoisy) {
- ALOGI("indexOfAttribute UTF8 %s (%zu) / %s (%zu)", ns8.string(), nsLen,
- attr8.string(), attrLen);
+ ALOGI("indexOfAttribute UTF8 %s (%zu) / %s (%zu)", ns8.c_str(), nsLen,
+ attr8.c_str(), attrLen);
}
for (size_t i=0; i<N; i++) {
size_t curNsLen = 0, curAttrLen = 0;
@@ -1555,7 +1555,7 @@
ALOGI(" curNs=%s (%zu), curAttr=%s (%zu)", curNs, curNsLen, curAttr, curAttrLen);
}
if (curAttr != NULL && curNsLen == nsLen && curAttrLen == attrLen
- && memcmp(attr8.string(), curAttr, attrLen) == 0) {
+ && memcmp(attr8.c_str(), curAttr, attrLen) == 0) {
if (ns == NULL) {
if (curNs == NULL) {
if (kDebugStringPoolNoisy) {
@@ -1565,8 +1565,8 @@
}
} else if (curNs != NULL) {
//printf(" --> ns=%s, curNs=%s\n",
- // String8(ns).string(), String8(curNs).string());
- if (memcmp(ns8.string(), curNs, nsLen) == 0) {
+ // String8(ns).c_str(), String8(curNs).c_str());
+ if (memcmp(ns8.c_str(), curNs, nsLen) == 0) {
if (kDebugStringPoolNoisy) {
ALOGI(" FOUND!");
}
@@ -1578,8 +1578,8 @@
} else {
if (kDebugStringPoolNoisy) {
ALOGI("indexOfAttribute UTF16 %s (%zu) / %s (%zu)",
- String8(ns, nsLen).string(), nsLen,
- String8(attr, attrLen).string(), attrLen);
+ String8(ns, nsLen).c_str(), nsLen,
+ String8(attr, attrLen).c_str(), attrLen);
}
for (size_t i=0; i<N; i++) {
size_t curNsLen = 0, curAttrLen = 0;
@@ -1587,8 +1587,8 @@
const char16_t* curAttr = getAttributeName(i, &curAttrLen);
if (kDebugStringPoolNoisy) {
ALOGI(" curNs=%s (%zu), curAttr=%s (%zu)",
- String8(curNs, curNsLen).string(), curNsLen,
- String8(curAttr, curAttrLen).string(), curAttrLen);
+ String8(curNs, curNsLen).c_str(), curNsLen,
+ String8(curAttr, curAttrLen).c_str(), curAttrLen);
}
if (curAttr != NULL && curNsLen == nsLen && curAttrLen == attrLen
&& (memcmp(attr, curAttr, attrLen*sizeof(char16_t)) == 0)) {
@@ -1601,7 +1601,7 @@
}
} else if (curNs != NULL) {
//printf(" --> ns=%s, curNs=%s\n",
- // String8(ns).string(), String8(curNs).string());
+ // String8(ns).c_str(), String8(curNs).c_str());
if (memcmp(ns, curNs, nsLen*sizeof(char16_t)) == 0) {
if (kDebugStringPoolNoisy) {
ALOGI(" FOUND!");
@@ -4475,7 +4475,7 @@
return false;
}
- outName->package = grp->name.string();
+ outName->package = grp->name.c_str();
outName->packageLen = grp->name.size();
if (allowUtf8) {
outName->type8 = UnpackOptionalString(entry.typeStr.string8(), &outName->typeLen);
@@ -4575,7 +4575,7 @@
outValue->dataType,
outValue->dataType == Res_value::TYPE_STRING ?
String8(UnpackOptionalString(
- entry.package->header->values.stringAt(outValue->data), &len)).string() :
+ entry.package->header->values.stringAt(outValue->data), &len)).c_str() :
"",
outValue->data);
}
@@ -4944,7 +4944,7 @@
AutoMutex _lock2(mFilteredConfigLock);
if (kDebugTableGetEntry) {
- ALOGI("Setting parameters: %s\n", params->toString().string());
+ ALOGI("Setting parameters: %s\n", params->toString().c_str());
}
mParams = *params;
for (size_t p = 0; p < mPackageGroups.size(); p++) {
@@ -5055,7 +5055,7 @@
if (name[1] == 'i' && name[2] == 'n'
&& name[3] == 'd' && name[4] == 'e' && name[5] == 'x'
&& name[6] == '_') {
- int index = atoi(String8(name + 7, nameLen - 7).string());
+ int index = atoi(String8(name + 7, nameLen - 7).c_str());
if (Res_CHECKID(index)) {
ALOGW("Array resource index: %d is too large.",
index);
@@ -5121,9 +5121,9 @@
if (kDebugTableNoisy) {
printf("Looking for identifier: type=%s, name=%s, package=%s\n",
- String8(type, typeLen).string(),
- String8(name, nameLen).string(),
- String8(package, packageLen).string());
+ String8(type, typeLen).c_str(),
+ String8(name, nameLen).c_str(),
+ String8(package, packageLen).c_str());
}
const String16 attr("attr");
@@ -5134,9 +5134,9 @@
const PackageGroup* group = mPackageGroups[ig];
if (strzcmp16(package, packageLen,
- group->name.string(), group->name.size())) {
+ group->name.c_str(), group->name.size())) {
if (kDebugTableNoisy) {
- printf("Skipping package group: %s\n", String8(group->name).string());
+ printf("Skipping package group: %s\n", String8(group->name).c_str());
}
continue;
}
@@ -5161,8 +5161,8 @@
}
return identifier;
}
- } while (strzcmp16(attr.string(), attr.size(), targetType, targetTypeLen) == 0
- && (targetType = attrPrivate.string())
+ } while (strzcmp16(attr.c_str(), attr.size(), targetType, targetTypeLen) == 0
+ && (targetType = attrPrivate.c_str())
&& (targetTypeLen = attrPrivate.size())
);
}
@@ -5610,7 +5610,7 @@
}
}
- //printf("Value for: %s\n", String8(s, len).string());
+ //printf("Value for: %s\n", String8(s, len).c_str());
uint32_t l10nReq = ResTable_map::L10N_NOT_REQUIRED;
uint32_t attrMin = 0x80000000, attrMax = 0x7fffffff;
@@ -5665,7 +5665,7 @@
// be to any other type; we just need to count on the client making
// sure the referenced type is correct.
- //printf("Looking up ref: %s\n", String8(s, len).string());
+ //printf("Looking up ref: %s\n", String8(s, len).c_str());
// It's a reference!
if (len == 5 && s[1]=='n' && s[2]=='u' && s[3]=='l' && s[4]=='l') {
@@ -5705,8 +5705,8 @@
}
uint32_t specFlags = 0;
- uint32_t rid = identifierForName(name.string(), name.size(), type.string(),
- type.size(), package.string(), package.size(), &specFlags);
+ uint32_t rid = identifierForName(name.c_str(), name.size(), type.c_str(),
+ type.size(), package.c_str(), package.size(), &specFlags);
if (rid != 0) {
if (enforcePrivate) {
if (accessor == NULL || accessor->getAssetsPackage() != package) {
@@ -5725,8 +5725,8 @@
Res_GETTYPE(rid), Res_GETENTRY(rid));
if (kDebugTableNoisy) {
ALOGI("Incl %s:%s/%s: 0x%08x\n",
- String8(package).string(), String8(type).string(),
- String8(name).string(), rid);
+ String8(package).c_str(), String8(type).c_str(),
+ String8(name).c_str(), rid);
}
}
@@ -5744,8 +5744,8 @@
if (rid != 0) {
if (kDebugTableNoisy) {
ALOGI("Pckg %s:%s/%s: 0x%08x\n",
- String8(package).string(), String8(type).string(),
- String8(name).string(), rid);
+ String8(package).c_str(), String8(type).c_str(),
+ String8(name).c_str(), rid);
}
uint32_t packageId = Res_GETPACKAGE(rid) + 1;
if (packageId == 0x00) {
@@ -5834,7 +5834,7 @@
}
} else {
outValue->data = color;
- //printf("Color input=%s, output=0x%x\n", String8(s, len).string(), color);
+ //printf("Color input=%s, output=0x%x\n", String8(s, len).c_str(), color);
return true;
}
} else {
@@ -5846,8 +5846,8 @@
#if 0
fprintf(stderr, "%s: Color ID %s value %s is not valid\n",
"Resource File", //(const char*)in->getPrintableSource(),
- String8(*curTag).string(),
- String8(s, len).string());
+ String8(*curTag).c_str(),
+ String8(s, len).c_str());
#endif
return false;
}
@@ -5861,7 +5861,7 @@
// be to any other type; we just need to count on the client making
// sure the referenced type is correct.
- //printf("Looking up attr: %s\n", String8(s, len).string());
+ //printf("Looking up attr: %s\n", String8(s, len).c_str());
static const String16 attr16("attr");
String16 package, type, name;
@@ -5874,13 +5874,13 @@
}
//printf("Pkg: %s, Type: %s, Name: %s\n",
- // String8(package).string(), String8(type).string(),
- // String8(name).string());
+ // String8(package).c_str(), String8(type).c_str(),
+ // String8(name).c_str());
uint32_t specFlags = 0;
uint32_t rid =
- identifierForName(name.string(), name.size(),
- type.string(), type.size(),
- package.string(), package.size(), &specFlags);
+ identifierForName(name.c_str(), name.size(),
+ type.c_str(), type.size(),
+ package.c_str(), package.size(), &specFlags);
if (rid != 0) {
if (enforcePrivate) {
if ((specFlags&ResTable_typeSpec::SPEC_PUBLIC) == 0) {
@@ -6038,8 +6038,8 @@
if (getResourceName(bag->map.name.ident, false, &rname)) {
#if 0
printf("Matching %s against %s (0x%08x)\n",
- String8(s, len).string(),
- String8(rname.name, rname.nameLen).string(),
+ String8(s, len).c_str(),
+ String8(rname.name, rname.nameLen).c_str(),
bag->map.name.ident);
#endif
if (strzcmp16(s, len, rname.name, rname.nameLen) == 0) {
@@ -6082,7 +6082,7 @@
while (pos < end && *pos != '|') {
pos++;
}
- //printf("Looking for: %s\n", String8(start, pos-start).string());
+ //printf("Looking for: %s\n", String8(start, pos-start).c_str());
const bag_entry* bagi = bag;
ssize_t i;
for (i=0; i<cnt; i++, bagi++) {
@@ -6091,8 +6091,8 @@
if (getResourceName(bagi->map.name.ident, false, &rname)) {
#if 0
printf("Matching %s against %s (0x%08x)\n",
- String8(start,pos-start).string(),
- String8(rname.name, rname.nameLen).string(),
+ String8(start,pos-start).c_str(),
+ String8(rname.name, rname.nameLen).c_str(),
bagi->map.name.ident);
#endif
if (strzcmp16(start, pos-start, rname.name, rname.nameLen) == 0) {
@@ -6419,7 +6419,7 @@
}
static bool compareString8AndCString(const String8& str, const char* cStr) {
- return strcmp(str.string(), cStr) < 0;
+ return strcmp(str.c_str(), cStr) < 0;
}
void ResTable::getLocales(Vector<String8>* locales, bool includeSystemLocales,
@@ -6433,7 +6433,7 @@
const auto endIter = locales->end();
auto iter = std::lower_bound(beginIter, endIter, locale, compareString8AndCString);
- if (iter == endIter || strcmp(iter->string(), locale) != 0) {
+ if (iter == endIter || strcmp(iter->c_str(), locale) != 0) {
locales->insertAt(String8(locale), std::distance(beginIter, iter));
}
});
@@ -7030,7 +7030,7 @@
ResTable_config thisConfig;
thisConfig.copyFromDtoH(type->config);
ALOGI("Adding config to type %d: %s\n", type->id,
- thisConfig.toString().string());
+ thisConfig.toString().c_str());
}
}
} else {
@@ -7107,7 +7107,7 @@
char16_t tmpName[sizeof(entry->packageName) / sizeof(char16_t)];
strcpy16_dtoh(tmpName, entry->packageName, sizeof(entry->packageName) / sizeof(char16_t));
if (kDebugLibNoisy) {
- ALOGV("Found lib entry %s with id %d\n", String8(tmpName).string(),
+ ALOGV("Found lib entry %s with id %d\n", String8(tmpName).c_str(),
dtohl(entry->packageId));
}
if (packageId >= 256) {
@@ -7386,7 +7386,7 @@
current_res.nameLen,
current_res.type,
current_res.typeLen,
- targetPackageName.string(),
+ targetPackageName.c_str(),
targetPackageName.size(),
&typeSpecFlags);
@@ -7493,7 +7493,7 @@
}
-#define CHAR16_TO_CSTR(c16, len) (String8(String16(c16,len)).string())
+#define CHAR16_TO_CSTR(c16, len) (String8(String16(c16,len)).c_str())
#define CHAR16_ARRAY_EQ(constant, var, len) \
(((len) == (sizeof(constant)/sizeof((constant)[0]))) && (0 == memcmp((var), (constant), (len))))
@@ -7588,13 +7588,13 @@
const char* str8 = UnpackOptionalString(pkg->header->values.string8At(
value.data), &len);
if (str8 != NULL) {
- printf("(string8) \"%s\"\n", normalizeForOutput(str8).string());
+ printf("(string8) \"%s\"\n", normalizeForOutput(str8).c_str());
} else {
const char16_t* str16 = UnpackOptionalString(pkg->header->values.stringAt(
value.data), &len);
if (str16 != NULL) {
printf("(string16) \"%s\"\n",
- normalizeForOutput(String8(str16, len).string()).string());
+ normalizeForOutput(String8(str16, len).c_str()).c_str());
} else {
printf("(string) null\n");
}
@@ -7635,7 +7635,7 @@
const PackageGroup* pg = mPackageGroups[pgIndex];
printf("Package Group %d id=0x%02x packageCount=%d name=%s\n",
(int)pgIndex, pg->id, (int)pg->packages.size(),
- String8(pg->name).string());
+ String8(pg->name).c_str());
const KeyedVector<String16, uint8_t>& refEntries = pg->dynamicRefTable.entries();
const size_t refEntryCount = refEntries.size();
@@ -7644,7 +7644,7 @@
for (size_t refIndex = 0; refIndex < refEntryCount; refIndex++) {
printf(" 0x%02x -> %s\n",
refEntries.valueAt(refIndex),
- String8(refEntries.keyAt(refIndex)).string());
+ String8(refEntries.keyAt(refIndex)).c_str());
}
printf("\n");
}
@@ -7670,7 +7670,7 @@
strcpy16_dtoh(tmpName, pkg->package->name,
sizeof(pkg->package->name)/sizeof(pkg->package->name[0]));
printf(" Package %d id=0x%02x name=%s\n", (int)pkgIndex,
- pkg->package->id, String8(tmpName).string());
+ pkg->package->id, String8(tmpName).c_str());
}
for (size_t typeIndex = 0; typeIndex < pg->types.size(); typeIndex++) {
@@ -7712,7 +7712,7 @@
printf(" spec resource 0x%08x %s:%s/%s: flags=0x%08x\n",
resID,
CHAR16_TO_CSTR(resName.package, resName.packageLen),
- type8.string(), name8.string(),
+ type8.c_str(), name8.c_str(),
dtohl(typeConfigs->typeSpecFlags[entryIndex]));
} else {
printf(" INVALID TYPE CONFIG FOR RESOURCE 0x%08x\n", resID);
@@ -7733,7 +7733,7 @@
String8 configStr = thisConfig.toString();
printf(" config %s", configStr.size() > 0
- ? configStr.string() : "(default)");
+ ? configStr.c_str() : "(default)");
if (type->flags != 0u) {
printf(" flags=0x%02x", type->flags);
if (type->flags & ResTable_type::FLAG_SPARSE) {
@@ -7807,7 +7807,7 @@
}
printf(" resource 0x%08x %s:%s/%s: ", resID,
CHAR16_TO_CSTR(resName.package, resName.packageLen),
- type8.string(), name8.string());
+ type8.c_str(), name8.c_str());
} else {
printf(" INVALID RESOURCE 0x%08x: ", resID);
}
diff --git a/libs/androidfw/include/androidfw/Asset.h b/libs/androidfw/include/androidfw/Asset.h
index 19febcd..f3776b5 100644
--- a/libs/androidfw/include/androidfw/Asset.h
+++ b/libs/androidfw/include/androidfw/Asset.h
@@ -135,7 +135,7 @@
* This is NOT intended to be used for anything except debug output.
* DO NOT try to parse this or use it to open a file.
*/
- const char* getAssetSource(void) const { return mAssetSource.string(); }
+ const char* getAssetSource(void) const { return mAssetSource.c_str(); }
/*
* Create the asset from a file descriptor.
diff --git a/libs/androidfw/include/androidfw/ConfigDescription.h b/libs/androidfw/include/androidfw/ConfigDescription.h
index 7fbd7c0..83a80ce 100644
--- a/libs/androidfw/include/androidfw/ConfigDescription.h
+++ b/libs/androidfw/include/androidfw/ConfigDescription.h
@@ -213,7 +213,7 @@
inline ::std::ostream& operator<<(::std::ostream& out,
const ConfigDescription& o) {
- return out << o.toString().string();
+ return out << o.toString().c_str();
}
} // namespace android
diff --git a/libs/androidfw/tests/BackupData_test.cpp b/libs/androidfw/tests/BackupData_test.cpp
index e25b616..7d3a341 100644
--- a/libs/androidfw/tests/BackupData_test.cpp
+++ b/libs/androidfw/tests/BackupData_test.cpp
@@ -56,10 +56,10 @@
mFilename.append(m_external_storage);
mFilename.append(TEST_FILENAME);
- ::unlink(mFilename.string());
- int fd = ::open(mFilename.string(), O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
+ ::unlink(mFilename.c_str());
+ int fd = ::open(mFilename.c_str(), O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
if (fd < 0) {
- FAIL() << "Couldn't create " << mFilename.string() << " for writing";
+ FAIL() << "Couldn't create " << mFilename.c_str() << " for writing";
}
mKey1 = String8(KEY1);
mKey2 = String8(KEY2);
@@ -72,7 +72,7 @@
};
TEST_F(BackupDataTest, WriteAndReadSingle) {
- int fd = ::open(mFilename.string(), O_WRONLY);
+ int fd = ::open(mFilename.c_str(), O_WRONLY);
BackupDataWriter* writer = new BackupDataWriter(fd);
EXPECT_EQ(NO_ERROR, writer->WriteEntityHeader(mKey1, sizeof(DATA1)))
@@ -81,7 +81,7 @@
<< "WriteEntityData returned an error";
::close(fd);
- fd = ::open(mFilename.string(), O_RDONLY);
+ fd = ::open(mFilename.c_str(), O_RDONLY);
BackupDataReader* reader = new BackupDataReader(fd);
EXPECT_EQ(NO_ERROR, reader->Status())
<< "Reader ctor failed";
@@ -114,7 +114,7 @@
}
TEST_F(BackupDataTest, WriteAndReadMultiple) {
- int fd = ::open(mFilename.string(), O_WRONLY);
+ int fd = ::open(mFilename.c_str(), O_WRONLY);
BackupDataWriter* writer = new BackupDataWriter(fd);
writer->WriteEntityHeader(mKey1, sizeof(DATA1));
writer->WriteEntityData(DATA1, sizeof(DATA1));
@@ -122,7 +122,7 @@
writer->WriteEntityData(DATA2, sizeof(DATA2));
::close(fd);
- fd = ::open(mFilename.string(), O_RDONLY);
+ fd = ::open(mFilename.c_str(), O_RDONLY);
BackupDataReader* reader = new BackupDataReader(fd);
bool done;
@@ -162,7 +162,7 @@
}
TEST_F(BackupDataTest, SkipEntity) {
- int fd = ::open(mFilename.string(), O_WRONLY);
+ int fd = ::open(mFilename.c_str(), O_WRONLY);
BackupDataWriter* writer = new BackupDataWriter(fd);
writer->WriteEntityHeader(mKey1, sizeof(DATA1));
writer->WriteEntityData(DATA1, sizeof(DATA1));
@@ -172,7 +172,7 @@
writer->WriteEntityData(DATA3, sizeof(DATA3));
::close(fd);
- fd = ::open(mFilename.string(), O_RDONLY);
+ fd = ::open(mFilename.c_str(), O_RDONLY);
BackupDataReader* reader = new BackupDataReader(fd);
bool done;
@@ -217,14 +217,14 @@
}
TEST_F(BackupDataTest, DeleteEntity) {
- int fd = ::open(mFilename.string(), O_WRONLY);
+ int fd = ::open(mFilename.c_str(), O_WRONLY);
BackupDataWriter* writer = new BackupDataWriter(fd);
writer->WriteEntityHeader(mKey1, sizeof(DATA1));
writer->WriteEntityData(DATA1, sizeof(DATA1));
writer->WriteEntityHeader(mKey2, -1);
::close(fd);
- fd = ::open(mFilename.string(), O_RDONLY);
+ fd = ::open(mFilename.c_str(), O_RDONLY);
BackupDataReader* reader = new BackupDataReader(fd);
bool done;
@@ -256,7 +256,7 @@
}
TEST_F(BackupDataTest, EneityAfterDelete) {
- int fd = ::open(mFilename.string(), O_WRONLY);
+ int fd = ::open(mFilename.c_str(), O_WRONLY);
BackupDataWriter* writer = new BackupDataWriter(fd);
writer->WriteEntityHeader(mKey1, sizeof(DATA1));
writer->WriteEntityData(DATA1, sizeof(DATA1));
@@ -265,7 +265,7 @@
writer->WriteEntityData(DATA3, sizeof(DATA3));
::close(fd);
- fd = ::open(mFilename.string(), O_RDONLY);
+ fd = ::open(mFilename.c_str(), O_RDONLY);
BackupDataReader* reader = new BackupDataReader(fd);
bool done;
@@ -317,7 +317,7 @@
}
TEST_F(BackupDataTest, OnlyDeleteEntities) {
- int fd = ::open(mFilename.string(), O_WRONLY);
+ int fd = ::open(mFilename.c_str(), O_WRONLY);
BackupDataWriter* writer = new BackupDataWriter(fd);
writer->WriteEntityHeader(mKey1, -1);
writer->WriteEntityHeader(mKey2, -1);
@@ -325,7 +325,7 @@
writer->WriteEntityHeader(mKey4, -1);
::close(fd);
- fd = ::open(mFilename.string(), O_RDONLY);
+ fd = ::open(mFilename.c_str(), O_RDONLY);
BackupDataReader* reader = new BackupDataReader(fd);
bool done;
@@ -385,13 +385,13 @@
}
TEST_F(BackupDataTest, ReadDeletedEntityData) {
- int fd = ::open(mFilename.string(), O_WRONLY);
+ int fd = ::open(mFilename.c_str(), O_WRONLY);
BackupDataWriter* writer = new BackupDataWriter(fd);
writer->WriteEntityHeader(mKey1, -1);
writer->WriteEntityHeader(mKey2, -1);
::close(fd);
- fd = ::open(mFilename.string(), O_RDONLY);
+ fd = ::open(mFilename.c_str(), O_RDONLY);
BackupDataReader* reader = new BackupDataReader(fd);
bool done;
diff --git a/libs/androidfw/tests/CommonHelpers.cpp b/libs/androidfw/tests/CommonHelpers.cpp
index 3396729..10138de 100644
--- a/libs/androidfw/tests/CommonHelpers.cpp
+++ b/libs/androidfw/tests/CommonHelpers.cpp
@@ -60,7 +60,7 @@
std::string GetStringFromPool(const ResStringPool* pool, uint32_t idx) {
auto str = pool->string8ObjectAt(idx);
CHECK(str.has_value()) << "failed to find string entry";
- return std::string(str->string(), str->length());
+ return std::string(str->c_str(), str->length());
}
} // namespace android
diff --git a/libs/androidfw/tests/ConfigDescription_test.cpp b/libs/androidfw/tests/ConfigDescription_test.cpp
index f5c01e5..ec478b0 100644
--- a/libs/androidfw/tests/ConfigDescription_test.cpp
+++ b/libs/androidfw/tests/ConfigDescription_test.cpp
@@ -50,10 +50,10 @@
TEST(ConfigDescriptionTest, ParseBasicQualifiers) {
ConfigDescription config;
EXPECT_TRUE(TestParse("", &config));
- EXPECT_EQ(std::string(""), config.toString().string());
+ EXPECT_EQ(std::string(""), config.toString().c_str());
EXPECT_TRUE(TestParse("fr-land", &config));
- EXPECT_EQ(std::string("fr-land"), config.toString().string());
+ EXPECT_EQ(std::string("fr-land"), config.toString().c_str());
EXPECT_TRUE(
TestParse("mcc310-pl-sw720dp-normal-long-port-night-"
@@ -61,22 +61,22 @@
&config));
EXPECT_EQ(std::string("mcc310-pl-sw720dp-normal-long-port-night-"
"xhdpi-keyssoft-qwerty-navexposed-nonav-v13"),
- config.toString().string());
+ config.toString().c_str());
}
TEST(ConfigDescriptionTest, ParseLocales) {
ConfigDescription config;
EXPECT_TRUE(TestParse("en-rUS", &config));
- EXPECT_EQ(std::string("en-rUS"), config.toString().string());
+ EXPECT_EQ(std::string("en-rUS"), config.toString().c_str());
}
TEST(ConfigDescriptionTest, ParseQualifierAddedInApi13) {
ConfigDescription config;
EXPECT_TRUE(TestParse("sw600dp", &config));
- EXPECT_EQ(std::string("sw600dp-v13"), config.toString().string());
+ EXPECT_EQ(std::string("sw600dp-v13"), config.toString().c_str());
EXPECT_TRUE(TestParse("sw600dp-v8", &config));
- EXPECT_EQ(std::string("sw600dp-v13"), config.toString().string());
+ EXPECT_EQ(std::string("sw600dp-v13"), config.toString().c_str());
}
TEST(ConfigDescriptionTest, ParseCarAttribute) {
@@ -91,13 +91,13 @@
EXPECT_EQ(android::ResTable_config::SCREENROUND_YES,
config.screenLayout2 & android::ResTable_config::MASK_SCREENROUND);
EXPECT_EQ(SDK_MARSHMALLOW, config.sdkVersion);
- EXPECT_EQ(std::string("round-v23"), config.toString().string());
+ EXPECT_EQ(std::string("round-v23"), config.toString().c_str());
EXPECT_TRUE(TestParse("notround", &config));
EXPECT_EQ(android::ResTable_config::SCREENROUND_NO,
config.screenLayout2 & android::ResTable_config::MASK_SCREENROUND);
EXPECT_EQ(SDK_MARSHMALLOW, config.sdkVersion);
- EXPECT_EQ(std::string("notround-v23"), config.toString().string());
+ EXPECT_EQ(std::string("notround-v23"), config.toString().c_str());
}
TEST(ConfigDescriptionTest, TestWideColorGamutQualifier) {
@@ -106,13 +106,13 @@
EXPECT_EQ(android::ResTable_config::WIDE_COLOR_GAMUT_YES,
config.colorMode & android::ResTable_config::MASK_WIDE_COLOR_GAMUT);
EXPECT_EQ(SDK_O, config.sdkVersion);
- EXPECT_EQ(std::string("widecg-v26"), config.toString().string());
+ EXPECT_EQ(std::string("widecg-v26"), config.toString().c_str());
EXPECT_TRUE(TestParse("nowidecg", &config));
EXPECT_EQ(android::ResTable_config::WIDE_COLOR_GAMUT_NO,
config.colorMode & android::ResTable_config::MASK_WIDE_COLOR_GAMUT);
EXPECT_EQ(SDK_O, config.sdkVersion);
- EXPECT_EQ(std::string("nowidecg-v26"), config.toString().string());
+ EXPECT_EQ(std::string("nowidecg-v26"), config.toString().c_str());
}
TEST(ConfigDescriptionTest, TestHdrQualifier) {
@@ -121,13 +121,13 @@
EXPECT_EQ(android::ResTable_config::HDR_YES,
config.colorMode & android::ResTable_config::MASK_HDR);
EXPECT_EQ(SDK_O, config.sdkVersion);
- EXPECT_EQ(std::string("highdr-v26"), config.toString().string());
+ EXPECT_EQ(std::string("highdr-v26"), config.toString().c_str());
EXPECT_TRUE(TestParse("lowdr", &config));
EXPECT_EQ(android::ResTable_config::HDR_NO,
config.colorMode & android::ResTable_config::MASK_HDR);
EXPECT_EQ(SDK_O, config.sdkVersion);
- EXPECT_EQ(std::string("lowdr-v26"), config.toString().string());
+ EXPECT_EQ(std::string("lowdr-v26"), config.toString().c_str());
}
TEST(ConfigDescriptionTest, ParseVrAttribute) {
@@ -135,7 +135,7 @@
EXPECT_TRUE(TestParse("vrheadset", &config));
EXPECT_EQ(android::ResTable_config::UI_MODE_TYPE_VR_HEADSET, config.uiMode);
EXPECT_EQ(SDK_O, config.sdkVersion);
- EXPECT_EQ(std::string("vrheadset-v26"), config.toString().string());
+ EXPECT_EQ(std::string("vrheadset-v26"), config.toString().c_str());
}
static inline ConfigDescription ParseConfigOrDie(android::StringPiece str) {
diff --git a/libs/androidfw/tests/ObbFile_test.cpp b/libs/androidfw/tests/ObbFile_test.cpp
index 1151121..ba818c4 100644
--- a/libs/androidfw/tests/ObbFile_test.cpp
+++ b/libs/androidfw/tests/ObbFile_test.cpp
@@ -43,9 +43,9 @@
mFileName.append(externalStorage);
mFileName.append(TEST_FILENAME);
- int fd = ::open(mFileName.string(), O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
+ int fd = ::open(mFileName.c_str(), O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
if (fd < 0) {
- FAIL() << "Couldn't create " << mFileName.string() << " for tests";
+ FAIL() << "Couldn't create " << mFileName.c_str() << " for tests";
}
}
@@ -69,17 +69,17 @@
EXPECT_TRUE(mObbFile->setSalt(salt, SALT_SIZE))
<< "Salt should be successfully set";
- EXPECT_TRUE(mObbFile->writeTo(mFileName.string()))
+ EXPECT_TRUE(mObbFile->writeTo(mFileName.c_str()))
<< "couldn't write to fake .obb file";
mObbFile = new ObbFile();
- EXPECT_TRUE(mObbFile->readFrom(mFileName.string()))
+ EXPECT_TRUE(mObbFile->readFrom(mFileName.c_str()))
<< "couldn't read from fake .obb file";
EXPECT_EQ(versionNum, mObbFile->getVersion())
<< "version didn't come out the same as it went in";
- const char* currentPackageName = mObbFile->getPackageName().string();
+ const char* currentPackageName = mObbFile->getPackageName().c_str();
EXPECT_STREQ(packageName, currentPackageName)
<< "package name didn't come out the same as it went in";
diff --git a/libs/androidfw/tests/ResTable_test.cpp b/libs/androidfw/tests/ResTable_test.cpp
index fbf7098..945981b 100644
--- a/libs/androidfw/tests/ResTable_test.cpp
+++ b/libs/androidfw/tests/ResTable_test.cpp
@@ -64,8 +64,8 @@
String16 defPackage("com.android.basic");
String16 testName("@string/test1");
uint32_t resID =
- table.identifierForName(testName.string(), testName.size(), 0, 0,
- defPackage.string(), defPackage.size());
+ table.identifierForName(testName.c_str(), testName.size(), 0, 0,
+ defPackage.c_str(), defPackage.size());
ASSERT_NE(uint32_t(0x00000000), resID);
ASSERT_EQ(basic::R::string::test1, resID);
}
diff --git a/libs/androidfw/tests/Split_test.cpp b/libs/androidfw/tests/Split_test.cpp
index 2c242db..3d88577 100644
--- a/libs/androidfw/tests/Split_test.cpp
+++ b/libs/androidfw/tests/Split_test.cpp
@@ -261,8 +261,8 @@
const String16 package("com.android.basic");
ASSERT_EQ(
R::string::test3,
- table.identifierForName(name.string(), name.size(), type.string(),
- type.size(), package.string(), package.size()));
+ table.identifierForName(name.c_str(), name.size(), type.c_str(),
+ type.size(), package.c_str(), package.size()));
}
} // namespace
diff --git a/libs/androidfw/tests/TestHelpers.cpp b/libs/androidfw/tests/TestHelpers.cpp
index 10c0a4f..c6f657c 100644
--- a/libs/androidfw/tests/TestHelpers.cpp
+++ b/libs/androidfw/tests/TestHelpers.cpp
@@ -79,9 +79,9 @@
}
if (String8(expected_str) != *actual_str) {
- return AssertionFailure() << actual_str->string();
+ return AssertionFailure() << actual_str->c_str();
}
- return AssertionSuccess() << actual_str->string();
+ return AssertionSuccess() << actual_str->c_str();
}
} // namespace android
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp
index 7f80dff..ce6b4b7 100644
--- a/libs/hwui/Android.bp
+++ b/libs/hwui/Android.bp
@@ -28,6 +28,24 @@
],
}
+aconfig_declarations {
+ name: "hwui_flags",
+ package: "com.android.graphics.hwui.flags",
+ srcs: [
+ "aconfig/hwui_flags.aconfig",
+ ],
+}
+
+java_aconfig_library {
+ name: "hwui_flags_java_lib",
+ aconfig_declarations: "hwui_flags",
+}
+
+cc_aconfig_library {
+ name: "hwui_flags_cc_lib",
+ aconfig_declarations: "hwui_flags",
+}
+
cc_defaults {
name: "hwui_defaults",
defaults: [
@@ -139,6 +157,7 @@
"libstatspull_lazy",
"libstatssocket_lazy",
"libtonemap",
+ "hwui_flags_cc_lib",
],
},
host: {
diff --git a/libs/hwui/AutoBackendTextureRelease.cpp b/libs/hwui/AutoBackendTextureRelease.cpp
index fcb1bfe..4d020c5 100644
--- a/libs/hwui/AutoBackendTextureRelease.cpp
+++ b/libs/hwui/AutoBackendTextureRelease.cpp
@@ -18,9 +18,9 @@
#include <SkImage.h>
#include <include/gpu/ganesh/SkImageGanesh.h>
-#include <include/gpu/GrBackendSurfaceMutableState.h>
#include <include/gpu/GrDirectContext.h>
#include <include/gpu/GrBackendSurface.h>
+#include <include/gpu/MutableTextureState.h>
#include "renderthread/RenderThread.h"
#include "utils/Color.h"
#include "utils/PaintUtils.h"
@@ -142,8 +142,8 @@
LOG_ALWAYS_FATAL_IF(Properties::getRenderPipelineType() != RenderPipelineType::SkiaVulkan);
if (mBackendTexture.isValid()) {
// Passing in VK_IMAGE_LAYOUT_UNDEFINED means we keep the old layout.
- GrBackendSurfaceMutableState newState(VK_IMAGE_LAYOUT_UNDEFINED,
- VK_QUEUE_FAMILY_FOREIGN_EXT);
+ skgpu::MutableTextureState newState(VK_IMAGE_LAYOUT_UNDEFINED,
+ VK_QUEUE_FAMILY_FOREIGN_EXT);
// The unref for this ref happens in the releaseProc passed into setBackendTextureState. The
// releaseProc callback will be made when the work to set the new state has finished on the
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h
index eb5878d..8c180da 100644
--- a/libs/hwui/DisplayList.h
+++ b/libs/hwui/DisplayList.h
@@ -54,6 +54,8 @@
mImpl->updateChildren(std::move(updateFn));
}
+ void visit(std::function<void(const RenderNode&)> func) const { mImpl->visit(std::move(func)); }
+
[[nodiscard]] explicit operator bool() const {
return mImpl.get() != nullptr;
}
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index 1dd22cf..eee93c1 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -109,6 +109,13 @@
output << std::endl;
}
+void RenderNode::visit(std::function<void(const RenderNode&)> func) const {
+ func(*this);
+ if (mDisplayList) {
+ mDisplayList.visit(func);
+ }
+}
+
int RenderNode::getUsageSize() {
int size = sizeof(RenderNode);
size += mStagingDisplayList.getUsedSize();
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h
index d1e04ad..529a49e9 100644
--- a/libs/hwui/RenderNode.h
+++ b/libs/hwui/RenderNode.h
@@ -114,7 +114,7 @@
return mDisplayList.containsProjectionReceiver();
}
- const char* getName() const { return mName.string(); }
+ const char* getName() const { return mName.c_str(); }
void setName(const char* name) {
if (name) {
@@ -129,10 +129,6 @@
StretchMask& getStretchMask() { return mStretchMask; }
- VirtualLightRefBase* getUserContext() const { return mUserContext.get(); }
-
- void setUserContext(VirtualLightRefBase* context) { mUserContext = context; }
-
bool isPropertyFieldDirty(DirtyPropertyMask field) const {
return mDirtyPropertyFields & field;
}
@@ -215,6 +211,8 @@
void output(std::ostream& output, uint32_t level);
+ void visit(std::function<void(const RenderNode&)>) const;
+
void setUsageHint(UsageHint usageHint) { mUsageHint = usageHint; }
UsageHint usageHint() const { return mUsageHint; }
@@ -222,6 +220,7 @@
int64_t uniqueId() const { return mUniqueId; }
void setIsTextureView() { mIsTextureView = true; }
+ bool isTextureView() const { return mIsTextureView; }
void markDrawStart(SkCanvas& canvas);
void markDrawEnd(SkCanvas& canvas);
@@ -248,7 +247,6 @@
const int64_t mUniqueId;
String8 mName;
- sp<VirtualLightRefBase> mUserContext;
uint32_t mDirtyPropertyFields;
RenderProperties mProperties;
diff --git a/libs/hwui/aconfig/hwui_flags.aconfig b/libs/hwui/aconfig/hwui_flags.aconfig
new file mode 100644
index 0000000..d074a90
--- /dev/null
+++ b/libs/hwui/aconfig/hwui_flags.aconfig
@@ -0,0 +1,8 @@
+package: "com.android.graphics.hwui.flags"
+
+flag {
+ name: "limited_hdr"
+ namespace: "core_graphics"
+ description: "API to enable apps to restrict the amount of HDR headroom that is used"
+ bug: "234181960"
+}
\ No newline at end of file
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
index af2d3b3..5c8285a 100644
--- a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
+++ b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
@@ -66,6 +66,12 @@
}
}
+void SkiaDisplayList::visit(std::function<void(const RenderNode&)> func) const {
+ for (auto& child : mChildNodes) {
+ child.getRenderNode()->visit(func);
+ }
+}
+
static bool intersects(const SkISize screenSize, const Matrix4& mat, const SkRect& bounds) {
Vector3 points[] = { Vector3 {bounds.fLeft, bounds.fTop, 0},
Vector3 {bounds.fRight, bounds.fTop, 0},
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.h b/libs/hwui/pipeline/skia/SkiaDisplayList.h
index 7af31a4..e5bd5c9 100644
--- a/libs/hwui/pipeline/skia/SkiaDisplayList.h
+++ b/libs/hwui/pipeline/skia/SkiaDisplayList.h
@@ -145,6 +145,8 @@
*/
void updateChildren(std::function<void(RenderNode*)> updateFn);
+ void visit(std::function<void(const RenderNode&)> func) const;
+
/**
* Returns true if there is a child render node that is a projection receiver.
*/
diff --git a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp
index 530c654..7744786 100644
--- a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp
+++ b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp
@@ -17,6 +17,7 @@
#include "SkiaOpenGLPipeline.h"
#include <include/gpu/ganesh/SkSurfaceGanesh.h>
+#include <include/gpu/ganesh/gl/GrGLBackendSurface.h>
#include <include/gpu/gl/GrGLTypes.h>
#include <GrBackendSurface.h>
#include <SkBlendMode.h>
@@ -140,7 +141,8 @@
LOG_ALWAYS_FATAL("Unsupported color type.");
}
- GrBackendRenderTarget backendRT(frame.width(), frame.height(), 0, STENCIL_BUFFER_SIZE, fboInfo);
+ auto backendRT = GrBackendRenderTargets::MakeGL(frame.width(), frame.height(), 0,
+ STENCIL_BUFFER_SIZE, fboInfo);
SkSurfaceProps props(mColorMode == ColorMode::Default ? 0 : SkSurfaceProps::kAlwaysDither_Flag,
kUnknown_SkPixelGeometry);
diff --git a/libs/hwui/pipeline/skia/SkiaPipeline.cpp b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
index 3d77877..6679f8f 100644
--- a/libs/hwui/pipeline/skia/SkiaPipeline.cpp
+++ b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
@@ -201,7 +201,7 @@
String8 cachesOutput;
mRenderThread.cacheManager().dumpMemoryUsage(cachesOutput,
&mRenderThread.renderState());
- ALOGE("%s", cachesOutput.string());
+ ALOGE("%s", cachesOutput.c_str());
if (errorHandler) {
std::ostringstream err;
err << "Unable to create layer for " << node->getName();
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 2e0de3f..4064bb9 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -1132,6 +1132,12 @@
return self->mColorMode != ColorMode::Default;
}
+void CanvasContext::visitAllRenderNodes(std::function<void(const RenderNode&)> func) const {
+ for (auto node : mRenderNodes) {
+ node->visit(func);
+ }
+}
+
} /* namespace renderthread */
} /* namespace uirenderer */
} /* namespace android */
diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h
index 3f02674..241f8dd 100644
--- a/libs/hwui/renderthread/CanvasContext.h
+++ b/libs/hwui/renderthread/CanvasContext.h
@@ -238,6 +238,8 @@
static bool shouldDither();
+ void visitAllRenderNodes(std::function<void(const RenderNode&)>) const;
+
private:
CanvasContext(RenderThread& thread, bool translucent, RenderNode* rootRenderNode,
IContextFactory* contextFactory, std::unique_ptr<IRenderPipeline> renderPipeline,
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index eb28c08..94ed06c 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -357,7 +357,15 @@
String8 cachesOutput;
mCacheManager->dumpMemoryUsage(cachesOutput, mRenderState);
- dprintf(fd, "\nPipeline=%s\n%s\n", pipelineToString(), cachesOutput.string());
+ dprintf(fd, "\nPipeline=%s\n%s", pipelineToString(), cachesOutput.c_str());
+ for (auto&& context : mCacheManager->mCanvasContexts) {
+ context->visitAllRenderNodes([&](const RenderNode& node) {
+ if (node.isTextureView()) {
+ dprintf(fd, "TextureView: %dx%d\n", node.getWidth(), node.getHeight());
+ }
+ });
+ }
+ dprintf(fd, "\n");
}
void RenderThread::getMemoryUsage(size_t* cpuUsage, size_t* gpuUsage) {
diff --git a/libs/hwui/utils/LinearAllocator.cpp b/libs/hwui/utils/LinearAllocator.cpp
index 8baa4b77..eab888e 100644
--- a/libs/hwui/utils/LinearAllocator.cpp
+++ b/libs/hwui/utils/LinearAllocator.cpp
@@ -31,15 +31,11 @@
#include <utils/Log.h>
#include <utils/Macros.h>
-// The ideal size of a page allocation (these need to be multiples of 8)
-#define INITIAL_PAGE_SIZE ((size_t)512) // 512b
-#define MAX_PAGE_SIZE ((size_t)131072) // 128kb
-
// The maximum amount of wasted space we can have per page
// Allocations exceeding this will have their own dedicated page
// If this is too low, we will malloc too much
// Too high, and we may waste too much space
-// Must be smaller than INITIAL_PAGE_SIZE
+// Must be smaller than kInitialPageSize
#define MAX_WASTE_RATIO (0.5f)
#if LOG_NDEBUG
@@ -75,6 +71,10 @@
namespace android {
namespace uirenderer {
+// The ideal size of a page allocation (these need to be multiples of 8)
+static constexpr size_t kInitialPageSize = 512; // 512b
+static constexpr size_t kMaxPageSize = 131072; // 128kb
+
class LinearAllocator::Page {
public:
Page* next() { return mNextPage; }
@@ -94,8 +94,8 @@
};
LinearAllocator::LinearAllocator()
- : mPageSize(INITIAL_PAGE_SIZE)
- , mMaxAllocSize(INITIAL_PAGE_SIZE * MAX_WASTE_RATIO)
+ : mPageSize(kInitialPageSize)
+ , mMaxAllocSize(kInitialPageSize * MAX_WASTE_RATIO)
, mNext(0)
, mCurrentPage(0)
, mPages(0)
@@ -135,8 +135,8 @@
void LinearAllocator::ensureNext(size_t size) {
if (fitsInCurrentPage(size)) return;
- if (mCurrentPage && mPageSize < MAX_PAGE_SIZE) {
- mPageSize = min(MAX_PAGE_SIZE, mPageSize * 2);
+ if (mCurrentPage && mPageSize < kMaxPageSize) {
+ mPageSize = min(kMaxPageSize, mPageSize * 2);
mMaxAllocSize = mPageSize * MAX_WASTE_RATIO;
mPageSize = ALIGN(mPageSize);
}
diff --git a/libs/input/Android.bp b/libs/input/Android.bp
index 6c0fd5f..5ce990f 100644
--- a/libs/input/Android.bp
+++ b/libs/input/Android.bp
@@ -23,6 +23,12 @@
cc_library_shared {
name: "libinputservice",
+ defaults: [
+ // Build using the same flags and configurations as inputflinger.
+ "inputflinger_defaults",
+ ],
+ host_supported: false,
+
srcs: [
"PointerController.cpp",
"PointerControllerContext.cpp",
@@ -50,12 +56,4 @@
],
include_dirs: ["frameworks/native/services"],
-
- cflags: [
- "-Wall",
- "-Wextra",
- "-Werror",
- "-Wthread-safety",
- ],
-
}
diff --git a/libs/input/MouseCursorController.cpp b/libs/input/MouseCursorController.cpp
index c3ad767..6a46544 100644
--- a/libs/input/MouseCursorController.cpp
+++ b/libs/input/MouseCursorController.cpp
@@ -47,7 +47,7 @@
mLocked.pointerX = 0;
mLocked.pointerY = 0;
mLocked.pointerAlpha = 0.0f; // pointer is initially faded
- mLocked.pointerSprite = mContext.getSpriteController()->createSprite();
+ mLocked.pointerSprite = mContext.getSpriteController().createSprite();
mLocked.updatePointerIcon = false;
mLocked.requestedPointerType = PointerIconStyle::TYPE_NOT_SPECIFIED;
mLocked.resolvedPointerType = PointerIconStyle::TYPE_NOT_SPECIFIED;
@@ -325,8 +325,8 @@
}
if (timestamp - mLocked.lastFrameUpdatedTime > iter->second.durationPerFrame) {
- sp<SpriteController> spriteController = mContext.getSpriteController();
- spriteController->openTransaction();
+ auto& spriteController = mContext.getSpriteController();
+ spriteController.openTransaction();
int incr = (timestamp - mLocked.lastFrameUpdatedTime) / iter->second.durationPerFrame;
mLocked.animationFrameIndex += incr;
@@ -336,7 +336,7 @@
}
mLocked.pointerSprite->setIcon(iter->second.animationFrames[mLocked.animationFrameIndex]);
- spriteController->closeTransaction();
+ spriteController.closeTransaction();
}
// Keep animating.
return true;
@@ -346,8 +346,8 @@
if (!mLocked.viewport.isValid()) {
return;
}
- sp<SpriteController> spriteController = mContext.getSpriteController();
- spriteController->openTransaction();
+ auto& spriteController = mContext.getSpriteController();
+ spriteController.openTransaction();
mLocked.pointerSprite->setLayer(Sprite::BASE_LAYER_POINTER);
mLocked.pointerSprite->setPosition(mLocked.pointerX, mLocked.pointerY);
@@ -392,7 +392,7 @@
mLocked.updatePointerIcon = false;
}
- spriteController->closeTransaction();
+ spriteController.closeTransaction();
}
void MouseCursorController::loadResourcesLocked(bool getAdditionalMouseResources) REQUIRES(mLock) {
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp
index e21d6fb..435452c 100644
--- a/libs/input/PointerController.cpp
+++ b/libs/input/PointerController.cpp
@@ -63,7 +63,7 @@
std::shared_ptr<PointerController> PointerController::create(
const sp<PointerControllerPolicyInterface>& policy, const sp<Looper>& looper,
- const sp<SpriteController>& spriteController) {
+ SpriteController& spriteController) {
// using 'new' to access non-public constructor
std::shared_ptr<PointerController> controller = std::shared_ptr<PointerController>(
new PointerController(policy, looper, spriteController));
@@ -85,8 +85,7 @@
}
PointerController::PointerController(const sp<PointerControllerPolicyInterface>& policy,
- const sp<Looper>& looper,
- const sp<SpriteController>& spriteController)
+ const sp<Looper>& looper, SpriteController& spriteController)
: PointerController(
policy, looper, spriteController,
[](const sp<android::gui::WindowInfosListener>& listener) {
@@ -97,13 +96,12 @@
}) {}
PointerController::PointerController(const sp<PointerControllerPolicyInterface>& policy,
- const sp<Looper>& looper,
- const sp<SpriteController>& spriteController,
+ const sp<Looper>& looper, SpriteController& spriteController,
WindowListenerConsumer registerListener,
WindowListenerConsumer unregisterListener)
: mContext(policy, looper, spriteController, *this),
mCursorController(mContext),
- mDisplayInfoListener(new DisplayInfoListener(this)),
+ mDisplayInfoListener(sp<DisplayInfoListener>::make(this)),
mUnregisterWindowInfosListener(std::move(unregisterListener)) {
std::scoped_lock lock(getLock());
mLocked.presentation = Presentation::SPOT;
diff --git a/libs/input/PointerController.h b/libs/input/PointerController.h
index 62ee743..c7e772d 100644
--- a/libs/input/PointerController.h
+++ b/libs/input/PointerController.h
@@ -47,7 +47,7 @@
public:
static std::shared_ptr<PointerController> create(
const sp<PointerControllerPolicyInterface>& policy, const sp<Looper>& looper,
- const sp<SpriteController>& spriteController);
+ SpriteController& spriteController);
~PointerController() override;
@@ -83,13 +83,12 @@
// Constructor used to test WindowInfosListener registration.
PointerController(const sp<PointerControllerPolicyInterface>& policy, const sp<Looper>& looper,
- const sp<SpriteController>& spriteController,
- WindowListenerConsumer registerListener,
+ SpriteController& spriteController, WindowListenerConsumer registerListener,
WindowListenerConsumer unregisterListener);
private:
PointerController(const sp<PointerControllerPolicyInterface>& policy, const sp<Looper>& looper,
- const sp<SpriteController>& spriteController);
+ SpriteController& spriteController);
friend PointerControllerContext::LooperCallback;
friend PointerControllerContext::MessageHandler;
diff --git a/libs/input/PointerControllerContext.cpp b/libs/input/PointerControllerContext.cpp
index f30e8d8..15c3517 100644
--- a/libs/input/PointerControllerContext.cpp
+++ b/libs/input/PointerControllerContext.cpp
@@ -32,12 +32,12 @@
PointerControllerContext::PointerControllerContext(
const sp<PointerControllerPolicyInterface>& policy, const sp<Looper>& looper,
- const sp<SpriteController>& spriteController, PointerController& controller)
+ SpriteController& spriteController, PointerController& controller)
: mPolicy(policy),
mLooper(looper),
mSpriteController(spriteController),
- mHandler(new MessageHandler()),
- mCallback(new LooperCallback()),
+ mHandler(sp<MessageHandler>::make()),
+ mCallback(sp<LooperCallback>::make()),
mController(controller),
mAnimator(*this) {
std::scoped_lock lock(mLock);
@@ -93,7 +93,7 @@
return mPolicy;
}
-sp<SpriteController> PointerControllerContext::getSpriteController() {
+SpriteController& PointerControllerContext::getSpriteController() {
return mSpriteController;
}
diff --git a/libs/input/PointerControllerContext.h b/libs/input/PointerControllerContext.h
index f6f5d3b..98c3988 100644
--- a/libs/input/PointerControllerContext.h
+++ b/libs/input/PointerControllerContext.h
@@ -92,7 +92,7 @@
class PointerControllerContext {
public:
PointerControllerContext(const sp<PointerControllerPolicyInterface>& policy,
- const sp<Looper>& looper, const sp<SpriteController>& spriteController,
+ const sp<Looper>& looper, SpriteController& spriteController,
PointerController& controller);
~PointerControllerContext();
@@ -109,7 +109,7 @@
void setCallbackController(std::shared_ptr<PointerController> controller);
sp<PointerControllerPolicyInterface> getPolicy();
- sp<SpriteController> getSpriteController();
+ SpriteController& getSpriteController();
void handleDisplayEvents();
@@ -163,7 +163,7 @@
sp<PointerControllerPolicyInterface> mPolicy;
sp<Looper> mLooper;
- sp<SpriteController> mSpriteController;
+ SpriteController& mSpriteController;
sp<MessageHandler> mHandler;
sp<LooperCallback> mCallback;
diff --git a/libs/input/SpriteController.cpp b/libs/input/SpriteController.cpp
index 130b204..6dc45a6 100644
--- a/libs/input/SpriteController.cpp
+++ b/libs/input/SpriteController.cpp
@@ -31,12 +31,19 @@
ParentSurfaceProvider parentSurfaceProvider)
: mLooper(looper),
mOverlayLayer(overlayLayer),
+ mHandler(sp<Handler>::make()),
mParentSurfaceProvider(std::move(parentSurfaceProvider)) {
- mHandler = new WeakMessageHandler(this);
mLocked.transactionNestingCount = 0;
mLocked.deferredSpriteUpdate = false;
}
+void SpriteController::setHandlerController(
+ const std::shared_ptr<android::SpriteController>& controller) {
+ // Initialize the weak message handler outside the constructor, because we cannot get a shared
+ // pointer to self in the constructor.
+ mHandler->spriteController = controller;
+}
+
SpriteController::~SpriteController() {
mLooper->removeMessages(mHandler);
@@ -47,7 +54,7 @@
}
sp<Sprite> SpriteController::createSprite() {
- return new SpriteImpl(this);
+ return sp<SpriteImpl>::make(*this);
}
void SpriteController::openTransaction() {
@@ -65,7 +72,7 @@
mLocked.transactionNestingCount -= 1;
if (mLocked.transactionNestingCount == 0 && mLocked.deferredSpriteUpdate) {
mLocked.deferredSpriteUpdate = false;
- mLooper->sendMessage(mHandler, Message(MSG_UPDATE_SPRITES));
+ mLooper->sendMessage(mHandler, Message(Handler::MSG_UPDATE_SPRITES));
}
}
@@ -76,7 +83,7 @@
if (mLocked.transactionNestingCount != 0) {
mLocked.deferredSpriteUpdate = true;
} else {
- mLooper->sendMessage(mHandler, Message(MSG_UPDATE_SPRITES));
+ mLooper->sendMessage(mHandler, Message(Handler::MSG_UPDATE_SPRITES));
}
}
}
@@ -85,18 +92,7 @@
bool wasEmpty = mLocked.disposedSurfaces.empty();
mLocked.disposedSurfaces.push_back(surfaceControl);
if (wasEmpty) {
- mLooper->sendMessage(mHandler, Message(MSG_DISPOSE_SURFACES));
- }
-}
-
-void SpriteController::handleMessage(const Message& message) {
- switch (message.what) {
- case MSG_UPDATE_SPRITES:
- doUpdateSprites();
- break;
- case MSG_DISPOSE_SURFACES:
- doDisposeSurfaces();
- break;
+ mLooper->sendMessage(mHandler, Message(Handler::MSG_DISPOSE_SURFACES));
}
}
@@ -327,7 +323,7 @@
void SpriteController::ensureSurfaceComposerClient() {
if (mSurfaceComposerClient == NULL) {
- mSurfaceComposerClient = new SurfaceComposerClient();
+ mSurfaceComposerClient = sp<SurfaceComposerClient>::make();
}
}
@@ -353,25 +349,41 @@
return surfaceControl;
}
-// --- SpriteController::SpriteImpl ---
+// --- SpriteController::Handler ---
-SpriteController::SpriteImpl::SpriteImpl(const sp<SpriteController> controller) :
- mController(controller) {
+void SpriteController::Handler::handleMessage(const android::Message& message) {
+ auto controller = spriteController.lock();
+ if (!controller) {
+ return;
+ }
+
+ switch (message.what) {
+ case MSG_UPDATE_SPRITES:
+ controller->doUpdateSprites();
+ break;
+ case MSG_DISPOSE_SURFACES:
+ controller->doDisposeSurfaces();
+ break;
+ }
}
+// --- SpriteController::SpriteImpl ---
+
+SpriteController::SpriteImpl::SpriteImpl(SpriteController& controller) : mController(controller) {}
+
SpriteController::SpriteImpl::~SpriteImpl() {
- AutoMutex _m(mController->mLock);
+ AutoMutex _m(mController.mLock);
// Let the controller take care of deleting the last reference to sprite
// surfaces so that we do not block the caller on an IPC here.
if (mLocked.state.surfaceControl != NULL) {
- mController->disposeSurfaceLocked(mLocked.state.surfaceControl);
+ mController.disposeSurfaceLocked(mLocked.state.surfaceControl);
mLocked.state.surfaceControl.clear();
}
}
void SpriteController::SpriteImpl::setIcon(const SpriteIcon& icon) {
- AutoMutex _l(mController->mLock);
+ AutoMutex _l(mController.mLock);
uint32_t dirty;
if (icon.isValid()) {
@@ -401,7 +413,7 @@
}
void SpriteController::SpriteImpl::setVisible(bool visible) {
- AutoMutex _l(mController->mLock);
+ AutoMutex _l(mController.mLock);
if (mLocked.state.visible != visible) {
mLocked.state.visible = visible;
@@ -410,7 +422,7 @@
}
void SpriteController::SpriteImpl::setPosition(float x, float y) {
- AutoMutex _l(mController->mLock);
+ AutoMutex _l(mController.mLock);
if (mLocked.state.positionX != x || mLocked.state.positionY != y) {
mLocked.state.positionX = x;
@@ -420,7 +432,7 @@
}
void SpriteController::SpriteImpl::setLayer(int32_t layer) {
- AutoMutex _l(mController->mLock);
+ AutoMutex _l(mController.mLock);
if (mLocked.state.layer != layer) {
mLocked.state.layer = layer;
@@ -429,7 +441,7 @@
}
void SpriteController::SpriteImpl::setAlpha(float alpha) {
- AutoMutex _l(mController->mLock);
+ AutoMutex _l(mController.mLock);
if (mLocked.state.alpha != alpha) {
mLocked.state.alpha = alpha;
@@ -439,7 +451,7 @@
void SpriteController::SpriteImpl::setTransformationMatrix(
const SpriteTransformationMatrix& matrix) {
- AutoMutex _l(mController->mLock);
+ AutoMutex _l(mController.mLock);
if (mLocked.state.transformationMatrix != matrix) {
mLocked.state.transformationMatrix = matrix;
@@ -448,7 +460,7 @@
}
void SpriteController::SpriteImpl::setDisplayId(int32_t displayId) {
- AutoMutex _l(mController->mLock);
+ AutoMutex _l(mController.mLock);
if (mLocked.state.displayId != displayId) {
mLocked.state.displayId = displayId;
@@ -461,7 +473,7 @@
mLocked.state.dirty |= dirty;
if (!wasDirty) {
- mController->invalidateSpriteLocked(this);
+ mController.invalidateSpriteLocked(sp<SpriteImpl>::fromExisting(this));
}
}
diff --git a/libs/input/SpriteController.h b/libs/input/SpriteController.h
index 1f113c0..04ecb38 100644
--- a/libs/input/SpriteController.h
+++ b/libs/input/SpriteController.h
@@ -109,15 +109,19 @@
*
* Clients are responsible for animating sprites by periodically updating their properties.
*/
-class SpriteController : public MessageHandler {
-protected:
- virtual ~SpriteController();
-
+class SpriteController {
public:
using ParentSurfaceProvider = std::function<sp<SurfaceControl>(int /*displayId*/)>;
SpriteController(const sp<Looper>& looper, int32_t overlayLayer, ParentSurfaceProvider parent);
+ SpriteController(const SpriteController&) = delete;
+ SpriteController& operator=(const SpriteController&) = delete;
+ virtual ~SpriteController();
- /* Creates a new sprite, initially invisible. */
+ /* Initialize the callback for the message handler. */
+ void setHandlerController(const std::shared_ptr<SpriteController>& controller);
+
+ /* Creates a new sprite, initially invisible. The lifecycle of the sprite must not extend beyond
+ * the lifecycle of this SpriteController. */
virtual sp<Sprite> createSprite();
/* Opens or closes a transaction to perform a batch of sprite updates as part of
@@ -129,9 +133,12 @@
virtual void closeTransaction();
private:
- enum {
- MSG_UPDATE_SPRITES,
- MSG_DISPOSE_SURFACES,
+ class Handler : public virtual android::MessageHandler {
+ public:
+ enum { MSG_UPDATE_SPRITES, MSG_DISPOSE_SURFACES };
+
+ void handleMessage(const Message& message) override;
+ std::weak_ptr<SpriteController> spriteController;
};
enum {
@@ -192,7 +199,7 @@
virtual ~SpriteImpl();
public:
- explicit SpriteImpl(const sp<SpriteController> controller);
+ explicit SpriteImpl(SpriteController& controller);
virtual void setIcon(const SpriteIcon& icon);
virtual void setVisible(bool visible);
@@ -220,7 +227,7 @@
}
private:
- sp<SpriteController> mController;
+ SpriteController& mController;
struct Locked {
SpriteState state;
@@ -245,7 +252,7 @@
sp<Looper> mLooper;
const int32_t mOverlayLayer;
- sp<WeakMessageHandler> mHandler;
+ sp<Handler> mHandler;
ParentSurfaceProvider mParentSurfaceProvider;
sp<SurfaceComposerClient> mSurfaceComposerClient;
@@ -260,7 +267,6 @@
void invalidateSpriteLocked(const sp<SpriteImpl>& sprite);
void disposeSurfaceLocked(const sp<SurfaceControl>& surfaceControl);
- void handleMessage(const Message& message);
void doUpdateSprites();
void doDisposeSurfaces();
diff --git a/libs/input/TouchSpotController.cpp b/libs/input/TouchSpotController.cpp
index d9fe599..b8de919 100644
--- a/libs/input/TouchSpotController.cpp
+++ b/libs/input/TouchSpotController.cpp
@@ -39,15 +39,15 @@
// --- Spot ---
-void TouchSpotController::Spot::updateSprite(const SpriteIcon* icon, float x, float y,
+void TouchSpotController::Spot::updateSprite(const SpriteIcon* icon, float newX, float newY,
int32_t displayId) {
sprite->setLayer(Sprite::BASE_LAYER_SPOT + id);
sprite->setAlpha(alpha);
sprite->setTransformationMatrix(SpriteTransformationMatrix(scale, 0.0f, 0.0f, scale));
- sprite->setPosition(x, y);
+ sprite->setPosition(newX, newY);
sprite->setDisplayId(displayId);
- this->x = x;
- this->y = y;
+ x = newX;
+ y = newY;
if (icon != mLastIcon) {
mLastIcon = icon;
@@ -98,8 +98,8 @@
#endif
std::scoped_lock lock(mLock);
- sp<SpriteController> spriteController = mContext.getSpriteController();
- spriteController->openTransaction();
+ auto& spriteController = mContext.getSpriteController();
+ spriteController.openTransaction();
// Add or move spots for fingers that are down.
for (BitSet32 idBits(spotIdBits); !idBits.isEmpty();) {
@@ -125,7 +125,7 @@
}
}
- spriteController->closeTransaction();
+ spriteController.closeTransaction();
}
void TouchSpotController::clearSpots() {
@@ -167,7 +167,7 @@
sprite = mLocked.recycledSprites.back();
mLocked.recycledSprites.pop_back();
} else {
- sprite = mContext.getSpriteController()->createSprite();
+ sprite = mContext.getSpriteController().createSprite();
}
// Return the new spot.
diff --git a/libs/input/tests/PointerController_test.cpp b/libs/input/tests/PointerController_test.cpp
index 8574751..3e2e43f 100644
--- a/libs/input/tests/PointerController_test.cpp
+++ b/libs/input/tests/PointerController_test.cpp
@@ -157,7 +157,7 @@
sp<MockSprite> mPointerSprite;
sp<MockPointerControllerPolicyInterface> mPolicy;
- sp<MockSpriteController> mSpriteController;
+ std::unique_ptr<MockSpriteController> mSpriteController;
std::shared_ptr<PointerController> mPointerController;
private:
@@ -175,14 +175,13 @@
PointerControllerTest::PointerControllerTest() : mPointerSprite(new NiceMock<MockSprite>),
mLooper(new MyLooper), mThread(&PointerControllerTest::loopThread, this) {
-
- mSpriteController = new NiceMock<MockSpriteController>(mLooper);
+ mSpriteController.reset(new NiceMock<MockSpriteController>(mLooper));
mPolicy = new MockPointerControllerPolicyInterface();
EXPECT_CALL(*mSpriteController, createSprite())
.WillOnce(Return(mPointerSprite));
- mPointerController = PointerController::create(mPolicy, mLooper, mSpriteController);
+ mPointerController = PointerController::create(mPolicy, mLooper, *mSpriteController);
}
PointerControllerTest::~PointerControllerTest() {
@@ -319,10 +318,9 @@
class TestPointerController : public PointerController {
public:
TestPointerController(sp<android::gui::WindowInfosListener>& registeredListener,
- const sp<Looper>& looper)
+ const sp<Looper>& looper, SpriteController& spriteController)
: PointerController(
- new MockPointerControllerPolicyInterface(), looper,
- new NiceMock<MockSpriteController>(looper),
+ new MockPointerControllerPolicyInterface(), looper, spriteController,
[®isteredListener](const sp<android::gui::WindowInfosListener>& listener) {
// Register listener
registeredListener = listener;
@@ -335,10 +333,12 @@
TEST_F(PointerControllerWindowInfoListenerTest,
doesNotCrashIfListenerCalledAfterPointerControllerDestroyed) {
+ sp<Looper> looper = new Looper(false);
+ auto spriteController = NiceMock<MockSpriteController>(looper);
sp<android::gui::WindowInfosListener> registeredListener;
sp<android::gui::WindowInfosListener> localListenerCopy;
{
- TestPointerController pointerController(registeredListener, new Looper(false));
+ TestPointerController pointerController(registeredListener, looper, spriteController);
ASSERT_NE(nullptr, registeredListener) << "WindowInfosListener was not registered";
localListenerCopy = registeredListener;
}
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index e8c9d0d..e2f4072 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -4739,6 +4739,97 @@
/**
* @hide
+ * Test method to return the list of UIDs currently marked as ducked because of their
+ * audio focus status
+ * @return the list of UIDs, can be empty when no app is being ducked.
+ */
+ @TestApi
+ @RequiresPermission("android.permission.QUERY_AUDIO_STATE")
+ public @NonNull List<Integer> getFocusDuckedUidsForTest() {
+ try {
+ return getService().getFocusDuckedUidsForTest();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * @hide
+ * Test method to return the duration of the fade out applied on the players of a focus loser
+ * @return the fade out duration in ms
+ */
+ @TestApi
+ @RequiresPermission("android.permission.QUERY_AUDIO_STATE")
+ public long getFocusFadeOutDurationForTest() {
+ try {
+ return getService().getFocusFadeOutDurationForTest();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * @hide
+ * Test method to return the length of time after a fade-out before the focus loser is unmuted
+ * (and is faded back in).
+ * @return the time gap after a fade-out completion on focus loss, and fade-in start in ms.
+ */
+ @TestApi
+ @RequiresPermission("android.permission.QUERY_AUDIO_STATE")
+ public long getFocusUnmuteDelayAfterFadeOutForTest() {
+ try {
+ return getService().getFocusUnmuteDelayAfterFadeOutForTest();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * @hide
+ * Test method to start preventing applications from requesting audio focus during a test,
+ * which could interfere with the functionality/behavior under test.
+ * Calling this method needs to be paired with a call to {@link #exitAudioFocusFreezeForTest}
+ * when the testing is done. If this is not the case (e.g. in case of a test crash),
+ * a death observer mechanism will ensure the system is not left in a bad state, but this should
+ * not be relied on when implementing tests.
+ * @param exemptedUids a list of UIDs that are exempt from the freeze. This would for instance
+ * be those of the test runner and other players used in the test, or the "fake" UIDs used
+ * for testing with {@link #requestAudioFocusForTest(AudioFocusRequest, String, int, int)}.
+ * @return true if the focus freeze mode is successfully entered, false if there was an issue,
+ * such as another freeze in place at the time of invocation.
+ * A false result should result in a test failure as this would indicate the system is not
+ * in a proper state with a predictable behavior for audio focus management.
+ */
+ @TestApi
+ @RequiresPermission("Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED")
+ public boolean enterAudioFocusFreezeForTest(@NonNull List<Integer> exemptedUids) {
+ Objects.requireNonNull(exemptedUids);
+ try {
+ final int[] uids = exemptedUids.stream().mapToInt(Integer::intValue).toArray();
+ return getService().enterAudioFocusFreezeForTest(mICallBack, uids);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * @hide
+ * Test method to end preventing applications from requesting audio focus during a test.
+ * @return true if the focus freeze mode is successfully exited, false if there was an issue,
+ * such as the freeze already having ended, or not started.
+ */
+ @TestApi
+ @RequiresPermission("Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED")
+ public boolean exitAudioFocusFreezeForTest() {
+ try {
+ return getService().exitAudioFocusFreezeForTest(mICallBack);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * @hide
* Request or lock audio focus.
* This method is to be used by system components that have registered an
* {@link android.media.audiopolicy.AudioPolicy} to request audio focus, but also to "lock" it
@@ -6915,7 +7006,10 @@
/**
* @hide
- * Returns whether CSD is enabled and supported by the HAL on this device.
+ * Returns whether CSD is enabled and supported by the current active audio module HAL.
+ * This method will return {@code false) for setups in which CSD as a feature is available
+ * (see {@link AudioManager#isCsdAsAFeatureAvailable()}) and not enabled (see
+ * {@link AudioManager#isCsdAsAFeatureEnabled()}).
*/
@TestApi
@RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED)
@@ -6929,6 +7023,49 @@
/**
* @hide
+ * Returns whether CSD as a feature can be manipulated by a client. This method
+ * returns {@code true} in countries where there isn't a safe hearing regulation
+ * enforced.
+ */
+ @RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED)
+ public boolean isCsdAsAFeatureAvailable() {
+ try {
+ return getService().isCsdAsAFeatureAvailable();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * @hide
+ * Returns {@code true} if the client has enabled CSD. This function should only
+ * be called if {@link AudioManager#isCsdAsAFeatureAvailable()} returns {@code true}.
+ */
+ @RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED)
+ public boolean isCsdAsAFeatureEnabled() {
+ try {
+ return getService().isCsdAsAFeatureEnabled();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * @hide
+ * Enables/disables the CSD feature. This function should only be called if
+ * {@link AudioManager#isCsdAsAFeatureAvailable()} returns {@code true}.
+ */
+ @RequiresPermission(Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED)
+ public void setCsdAsAFeatureEnabled(boolean csdToggleValue) {
+ try {
+ getService().setCsdAsAFeatureEnabled(csdToggleValue);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * @hide
* Describes an audio device that has not been categorized with a specific
* audio type.
*/
diff --git a/media/java/android/media/IAudioService.aidl b/media/java/android/media/IAudioService.aidl
index b2466e9..e45ef40 100644
--- a/media/java/android/media/IAudioService.aidl
+++ b/media/java/android/media/IAudioService.aidl
@@ -325,6 +325,15 @@
boolean isCsdEnabled();
@EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED")
+ boolean isCsdAsAFeatureAvailable();
+
+ @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED")
+ boolean isCsdAsAFeatureEnabled();
+
+ @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED")
+ oneway void setCsdAsAFeatureEnabled(boolean csdToggleValue);
+
+ @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED")
oneway void setBluetoothAudioDeviceCategory(in String address, boolean isBle, int deviceType);
@EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED")
@@ -520,6 +529,23 @@
long getFadeOutDurationOnFocusLossMillis(in AudioAttributes aa);
+ @EnforcePermission("QUERY_AUDIO_STATE")
+ /* Returns a List<Integer> */
+ @SuppressWarnings(value = {"untyped-collection"})
+ List getFocusDuckedUidsForTest();
+
+ @EnforcePermission("QUERY_AUDIO_STATE")
+ long getFocusFadeOutDurationForTest();
+
+ @EnforcePermission("QUERY_AUDIO_STATE")
+ long getFocusUnmuteDelayAfterFadeOutForTest();
+
+ @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED")
+ boolean enterAudioFocusFreezeForTest(IBinder cb, in int[] uids);
+
+ @EnforcePermission("MODIFY_AUDIO_SETTINGS_PRIVILEGED")
+ boolean exitAudioFocusFreezeForTest(IBinder cb);
+
void registerModeDispatcher(IAudioModeDispatcher dispatcher);
oneway void unregisterModeDispatcher(IAudioModeDispatcher dispatcher);
diff --git a/media/java/android/media/projection/IMediaProjectionManager.aidl b/media/java/android/media/projection/IMediaProjectionManager.aidl
index 304eecb..d294601 100644
--- a/media/java/android/media/projection/IMediaProjectionManager.aidl
+++ b/media/java/android/media/projection/IMediaProjectionManager.aidl
@@ -108,6 +108,7 @@
+ ".permission.MANAGE_MEDIA_PROJECTION)")
void notifyActiveProjectionCapturedContentVisibilityChanged(boolean isVisible);
+ @EnforcePermission("MANAGE_MEDIA_PROJECTION")
@JavaPassthrough(annotation = "@android.annotation.RequiresPermission(android.Manifest"
+ ".permission.MANAGE_MEDIA_PROJECTION)")
void addCallback(IMediaProjectionWatcherCallback callback);
diff --git a/media/java/android/media/session/MediaSessionManager.java b/media/java/android/media/session/MediaSessionManager.java
index 0d9bd65..371b47f 100644
--- a/media/java/android/media/session/MediaSessionManager.java
+++ b/media/java/android/media/session/MediaSessionManager.java
@@ -617,7 +617,7 @@
mService.dispatchMediaKeyEvent(mContext.getPackageName(), asSystemService, keyEvent,
needWakeLock);
} catch (RemoteException e) {
- Log.e(TAG, "Failed to send key event.", e);
+ e.rethrowFromSystemServer();
}
}
diff --git a/media/tests/MediaRouter/src/com/android/mediaroutertest/MediaRouter2ManagerTest.java b/media/tests/MediaRouter/src/com/android/mediaroutertest/MediaRouter2ManagerTest.java
index ac8e4d4..8ed4bf2 100644
--- a/media/tests/MediaRouter/src/com/android/mediaroutertest/MediaRouter2ManagerTest.java
+++ b/media/tests/MediaRouter/src/com/android/mediaroutertest/MediaRouter2ManagerTest.java
@@ -920,7 +920,7 @@
CountDownLatch addedLatch = new CountDownLatch(1);
CountDownLatch preferenceLatch = new CountDownLatch(1);
- // A dummy callback is required to send route feature info.
+ // A placeholder callback is required to send route feature info.
RouteCallback routeCallback = new RouteCallback() {};
MediaRouter2Manager.Callback managerCallback =
new MediaRouter2Manager.Callback() {
diff --git a/native/android/performance_hint.cpp b/native/android/performance_hint.cpp
index c25df6e..c571b74 100644
--- a/native/android/performance_hint.cpp
+++ b/native/android/performance_hint.cpp
@@ -144,6 +144,8 @@
binder::Status ret =
mHintManager->createHintSession(mToken, tids, initialTargetWorkDurationNanos, &session);
if (!ret.isOk() || !session) {
+ ALOGE("%s: PerformanceHint cannot create hint session. %s", __FUNCTION__,
+ ret.exceptionMessage().c_str());
return nullptr;
}
return new APerformanceHintSession(mHintManager, std::move(session), mPreferredRateNanos,
diff --git a/packages/CredentialManager/res/values-zh-rCN/strings.xml b/packages/CredentialManager/res/values-zh-rCN/strings.xml
index 42eaf00..15a668a 100644
--- a/packages/CredentialManager/res/values-zh-rCN/strings.xml
+++ b/packages/CredentialManager/res/values-zh-rCN/strings.xml
@@ -33,7 +33,7 @@
<string name="passwordless_technology_detail" msgid="6853928846532955882">"借助通行密钥,您不必依赖密码就能登录。您只需使用指纹、人脸识别功能、PIN 码或滑动图案便可验证您的身份并创建通行密钥。"</string>
<string name="public_key_cryptography_title" msgid="6751970819265298039">"公钥加密"</string>
<string name="public_key_cryptography_detail" msgid="6937631710280562213">"根据 FIDO 联盟(成员包括 Google、Apple、Microsoft 等)和 W3C 的标准,通行密钥使用加密密钥对。不同于“用户名+密码字符串”的传统登录凭据,采用通行密钥时,系统会为应用或网站创建一个私钥-公钥对。私钥会安全地存储在您的设备上或密码管理工具中,用于证实您的身份。公钥会被共享给应用或网站服务器。您只要使用相应密钥,就能瞬间注册并登录。"</string>
- <string name="improved_account_security_title" msgid="1069841917893513424">"提升了帐号安全性"</string>
+ <string name="improved_account_security_title" msgid="1069841917893513424">"提升了账号安全性"</string>
<string name="improved_account_security_detail" msgid="9123750251551844860">"每个密钥都是专为特定应用或网站创建的,且仅与各自对应的网站或应用关联,因此您绝不会错误地登录任何欺诈性应用或网站。另外,由于服务器只保留公钥,黑客入侵的难度会大大增加。"</string>
<string name="seamless_transition_title" msgid="5335622196351371961">"无缝转换"</string>
<string name="seamless_transition_detail" msgid="4475509237171739843">"在我们向无密码未来迈进的过程中,密码仍会与通行密钥并行使用。"</string>
diff --git a/packages/CtsShim/build/Android.bp b/packages/CtsShim/build/Android.bp
index d778feb..d6b7ecf 100644
--- a/packages/CtsShim/build/Android.bp
+++ b/packages/CtsShim/build/Android.bp
@@ -208,3 +208,22 @@
],
min_sdk_version: "24",
}
+
+//##########################################################
+// Variant: Add apk to an apex
+android_app {
+ name: "CtsShimAddApkToApex",
+ sdk_version: "current",
+ srcs: ["shim_add_apk_to_apex/src/android/addapktoapex/app/AddApkToApexDeviceActivity.java"],
+ optimize: {
+ enabled: false,
+ },
+ dex_preopt: {
+ enabled: false,
+ },
+ manifest: "shim_add_apk_to_apex/AndroidManifestAddApkToApex.xml",
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.apex.cts.shim.v2_add_apk_to_apex",
+ ],
+}
diff --git a/packages/CtsShim/build/shim_add_apk_to_apex/AndroidManifestAddApkToApex.xml b/packages/CtsShim/build/shim_add_apk_to_apex/AndroidManifestAddApkToApex.xml
new file mode 100644
index 0000000..0e620b0
--- /dev/null
+++ b/packages/CtsShim/build/shim_add_apk_to_apex/AndroidManifestAddApkToApex.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * 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.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="android.addapktoapex.app">
+
+ <application>
+ <activity android:name=".AddApkToApexDeviceActivity"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
\ No newline at end of file
diff --git a/packages/CtsShim/build/shim_add_apk_to_apex/src/android/addapktoapex/app/AddApkToApexDeviceActivity.java b/packages/CtsShim/build/shim_add_apk_to_apex/src/android/addapktoapex/app/AddApkToApexDeviceActivity.java
new file mode 100644
index 0000000..c68904b
--- /dev/null
+++ b/packages/CtsShim/build/shim_add_apk_to_apex/src/android/addapktoapex/app/AddApkToApexDeviceActivity.java
@@ -0,0 +1,42 @@
+/*
+ * 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.addapktoapex.app;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.util.Log;
+
+/**
+ * A simple activity which logs to Logcat.
+ */
+public class AddApkToApexDeviceActivity extends Activity {
+
+ private static final String TAG = AddApkToApexDeviceActivity.class.getSimpleName();
+
+ /**
+ * The test string to log.
+ */
+ private static final String TEST_STRING = "AddApkToApexTestString";
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ // Log the test string to Logcat.
+ Log.i(TAG, TEST_STRING);
+ }
+
+}
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/InstallStart.java b/packages/PackageInstaller/src/com/android/packageinstaller/InstallStart.java
index f2f019d9..736e0ef 100644
--- a/packages/PackageInstaller/src/com/android/packageinstaller/InstallStart.java
+++ b/packages/PackageInstaller/src/com/android/packageinstaller/InstallStart.java
@@ -34,7 +34,6 @@
import android.os.Bundle;
import android.os.Process;
import android.os.UserManager;
-import android.provider.Settings;
import android.text.TextUtils;
import android.util.EventLog;
import android.util.Log;
@@ -51,12 +50,10 @@
public class InstallStart extends Activity {
private static final String TAG = InstallStart.class.getSimpleName();
-
- private static final int DLG_INSTALL_APPS_RESTRICTED_FOR_USER = 1;
- private static final int DLG_UNKNOWN_SOURCES_RESTRICTED_FOR_USER = 2;
private PackageManager mPackageManager;
private UserManager mUserManager;
private boolean mAbortInstall = false;
+ private boolean mShouldFinish = true;
private final boolean mLocalLOGV = false;
@@ -131,7 +128,7 @@
mAbortInstall = true;
}
- checkDevicePolicyRestriction();
+ checkDevicePolicyRestrictions();
final String installerPackageNameFromIntent = getIntent().getStringExtra(
Intent.EXTRA_INSTALLER_PACKAGE_NAME);
@@ -150,7 +147,9 @@
if (mAbortInstall) {
setResult(RESULT_CANCELED);
- finish();
+ if (mShouldFinish) {
+ finish();
+ }
return;
}
@@ -281,58 +280,52 @@
return originatingUid == installerUid;
}
- private void checkDevicePolicyRestriction() {
- // Check for install apps user restriction first.
- final int installAppsRestrictionSource = mUserManager.getUserRestrictionSource(
- UserManager.DISALLOW_INSTALL_APPS, Process.myUserHandle());
- if ((installAppsRestrictionSource & UserManager.RESTRICTION_SOURCE_SYSTEM) != 0) {
- if (mLocalLOGV) Log.i(TAG, "install not allowed: " + UserManager.DISALLOW_INSTALL_APPS);
- mAbortInstall = true;
- showDialogInner(DLG_INSTALL_APPS_RESTRICTED_FOR_USER);
- return;
- } else if (installAppsRestrictionSource != UserManager.RESTRICTION_NOT_SET) {
- if (mLocalLOGV) {
- Log.i(TAG, "install not allowed by admin; showing "
- + Settings.ACTION_SHOW_ADMIN_SUPPORT_DETAILS);
- }
- mAbortInstall = true;
- startActivity(new Intent(Settings.ACTION_SHOW_ADMIN_SUPPORT_DETAILS));
- return;
- }
+ private void checkDevicePolicyRestrictions() {
+ final String[] restrictions = new String[] {
+ UserManager.DISALLOW_INSTALL_APPS,
+ UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES,
+ UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY
+ };
- final int unknownSourcesRestrictionSource = mUserManager.getUserRestrictionSource(
- UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, Process.myUserHandle());
- final int unknownSourcesGlobalRestrictionSource = mUserManager.getUserRestrictionSource(
- UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY, Process.myUserHandle());
- final int systemRestriction = UserManager.RESTRICTION_SOURCE_SYSTEM
- & (unknownSourcesRestrictionSource | unknownSourcesGlobalRestrictionSource);
- if (systemRestriction != 0) {
- if (mLocalLOGV) Log.i(TAG, "Showing DLG_UNKNOWN_SOURCES_RESTRICTED_FOR_USER");
+ final DevicePolicyManager dpm = getSystemService(DevicePolicyManager.class);
+ for (String restriction : restrictions) {
+ if (!mUserManager.hasUserRestrictionForUser(restriction, Process.myUserHandle())) {
+ continue;
+ }
+
mAbortInstall = true;
- showDialogInner(DLG_UNKNOWN_SOURCES_RESTRICTED_FOR_USER);
- } else if (unknownSourcesRestrictionSource != UserManager.RESTRICTION_NOT_SET) {
- mAbortInstall = true;
- startAdminSupportDetailsActivity(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES);
- } else if (unknownSourcesGlobalRestrictionSource != UserManager.RESTRICTION_NOT_SET) {
- mAbortInstall = true;
- startAdminSupportDetailsActivity(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY);
+
+ // If the given restriction is set by an admin, display information about the
+ // admin enforcing the restriction for the affected user. If not enforced by the admin,
+ // show the system dialog.
+ final Intent showAdminSupportDetailsIntent = dpm.createAdminSupportIntent(restriction);
+ if (showAdminSupportDetailsIntent != null) {
+ if (mLocalLOGV) Log.i(TAG, "starting " + showAdminSupportDetailsIntent);
+ startActivity(showAdminSupportDetailsIntent);
+ } else {
+ if (mLocalLOGV) Log.i(TAG, "Restriction set by system: " + restriction);
+ mShouldFinish = false;
+ showDialogInner(restriction);
+ }
+ break;
}
}
/**
- * Replace any dialog shown by the dialog with the one for the given {@link #createDialog(int)}.
+ * Replace any dialog shown by the dialog with the one for the given
+ * {@link #createDialog(String)}.
*
- * @param id The dialog type to add
+ * @param restriction The restriction to create the dialog for
*/
- private void showDialogInner(int id) {
- if (mLocalLOGV) Log.i(TAG, "showDialogInner(" + id + ")");
+ private void showDialogInner(String restriction) {
+ if (mLocalLOGV) Log.i(TAG, "showDialogInner(" + restriction + ")");
DialogFragment currentDialog =
(DialogFragment) getFragmentManager().findFragmentByTag("dialog");
if (currentDialog != null) {
currentDialog.dismissAllowingStateLoss();
}
- DialogFragment newDialog = createDialog(id);
+ DialogFragment newDialog = createDialog(restriction);
if (newDialog != null) {
getFragmentManager().beginTransaction()
.add(newDialog, "dialog").commitAllowingStateLoss();
@@ -342,34 +335,20 @@
/**
* Create a new dialog.
*
- * @param id The id of the dialog (determines dialog type)
+ * @param restriction The restriction to create the dialog for
* @return The dialog
*/
- private DialogFragment createDialog(int id) {
- if (mLocalLOGV) Log.i(TAG, "createDialog(" + id + ")");
- switch (id) {
- case DLG_INSTALL_APPS_RESTRICTED_FOR_USER:
+ private DialogFragment createDialog(String restriction) {
+ if (mLocalLOGV) Log.i(TAG, "createDialog(" + restriction + ")");
+ switch (restriction) {
+ case UserManager.DISALLOW_INSTALL_APPS:
return PackageUtil.SimpleErrorDialog.newInstance(
R.string.install_apps_user_restriction_dlg_text);
- case DLG_UNKNOWN_SOURCES_RESTRICTED_FOR_USER:
+ case UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES:
+ case UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY:
return PackageUtil.SimpleErrorDialog.newInstance(
R.string.unknown_apps_user_restriction_dlg_text);
}
return null;
}
-
- private void startAdminSupportDetailsActivity(String restriction) {
- if (mLocalLOGV) Log.i(TAG, "startAdminSupportDetailsActivity(): " + restriction);
-
- // If the given restriction is set by an admin, display information about the
- // admin enforcing the restriction for the affected user.
- final DevicePolicyManager dpm = getSystemService(DevicePolicyManager.class);
- final Intent showAdminSupportDetailsIntent = dpm.createAdminSupportIntent(restriction);
- if (showAdminSupportDetailsIntent != null) {
- if (mLocalLOGV) Log.i(TAG, "starting " + showAdminSupportDetailsIntent);
- startActivity(showAdminSupportDetailsIntent);
- } else {
- if (mLocalLOGV) Log.w(TAG, "not intent for " + restriction);
- }
- }
}
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java
index df91d98..80e8761 100644
--- a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java
+++ b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java
@@ -443,7 +443,7 @@
if (mLocalLOGV) Log.i(TAG, "onResume(): mAppSnippet=" + mAppSnippet);
if (mAppSnippet != null) {
- // load dummy layout with OK button disabled until we override this layout in
+ // load placeholder layout with OK button disabled until we override this layout in
// startInstallConfirm
bindUi();
checkIfAllowedAndInitiateInstall();
diff --git a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/compose/Keyboards.kt b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/compose/Keyboards.kt
index 3f7cc19..b650034 100644
--- a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/compose/Keyboards.kt
+++ b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/compose/Keyboards.kt
@@ -21,7 +21,6 @@
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.snapshotFlow
-import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.filter
@@ -29,7 +28,6 @@
/**
* An action when run, hides the keyboard if it's open.
*/
-@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun hideKeyboardAction(): () -> Unit {
val keyboardController = LocalSoftwareKeyboardController.current
@@ -41,7 +39,6 @@
*
* And when user scrolling the lazy list, hides the keyboard if it's open.
*/
-@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun rememberLazyListStateAndHideKeyboardWhenStartScroll(): LazyListState {
val listState = rememberLazyListState()
diff --git a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/framework/compose/KeyboardsTest.kt b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/framework/compose/KeyboardsTest.kt
index 944ef7f..e9b3109 100644
--- a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/framework/compose/KeyboardsTest.kt
+++ b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/framework/compose/KeyboardsTest.kt
@@ -21,7 +21,6 @@
import androidx.compose.material3.Text
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
-import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.platform.SoftwareKeyboardController
@@ -32,12 +31,11 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mock
-import org.mockito.Mockito.never
-import org.mockito.Mockito.verify
import org.mockito.junit.MockitoJUnit
import org.mockito.junit.MockitoRule
+import org.mockito.kotlin.never
+import org.mockito.kotlin.verify
-@OptIn(ExperimentalComposeUiApi::class)
@RunWith(AndroidJUnit4::class)
class KeyboardsTest {
@get:Rule
diff --git a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/framework/theme/SettingsThemeTest.kt b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/framework/theme/SettingsThemeTest.kt
index 2ff3039..bd8a54b 100644
--- a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/framework/theme/SettingsThemeTest.kt
+++ b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/framework/theme/SettingsThemeTest.kt
@@ -31,10 +31,10 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mock
-import org.mockito.Mockito.anyInt
import org.mockito.junit.MockitoJUnit
import org.mockito.junit.MockitoRule
-import org.mockito.Mockito.`when` as whenever
+import org.mockito.kotlin.any
+import org.mockito.kotlin.whenever
@RunWith(AndroidJUnit4::class)
class SettingsThemeTest {
@@ -55,7 +55,7 @@
@Before
fun setUp() {
whenever(context.resources).thenReturn(resources)
- whenever(resources.getString(anyInt())).thenReturn("")
+ whenever(resources.getString(any())).thenReturn("")
}
private fun mockAndroidConfig(configName: String, configValue: String) {
diff --git a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/framework/util/AnnotatedTextTest.kt b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/framework/util/AnnotatedTextTest.kt
index 2c218e3..5e59620 100644
--- a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/framework/util/AnnotatedTextTest.kt
+++ b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/framework/util/AnnotatedTextTest.kt
@@ -32,9 +32,9 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mock
-import org.mockito.Mockito.verify
import org.mockito.junit.MockitoJUnit
import org.mockito.junit.MockitoRule
+import org.mockito.kotlin.verify
@RunWith(AndroidJUnit4::class)
class AnnotatedTextTest {
diff --git a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/scaffold/SettingsScaffoldTest.kt b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/scaffold/SettingsScaffoldTest.kt
index 872d957..3e8fdec 100644
--- a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/scaffold/SettingsScaffoldTest.kt
+++ b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/scaffold/SettingsScaffoldTest.kt
@@ -33,9 +33,9 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mock
-import org.mockito.Mockito.verify
import org.mockito.junit.MockitoJUnit
import org.mockito.junit.MockitoRule
+import org.mockito.kotlin.verify
@RunWith(AndroidJUnit4::class)
class SettingsScaffoldTest {
diff --git a/packages/SettingsLib/Spa/testutils/Android.bp b/packages/SettingsLib/Spa/testutils/Android.bp
index 65f5d34..4031cd7 100644
--- a/packages/SettingsLib/Spa/testutils/Android.bp
+++ b/packages/SettingsLib/Spa/testutils/Android.bp
@@ -30,7 +30,7 @@
"androidx.compose.ui_ui-test-junit4",
"androidx.compose.ui_ui-test-manifest",
"androidx.lifecycle_lifecycle-runtime-testing",
- "mockito",
+ "mockito-kotlin2",
"truth-prebuilt",
],
kotlincflags: [
diff --git a/packages/SettingsLib/Spa/testutils/build.gradle.kts b/packages/SettingsLib/Spa/testutils/build.gradle.kts
index f5a22c9..50243dc 100644
--- a/packages/SettingsLib/Spa/testutils/build.gradle.kts
+++ b/packages/SettingsLib/Spa/testutils/build.gradle.kts
@@ -41,7 +41,12 @@
api("androidx.arch.core:core-testing:2.2.0-alpha01")
api("androidx.compose.ui:ui-test-junit4:$jetpackComposeVersion")
api("androidx.lifecycle:lifecycle-runtime-testing")
+ api("org.mockito.kotlin:mockito-kotlin:5.1.0")
+ api("org.mockito:mockito-core") {
+ version {
+ strictly("2.28.2")
+ }
+ }
api(libs.truth)
- api("org.mockito:mockito-core:2.21.0")
debugApi("androidx.compose.ui:ui-test-manifest:$jetpackComposeVersion")
}
diff --git a/packages/SettingsLib/Spa/testutils/src/com/android/settingslib/spa/testutils/MockitoHelper.kt b/packages/SettingsLib/Spa/testutils/src/com/android/settingslib/spa/testutils/MockitoHelper.kt
deleted file mode 100644
index 5ba54c1..0000000
--- a/packages/SettingsLib/Spa/testutils/src/com/android/settingslib/spa/testutils/MockitoHelper.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2022 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settingslib.spa.testutils
-
-import org.mockito.Mockito
-
-/**
- * Returns Mockito.any() as nullable type to avoid java.lang.IllegalStateException when null is
- * returned.
- *
- * Generic T is nullable because implicitly bounded by Any?.
- */
-fun <T> any(type: Class<T>): T = Mockito.any(type)
-
-inline fun <reified T> any(): T = any(T::class.java)
diff --git a/packages/SettingsLib/aconfig/settingslib_media_flag_declarations.aconfig b/packages/SettingsLib/aconfig/settingslib_media_flag_declarations.aconfig
index 0b74fa8..d1bcb57 100644
--- a/packages/SettingsLib/aconfig/settingslib_media_flag_declarations.aconfig
+++ b/packages/SettingsLib/aconfig/settingslib_media_flag_declarations.aconfig
@@ -2,7 +2,7 @@
flag {
name: "use_media_router2_for_info_media_manager"
- namespace: "placeholder_namespace"
+ namespace: "media_solutions"
description: "Gates whether to use a MediaRouter2-based implementation of InfoMediaManager, instead of the legacy MediaRouter2Manager-based implementation."
bug: "192657812"
}
\ No newline at end of file
diff --git a/packages/SettingsLib/res/values-af/strings.xml b/packages/SettingsLib/res/values-af/strings.xml
index ab07758..df32ef2 100644
--- a/packages/SettingsLib/res/values-af/strings.xml
+++ b/packages/SettingsLib/res/values-af/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Lêeroordrag"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Invoertoestel"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internettoegang"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Deling van kontakte en oproepgeskiedenis"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Gebruik vir deling van kontakte en oproepgeskiedenis"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Deling van internetverbinding"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Teksboodskappe"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM-toegang"</string>
diff --git a/packages/SettingsLib/res/values-am/strings.xml b/packages/SettingsLib/res/values-am/strings.xml
index 8d9bf8c..c20a9606 100644
--- a/packages/SettingsLib/res/values-am/strings.xml
+++ b/packages/SettingsLib/res/values-am/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ፋይል ማስተላለፍ"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ግቤት መሣሪያ"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"የበይነመረብ ድረስ"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"የእውቂያዎች እና የጥሪ ታሪክ ማጋራት"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"እውቂያዎችን እና የጥሪ ታሪክን ለማጋራት ይጠቀሙበት"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"የበይነ መረብ ተያያዥ ማጋሪያ"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"የጽሑፍ መልዕክቶች"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"የሲም መዳረሻ"</string>
diff --git a/packages/SettingsLib/res/values-ar/strings.xml b/packages/SettingsLib/res/values-ar/strings.xml
index 5a1a135..7337d73 100644
--- a/packages/SettingsLib/res/values-ar/strings.xml
+++ b/packages/SettingsLib/res/values-ar/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"نقل الملف"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"جهاز الإرسال"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"الوصول إلى الإنترنت"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"مشاركة جهات الاتصال وسجل المكالمات"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"استخدام إعدادات بلوتوث لمشاركة جهات الاتصال وسجل المكالمات"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"مشاركة اتصال الإنترنت"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"الرسائل النصية"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"الوصول إلى شريحة SIM"</string>
diff --git a/packages/SettingsLib/res/values-as/strings.xml b/packages/SettingsLib/res/values-as/strings.xml
index 6080dbf..dd3e5f4 100644
--- a/packages/SettingsLib/res/values-as/strings.xml
+++ b/packages/SettingsLib/res/values-as/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ফাইল স্থানান্তৰণ"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ইনপুট ডিভাইচ"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"ইণ্টাৰনেট সংযোগ"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"সম্পৰ্কসূচী আৰু কলৰ ইতিহাস শ্বেয়াৰ কৰা"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"সম্পৰ্কসূচী আৰু কলৰ ইতিহাস শ্বেয়াৰ কৰাৰ বাবে ব্যৱহাৰ কৰক"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"ইণ্টাৰনেট সংযোগ শ্বেয়াৰ"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"পাঠ বাৰ্তা"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"ছিমৰ এক্সেছ"</string>
diff --git a/packages/SettingsLib/res/values-az/strings.xml b/packages/SettingsLib/res/values-az/strings.xml
index 3cf8afa..05231ac 100644
--- a/packages/SettingsLib/res/values-az/strings.xml
+++ b/packages/SettingsLib/res/values-az/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Fayl transferi"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Daxiletmə cihazı"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"İnternetə giriş"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Kontaktlar və zəng tarixçəsi paylaşımı"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Kontaktlar və zəng tarixçəsi paylaşımı üçün istifadə edin"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"internet bağlantı paylaşımı"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Mətn Mesajları"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM-karta giriş"</string>
diff --git a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
index 29d2f72..3cefd59 100644
--- a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
+++ b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Prenos datoteke"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Ulazni uređaj"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Pristup Internetu"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Deljenje kontakata i istorije poziva"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Koristite za deljenje kontakata i istorije poziva"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Deljenje internet veze"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"SMS-ovi"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Pristup SIM kartici"</string>
diff --git a/packages/SettingsLib/res/values-be/arrays.xml b/packages/SettingsLib/res/values-be/arrays.xml
index b993eb6..e70d694 100644
--- a/packages/SettingsLib/res/values-be/arrays.xml
+++ b/packages/SettingsLib/res/values-be/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K (бяспечны)"</item>
<item msgid="7322156123728520872">"4K (шырокамаштабны)"</item>
<item msgid="7735692090314849188">"4K (шырокамаштабны, бяспечны)"</item>
- <item msgid="7346816300608639624">"720p, 1080p (два экраны)"</item>
+ <item msgid="7346816300608639624">"720p, 1080p (Dual Screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"Няма"</item>
diff --git a/packages/SettingsLib/res/values-be/strings.xml b/packages/SettingsLib/res/values-be/strings.xml
index 6489255..47fa1db 100644
--- a/packages/SettingsLib/res/values-be/strings.xml
+++ b/packages/SettingsLib/res/values-be/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Перадача файлаў"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Прылада ўводу"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Доступ у інтэрнэт"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Абагульванне кантактаў і гісторыі выклікаў"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Ужываць для абагульвання кантактаў і гісторыі выклікаў"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Прадастаўленне доступу да Інтэрнэту"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Тэкставыя паведамленні"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Доступ да SIM-карты"</string>
diff --git a/packages/SettingsLib/res/values-bg/strings.xml b/packages/SettingsLib/res/values-bg/strings.xml
index 91dbb33..bd117b0 100644
--- a/packages/SettingsLib/res/values-bg/strings.xml
+++ b/packages/SettingsLib/res/values-bg/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Прехвърляне на файл"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Входно устройство"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Достъп до интернет"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Споделяне на контактите и ист. на обажд."</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Служи за споделяне на контактите и историята на обажданията"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Споделяне на връзката с интернет"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Текстови съобщения"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Достъп до SIM картата"</string>
diff --git a/packages/SettingsLib/res/values-bn/strings.xml b/packages/SettingsLib/res/values-bn/strings.xml
index fdbc9e4..d701894 100644
--- a/packages/SettingsLib/res/values-bn/strings.xml
+++ b/packages/SettingsLib/res/values-bn/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ফাইল স্থানান্তর"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ইনপুট ডিভাইস"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"ইন্টারনেট অ্যাক্সেস"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"পরিচিতি এবং কলের ইতিহাস শেয়ার করা"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"পরিচিতি ও কলের ইতিহাস শেয়ার করার জন্য ব্যবহার করুন"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"ইন্টারনেট কানেকশন শেয়ার করা হচ্ছে"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"এসএমএস"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"সিম অ্যাক্সেস"</string>
diff --git a/packages/SettingsLib/res/values-bs/strings.xml b/packages/SettingsLib/res/values-bs/strings.xml
index ec84dc6..99e160d 100644
--- a/packages/SettingsLib/res/values-bs/strings.xml
+++ b/packages/SettingsLib/res/values-bs/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Prenošenje fajla"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Ulazni uređaj"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Pristup internetu"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Dijeljenje kontakata i historije poziva"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Upotrijebite za dijeljenje kontakata i historije poziva"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Dijeljenje internet veze"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"SMS-ovi"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Pristup SIM-u"</string>
diff --git a/packages/SettingsLib/res/values-ca/strings.xml b/packages/SettingsLib/res/values-ca/strings.xml
index 2901385..49358bd 100644
--- a/packages/SettingsLib/res/values-ca/strings.xml
+++ b/packages/SettingsLib/res/values-ca/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Transferència de fitxers"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Dispositiu d\'entrada"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Accés a Internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Compartició de contactes i historial de trucades"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Utilitza per compartir contactes i l\'historial de trucades"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Compartició de connexió d\'Internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Missatges de text"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Accés a la SIM"</string>
diff --git a/packages/SettingsLib/res/values-cs/strings.xml b/packages/SettingsLib/res/values-cs/strings.xml
index b52e7b7..dc2d456 100644
--- a/packages/SettingsLib/res/values-cs/strings.xml
+++ b/packages/SettingsLib/res/values-cs/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Přenos souborů"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Vstupní zařízení"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Přístup k internetu"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Sdílení kontaktů a historie volání"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Používat ke sdílení kontaktů a historie hovorů"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Sdílení internetového připojení"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Textové zprávy"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Přístup k SIM kartě"</string>
diff --git a/packages/SettingsLib/res/values-da/strings.xml b/packages/SettingsLib/res/values-da/strings.xml
index b96c28a..83a67c1 100644
--- a/packages/SettingsLib/res/values-da/strings.xml
+++ b/packages/SettingsLib/res/values-da/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Filoverførsel"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Inputenhed"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internetadgang"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Deling af kontakter og opkaldshistorik"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Brug til deling af kontakter og opkaldshistorik"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Deling af internetforbindelse"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Sms-beskeder"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Adgang til SIM-kort"</string>
diff --git a/packages/SettingsLib/res/values-de/strings.xml b/packages/SettingsLib/res/values-de/strings.xml
index d93baf1..6575f20 100644
--- a/packages/SettingsLib/res/values-de/strings.xml
+++ b/packages/SettingsLib/res/values-de/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Dateiübertragung"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Eingabegerät"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internetzugriff"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Teilen von Kontakten und der Anrufliste"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Zum Teilen von Kontakten und der Anrufliste verwenden"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Freigabe der Internetverbindung"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"SMS"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Zugriff auf SIM"</string>
diff --git a/packages/SettingsLib/res/values-el/strings.xml b/packages/SettingsLib/res/values-el/strings.xml
index e8edbff..1a36ef8 100644
--- a/packages/SettingsLib/res/values-el/strings.xml
+++ b/packages/SettingsLib/res/values-el/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Μεταφορά αρχείου"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Συσκευή εισόδου"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Πρόσβαση στο Διαδίκτυο"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Κοινοποίηση επαφών και ιστορικού κλήσεων"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Χρήση για την κοινοποίηση επαφών και του ιστορικού κλήσεων"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Κοινή χρήση σύνδεσης στο Διαδίκτυο"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Μηνύματα κειμένου"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Πρόσβαση SIM"</string>
diff --git a/packages/SettingsLib/res/values-en-rAU/strings.xml b/packages/SettingsLib/res/values-en-rAU/strings.xml
index 2a2e4ca..fa00776 100644
--- a/packages/SettingsLib/res/values-en-rAU/strings.xml
+++ b/packages/SettingsLib/res/values-en-rAU/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"File transfer"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Input device"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internet access"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Contacts and call history sharing"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Use for contacts and call history sharing"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Internet connection sharing"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Text messages"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM access"</string>
diff --git a/packages/SettingsLib/res/values-en-rCA/strings.xml b/packages/SettingsLib/res/values-en-rCA/strings.xml
index a9a95b1..5b1e86f 100644
--- a/packages/SettingsLib/res/values-en-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-en-rCA/strings.xml
@@ -107,8 +107,8 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"File transfer"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Input device"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internet access"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Contacts and call history sharing"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Use for contacts and call history sharing"</string>
+ <string name="bluetooth_profile_pbap" msgid="2103406516858653017">"Allow access to contacts and call history"</string>
+ <string name="bluetooth_profile_pbap_summary" msgid="402819589201138227">"Info will be used for call announcements and more"</string>
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Internet connection sharing"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Text Messages"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM Access"</string>
diff --git a/packages/SettingsLib/res/values-en-rGB/strings.xml b/packages/SettingsLib/res/values-en-rGB/strings.xml
index 2a2e4ca..fa00776 100644
--- a/packages/SettingsLib/res/values-en-rGB/strings.xml
+++ b/packages/SettingsLib/res/values-en-rGB/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"File transfer"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Input device"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internet access"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Contacts and call history sharing"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Use for contacts and call history sharing"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Internet connection sharing"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Text messages"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM access"</string>
diff --git a/packages/SettingsLib/res/values-en-rIN/strings.xml b/packages/SettingsLib/res/values-en-rIN/strings.xml
index 2a2e4ca..fa00776 100644
--- a/packages/SettingsLib/res/values-en-rIN/strings.xml
+++ b/packages/SettingsLib/res/values-en-rIN/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"File transfer"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Input device"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internet access"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Contacts and call history sharing"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Use for contacts and call history sharing"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Internet connection sharing"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Text messages"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM access"</string>
diff --git a/packages/SettingsLib/res/values-en-rXC/strings.xml b/packages/SettingsLib/res/values-en-rXC/strings.xml
index af34e5b..8f4ba0e 100644
--- a/packages/SettingsLib/res/values-en-rXC/strings.xml
+++ b/packages/SettingsLib/res/values-en-rXC/strings.xml
@@ -107,8 +107,8 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"File transfer"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Input device"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internet access"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Contacts and call history sharing"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Use for contacts and call history sharing"</string>
+ <string name="bluetooth_profile_pbap" msgid="2103406516858653017">"Allow access to contacts and call history"</string>
+ <string name="bluetooth_profile_pbap_summary" msgid="402819589201138227">"Info will be used for call announcements and more"</string>
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Internet connection sharing"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Text Messages"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM Access"</string>
diff --git a/packages/SettingsLib/res/values-es-rUS/strings.xml b/packages/SettingsLib/res/values-es-rUS/strings.xml
index 52cd3fa..ec6e152 100644
--- a/packages/SettingsLib/res/values-es-rUS/strings.xml
+++ b/packages/SettingsLib/res/values-es-rUS/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Transferencia de archivos"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Dispositivo de entrada"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Acceso a Internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Compartir contactos e historial de llamadas"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Uso para compartir contactos e historial de llamadas"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Compartir conexión a Internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Mensajes de texto"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Acceso a SIM"</string>
diff --git a/packages/SettingsLib/res/values-es/strings.xml b/packages/SettingsLib/res/values-es/strings.xml
index dfad8d3..6934f8a 100644
--- a/packages/SettingsLib/res/values-es/strings.xml
+++ b/packages/SettingsLib/res/values-es/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Transferencia de archivos"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Dispositivo de entrada"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Acceso a Internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Compartir contactos e historial de llamadas"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Usar para compartir los contactos y el historial de llamadas"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Compartir conexión a Internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Mensajes de texto"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Acceso a tarjeta SIM"</string>
diff --git a/packages/SettingsLib/res/values-et/strings.xml b/packages/SettingsLib/res/values-et/strings.xml
index 53995ce..9979eda 100644
--- a/packages/SettingsLib/res/values-et/strings.xml
+++ b/packages/SettingsLib/res/values-et/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Failiedastus"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Sisendseade"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Juurdepääs internetile"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Kontaktide ja kõneajaloo jagamine"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Kasutage kontaktide ja kõneajaloo jagamiseks"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Interneti-ühenduse jagamine"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Tekstsõnumid"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Juurdepääs SIM-ile"</string>
diff --git a/packages/SettingsLib/res/values-eu/arrays.xml b/packages/SettingsLib/res/values-eu/arrays.xml
index 106dc89..95adf96 100644
--- a/packages/SettingsLib/res/values-eu/arrays.xml
+++ b/packages/SettingsLib/res/values-eu/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K (segurua)"</item>
<item msgid="7322156123728520872">"4K (hobetua)"</item>
<item msgid="7735692090314849188">"4K (hobetua, segurua)"</item>
- <item msgid="7346816300608639624">"720p, 1080p (bi pantaila)"</item>
+ <item msgid="7346816300608639624">"720p, 1080p (Dual Screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"Bat ere ez"</item>
diff --git a/packages/SettingsLib/res/values-eu/strings.xml b/packages/SettingsLib/res/values-eu/strings.xml
index 06528e5..dacd8c6 100644
--- a/packages/SettingsLib/res/values-eu/strings.xml
+++ b/packages/SettingsLib/res/values-eu/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Fitxategi-transferentzia"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Sarrerako gailua"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Interneteko konexioa"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Kontaktuak eta deien historia partekatzeko aukera"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Erabili kontaktuetarako eta deien historia partekatzeko"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Interneteko konexioa partekatzea"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Testu-mezuak"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIMerako sarbidea"</string>
diff --git a/packages/SettingsLib/res/values-fa/strings.xml b/packages/SettingsLib/res/values-fa/strings.xml
index a46e327..b67b2d7 100644
--- a/packages/SettingsLib/res/values-fa/strings.xml
+++ b/packages/SettingsLib/res/values-fa/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"انتقال فایل"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"دستگاه ورودی"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"دسترسی به اینترنت"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"همرسانی مخاطبین و سابقه تماس"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"استفاده برای همرسانی مخاطبین و سابقه تماس"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"اشتراکگذاری اتصال اینترنت"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"پیامهای نوشتاری"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"دسترسی سیمکارت"</string>
diff --git a/packages/SettingsLib/res/values-fi/strings.xml b/packages/SettingsLib/res/values-fi/strings.xml
index a5ce348..45d9784 100644
--- a/packages/SettingsLib/res/values-fi/strings.xml
+++ b/packages/SettingsLib/res/values-fi/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Tiedostonsiirto"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Syöttölaite"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internetyhteys"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Yhteystietojen ja soittohistorian jako"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Käytä yhteystiedoissa ja soittohistorian jakamiseen"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Internetyhteyden jakaminen"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Tekstiviestit"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM-kortin käyttö"</string>
diff --git a/packages/SettingsLib/res/values-fr-rCA/arrays.xml b/packages/SettingsLib/res/values-fr-rCA/arrays.xml
index 8bba20d..15cb17d 100644
--- a/packages/SettingsLib/res/values-fr-rCA/arrays.xml
+++ b/packages/SettingsLib/res/values-fr-rCA/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K (sécurisé)"</item>
<item msgid="7322156123728520872">"4K (adapté à la haute résolution)"</item>
<item msgid="7735692090314849188">"4K (adapté haute rés., sécurisé)"</item>
- <item msgid="7346816300608639624">"720p, 1080p (double écran)"</item>
+ <item msgid="7346816300608639624">"720p, 1080p (Dual Screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"Aucun"</item>
diff --git a/packages/SettingsLib/res/values-fr-rCA/strings.xml b/packages/SettingsLib/res/values-fr-rCA/strings.xml
index fa565e6..c165acc5 100644
--- a/packages/SettingsLib/res/values-fr-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-fr-rCA/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Transfert de fichier"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Périphérique d\'entrée"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Accès Internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Partage des contacts et des appels"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Sert à partager des contacts et l\'historique des appels"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Partage de connexion Internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Messages texte"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Accès à la carte SIM"</string>
diff --git a/packages/SettingsLib/res/values-fr/strings.xml b/packages/SettingsLib/res/values-fr/strings.xml
index 4972ebb..55658e7 100644
--- a/packages/SettingsLib/res/values-fr/strings.xml
+++ b/packages/SettingsLib/res/values-fr/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Transfert de fichiers"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Périphérique d\'entrée"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Accès Internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Partage contacts/historique des appels"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"À utiliser pour partage des contacts/historique des appels"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Partage de connexion Internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"SMS"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Accès à la SIM"</string>
diff --git a/packages/SettingsLib/res/values-gl/strings.xml b/packages/SettingsLib/res/values-gl/strings.xml
index fadaea5..f1d0ed1 100644
--- a/packages/SettingsLib/res/values-gl/strings.xml
+++ b/packages/SettingsLib/res/values-gl/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Transferencia de ficheiros"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Dispositivo de entrada"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Acceso a Internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Compartir contactos e hist. de chamadas"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Uso da opción de compartir contactos e historial de chamadas"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Uso compartido da conexión a Internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Mensaxes de texto"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Acceso á SIM"</string>
diff --git a/packages/SettingsLib/res/values-gu/arrays.xml b/packages/SettingsLib/res/values-gu/arrays.xml
index c4f90e4..4f7cbd2 100644
--- a/packages/SettingsLib/res/values-gu/arrays.xml
+++ b/packages/SettingsLib/res/values-gu/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K (સુરક્ષિત)"</item>
<item msgid="7322156123728520872">"4K (ઉચ્ચ સ્તરીય)"</item>
<item msgid="7735692090314849188">"4K (ઉચ્ચ સ્તરીય, સુરક્ષિત)"</item>
- <item msgid="7346816300608639624">"720p, 1080p (દ્વિ સ્ક્રીન)"</item>
+ <item msgid="7346816300608639624">"720p, 1080p (Dual Screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"કોઈ નહીં"</item>
diff --git a/packages/SettingsLib/res/values-gu/strings.xml b/packages/SettingsLib/res/values-gu/strings.xml
index 11bd628..9f84dd4 100644
--- a/packages/SettingsLib/res/values-gu/strings.xml
+++ b/packages/SettingsLib/res/values-gu/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ફાઇલ સ્થાનાંતરણ"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ઇનપુટ ડિવાઇસ"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"ઇન્ટરનેટ ઍક્સેસ"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"સંપર્કો અને કૉલ ઇતિહાસની શેરિંગ"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"સંપર્કો અને કૉલ ઇતિહાસની શેરિંગ માટે ઉપયોગ કરો"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"ઇન્ટરનેટ કનેક્શન શેરિંગ"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"ટેક્સ્ટ સંદેશા"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"સિમ ઍક્સેસ"</string>
diff --git a/packages/SettingsLib/res/values-hi/strings.xml b/packages/SettingsLib/res/values-hi/strings.xml
index 828fb60..f417f8e 100644
--- a/packages/SettingsLib/res/values-hi/strings.xml
+++ b/packages/SettingsLib/res/values-hi/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"फ़ाइल स्थानांतरण"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"इनपुट डिवाइस"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"इंटरनेट ऐक्सेस"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"संपर्क और कॉल का इतिहास शेयर करें"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"इसका इस्तेमाल संपर्क और कॉल का इतिहास शेयर करने के लिए करें"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"इंटरनेट कनेक्शन साझाकरण"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"लेख संदेश"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"सिम ऐक्सेस"</string>
diff --git a/packages/SettingsLib/res/values-hr/strings.xml b/packages/SettingsLib/res/values-hr/strings.xml
index 4c2f89a..0da7d1d 100644
--- a/packages/SettingsLib/res/values-hr/strings.xml
+++ b/packages/SettingsLib/res/values-hr/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Prijenos datoteke"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Ulazni uređaj"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Pristup internetu"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Dijeljenje kontakata i povijesti poziva"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Upotreba za dijeljenje kontakata i povijesti poziva"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Dijeljenje internetske veze"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"SMS-ovi"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Pristup SIM-u"</string>
diff --git a/packages/SettingsLib/res/values-hu/strings.xml b/packages/SettingsLib/res/values-hu/strings.xml
index 136afb1..1bca6a0 100644
--- a/packages/SettingsLib/res/values-hu/strings.xml
+++ b/packages/SettingsLib/res/values-hu/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Fájlátvitel"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Beviteli eszköz"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internetelérés"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Névjegyek és hívásnapló megosztása"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Névjegyek és hívásnapló megosztásához használható"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Internetkapcsolat megosztása"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Szöveges üzenetek"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM-elérés"</string>
diff --git a/packages/SettingsLib/res/values-hy/strings.xml b/packages/SettingsLib/res/values-hy/strings.xml
index 58b2df54..a5bccea 100644
--- a/packages/SettingsLib/res/values-hy/strings.xml
+++ b/packages/SettingsLib/res/values-hy/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Ֆայլերի փոխանցում"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Ներմուծման սարք"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Ինտերնետի հասանելիություն"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Կիսվել կոնտակտներով/զանգերի պատմությամբ"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Օգտագործել՝ կոնտակտներով/զանգերի պատմությամբ կիսվելու համար"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Ինտերնետ կապի տարածում"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"SMS հաղորդագրություններ"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM քարտի հասանելիություն"</string>
diff --git a/packages/SettingsLib/res/values-in/arrays.xml b/packages/SettingsLib/res/values-in/arrays.xml
index e309af7..038800c 100644
--- a/packages/SettingsLib/res/values-in/arrays.xml
+++ b/packages/SettingsLib/res/values-in/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K (aman)"</item>
<item msgid="7322156123728520872">"4K (ditingkatkan)"</item>
<item msgid="7735692090314849188">"4K (ditingkatkan, aman)"</item>
- <item msgid="7346816300608639624">"720p, 1080p (layar ganda)"</item>
+ <item msgid="7346816300608639624">"720p, 1080p (Dual Screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"Tidak ada"</item>
diff --git a/packages/SettingsLib/res/values-in/strings.xml b/packages/SettingsLib/res/values-in/strings.xml
index 71ecc34..d9c0a06 100644
--- a/packages/SettingsLib/res/values-in/strings.xml
+++ b/packages/SettingsLib/res/values-in/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Transfer file"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Perangkat masukan"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Akses Internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Berbagi kontak dan histori panggilan"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Gunakan untuk berbagi kontak dan histori panggilan"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Berbagi koneksi internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"SMS"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Akses SIM"</string>
diff --git a/packages/SettingsLib/res/values-is/strings.xml b/packages/SettingsLib/res/values-is/strings.xml
index d78bd13..7e746ff 100644
--- a/packages/SettingsLib/res/values-is/strings.xml
+++ b/packages/SettingsLib/res/values-is/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Skráaflutningur"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Inntakstæki"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internetaðgangur"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Deiling tengiliða og símtalaferils"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Nota til að deila tengiliðum og símtalaferli"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Deiling nettengingar"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Textaskilaboð"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Aðgangur að SIM-korti"</string>
diff --git a/packages/SettingsLib/res/values-it/strings.xml b/packages/SettingsLib/res/values-it/strings.xml
index becf59e..1e4b981 100644
--- a/packages/SettingsLib/res/values-it/strings.xml
+++ b/packages/SettingsLib/res/values-it/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Trasferimento file"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Dispositivo di input"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Accesso a Internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Condivisione contatti e cronologia chiamate"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Usa per condivisione di contatti e cronologia chiamate"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Condivisione connessione Internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"SMS"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Accesso alla SIM"</string>
@@ -545,12 +547,12 @@
<string name="zen_mode_duration_always_prompt_title" msgid="3212996860498119555">"Chiedi ogni volta"</string>
<string name="zen_mode_forever" msgid="3339224497605461291">"Fino alla disattivazione"</string>
<string name="time_unit_just_now" msgid="3006134267292728099">"Adesso"</string>
- <string name="media_transfer_this_device_name" product="default" msgid="2357329267148436433">"Questo telefono"</string>
+ <string name="media_transfer_this_device_name" product="default" msgid="2357329267148436433">"Questo smartphone"</string>
<string name="media_transfer_this_device_name" product="tablet" msgid="3714653244000242800">"Questo tablet"</string>
<string name="media_transfer_dock_speaker_device_name" msgid="2856219597113881950">"Base con altoparlante"</string>
<string name="media_transfer_external_device_name" msgid="2588672258721846418">"Dispositivo esterno"</string>
<string name="media_transfer_default_device_name" msgid="4315604017399871828">"Dispositivo connesso"</string>
- <string name="media_transfer_this_phone" msgid="7194341457812151531">"Questo telefono"</string>
+ <string name="media_transfer_this_phone" msgid="7194341457812151531">"Questo smartphone"</string>
<string name="media_output_status_unknown_error" msgid="5098565887497902222">"Impossibile riprodurre su questo dispositivo"</string>
<string name="media_output_status_require_premium" msgid="8411255800047014822">"Esegui l\'upgrade dell\'account per cambiare"</string>
<string name="media_output_status_not_support_downloads" msgid="4523828729240373315">"Qui non è possibile riprodurre i download"</string>
diff --git a/packages/SettingsLib/res/values-iw/strings.xml b/packages/SettingsLib/res/values-iw/strings.xml
index 77787dc..328cc82 100644
--- a/packages/SettingsLib/res/values-iw/strings.xml
+++ b/packages/SettingsLib/res/values-iw/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"העברת קבצים"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"מכשיר קלט"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"גישה לאינטרנט"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"שיתוף אנשי הקשר והיסטוריית השיחות"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"ההגדרה משמשת לשיתוף של אנשי הקשר והיסטוריית השיחות"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"שיתוף חיבור לאינטרנט"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"הודעות טקסט"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"גישה ל-SIM"</string>
@@ -316,7 +318,7 @@
<string name="select_usb_configuration_dialog_title" msgid="3579567144722589237">"יש לבחור תצורת USB"</string>
<string name="allow_mock_location" msgid="2102650981552527884">"אפשרות של מיקומים מדומים"</string>
<string name="allow_mock_location_summary" msgid="179780881081354579">"אפשרות של מיקומים מדומים"</string>
- <string name="debug_view_attributes" msgid="3539609843984208216">"לאפשר בדיקת תכונת תצוגה"</string>
+ <string name="debug_view_attributes" msgid="3539609843984208216">"לאפשר את הבדיקה של מאפיינים של ה-View"</string>
<string name="mobile_data_always_on_summary" msgid="1112156365594371019">"השארת חבילת הגלישה פעילה תמיד, גם כש-Wi‑Fi פעיל (למעבר מהיר בין רשתות)."</string>
<string name="tethering_hardware_offload_summary" msgid="7801345335142803029">"אם השירות זמין, יש להשתמש בשיפור מהירות באמצעות חומרה לצורך שיתוף אינטרנט בין ניידים"</string>
<string name="adb_warning_title" msgid="7708653449506485728">"לאפשר ניפוי באגים של USB?"</string>
@@ -343,7 +345,7 @@
<string name="select_application" msgid="2543228890535466325">"בחירת אפליקציה"</string>
<string name="no_application" msgid="9038334538870247690">"אף אחת"</string>
<string name="wait_for_debugger" msgid="7461199843335409809">"יש להמתין לכלי לניפוי באגים"</string>
- <string name="wait_for_debugger_summary" msgid="6846330006113363286">"אפליקציה שנוקו בה הבאגים ממתינה למנקה הבאגים לצירוף לפני ביצוע"</string>
+ <string name="wait_for_debugger_summary" msgid="6846330006113363286">"האפליקציה שמתבצע בה ניקוי באגים ממתינה שהכלי לניפוי באגים יתחבר אליה לפני הריצה"</string>
<string name="debug_input_category" msgid="7349460906970849771">"קלט"</string>
<string name="debug_drawing_category" msgid="5066171112313666619">"שרטוט"</string>
<string name="debug_hw_drawing_category" msgid="5830815169336975162">"עיבוד מואץ של חומרה"</string>
diff --git a/packages/SettingsLib/res/values-ja/strings.xml b/packages/SettingsLib/res/values-ja/strings.xml
index deaba35..46bb17e 100644
--- a/packages/SettingsLib/res/values-ja/strings.xml
+++ b/packages/SettingsLib/res/values-ja/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ファイル転送"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"入力デバイス"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"インターネットアクセス"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"連絡先と通話履歴の共有"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"連絡先と通話履歴の共有に使用します"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"インターネット接続の共有"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"テキスト メッセージ"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIMアクセス"</string>
diff --git a/packages/SettingsLib/res/values-ka/strings.xml b/packages/SettingsLib/res/values-ka/strings.xml
index fb7bada..a0205bb 100644
--- a/packages/SettingsLib/res/values-ka/strings.xml
+++ b/packages/SettingsLib/res/values-ka/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ფაილების გადაცემა"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"შეყვანის მოწყობილობა"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"ინტერნეტზე წვდომა"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"კონტაქტ. და საუბრის ისტორიის გაზიარება"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"გამოიყენეთ კონტაქტებისა და საუბრის ისტორიის გასაზიარებლად"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"ინტერნეტ კავშირის გაზიარება"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"ტექსტური შეტყობინებები"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM წვდომა"</string>
diff --git a/packages/SettingsLib/res/values-kk/strings.xml b/packages/SettingsLib/res/values-kk/strings.xml
index 0c55c2d..3b240d4 100644
--- a/packages/SettingsLib/res/values-kk/strings.xml
+++ b/packages/SettingsLib/res/values-kk/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Файл жіберу"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Кіріс құрылғысы"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Интернетке қосылу"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Контактілер мен қоңыраулар тарихын бөлісу"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Контактілер мен қоңыраулар тарихын бөлісу үшін пайдалану"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Интернет байланысын ортақ қолдану"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Мәтіндік хабарлар"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM картасына кіру"</string>
diff --git a/packages/SettingsLib/res/values-km/strings.xml b/packages/SettingsLib/res/values-km/strings.xml
index f9f964f..36c25a9 100644
--- a/packages/SettingsLib/res/values-km/strings.xml
+++ b/packages/SettingsLib/res/values-km/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ផ្ទេរឯកសារ"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ឧបករណ៍បញ្ចូល"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"ការចូលប្រើអ៊ីនធឺណិត"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"ការចែករំលែកទំនាក់ទំនង និងប្រវត្តិហៅទូរសព្ទ"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"ការប្រើសម្រាប់ការចែករំលែកទំនាក់ទំនង និងប្រវត្តិហៅទូរសព្ទ"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"ចែករំលែកការតភ្ជាប់អ៊ីនធឺណិត"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"សារជាអក្សរ"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"ការចូលដំណើរការស៊ីម"</string>
diff --git a/packages/SettingsLib/res/values-kn/strings.xml b/packages/SettingsLib/res/values-kn/strings.xml
index e17121a..aa93942 100644
--- a/packages/SettingsLib/res/values-kn/strings.xml
+++ b/packages/SettingsLib/res/values-kn/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ಫೈಲ್ ವರ್ಗಾವಣೆ"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ಇನ್ಪುಟ್ ಸಾಧನ"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"ಇಂಟರ್ನೆಟ್ ಆ್ಯಕ್ಸೆಸ್"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"ಸಂಪರ್ಕಗಳು ಹಾಗೂ ಕರೆ ಇತಿಹಾಸ ಹಂಚಿಕೊಳ್ಳುವಿಕೆ"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"ಸಂಪರ್ಕಗಳು ಮತ್ತು ಕರೆ ಇತಿಹಾಸ ಹಂಚಿಕೆಗಾಗಿ ಬಳಸಿ"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"ಇಂಟರ್ನೆಟ್ ಸಂಪರ್ಕ ಹಂಚಿಕೊಳ್ಳುವಿಕೆ"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"ಪಠ್ಯ ಸಂದೇಶಗಳು"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"ಸಿಮ್ ಆ್ಯಕ್ಸೆಸ್"</string>
diff --git a/packages/SettingsLib/res/values-ko/strings.xml b/packages/SettingsLib/res/values-ko/strings.xml
index 148e81d..2b2a09f 100644
--- a/packages/SettingsLib/res/values-ko/strings.xml
+++ b/packages/SettingsLib/res/values-ko/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"파일 전송"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"입력 장치"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"인터넷 액세스"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"연락처 및 통화 기록 공유"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"연락처 및 통화 기록 공유에 사용"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"인터넷 연결 공유"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"문자 메시지"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM 액세스"</string>
diff --git a/packages/SettingsLib/res/values-ky/strings.xml b/packages/SettingsLib/res/values-ky/strings.xml
index b3b5abd..92df614 100644
--- a/packages/SettingsLib/res/values-ky/strings.xml
+++ b/packages/SettingsLib/res/values-ky/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Файл алмашуу"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Киргизүү түзмөгү"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Интернетке мүмкүнчүлүк алуу"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Байланыштарды жана чалуу таржымалын бөлүшүү"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Байланыштарды жана чалуу таржымалын бөлүшүү үчүн колдонуу"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Интернет байланышын бөлүшүү"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"SMS билдирүүлөрү"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM картаны пайдалануу мүмкүнчүлүгү"</string>
diff --git a/packages/SettingsLib/res/values-lo/strings.xml b/packages/SettingsLib/res/values-lo/strings.xml
index 3963518..fdd393d 100644
--- a/packages/SettingsLib/res/values-lo/strings.xml
+++ b/packages/SettingsLib/res/values-lo/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ການໂອນຍ້າຍໄຟລ໌"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ອຸປະກອນປ້ອນຂໍ້ມູນ"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"ການເຂົ້າເຖິງອິນເຕີເນັດ"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"ແບ່ງປັນລາຍຊື່ຜູ້ຕິດຕໍ່ ແລະ ປະຫວັດການໂທ"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"ໃຊ້ສໍາລັບແບ່ງປັນລາຍຊື່ຜູ້ຕິດຕໍ່ ແລະ ປະຫວັດການໂທ"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"ການແບ່ງປັນການເຊື່ອມຕໍ່ອິນເຕີເນັດ"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"ຂໍ້ຄວາມ"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"ການເຂົ້າເຖິງ SIM"</string>
diff --git a/packages/SettingsLib/res/values-lt/strings.xml b/packages/SettingsLib/res/values-lt/strings.xml
index 9ede534..7376c11 100644
--- a/packages/SettingsLib/res/values-lt/strings.xml
+++ b/packages/SettingsLib/res/values-lt/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Failo perkėlimas"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Įvesties įrenginys"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Prieiga prie interneto"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Kontaktų ir skambučių istorijos bendrinimas"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Naudoti kontaktams ir skambučių istorijai bendrinti"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Interneto ryšio bendrinimas"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Teksto pranešimai"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM prieiga"</string>
diff --git a/packages/SettingsLib/res/values-lv/arrays.xml b/packages/SettingsLib/res/values-lv/arrays.xml
index c9161d9..7626c66 100644
--- a/packages/SettingsLib/res/values-lv/arrays.xml
+++ b/packages/SettingsLib/res/values-lv/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4 KB (drošs)"</item>
<item msgid="7322156123728520872">"4 KB (mērogots)"</item>
<item msgid="7735692090314849188">"4 KB (mērogots, drošs)"</item>
- <item msgid="7346816300608639624">"720p, 1080p (dubults ekrāns)"</item>
+ <item msgid="7346816300608639624">"720p, 1080p (Dual Screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"Nav"</item>
diff --git a/packages/SettingsLib/res/values-lv/strings.xml b/packages/SettingsLib/res/values-lv/strings.xml
index c33243b..85ca364 100644
--- a/packages/SettingsLib/res/values-lv/strings.xml
+++ b/packages/SettingsLib/res/values-lv/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Failu pārsūtīšana"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Ievades ierīce"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Piekļuve internetam"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Kontaktpersonu un zvanu vēst. kopīgošana"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Paredzēts kontaktpersonu un zvanu vēstures kopīgošanai"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Interneta savienojuma koplietošana"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Īsziņas"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Piekļuve SIM kartei"</string>
diff --git a/packages/SettingsLib/res/values-mk/strings.xml b/packages/SettingsLib/res/values-mk/strings.xml
index a3d9e96..cdc0831 100644
--- a/packages/SettingsLib/res/values-mk/strings.xml
+++ b/packages/SettingsLib/res/values-mk/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Пренос на датотека"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Влезен уред"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Пристап до интернет"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Споделување контакти и историја на повици"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Користење на споделувањето контакти и историја на повици"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Споделување конекција на интернет"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Текстуални пораки"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Пристап до SIM"</string>
diff --git a/packages/SettingsLib/res/values-ml/strings.xml b/packages/SettingsLib/res/values-ml/strings.xml
index 8b3caae..fe7a375 100644
--- a/packages/SettingsLib/res/values-ml/strings.xml
+++ b/packages/SettingsLib/res/values-ml/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ഫയൽ കൈമാറൽ"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ഇൻപുട്ട് ഉപകരണം"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"ഇന്റർനെറ്റ് ആക്സസ്"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"കോൺടാക്റ്റുകളും കോൾ ചരിത്രം പങ്കിടലും"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"കോൺടാക്റ്റുകളുടെയും കോൾ ചരിത്രം പങ്കിടലിന്റെയും ഉപയോഗം"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"ഇന്റർനെറ്റ് കണക്ഷൻ പങ്കിടൽ"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"അക്ഷര സന്ദേശങ്ങൾ"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"സിം ആക്സസ്"</string>
diff --git a/packages/SettingsLib/res/values-mn/strings.xml b/packages/SettingsLib/res/values-mn/strings.xml
index a2447d26..23b3c2e 100644
--- a/packages/SettingsLib/res/values-mn/strings.xml
+++ b/packages/SettingsLib/res/values-mn/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Файл дамжуулалт"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Оруулах төхөөрөмж"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Интернэт хандалт"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Харилцагчид ба дуудлагын түүх хуваалцах"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Харилцагчид ба дуудлагын түүх хуваалцахад ашиглах"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Интернэт холболтыг хуваалцах"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Мессеж"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM Хандалт"</string>
diff --git a/packages/SettingsLib/res/values-mr/strings.xml b/packages/SettingsLib/res/values-mr/strings.xml
index e76c708..8e10da7 100644
--- a/packages/SettingsLib/res/values-mr/strings.xml
+++ b/packages/SettingsLib/res/values-mr/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"फाइल स्थानांतरण"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"इनपुट डिव्हाइस"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"इंटरनेट अॅक्सेस"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"संपर्क आणि कॉल इतिहास शेअरिंग"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"संपर्क आणि कॉल इतिहास शेअरिंगसाठी वापरा"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"इंटरनेट कनेक्शन शेअररण"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"मजकूर मेसेज"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"सिम अॅक्सेस"</string>
diff --git a/packages/SettingsLib/res/values-ms/strings.xml b/packages/SettingsLib/res/values-ms/strings.xml
index 3f35079..70d99a1 100644
--- a/packages/SettingsLib/res/values-ms/strings.xml
+++ b/packages/SettingsLib/res/values-ms/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Pemindahan fail"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Peranti input"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Akses Internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Perkongsian kenalan & sejarah panggilan"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Digunakan untuk perkongsian kenalan dan sejarah panggilan"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Perkongsian sambungan Internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Mesej Teks"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Akses SIM"</string>
diff --git a/packages/SettingsLib/res/values-my/strings.xml b/packages/SettingsLib/res/values-my/strings.xml
index 9cc6051..8c596ad 100644
--- a/packages/SettingsLib/res/values-my/strings.xml
+++ b/packages/SettingsLib/res/values-my/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ဖိုင်လွဲပြောင်းခြင်း"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ထည့်သွင်းသော စက်"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"အင်တာနက်ချိတ်ဆက်ခြင်း"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"အဆက်အသွယ်၊ ခေါ်ဆိုမှုမှတ်တမ်း မျှဝေခြင်း"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"အဆက်အသွယ်နှင့် ခေါ်ဆိုမှုမှတ်တမ်း မျှဝေရန် သုံးသည်"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"အင်တာနက်ဆက်သွယ်မှု မျှဝေခြင်း"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"မိုဘိုင်းမက်ဆေ့ဂျ်များ"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM အသုံးပြုခြင်း"</string>
diff --git a/packages/SettingsLib/res/values-nb/arrays.xml b/packages/SettingsLib/res/values-nb/arrays.xml
index 0ab39ee..c456ae1 100644
--- a/packages/SettingsLib/res/values-nb/arrays.xml
+++ b/packages/SettingsLib/res/values-nb/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K (sikker)"</item>
<item msgid="7322156123728520872">"4K (oppskalert)"</item>
<item msgid="7735692090314849188">"4K (oppskalert, sikker)"</item>
- <item msgid="7346816300608639624">"720p, 1080p (dobbel skjerm)"</item>
+ <item msgid="7346816300608639624">"720p, 1080p (Dual Screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"Ingen"</item>
diff --git a/packages/SettingsLib/res/values-nb/strings.xml b/packages/SettingsLib/res/values-nb/strings.xml
index 9d35068..f5b607d 100644
--- a/packages/SettingsLib/res/values-nb/strings.xml
+++ b/packages/SettingsLib/res/values-nb/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Filoverføring"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Inndataenhet"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internett-tilgang"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Deling av kontakter og anropslogg"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Bruk for deling av kontakter og anropslogg"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Deling av internettilkobling"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Tekstmeldinger"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Tilgang til SIM-kortet"</string>
@@ -556,7 +558,7 @@
<string name="media_output_status_not_support_downloads" msgid="4523828729240373315">"Kan ikke spille av nedlastinger her"</string>
<string name="media_output_status_try_after_ad" msgid="8312579066856015441">"Prøv igjen etter annonsen"</string>
<string name="media_output_status_device_in_low_power_mode" msgid="8184631698321758451">"Vekk enheten for å spille her"</string>
- <string name="media_output_status_unauthorized" msgid="5880222828273853838">"Enheten er ikke godkjent"</string>
+ <string name="media_output_status_unauthorized" msgid="5880222828273853838">"Enheten er ikke godkjent til å spille av"</string>
<string name="media_output_status_track_unsupported" msgid="5576313219317709664">"Kan ikke spille av dette her"</string>
<string name="profile_connect_timeout_subtext" msgid="4043408193005851761">"Tilkoblingsproblemer. Slå enheten av og på igjen"</string>
<string name="media_transfer_wired_device_name" msgid="4447880899964056007">"Lydenhet med kabel"</string>
diff --git a/packages/SettingsLib/res/values-ne/strings.xml b/packages/SettingsLib/res/values-ne/strings.xml
index e536c16..a3c121a 100644
--- a/packages/SettingsLib/res/values-ne/strings.xml
+++ b/packages/SettingsLib/res/values-ne/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"फाइल स्थानान्तरण"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"इनपुट उपकरण"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"इन्टरनेट एक्सेस"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"कन्ट्याक्ट र कल हिस्ट्री सेयर गर्ने"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"कन्ट्याक्ट र कल हिस्ट्री सेयर गर्न प्रयोग गरियोस्"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"इन्टरनेट जडान साझेदारी गर्दै"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"टेक्स्ट म्यासेजहरू"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM एक्सेस"</string>
diff --git a/packages/SettingsLib/res/values-nl/arrays.xml b/packages/SettingsLib/res/values-nl/arrays.xml
index 6898086..4451c93 100644
--- a/packages/SettingsLib/res/values-nl/arrays.xml
+++ b/packages/SettingsLib/res/values-nl/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K (veilig)"</item>
<item msgid="7322156123728520872">"4K (opgeschaald)"</item>
<item msgid="7735692090314849188">"4K (opgeschaald, veilig)"</item>
- <item msgid="7346816300608639624">"720p, 1080p (dubbel scherm)"</item>
+ <item msgid="7346816300608639624">"720p, 1080p (dual screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"Geen"</item>
diff --git a/packages/SettingsLib/res/values-nl/strings.xml b/packages/SettingsLib/res/values-nl/strings.xml
index c73abb4..aa7e7a0 100644
--- a/packages/SettingsLib/res/values-nl/strings.xml
+++ b/packages/SettingsLib/res/values-nl/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Bestandsoverdracht"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Invoerapparaat"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internettoegang"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Contacten en gespreksgeschiedenis delen"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Gebruiken om contacten en gespreksgeschiedenis te delen"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Internetverbinding delen"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Sms-berichten"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Sim-toegang"</string>
diff --git a/packages/SettingsLib/res/values-or/strings.xml b/packages/SettingsLib/res/values-or/strings.xml
index 89d3636..6154db1 100644
--- a/packages/SettingsLib/res/values-or/strings.xml
+++ b/packages/SettingsLib/res/values-or/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ଫାଇଲ୍ ଟ୍ରାନ୍ସଫର୍"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ଇନ୍ପୁଟ୍ ଡିଭାଇସ୍"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"ଇଣ୍ଟରନେଟ ଆକ୍ସେସ"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"କଣ୍ଟାକ୍ଟ ଏବଂ କଲ ଇତିହାସ ସେୟାରିଂ"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"କଣ୍ଟାକ୍ଟ ଏବଂ କଲ ଇତିହାସ ସେୟାରିଂ ପାଇଁ ବ୍ୟବହାର କରନ୍ତୁ"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"ଇଣ୍ଟର୍ନେଟ୍ ସଂଯୋଗ ଶେୟାରିଙ୍ଗ"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"ଟେକ୍ସଟ୍ ମେସେଜ୍"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM ଆକ୍ସେସ"</string>
diff --git a/packages/SettingsLib/res/values-pa/arrays.xml b/packages/SettingsLib/res/values-pa/arrays.xml
index 0ac6bb5..3cb0f50 100644
--- a/packages/SettingsLib/res/values-pa/arrays.xml
+++ b/packages/SettingsLib/res/values-pa/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K (ਸੁਰੱਖਿਅਤ)"</item>
<item msgid="7322156123728520872">"4K (ਪੂਰਾ ਕੀਤਾ)"</item>
<item msgid="7735692090314849188">"4K (ਪੂਰਾ ਕੀਤਾ, ਸੁਰੱਖਿਅਤ)"</item>
- <item msgid="7346816300608639624">"720p, 1080p (ਦੂਹਰੀ ਸਕ੍ਰੀਨ)"</item>
+ <item msgid="7346816300608639624">"720p, 1080p (Dual Screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"ਕੋਈ ਨਹੀਂ"</item>
diff --git a/packages/SettingsLib/res/values-pa/strings.xml b/packages/SettingsLib/res/values-pa/strings.xml
index 8ba9e78..1ab9dda 100644
--- a/packages/SettingsLib/res/values-pa/strings.xml
+++ b/packages/SettingsLib/res/values-pa/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ਫਾਈਲ ਟ੍ਰਾਂਸਫਰ"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ਇਨਪੁੱਟ ਡੀਵਾਈਸ"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"ਇੰਟਰਨੈੱਟ ਪਹੁੰਚ"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"ਸੰਪਰਕ ਅਤੇ ਕਾਲ ਇਤਿਹਾਸ ਸਾਂਝਾ ਕਰਨਾ"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"ਸੰਪਰਕ ਅਤੇ ਕਾਲ ਇਤਿਹਾਸ ਸਾਂਝਾ ਕਰਨ ਲਈ ਵਰਤੋਂ ਕਰੋ"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"ਇੰਟਰਨੈੱਟ ਕਨੈਕਸ਼ਨ ਸਾਂਝਾਕਰਨ"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"ਲਿਖਤ ਸੁਨੇਹੇ"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"ਸਿਮ ਪਹੁੰਚ"</string>
diff --git a/packages/SettingsLib/res/values-pl/strings.xml b/packages/SettingsLib/res/values-pl/strings.xml
index e75ea77..c0dce8d 100644
--- a/packages/SettingsLib/res/values-pl/strings.xml
+++ b/packages/SettingsLib/res/values-pl/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Przesyłanie pliku"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Urządzenie wejściowe"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Dostęp do internetu"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Udostępnianie kontaktów i historii połączeń"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Używaj w przypadku udostępniania kontaktów i historii połączeń"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Udostępnianie połączenia internetowego"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"SMS-y"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Dostęp do karty SIM"</string>
diff --git a/packages/SettingsLib/res/values-pt-rBR/strings.xml b/packages/SettingsLib/res/values-pt-rBR/strings.xml
index 1507e5b..9493e20 100644
--- a/packages/SettingsLib/res/values-pt-rBR/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rBR/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Transferência de arquivo"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Dispositivo de entrada"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Acesso à Internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Compartilhar contatos e histórico de chamadas"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Use para compartilhar contatos e o histórico de chamadas"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Compartilhamento de conexão à Internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Mensagens de texto"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Acesso ao chip"</string>
diff --git a/packages/SettingsLib/res/values-pt-rPT/strings.xml b/packages/SettingsLib/res/values-pt-rPT/strings.xml
index a40cd2a..12d37d2 100644
--- a/packages/SettingsLib/res/values-pt-rPT/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rPT/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Transferência do ficheiro"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Dispositivo de entrada"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Acesso à internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Part. histórico de chamadas e contactos"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Usar para partilha do histórico de chamadas e dos contactos"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Partilha da ligação à internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Mensagens de texto"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Acesso ao SIM"</string>
diff --git a/packages/SettingsLib/res/values-pt/strings.xml b/packages/SettingsLib/res/values-pt/strings.xml
index 1507e5b..9493e20 100644
--- a/packages/SettingsLib/res/values-pt/strings.xml
+++ b/packages/SettingsLib/res/values-pt/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Transferência de arquivo"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Dispositivo de entrada"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Acesso à Internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Compartilhar contatos e histórico de chamadas"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Use para compartilhar contatos e o histórico de chamadas"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Compartilhamento de conexão à Internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Mensagens de texto"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Acesso ao chip"</string>
diff --git a/packages/SettingsLib/res/values-ro/strings.xml b/packages/SettingsLib/res/values-ro/strings.xml
index 6fda8d2..0f68d27 100644
--- a/packages/SettingsLib/res/values-ro/strings.xml
+++ b/packages/SettingsLib/res/values-ro/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Transfer de fișiere"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Dispozitiv de intrare"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Acces la internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Acces la agendă și istoricul apelurilor"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Folosește pentru accesul la agendă și istoricul apelurilor"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Distribuirea conexiunii la internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Mesaje text"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Acces la SIM"</string>
diff --git a/packages/SettingsLib/res/values-ru/arrays.xml b/packages/SettingsLib/res/values-ru/arrays.xml
index 3e3b21c..e26b1a6 100644
--- a/packages/SettingsLib/res/values-ru/arrays.xml
+++ b/packages/SettingsLib/res/values-ru/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K (защита)"</item>
<item msgid="7322156123728520872">"4K (масштабирование)"</item>
<item msgid="7735692090314849188">"4K (масштабирование, защита)"</item>
- <item msgid="7346816300608639624">"720p, 1080p (два экрана)"</item>
+ <item msgid="7346816300608639624">"720p, 1080p (Dual Screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"Нет"</item>
diff --git a/packages/SettingsLib/res/values-ru/strings.xml b/packages/SettingsLib/res/values-ru/strings.xml
index 8127ef2..2a390aa 100644
--- a/packages/SettingsLib/res/values-ru/strings.xml
+++ b/packages/SettingsLib/res/values-ru/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Профиль OPP"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Профиль HID"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Доступ к интернету"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Доступ к контактам и журналу звонков"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Использовать для доступа к контактам и журналу звонков"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Профиль PAN"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Текстовые сообщения"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Доступ к SIM-карте"</string>
diff --git a/packages/SettingsLib/res/values-si/strings.xml b/packages/SettingsLib/res/values-si/strings.xml
index 277125d..15e00c9 100644
--- a/packages/SettingsLib/res/values-si/strings.xml
+++ b/packages/SettingsLib/res/values-si/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ගොනු හුවමාරුව"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ආදාන උපාංගය"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"අන්තර්ජාල ප්රවේශය"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"සම්බන්ධතා සහ ඇමතුම් ඉතිහාසය බෙදා ගැනීම"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"සම්බන්ධතා සහ ඇමතුම් ඉතිහාසය බෙදා ගැනීම සඳහා භාවිතා කරන්න"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"අන්තර්ජාල සම්බන්ධතා බෙදාගැනීම"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"පෙළ පණිවිඩ"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM ප්රවේශය"</string>
diff --git a/packages/SettingsLib/res/values-sk/strings.xml b/packages/SettingsLib/res/values-sk/strings.xml
index 52b0f0b..5be4d1b 100644
--- a/packages/SettingsLib/res/values-sk/strings.xml
+++ b/packages/SettingsLib/res/values-sk/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Prenos súborov"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Vstupné zariadenie"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Prístup na internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Zdieľať kontakty a históriu hovorov"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Používané pri zdieľaní kontaktov a histórie hovorov"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Zdieľanie pripojenia na Internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Textové správy"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Prístup k SIM karte"</string>
diff --git a/packages/SettingsLib/res/values-sl/strings.xml b/packages/SettingsLib/res/values-sl/strings.xml
index fdd0a22..ecef697 100644
--- a/packages/SettingsLib/res/values-sl/strings.xml
+++ b/packages/SettingsLib/res/values-sl/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Prenos datoteke"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Vnosna naprava"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internetni dostop"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Deljenje stikov in zgodovine klicev"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Uporabite za deljenje stikov in zgodovine klicev."</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Deljenje internetne povezave"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Sporočila SMS"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Dostop do kartice SIM"</string>
diff --git a/packages/SettingsLib/res/values-sq/strings.xml b/packages/SettingsLib/res/values-sq/strings.xml
index 1622ff7..e4d402d6 100644
--- a/packages/SettingsLib/res/values-sq/strings.xml
+++ b/packages/SettingsLib/res/values-sq/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Transferimi i skedarëve"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Pajisja e hyrjes"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Qasje në internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Ndarje: kontakte e historik telefonatash"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Përdor për ndarje kontaktesh e të historikut të telefonatave"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Ndarja e lidhjes së internetit"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Mesazhet me tekst"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Qasje në kartën SIM"</string>
diff --git a/packages/SettingsLib/res/values-sr/strings.xml b/packages/SettingsLib/res/values-sr/strings.xml
index d1b3289..2f5ebdd 100644
--- a/packages/SettingsLib/res/values-sr/strings.xml
+++ b/packages/SettingsLib/res/values-sr/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Пренос датотеке"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Улазни уређај"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Приступ Интернету"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Дељење контаката и историје позива"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Користите за дељење контаката и историје позива"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Дељење интернет везе"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"SMS-ови"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Приступ SIM картици"</string>
diff --git a/packages/SettingsLib/res/values-sv/arrays.xml b/packages/SettingsLib/res/values-sv/arrays.xml
index dfe491d..3a344ce 100644
--- a/packages/SettingsLib/res/values-sv/arrays.xml
+++ b/packages/SettingsLib/res/values-sv/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K (säkert)"</item>
<item msgid="7322156123728520872">"4K (uppskalat)"</item>
<item msgid="7735692090314849188">"4K (uppskalat, säkert)"</item>
- <item msgid="7346816300608639624">"720 p, 1080 p (dubbla skärmar)"</item>
+ <item msgid="7346816300608639624">"720 p, 1080 p (Dual Screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"Inga"</item>
diff --git a/packages/SettingsLib/res/values-sv/strings.xml b/packages/SettingsLib/res/values-sv/strings.xml
index 2c7c736..3cc2dc4 100644
--- a/packages/SettingsLib/res/values-sv/strings.xml
+++ b/packages/SettingsLib/res/values-sv/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Filöverföring"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Indataenhet"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internetåtkomst"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Delning av kontakter och samtalshistorik"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Använd för delning av kontakter och samtalshistorik"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Delning av Internetanslutning"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Sms"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM-åtkomst"</string>
diff --git a/packages/SettingsLib/res/values-sw/strings.xml b/packages/SettingsLib/res/values-sw/strings.xml
index 60d9186..67ab4d3 100644
--- a/packages/SettingsLib/res/values-sw/strings.xml
+++ b/packages/SettingsLib/res/values-sw/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Uhamishaji wa faili"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Kifaa cha kuingiza"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Ufikiaji wa intaneti"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Kushiriki anwani na rekodi ya simu zilizopigwa"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Tumia kushiriki anwani na rekodi ya simu zilizopigwa"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Kushiriki muunganisho wa tovuti"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"SMS"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Ufikiaji wa SIM"</string>
diff --git a/packages/SettingsLib/res/values-ta/strings.xml b/packages/SettingsLib/res/values-ta/strings.xml
index ce10e21..b99a0c5 100644
--- a/packages/SettingsLib/res/values-ta/strings.xml
+++ b/packages/SettingsLib/res/values-ta/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ஃபைல் இடமாற்றம்"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"உள்ளீட்டுச் சாதனம்"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"இணைய அணுகல்"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"தொடர்புகள் & அழைப்புப் பதிவைப் பகிர்தல்"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"தொடர்புகளையும் அழைப்புப் பதிவையும் பகிர்வதற்குப் பயன்படுத்து"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"இணைய இணைப்பு பகிர்தல்"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"உரைச் செய்திகள்"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"சிம் அணுகல்"</string>
diff --git a/packages/SettingsLib/res/values-te/strings.xml b/packages/SettingsLib/res/values-te/strings.xml
index 567bffb..3c12cdc 100644
--- a/packages/SettingsLib/res/values-te/strings.xml
+++ b/packages/SettingsLib/res/values-te/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ఫైల్ బదిలీ"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ఇన్పుట్ పరికరం"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"ఇంటర్నెట్ యాక్సెస్"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"కాంటాక్ట్లు, కాల్ హిస్టరీ షేరింగ్"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"కాంటాక్ట్లు, కాల్ హిస్టరీ షేరింగ్ కోసం ఉపయోగించండి"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"ఇంటర్నెట్ కనెక్షన్ షేరింగ్"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"టెక్స్ట్ మెసేజ్లు"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM యాక్సెస్"</string>
diff --git a/packages/SettingsLib/res/values-th/arrays.xml b/packages/SettingsLib/res/values-th/arrays.xml
index 23d5f60..480aee4 100644
--- a/packages/SettingsLib/res/values-th/arrays.xml
+++ b/packages/SettingsLib/res/values-th/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K (ปลอดภัย)"</item>
<item msgid="7322156123728520872">"4K (เพิ่มความละเอียด)"</item>
<item msgid="7735692090314849188">"4K (เพิ่มความละเอียด ปลอดภัย)"</item>
- <item msgid="7346816300608639624">"720p, 1080p (หน้าจอคู่)"</item>
+ <item msgid="7346816300608639624">"720p, 1080p (Dual Screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"ไม่มี"</item>
diff --git a/packages/SettingsLib/res/values-th/strings.xml b/packages/SettingsLib/res/values-th/strings.xml
index 69324d1..f3d08ba 100644
--- a/packages/SettingsLib/res/values-th/strings.xml
+++ b/packages/SettingsLib/res/values-th/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"การถ่ายโอนไฟล์"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"อุปกรณ์อินพุต"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"การเข้าถึงอินเทอร์เน็ต"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"การแชร์รายชื่อติดต่อและประวัติการโทร"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"ใช้สำหรับการแชร์รายชื่อติดต่อและประวัติการโทร"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"การแชร์การเชื่อมต่ออินเทอร์เน็ต"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"ข้อความ"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"การเข้าถึงซิม"</string>
diff --git a/packages/SettingsLib/res/values-tl/strings.xml b/packages/SettingsLib/res/values-tl/strings.xml
index 889e396..9159ca4 100644
--- a/packages/SettingsLib/res/values-tl/strings.xml
+++ b/packages/SettingsLib/res/values-tl/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Paglilipat ng file"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Device sa pag-input"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Access sa internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Contacts at pagbabahagi ng call history"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Gamitin para sa contacts at pagbabahagi ng call history"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Pagbabahagi ng koneksyon sa internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Mga Text Message"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Access sa SIM"</string>
diff --git a/packages/SettingsLib/res/values-tr/arrays.xml b/packages/SettingsLib/res/values-tr/arrays.xml
index ed3755a..27591be 100644
--- a/packages/SettingsLib/res/values-tr/arrays.xml
+++ b/packages/SettingsLib/res/values-tr/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K (güvenli)"</item>
<item msgid="7322156123728520872">"4K (yukarı ölçeklenmiş)"</item>
<item msgid="7735692090314849188">"4K (yukarı ölçeklenmiş, güvenli)"</item>
- <item msgid="7346816300608639624">"720p, 1080p (çift ekran)"</item>
+ <item msgid="7346816300608639624">"720p, 1080p (Dual Screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"Hiçbiri"</item>
diff --git a/packages/SettingsLib/res/values-tr/strings.xml b/packages/SettingsLib/res/values-tr/strings.xml
index 495bcd9..0f8df02 100644
--- a/packages/SettingsLib/res/values-tr/strings.xml
+++ b/packages/SettingsLib/res/values-tr/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Dosya aktarımı"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Giriş cihazı"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"İnternet erişimi"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Kişi ve çağrı geçmişi paylaşımı"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Kişi ve çağrı geçmişi paylaşımı için kullanın"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"İnternet bağlantısı paylaşımı"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Kısa Mesajlar"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM Erişimi"</string>
diff --git a/packages/SettingsLib/res/values-uk/arrays.xml b/packages/SettingsLib/res/values-uk/arrays.xml
index 83336d5..6032efb 100644
--- a/packages/SettingsLib/res/values-uk/arrays.xml
+++ b/packages/SettingsLib/res/values-uk/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K (захист)"</item>
<item msgid="7322156123728520872">"4K (масштабування)"</item>
<item msgid="7735692090314849188">"4K (масштабування, захист)"</item>
- <item msgid="7346816300608639624">"720p, 1080p (два екрани)"</item>
+ <item msgid="7346816300608639624">"720p, 1080p (Dual Screen)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"Нічого"</item>
diff --git a/packages/SettingsLib/res/values-uk/strings.xml b/packages/SettingsLib/res/values-uk/strings.xml
index 2158ec1..8c24312 100644
--- a/packages/SettingsLib/res/values-uk/strings.xml
+++ b/packages/SettingsLib/res/values-uk/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Передавання файлів"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Пристрій введення"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Доступ до Інтернету"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Доступ до контактів і історії викликів"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Використовуйте, щоб надсилати контакти й історію викликів"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Надання доступу до Інтернету"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Текстові повідомлення"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Доступ до SIM-карти"</string>
diff --git a/packages/SettingsLib/res/values-ur/strings.xml b/packages/SettingsLib/res/values-ur/strings.xml
index 5dc7332..5967add 100644
--- a/packages/SettingsLib/res/values-ur/strings.xml
+++ b/packages/SettingsLib/res/values-ur/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"فائل کی منتقلی"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"ان پٹ آلہ"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"انٹرنیٹ تک رسائی"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"رابطے اور کال کی سرگزشت کا اشتراک"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"رابطے اور کال کی سرگزشت کے اشتراک کے لیے استعمال کریں"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"انٹرنیٹ کنکشن کا اشتراک کرنا"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"ٹیکسٹ پیغامات"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM رسائی"</string>
diff --git a/packages/SettingsLib/res/values-uz/strings.xml b/packages/SettingsLib/res/values-uz/strings.xml
index cdc7e1c..b9c17fc 100644
--- a/packages/SettingsLib/res/values-uz/strings.xml
+++ b/packages/SettingsLib/res/values-uz/strings.xml
@@ -107,8 +107,8 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Fayl uzatish"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Kiritish qurilmasi"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internetga ulanish"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Kontakt va chaqiruvlar tarixiga kirish"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Kontaktlar va chaqiruvlar tarixiga kirish uchun foydalaning"</string>
+ <string name="bluetooth_profile_pbap" msgid="2103406516858653017">"Chaqiruv va kontaktlarga ruxsat berilsinmi?"</string>
+ <string name="bluetooth_profile_pbap_summary" msgid="402819589201138227">"Maʼlumotlar chaqiruvlar haqida xabar berish uchun ishlatiladi"</string>
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Internet aloqasi ulashmasi"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"SMS xabarlari"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM kartaga kirish"</string>
diff --git a/packages/SettingsLib/res/values-vi/strings.xml b/packages/SettingsLib/res/values-vi/strings.xml
index 8ed63e9..cc8dacd 100644
--- a/packages/SettingsLib/res/values-vi/strings.xml
+++ b/packages/SettingsLib/res/values-vi/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Chuyển tệp"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Thiết bị đầu vào"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Truy cập Internet"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Chia sẻ danh bạ và nhật ký cuộc gọi"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Dùng để chia sẻ danh bạ và nhật ký cuộc gọi"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Chia sẻ kết nối internet"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Tin nhắn văn bản"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Truy cập SIM"</string>
diff --git a/packages/SettingsLib/res/values-zh-rCN/arrays.xml b/packages/SettingsLib/res/values-zh-rCN/arrays.xml
index 1ae55e4..432dd5f 100644
--- a/packages/SettingsLib/res/values-zh-rCN/arrays.xml
+++ b/packages/SettingsLib/res/values-zh-rCN/arrays.xml
@@ -243,7 +243,7 @@
<item msgid="8612549335720461635">"4K(安全)"</item>
<item msgid="7322156123728520872">"4K(画质提升)"</item>
<item msgid="7735692090314849188">"4K(画质提升、安全)"</item>
- <item msgid="7346816300608639624">"720p,1080p(双屏)"</item>
+ <item msgid="7346816300608639624">"720p、1080p(双屏幕)"</item>
</string-array>
<string-array name="enable_opengl_traces_entries">
<item msgid="4433736508877934305">"无"</item>
diff --git a/packages/SettingsLib/res/values-zh-rCN/strings.xml b/packages/SettingsLib/res/values-zh-rCN/strings.xml
index 0f0b9c4..84af4b5 100644
--- a/packages/SettingsLib/res/values-zh-rCN/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rCN/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"文件传输"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"输入设备"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"互联网连接"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"联系人信息和通话记录分享"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"用于联系人信息和通话记录分享"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"共享互联网连接"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"短信"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM 卡访问权限"</string>
@@ -552,7 +554,7 @@
<string name="media_transfer_default_device_name" msgid="4315604017399871828">"连接的设备"</string>
<string name="media_transfer_this_phone" msgid="7194341457812151531">"这部手机"</string>
<string name="media_output_status_unknown_error" msgid="5098565887497902222">"无法在此设备上播放"</string>
- <string name="media_output_status_require_premium" msgid="8411255800047014822">"升级帐号后才能切换"</string>
+ <string name="media_output_status_require_premium" msgid="8411255800047014822">"升级账号后才能切换"</string>
<string name="media_output_status_not_support_downloads" msgid="4523828729240373315">"无法在此设备上播放下载的内容"</string>
<string name="media_output_status_try_after_ad" msgid="8312579066856015441">"广告之后重试"</string>
<string name="media_output_status_device_in_low_power_mode" msgid="8184631698321758451">"若要在此设备上播放,请唤醒设备"</string>
@@ -576,7 +578,7 @@
<string name="delete_blob_text" msgid="2819192607255625697">"删除共享数据"</string>
<string name="delete_blob_confirmation_text" msgid="7807446938920827280">"确定要删除这些共享数据吗?"</string>
<string name="user_add_user_item_summary" msgid="5748424612724703400">"用户拥有个人专属的应用和内容"</string>
- <string name="user_add_profile_item_summary" msgid="5418602404308968028">"您可以限制其他人使用来自您的帐号的应用和内容"</string>
+ <string name="user_add_profile_item_summary" msgid="5418602404308968028">"您可以限制其他人使用来自您的账号的应用和内容"</string>
<string name="user_add_user_item_title" msgid="2394272381086965029">"用户"</string>
<string name="user_add_profile_item_title" msgid="3111051717414643029">"受限个人资料"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"要添加新用户吗?"</string>
diff --git a/packages/SettingsLib/res/values-zh-rHK/strings.xml b/packages/SettingsLib/res/values-zh-rHK/strings.xml
index 57718d8..dfde69f 100644
--- a/packages/SettingsLib/res/values-zh-rHK/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rHK/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"檔案傳輸"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"輸入裝置"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"互聯網連線"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"分享通訊錄及通話記錄"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"用於分享通訊錄及通話記錄"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"互聯網連線分享"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"短訊"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM 卡存取"</string>
diff --git a/packages/SettingsLib/res/values-zh-rTW/strings.xml b/packages/SettingsLib/res/values-zh-rTW/strings.xml
index 18317da..0257527 100644
--- a/packages/SettingsLib/res/values-zh-rTW/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rTW/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"檔案傳輸"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"輸入裝置"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"網際網路連線"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"分享聯絡人和通話記錄"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"用於分享聯絡人和通話記錄"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"網際網路連線分享"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"簡訊"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"SIM 卡存取權"</string>
diff --git a/packages/SettingsLib/res/values-zu/strings.xml b/packages/SettingsLib/res/values-zu/strings.xml
index edf5f3c..27bad75 100644
--- a/packages/SettingsLib/res/values-zu/strings.xml
+++ b/packages/SettingsLib/res/values-zu/strings.xml
@@ -107,8 +107,10 @@
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"Dlulisa ifayela"</string>
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Idivaysi yokufakwayo"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Ukufinyelela i-Inthanethi"</string>
- <string name="bluetooth_profile_pbap" msgid="4262303387989406171">"Ukwabelana ngoxhumana nabo nomlando wekholi"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="6466456791354759132">"Ukusetshenziswa kokwabelana ngoxhumana nabo nomlando wekholi"</string>
+ <!-- no translation found for bluetooth_profile_pbap (2103406516858653017) -->
+ <skip />
+ <!-- no translation found for bluetooth_profile_pbap_summary (402819589201138227) -->
+ <skip />
<string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Ukwabelana ngoxhumano lwe-Inthanethi"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Imilayezo yombhalo"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Ukufinyelela kwe-SIM"</string>
diff --git a/packages/SettingsLib/src/com/android/settingslib/deviceinfo/AbstractBluetoothAddressPreferenceController.java b/packages/SettingsLib/src/com/android/settingslib/deviceinfo/AbstractBluetoothAddressPreferenceController.java
index 7455912..4fcdc8b 100644
--- a/packages/SettingsLib/src/com/android/settingslib/deviceinfo/AbstractBluetoothAddressPreferenceController.java
+++ b/packages/SettingsLib/src/com/android/settingslib/deviceinfo/AbstractBluetoothAddressPreferenceController.java
@@ -27,6 +27,7 @@
import com.android.settingslib.R;
import com.android.settingslib.core.lifecycle.Lifecycle;
+import com.android.settingslib.utils.ThreadUtils;
/**
* Preference controller for bluetooth address
@@ -74,13 +75,18 @@
protected void updateConnectivity() {
BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter();
if (bluetooth != null && mBtAddress != null) {
- String address = bluetooth.isEnabled() ? bluetooth.getAddress() : null;
- if (!TextUtils.isEmpty(address)) {
- // Convert the address to lowercase for consistency with the wifi MAC address.
- mBtAddress.setSummary(address.toLowerCase());
- } else {
- mBtAddress.setSummary(R.string.status_unavailable);
- }
+ ThreadUtils.postOnBackgroundThread(() -> {
+ String address = bluetooth.isEnabled() ? bluetooth.getAddress() : null;
+ ThreadUtils.postOnMainThread(() -> {
+ if (!TextUtils.isEmpty(address)) {
+ // Convert the address to lowercase for consistency with the wifi MAC
+ // address.
+ mBtAddress.setSummary(address.toLowerCase());
+ } else {
+ mBtAddress.setSummary(R.string.status_unavailable);
+ }
+ });
+ });
}
}
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/fuelgauge/BatteryStatus.java b/packages/SettingsLib/src/com/android/settingslib/fuelgauge/BatteryStatus.java
index 9ab84d2..f90a17a 100644
--- a/packages/SettingsLib/src/com/android/settingslib/fuelgauge/BatteryStatus.java
+++ b/packages/SettingsLib/src/com/android/settingslib/fuelgauge/BatteryStatus.java
@@ -45,6 +45,7 @@
private static final int EXTREME_LOW_BATTERY_THRESHOLD = 3;
private static final int DEFAULT_CHARGING_VOLTAGE_MICRO_VOLT = 5000000;
+ public static final int BATTERY_LEVEL_UNKNOWN = -1;
public static final int CHARGING_UNKNOWN = -1;
public static final int CHARGING_SLOWLY = 0;
public static final int CHARGING_REGULAR = 1;
@@ -186,12 +187,13 @@
/** Gets the battery level from the intent. */
public static int getBatteryLevel(Intent batteryChangedIntent) {
if (batteryChangedIntent == null) {
- return -1; /*invalid battery level*/
+ return BATTERY_LEVEL_UNKNOWN;
}
- final int level = batteryChangedIntent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
+ final int level =
+ batteryChangedIntent.getIntExtra(BatteryManager.EXTRA_LEVEL, BATTERY_LEVEL_UNKNOWN);
final int scale = batteryChangedIntent.getIntExtra(BatteryManager.EXTRA_SCALE, 0);
return scale == 0
- ? -1 /*invalid battery level*/
+ ? BATTERY_LEVEL_UNKNOWN
: Math.round((level / (float) scale) * 100f);
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java b/packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java
index fe3ef5d..dbc3bf7 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java
@@ -22,6 +22,7 @@
import android.bluetooth.BluetoothDevice;
import android.content.ComponentName;
import android.content.Context;
+import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.media.AudioDeviceAttributes;
import android.media.AudioManager;
@@ -520,9 +521,13 @@
if (type == MediaDevice.MediaDeviceType.TYPE_USB_C_AUDIO_DEVICE
|| type == MediaDevice.MediaDeviceType.TYPE_3POINT5_MM_AUDIO_DEVICE
|| type == MediaDevice.MediaDeviceType.TYPE_PHONE_DEVICE) {
- MediaDevice mutingExpectedDevice = getMutingExpectedDevice();
- if (mutingExpectedDevice != null) {
- mMediaDevices.add(mutingExpectedDevice);
+ if (isTv()) {
+ mMediaDevices.addAll(buildDisconnectedBluetoothDevice());
+ } else {
+ MediaDevice mutingExpectedDevice = getMutingExpectedDevice();
+ if (mutingExpectedDevice != null) {
+ mMediaDevices.add(mutingExpectedDevice);
+ }
}
break;
}
@@ -542,6 +547,12 @@
}
}
+ private boolean isTv() {
+ PackageManager pm = mContext.getPackageManager();
+ return pm.hasSystemFeature(PackageManager.FEATURE_TELEVISION)
+ || pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK);
+ }
+
private MediaDevice getMutingExpectedDevice() {
if (mBluetoothAdapter == null
|| mAudioManager.getMutingExpectedDevice() == null) {
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/dpp/WifiDppIntentHelper.java b/packages/SettingsLib/src/com/android/settingslib/wifi/dpp/WifiDppIntentHelper.java
index 1134d13..bc8c560 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/dpp/WifiDppIntentHelper.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/dpp/WifiDppIntentHelper.java
@@ -28,6 +28,11 @@
* Wifi dpp intent helper functions to share between the Settings App and SystemUI.
*/
public class WifiDppIntentHelper {
+ /**
+ * Action added to the intent when app wants to launch the QR code generator with lock screen.
+ */
+ public static final String ACTION_CONFIGURATOR_AUTH_QR_CODE_GENERATOR =
+ "android.settings.WIFI_DPP_CONFIGURATOR_AUTH_QR_CODE_GENERATOR";
static final String EXTRA_WIFI_SECURITY = "security";
/** The data corresponding to {@code WifiConfiguration} SSID */
diff --git a/packages/SettingsLib/tests/robotests/Android.bp b/packages/SettingsLib/tests/robotests/Android.bp
index 5c55a43..c037c40 100644
--- a/packages/SettingsLib/tests/robotests/Android.bp
+++ b/packages/SettingsLib/tests/robotests/Android.bp
@@ -42,7 +42,10 @@
name: "SettingsLibRoboTests",
srcs: ["src/**/*.java"],
static_libs: [
+ "Settings_robolectric_meta_service_file",
+ "Robolectric_shadows_androidx_fragment_upstream",
"SettingsLib-robo-testutils",
+ "androidx.fragment_fragment",
"androidx.test.core",
"androidx.core_core",
"testng", // TODO: remove once JUnit on Android provides assertThrows
@@ -53,6 +56,20 @@
test_options: {
timeout: 36000,
},
+ upstream: true,
+}
+
+java_genrule {
+ name: "Settings_robolectric_meta_service_file",
+ out: ["robolectric_meta_service_file.jar"],
+ tools: ["soong_zip"],
+ cmd: "mkdir -p $(genDir)/META-INF/services/ && touch $(genDir)/META-INF/services/org.robolectric.internal.ShadowProvider &&" +
+ "echo -e 'org.robolectric.Shadows' >> $(genDir)/META-INF/services/org.robolectric.internal.ShadowProvider && " +
+ "echo -e 'org.robolectric.shadows.multidex.Shadows' >> $(genDir)/META-INF/services/org.robolectric.internal.ShadowProvider && " +
+ "echo -e 'org.robolectric.shadows.httpclient.Shadows' >> $(genDir)/META-INF/services/org.robolectric.internal.ShadowProvider && " +
+ //"echo -e 'com.android.settings.testutils.shadow.Shadows' >> $(genDir)/META-INF/services/org.robolectric.internal.ShadowProvider && " +
+ "echo -e 'com.android.settingslib.testutils.shadow.Shadows' >> $(genDir)/META-INF/services/org.robolectric.internal.ShadowProvider && " +
+ "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)/META-INF/services/",
}
java_library {
@@ -60,9 +77,23 @@
srcs: [
"testutils/com/android/settingslib/testutils/**/*.java",
],
-
+ javacflags: [
+ "-Aorg.robolectric.annotation.processing.shadowPackage=com.android.settingslib.testutils.shadow",
+ "-Aorg.robolectric.annotation.processing.sdkCheckMode=ERROR",
+ // Uncomment the below to debug annotation processors not firing.
+ //"-verbose",
+ //"-XprintRounds",
+ //"-XprintProcessorInfo",
+ //"-Xlint",
+ //"-J-verbose",
+ ],
+ plugins: [
+ "auto_value_plugin_1.9",
+ "auto_value_builder_plugin_1.9",
+ "Robolectric_processor_upstream",
+ ],
libs: [
- "Robolectric_all-target",
+ "Robolectric_all-target_upstream",
"mockito-robolectric-prebuilt",
"truth-prebuilt",
],
diff --git a/packages/SettingsLib/tests/robotests/config/robolectric.properties b/packages/SettingsLib/tests/robotests/config/robolectric.properties
index fab7251..2a9e50d 100644
--- a/packages/SettingsLib/tests/robotests/config/robolectric.properties
+++ b/packages/SettingsLib/tests/robotests/config/robolectric.properties
@@ -1 +1,2 @@
sdk=NEWEST_SDK
+instrumentedPackages=androidx.preference
diff --git a/packages/SettingsLib/tests/robotests/fragment/Android.bp b/packages/SettingsLib/tests/robotests/fragment/Android.bp
new file mode 100644
index 0000000..3e67156
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/fragment/Android.bp
@@ -0,0 +1,40 @@
+//#############################################
+// Compile Robolectric shadows framework misapplied to androidx
+//#############################################
+
+package {
+ // 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"],
+}
+
+java_library {
+ name: "Robolectric_shadows_androidx_fragment_upstream",
+ srcs: [
+ "src/main/java/**/*.java",
+ "src/main/java/**/*.kt",
+ ],
+ javacflags: [
+ "-Aorg.robolectric.annotation.processing.shadowPackage=org.robolectric.shadows.androidx.fragment",
+ "-Aorg.robolectric.annotation.processing.sdkCheckMode=ERROR",
+ // Uncomment the below to debug annotation processors not firing.
+ //"-verbose",
+ //"-XprintRounds",
+ //"-XprintProcessorInfo",
+ //"-Xlint",
+ //"-J-verbose",
+ ],
+ libs: [
+ "Robolectric_all-target_upstream",
+ "androidx.fragment_fragment",
+ ],
+ plugins: [
+ "auto_value_plugin_1.9",
+ "auto_value_builder_plugin_1.9",
+ "Robolectric_processor_upstream",
+ ],
+
+}
diff --git a/packages/SettingsLib/tests/robotests/fragment/BUILD b/packages/SettingsLib/tests/robotests/fragment/BUILD
new file mode 100644
index 0000000..393a02e
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/fragment/BUILD
@@ -0,0 +1,69 @@
+load("//third_party/java/android/android_sdk_linux/extras/android/compatibility/jetify:jetify.bzl", "jetify_android_library", "jetify_android_local_test")
+
+package(
+ default_applicable_licenses = ["//third_party/java_src/robolectric:license"],
+ default_visibility = ["//third_party/java_src/robolectric:__subpackages__"],
+)
+
+licenses(["notice"])
+
+#==============================================================================
+# Test resources library
+#==============================================================================
+jetify_android_library(
+ name = "test_resources",
+ custom_package = "org.robolectric.shadows.androidx.fragment",
+ manifest = "src/test/AndroidManifest.xml",
+ resource_files = glob(
+ ["src/test/resources/**/*"],
+ ),
+)
+
+#==============================================================================
+# AndroidX fragment module library
+#==============================================================================
+jetify_android_library(
+ name = "androidx_fragment",
+ testonly = 1,
+ srcs = glob(
+ ["src/main/java/**"],
+ ),
+ custom_package = "org.robolectric.shadows.androidx.fragment",
+ javacopts = [
+ "-Aorg.robolectric.annotation.processing.shadowPackage=org.robolectric.shadows.androidx.fragment",
+ ],
+ jetify_sources = True,
+ plugins = [
+ "//java/com/google/thirdparty/robolectric/processor",
+ ],
+ deps = [
+ "//third_party/java/androidx/core",
+ "//third_party/java/androidx/fragment",
+ "//third_party/java/androidx/lifecycle",
+ "//third_party/java_src/robolectric/shadowapi",
+ "//third_party/java_src/robolectric/shadows/framework",
+ ],
+)
+
+[
+ jetify_android_local_test(
+ name = "test_" + src.rstrip(".java"),
+ size = "small",
+ srcs = glob(
+ ["src/test/java/**/*.java"],
+ ),
+ jetify_sources = True,
+ deps = [
+ ":androidx_fragment",
+ ":test_resources",
+ "//third_party/java/androidx/fragment",
+ "//third_party/java/androidx/loader",
+ "//third_party/java/mockito",
+ "//third_party/java/robolectric",
+ "//third_party/java/truth",
+ ],
+ )
+ for src in glob(
+ ["src/test/java/**/*Test.java"],
+ )
+]
diff --git a/packages/SettingsLib/tests/robotests/fragment/build.gradle b/packages/SettingsLib/tests/robotests/fragment/build.gradle
new file mode 100644
index 0000000..d9dcd84
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/fragment/build.gradle
@@ -0,0 +1,48 @@
+plugins {
+ id "net.ltgt.errorprone" version "0.0.13"
+}
+
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 28
+
+ android {
+ sourceSets {
+ main {
+ res.srcDirs = ['src/test/resources/res']
+ }
+ }
+ testOptions {
+ unitTests {
+ includeAndroidResources = true
+ }
+ }
+ }
+}
+
+dependencies {
+ // Project dependencies
+ compileOnly project(":robolectric")
+
+ // Compile dependencies
+ compileOnly AndroidSdk.MAX_SDK.coordinates
+ compileOnly "androidx.core:core:1.0.0-rc02"
+ compileOnly 'androidx.fragment:fragment:1.0.0-rc02'
+ compileOnly "androidx.lifecycle:lifecycle-viewmodel:2.0.0-rc01"
+ compileOnly "androidx.lifecycle:lifecycle-common:2.0.0-beta01"
+
+ // Testing dependencies
+ testImplementation "com.google.truth:truth:0.44"
+ testImplementation "org.mockito:mockito-core:2.5.4"
+ testImplementation "androidx.arch.core:core-common:2.0.0-beta01"
+ testImplementation "androidx.arch.core:core-runtime:2.0.0-rc01"
+ testImplementation "androidx.collection:collection:1.0.0-rc01"
+ testImplementation "androidx.core:core:1.0.0-rc02"
+ testImplementation 'androidx.fragment:fragment:1.0.0-rc02'
+ testImplementation "androidx.lifecycle:lifecycle-viewmodel:2.0.0-rc01"
+ testImplementation "androidx.lifecycle:lifecycle-common:2.0.0-beta01"
+ testImplementation "androidx.lifecycle:lifecycle-runtime:2.0.0-rc01"
+ testImplementation "androidx.lifecycle:lifecycle-livedata-core:2.0.0-rc01"
+ testImplementation "androidx.loader:loader:1.0.0-rc02"
+}
diff --git a/packages/SettingsLib/tests/robotests/fragment/src/main/java/org/robolectric/shadows/androidx/fragment/FragmentController.java b/packages/SettingsLib/tests/robotests/fragment/src/main/java/org/robolectric/shadows/androidx/fragment/FragmentController.java
new file mode 100644
index 0000000..c688683
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/fragment/src/main/java/org/robolectric/shadows/androidx/fragment/FragmentController.java
@@ -0,0 +1,348 @@
+/*
+ * 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 org.robolectric.shadows.androidx.fragment;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.widget.LinearLayout;
+
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
+
+import org.robolectric.android.controller.ActivityController;
+import org.robolectric.android.controller.ComponentController;
+import org.robolectric.util.ReflectionHelpers;
+
+/** A Controller that can be used to drive the lifecycle of a {@link Fragment} */
+public class FragmentController<F extends Fragment>
+ extends ComponentController<FragmentController<F>, F> {
+
+ private final F mFragment;
+ private final ActivityController<? extends FragmentActivity> mActivityController;
+
+ private FragmentController(F fragment, Class<? extends FragmentActivity> activityClass) {
+ this(fragment, activityClass, null /*intent*/, null /*arguments*/);
+ }
+
+ private FragmentController(
+ F fragment, Class<? extends FragmentActivity> activityClass, Intent intent) {
+ this(fragment, activityClass, intent, null /*arguments*/);
+ }
+
+ private FragmentController(
+ F fragment, Class<? extends FragmentActivity> activityClass, Bundle arguments) {
+ this(fragment, activityClass, null /*intent*/, arguments);
+ }
+
+ private FragmentController(
+ F fragment,
+ Class<? extends FragmentActivity> activityClass,
+ Intent intent,
+ Bundle arguments) {
+ super(fragment, intent);
+ this.mFragment = fragment;
+ if (arguments != null) {
+ this.mFragment.setArguments(arguments);
+ }
+ this.mActivityController =
+ ActivityController.of(ReflectionHelpers.callConstructor(activityClass), intent);
+ }
+
+ /**
+ * Generate the {@link FragmentController} for specific fragment.
+ *
+ * @param fragment the fragment which you'd like to drive lifecycle
+ * @return {@link FragmentController}
+ */
+ public static <F extends Fragment> FragmentController<F> of(F fragment) {
+ return new FragmentController<>(fragment, FragmentControllerActivity.class);
+ }
+
+ /**
+ * Generate the {@link FragmentController} for specific fragment and intent.
+ *
+ * @param fragment the fragment which you'd like to drive lifecycle
+ * @param intent the intent which will be retained by activity
+ * @return {@link FragmentController}
+ */
+ public static <F extends Fragment> FragmentController<F> of(F fragment, Intent intent) {
+ return new FragmentController<>(fragment, FragmentControllerActivity.class, intent);
+ }
+
+ /**
+ * Generate the {@link FragmentController} for specific fragment and arguments.
+ *
+ * @param fragment the fragment which you'd like to drive lifecycle
+ * @param arguments the arguments which will be retained by fragment
+ * @return {@link FragmentController}
+ */
+ public static <F extends Fragment> FragmentController<F> of(F fragment, Bundle arguments) {
+ return new FragmentController<>(fragment, FragmentControllerActivity.class, arguments);
+ }
+
+ /**
+ * Generate the {@link FragmentController} for specific fragment and activity class.
+ *
+ * @param fragment the fragment which you'd like to drive lifecycle
+ * @param activityClass the activity which will be attached by fragment
+ * @return {@link FragmentController}
+ */
+ public static <F extends Fragment> FragmentController<F> of(
+ F fragment, Class<? extends FragmentActivity> activityClass) {
+ return new FragmentController<>(fragment, activityClass);
+ }
+
+ /**
+ * Generate the {@link FragmentController} for specific fragment, intent and arguments.
+ *
+ * @param fragment the fragment which you'd like to drive lifecycle
+ * @param intent the intent which will be retained by activity
+ * @param arguments the arguments which will be retained by fragment
+ * @return {@link FragmentController}
+ */
+ public static <F extends Fragment> FragmentController<F> of(
+ F fragment, Intent intent, Bundle arguments) {
+ return new FragmentController<>(fragment, FragmentControllerActivity.class, intent,
+ arguments);
+ }
+
+ /**
+ * Generate the {@link FragmentController} for specific fragment, activity class and intent.
+ *
+ * @param fragment the fragment which you'd like to drive lifecycle
+ * @param activityClass the activity which will be attached by fragment
+ * @param intent the intent which will be retained by activity
+ * @return {@link FragmentController}
+ */
+ public static <F extends Fragment> FragmentController<F> of(
+ F fragment, Class<? extends FragmentActivity> activityClass, Intent intent) {
+ return new FragmentController<>(fragment, activityClass, intent);
+ }
+
+ /**
+ * Generate the {@link FragmentController} for specific fragment, activity class and arguments.
+ *
+ * @param fragment the fragment which you'd like to drive lifecycle
+ * @param activityClass the activity which will be attached by fragment
+ * @param arguments the arguments which will be retained by fragment
+ * @return {@link FragmentController}
+ */
+ public static <F extends Fragment> FragmentController<F> of(
+ F fragment, Class<? extends FragmentActivity> activityClass, Bundle arguments) {
+ return new FragmentController<>(fragment, activityClass, arguments);
+ }
+
+ /**
+ * Generate the {@link FragmentController} for specific fragment, activity class, intent and
+ * arguments.
+ *
+ * @param fragment the fragment which you'd like to drive lifecycle
+ * @param activityClass the activity which will be attached by fragment
+ * @param intent the intent which will be retained by activity
+ * @param arguments the arguments which will be retained by fragment
+ * @return {@link FragmentController}
+ */
+ public static <F extends Fragment> FragmentController<F> of(
+ F fragment,
+ Class<? extends FragmentActivity> activityClass,
+ Intent intent,
+ Bundle arguments) {
+ return new FragmentController<>(fragment, activityClass, intent, arguments);
+ }
+
+ /**
+ * Sets up the given fragment by attaching it to an activity, calling its onCreate() through
+ * onResume() lifecycle methods, and then making it visible. Note that the fragment will be
+ * added
+ * to the view with ID 1.
+ */
+ public static <F extends Fragment> F setupFragment(F fragment) {
+ return FragmentController.of(fragment).create().start().resume().visible().get();
+ }
+
+ /**
+ * Sets up the given fragment by attaching it to an activity, calling its onCreate() through
+ * onResume() lifecycle methods, and then making it visible. Note that the fragment will be
+ * added
+ * to the view with ID 1.
+ */
+ public static <F extends Fragment> F setupFragment(
+ F fragment, Class<? extends FragmentActivity> fragmentActivityClass) {
+ return FragmentController.of(fragment, fragmentActivityClass)
+ .create()
+ .start()
+ .resume()
+ .visible()
+ .get();
+ }
+
+ /**
+ * Sets up the given fragment by attaching it to an activity created with the given bundle,
+ * calling its onCreate() through onResume() lifecycle methods, and then making it visible. Note
+ * that the fragment will be added to the view with ID 1.
+ */
+ public static <F extends Fragment> F setupFragment(
+ F fragment, Class<? extends FragmentActivity> fragmentActivityClass, Bundle bundle) {
+ return FragmentController.of(fragment, fragmentActivityClass)
+ .create(bundle)
+ .start()
+ .resume()
+ .visible()
+ .get();
+ }
+
+ /**
+ * Sets up the given fragment by attaching it to an activity created with the given bundle and
+ * container id, calling its onCreate() through onResume() lifecycle methods, and then making it
+ * visible.
+ */
+ public static <F extends Fragment> F setupFragment(
+ F fragment,
+ Class<? extends FragmentActivity> fragmentActivityClass,
+ int containerViewId,
+ Bundle bundle) {
+ return FragmentController.of(fragment, fragmentActivityClass)
+ .create(containerViewId, bundle)
+ .start()
+ .resume()
+ .visible()
+ .get();
+ }
+
+ /**
+ * Creates the activity with {@link Bundle} and adds the fragment to the view with ID {@code
+ * contentViewId}.
+ */
+ public FragmentController<F> create(final int contentViewId, final Bundle bundle) {
+ shadowMainLooper.runPaused(
+ new Runnable() {
+ @Override
+ public void run() {
+ mActivityController
+ .create(bundle)
+ .get()
+ .getSupportFragmentManager()
+ .beginTransaction()
+ .add(contentViewId, mFragment)
+ .commit();
+ }
+ });
+ return this;
+ }
+
+ /**
+ * Creates the activity with {@link Bundle} and adds the fragment to it. Note that the fragment
+ * will be added to the view with ID 1.
+ */
+ public FragmentController<F> create(final Bundle bundle) {
+ return create(1, bundle);
+ }
+
+ /**
+ * Creates the {@link Fragment} in a newly initialized state and hence will receive a null
+ * savedInstanceState {@link Bundle parameter}
+ */
+ @Override
+ public FragmentController<F> create() {
+ return create(null);
+ }
+
+ /** Drive lifecycle of activity to Start lifetime */
+ public FragmentController<F> start() {
+ shadowMainLooper.runPaused(
+ new Runnable() {
+ @Override
+ public void run() {
+ mActivityController.start();
+ }
+ });
+ return this;
+ }
+
+ /** Drive lifecycle of activity to Resume lifetime */
+ public FragmentController<F> resume() {
+ shadowMainLooper.runPaused(
+ new Runnable() {
+ @Override
+ public void run() {
+ mActivityController.resume();
+ }
+ });
+ return this;
+ }
+
+ /** Drive lifecycle of activity to Pause lifetime */
+ public FragmentController<F> pause() {
+ shadowMainLooper.runPaused(
+ new Runnable() {
+ @Override
+ public void run() {
+ mActivityController.pause();
+ }
+ });
+ return this;
+ }
+
+ /** Drive lifecycle of activity to Stop lifetime */
+ public FragmentController<F> stop() {
+ shadowMainLooper.runPaused(
+ new Runnable() {
+ @Override
+ public void run() {
+ mActivityController.stop();
+ }
+ });
+ return this;
+ }
+
+ /** Drive lifecycle of activity to Destroy lifetime */
+ @Override
+ public FragmentController<F> destroy() {
+ shadowMainLooper.runPaused(
+ new Runnable() {
+ @Override
+ public void run() {
+ mActivityController.destroy();
+ }
+ });
+ return this;
+ }
+
+ /** Let activity can be visible lifetime */
+ public FragmentController<F> visible() {
+ shadowMainLooper.runPaused(
+ new Runnable() {
+ @Override
+ public void run() {
+ mActivityController.visible();
+ }
+ });
+ return this;
+ }
+
+ private static class FragmentControllerActivity extends FragmentActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ LinearLayout view = new LinearLayout(this);
+ view.setId(1);
+
+ setContentView(view);
+ }
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/fragment/src/main/java/org/robolectric/shadows/androidx/fragment/package-info.java b/packages/SettingsLib/tests/robotests/fragment/src/main/java/org/robolectric/shadows/androidx/fragment/package-info.java
new file mode 100644
index 0000000..dd89441
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/fragment/src/main/java/org/robolectric/shadows/androidx/fragment/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+/**
+ * Testing infrastructure for androidx.fragment library.
+ *
+ * <p>To use this in your project, add the artifact {@code
+ * org.robolectric:shadows-androidx-fragment} to your project.
+ */
+package org.robolectric.shadows.androidx.fragment;
diff --git a/packages/SettingsLib/tests/robotests/fragment/src/test/AndroidManifest.xml b/packages/SettingsLib/tests/robotests/fragment/src/test/AndroidManifest.xml
new file mode 100644
index 0000000..8493c02
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/fragment/src/test/AndroidManifest.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.robolectric.shadows.androidx.fragment">
+
+ <uses-sdk android:targetSdkVersion="28"/>
+</manifest>
diff --git a/packages/SettingsLib/tests/robotests/fragment/src/test/java/org/robolectric/shadows/androidx/fragment/FragmentControllerTest.java b/packages/SettingsLib/tests/robotests/fragment/src/test/java/org/robolectric/shadows/androidx/fragment/FragmentControllerTest.java
new file mode 100644
index 0000000..ef63058
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/fragment/src/test/java/org/robolectric/shadows/androidx/fragment/FragmentControllerTest.java
@@ -0,0 +1,360 @@
+/*
+ * 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 org.robolectric.shadows.androidx.fragment;
+
+import static android.os.Looper.getMainLooper;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.robolectric.Shadows.shadowOf;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
+
+import org.junit.After;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/** Tests for {@link FragmentController} */
+@RunWith(RobolectricTestRunner.class)
+public class FragmentControllerTest {
+
+ @After
+ public void tearDown() {
+ TranscriptFragment.clearLifecycleEvents();
+ }
+
+ @Test
+ public void initialNotAttached() {
+ final FragmentController<TranscriptFragment> controller =
+ FragmentController.of(new TranscriptFragment());
+
+ assertThat(controller.get().getView()).isNull();
+ assertThat(controller.get().getActivity()).isNull();
+ assertThat(controller.get().isAdded()).isFalse();
+ }
+
+ @Test
+ public void initialNotAttached_customActivity() {
+ final FragmentController<TranscriptFragment> controller =
+ FragmentController.of(new TranscriptFragment(), TestActivity.class);
+
+ assertThat(controller.get().getView()).isNull();
+ assertThat(controller.get().getActivity()).isNull();
+ assertThat(controller.get().isAdded()).isFalse();
+ }
+
+ @Test
+ public void attachedAfterCreate() {
+ final FragmentController<TranscriptFragment> controller =
+ FragmentController.of(new TranscriptFragment());
+
+ controller.create();
+ shadowOf(getMainLooper()).idle();
+
+ assertThat(controller.get().getActivity()).isNotNull();
+ assertThat(controller.get().isAdded()).isTrue();
+ assertThat(controller.get().isResumed()).isFalse();
+ }
+
+ @Test
+ public void attachedAfterCreate_customActivity() {
+ final FragmentController<TranscriptFragment> controller =
+ FragmentController.of(new TranscriptFragment(), TestActivity.class);
+
+ controller.create();
+ shadowOf(getMainLooper()).idle();
+
+ assertThat(controller.get().getActivity()).isNotNull();
+ assertThat(controller.get().getActivity()).isInstanceOf(TestActivity.class);
+ assertThat(controller.get().isAdded()).isTrue();
+ assertThat(controller.get().isResumed()).isFalse();
+ }
+
+ @Test
+ public void attachedAfterCreate_customizedViewId() {
+ final FragmentController<TranscriptFragment> controller =
+ FragmentController.of(new TranscriptFragment(), CustomizedViewIdTestActivity.class);
+
+ controller.create(R.id.custom_activity_view, null).start();
+
+ assertThat(controller.get().getView()).isNotNull();
+ assertThat(controller.get().getActivity()).isNotNull();
+ assertThat(controller.get().isAdded()).isTrue();
+ assertThat(controller.get().isResumed()).isFalse();
+ assertThat((TextView) controller.get().getView().findViewById(R.id.tacos)).isNotNull();
+ }
+
+ @Test
+ public void hasViewAfterStart() {
+ final FragmentController<TranscriptFragment> controller =
+ FragmentController.of(new TranscriptFragment());
+
+ controller.create().start();
+
+ assertThat(controller.get().getView()).isNotNull();
+ }
+
+ @Test
+ public void isResumed() {
+ final FragmentController<TranscriptFragment> controller =
+ FragmentController.of(new TranscriptFragment(), TestActivity.class);
+
+ controller.create().start().resume();
+
+ assertThat(controller.get().getView()).isNotNull();
+ assertThat(controller.get().getActivity()).isNotNull();
+ assertThat(controller.get().isAdded()).isTrue();
+ assertThat(controller.get().isResumed()).isTrue();
+ assertThat((TextView) controller.get().getView().findViewById(R.id.tacos)).isNotNull();
+ }
+
+ @Test
+ public void isPaused() {
+ final FragmentController<TranscriptFragment> controller =
+ FragmentController.of(new TranscriptFragment(), TestActivity.class);
+
+ controller.create().start().resume().pause();
+
+ assertThat(controller.get().getView()).isNotNull();
+ assertThat(controller.get().getActivity()).isNotNull();
+ assertThat(controller.get().isAdded()).isTrue();
+ assertThat(controller.get().isResumed()).isFalse();
+ assertThat(controller.get().getLifecycleEvents())
+ .containsExactly("onCreate", "onStart", "onResume", "onPause")
+ .inOrder();
+ }
+
+ @Test
+ public void isStopped() {
+ final FragmentController<TranscriptFragment> controller =
+ FragmentController.of(new TranscriptFragment(), TestActivity.class);
+
+ controller.create().start().resume().pause().stop();
+
+ assertThat(controller.get().getView()).isNotNull();
+ assertThat(controller.get().getActivity()).isNotNull();
+ assertThat(controller.get().isAdded()).isTrue();
+ assertThat(controller.get().isResumed()).isFalse();
+ assertThat(controller.get().getLifecycleEvents())
+ .containsExactly("onCreate", "onStart", "onResume", "onPause", "onStop")
+ .inOrder();
+ }
+
+ @Test
+ public void withIntent() {
+ final Intent intent = generateTestIntent();
+ final FragmentController<TranscriptFragment> controller =
+ FragmentController.of(new TranscriptFragment(), TestActivity.class, intent);
+
+ controller.create();
+ shadowOf(getMainLooper()).idle();
+ final Intent intentInFragment = controller.get().getActivity().getIntent();
+
+ assertThat(intentInFragment.getAction()).isEqualTo("test_action");
+ assertThat(intentInFragment.getExtras().getString("test_key")).isEqualTo("test_value");
+ }
+
+ @Test
+ public void withArguments() {
+ final Bundle bundle = generateTestBundle();
+ final FragmentController<TranscriptFragment> controller =
+ FragmentController.of(new TranscriptFragment(), TestActivity.class, bundle);
+
+ controller.create();
+ final Bundle args = controller.get().getArguments();
+
+ assertThat(args.getString("test_key")).isEqualTo("test_value");
+ }
+
+ @Test
+ public void withIntentAndArguments() {
+ final Bundle bundle = generateTestBundle();
+ final Intent intent = generateTestIntent();
+ final FragmentController<TranscriptFragment> controller =
+ FragmentController.of(new TranscriptFragment(), TestActivity.class, intent, bundle);
+
+ controller.create();
+ shadowOf(getMainLooper()).idle();
+ final Intent intentInFragment = controller.get().getActivity().getIntent();
+ final Bundle args = controller.get().getArguments();
+
+ assertThat(intentInFragment.getAction()).isEqualTo("test_action");
+ assertThat(intentInFragment.getExtras().getString("test_key")).isEqualTo("test_value");
+ assertThat(args.getString("test_key")).isEqualTo("test_value");
+ }
+
+ @Test
+ public void visible() {
+ final FragmentController<TranscriptFragment> controller =
+ FragmentController.of(new TranscriptFragment(), TestActivity.class);
+
+ controller.create().start().resume();
+
+ assertThat(controller.get().isVisible()).isFalse();
+
+ controller.visible();
+
+ assertThat(controller.get().isVisible()).isTrue();
+ }
+
+ @Test
+ public void setupFragmentWithFragment_fragmentHasCorrectLifecycle() {
+ TranscriptFragment fragment = FragmentController.setupFragment(new TranscriptFragment());
+
+ assertThat(fragment.getLifecycleEvents())
+ .containsExactly("onCreate", "onStart", "onResume")
+ .inOrder();
+ assertThat(fragment.isVisible()).isTrue();
+ }
+
+ @Test
+ public void setupFragmentWithFragmentAndActivity_fragmentHasCorrectLifecycle() {
+ TranscriptFragment fragment =
+ FragmentController.setupFragment(new TranscriptFragment(), TestActivity.class);
+
+ assertThat(fragment.getLifecycleEvents())
+ .containsExactly("onCreate", "onStart", "onResume")
+ .inOrder();
+ assertThat(fragment.isVisible()).isTrue();
+ }
+
+ @Test
+ public void setupFragmentWithFragmentAndActivityAndBundle_HasCorrectLifecycle() {
+ Bundle testBundle = generateTestBundle();
+ TranscriptFragment fragment =
+ FragmentController.setupFragment(new TranscriptFragment(), TestActivity.class,
+ testBundle);
+
+ assertThat(fragment.getLifecycleEvents())
+ .containsExactly("onCreate", "onStart", "onResume")
+ .inOrder();
+ assertThat(fragment.isVisible()).isTrue();
+ }
+
+ @Test
+ public void
+ setupFragmentWithFragment_Activity_ContainViewIdAndBundle_HasCorrectLifecycle() {
+ Bundle testBundle = generateTestBundle();
+ TranscriptFragment fragment =
+ FragmentController.setupFragment(
+ new TranscriptFragment(),
+ CustomizedViewIdTestActivity.class,
+ R.id.custom_activity_view,
+ testBundle);
+
+ assertThat(fragment.getLifecycleEvents())
+ .containsExactly("onCreate", "onStart", "onResume")
+ .inOrder();
+ assertThat(fragment.isVisible()).isTrue();
+ }
+
+ private Intent generateTestIntent() {
+ final Intent testIntent = new Intent("test_action").putExtra("test_key", "test_value");
+ return testIntent;
+ }
+
+ private Bundle generateTestBundle() {
+ final Bundle testBundle = new Bundle();
+ testBundle.putString("test_key", "test_value");
+
+ return testBundle;
+ }
+
+ /** A Fragment which can record lifecycle status for test. */
+ public static class TranscriptFragment extends Fragment {
+
+ public static final List<String> sLifecycleEvents = new ArrayList<>();
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ sLifecycleEvents.add("onCreate");
+ }
+
+ @Override
+ public void onStart() {
+ super.onStart();
+ sLifecycleEvents.add("onStart");
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ sLifecycleEvents.add("onResume");
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ sLifecycleEvents.add("onPause");
+ }
+
+ @Override
+ public void onStop() {
+ super.onStop();
+ sLifecycleEvents.add("onStop");
+ }
+
+ @Override
+ public View onCreateView(
+ LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.fragment_contents, container, false);
+ }
+
+ public List<String> getLifecycleEvents() {
+ return sLifecycleEvents;
+ }
+
+ public static void clearLifecycleEvents() {
+ sLifecycleEvents.clear();
+ }
+ }
+
+ /** A Activity which set a default view for test. */
+ public static class TestActivity extends FragmentActivity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ LinearLayout view = new LinearLayout(this);
+ view.setId(1);
+
+ setContentView(view);
+ }
+ }
+
+ /** A Activity which has a custom view for test. */
+ public static class CustomizedViewIdTestActivity extends FragmentActivity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.custom_activity_view);
+ }
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/fragment/src/test/resources/res/layout/custom_activity_view.xml b/packages/SettingsLib/tests/robotests/fragment/src/test/resources/res/layout/custom_activity_view.xml
new file mode 100644
index 0000000..c074f30
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/fragment/src/test/resources/res/layout/custom_activity_view.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/custom_activity_view"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical">
+
+</LinearLayout>
diff --git a/packages/SettingsLib/tests/robotests/fragment/src/test/resources/res/layout/fragment_contents.xml b/packages/SettingsLib/tests/robotests/fragment/src/test/resources/res/layout/fragment_contents.xml
new file mode 100644
index 0000000..425b2bb
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/fragment/src/test/resources/res/layout/fragment_contents.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/tacos"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="TACOS"/>
+
+ <TextView
+ android:id="@+id/burritos"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="BURRITOS"/>
+
+</LinearLayout>
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/UtilsTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/UtilsTest.java
index 4a913c8..bb72375 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/UtilsTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/UtilsTest.java
@@ -25,7 +25,6 @@
import static org.mockito.Mockito.when;
import android.app.ActivityManager;
-import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
@@ -58,12 +57,10 @@
import org.robolectric.shadows.ShadowSettings;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
@RunWith(RobolectricTestRunner.class)
-@Config(shadows = {UtilsTest.ShadowSecure.class, UtilsTest.ShadowLocationManager.class})
+@Config(shadows = {UtilsTest.ShadowLocationManager.class})
public class UtilsTest {
private static final double[] TEST_PERCENTAGES = {0, 0.4, 0.5, 0.6, 49, 49.3, 49.8, 50, 100};
private static final String TAG = "UtilsTest";
@@ -94,7 +91,7 @@
mContext = spy(RuntimeEnvironment.application);
when(mContext.getSystemService(Context.LOCATION_SERVICE)).thenReturn(mLocationManager);
when(mContext.getSystemService(UsbManager.class)).thenReturn(mUsbManager);
- ShadowSecure.reset();
+ ShadowSettings.ShadowSecure.reset();
mAudioManager = mContext.getSystemService(AudioManager.class);
}
@@ -111,15 +108,16 @@
Settings.Secure.LOCATION_CHANGER_QUICK_SETTINGS);
assertThat(Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Secure.LOCATION_CHANGER, Settings.Secure.LOCATION_CHANGER_UNKNOWN))
- .isEqualTo(Settings.Secure.LOCATION_CHANGER_QUICK_SETTINGS);
+ Settings.Secure.LOCATION_CHANGER,
+ Settings.Secure.LOCATION_CHANGER_UNKNOWN)).isEqualTo(
+ Settings.Secure.LOCATION_CHANGER_QUICK_SETTINGS);
}
@Test
public void testFormatPercentage_RoundTrue_RoundUpIfPossible() {
- final String[] expectedPercentages = {PERCENTAGE_0, PERCENTAGE_0, PERCENTAGE_1,
- PERCENTAGE_1, PERCENTAGE_49, PERCENTAGE_49, PERCENTAGE_50, PERCENTAGE_50,
- PERCENTAGE_100};
+ final String[] expectedPercentages =
+ {PERCENTAGE_0, PERCENTAGE_0, PERCENTAGE_1, PERCENTAGE_1, PERCENTAGE_49,
+ PERCENTAGE_49, PERCENTAGE_50, PERCENTAGE_50, PERCENTAGE_100};
for (int i = 0, size = TEST_PERCENTAGES.length; i < size; i++) {
final String percentage = Utils.formatPercentage(TEST_PERCENTAGES[i], true);
@@ -129,9 +127,9 @@
@Test
public void testFormatPercentage_RoundFalse_NoRound() {
- final String[] expectedPercentages = {PERCENTAGE_0, PERCENTAGE_0, PERCENTAGE_0,
- PERCENTAGE_0, PERCENTAGE_49, PERCENTAGE_49, PERCENTAGE_49, PERCENTAGE_50,
- PERCENTAGE_100};
+ final String[] expectedPercentages =
+ {PERCENTAGE_0, PERCENTAGE_0, PERCENTAGE_0, PERCENTAGE_0, PERCENTAGE_49,
+ PERCENTAGE_49, PERCENTAGE_49, PERCENTAGE_50, PERCENTAGE_100};
for (int i = 0, size = TEST_PERCENTAGES.length; i < size; i++) {
final String percentage = Utils.formatPercentage(TEST_PERCENTAGES[i], false);
@@ -143,12 +141,7 @@
public void testGetDefaultStorageManagerDaysToRetain_storageManagerDaysToRetainUsesResources() {
Resources resources = mock(Resources.class);
when(resources.getInteger(
- eq(
- com.android
- .internal
- .R
- .integer
- .config_storageManagerDaystoRetainDefault)))
+ eq(com.android.internal.R.integer.config_storageManagerDaystoRetainDefault)))
.thenReturn(60);
assertThat(Utils.getDefaultStorageManagerDaysToRetain(resources)).isEqualTo(60);
}
@@ -163,31 +156,6 @@
return intent -> TextUtils.equals(expected, intent.getAction());
}
- @Implements(value = Settings.Secure.class)
- public static class ShadowSecure extends ShadowSettings.ShadowSecure {
- private static Map<String, Integer> map = new HashMap<>();
-
- @Implementation
- public static boolean putIntForUser(ContentResolver cr, String name, int value,
- int userHandle) {
- map.put(name, value);
- return true;
- }
-
- @Implementation
- public static int getIntForUser(ContentResolver cr, String name, int def, int userHandle) {
- if (map.containsKey(name)) {
- return map.get(name);
- } else {
- return def;
- }
- }
-
- public static void reset() {
- map.clear();
- }
- }
-
@Implements(value = LocationManager.class)
public static class ShadowLocationManager {
@@ -337,9 +305,8 @@
@Test
public void getBatteryStatus_statusIsFull_returnFullString() {
- final Intent intent = new Intent()
- .putExtra(BatteryManager.EXTRA_LEVEL, 100)
- .putExtra(BatteryManager.EXTRA_SCALE, 100);
+ final Intent intent = new Intent().putExtra(BatteryManager.EXTRA_LEVEL, 100).putExtra(
+ BatteryManager.EXTRA_SCALE, 100);
final Resources resources = mContext.getResources();
assertThat(Utils.getBatteryStatus(mContext, intent, /* compactStatus= */ false)).isEqualTo(
@@ -348,9 +315,8 @@
@Test
public void getBatteryStatus_statusIsFullAndUseCompactStatus_returnFullyChargedString() {
- final Intent intent = new Intent()
- .putExtra(BatteryManager.EXTRA_LEVEL, 100)
- .putExtra(BatteryManager.EXTRA_SCALE, 100);
+ final Intent intent = new Intent().putExtra(BatteryManager.EXTRA_LEVEL, 100).putExtra(
+ BatteryManager.EXTRA_SCALE, 100);
final Resources resources = mContext.getResources();
assertThat(Utils.getBatteryStatus(mContext, intent, /* compactStatus= */ true)).isEqualTo(
@@ -516,7 +482,6 @@
when(mUsbPort.getStatus()).thenReturn(mUsbPortStatus);
when(mUsbPort.supportsComplianceWarnings()).thenReturn(true);
when(mUsbPortStatus.isConnected()).thenReturn(true);
- when(mUsbPortStatus.getComplianceWarnings())
- .thenReturn(new int[]{complianceWarningType});
+ when(mUsbPortStatus.getComplianceWarnings()).thenReturn(new int[]{complianceWarningType});
}
}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/accessibility/AccessibilityUtilsTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/accessibility/AccessibilityUtilsTest.java
index 44fdaec..3de8446 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/accessibility/AccessibilityUtilsTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/accessibility/AccessibilityUtilsTest.java
@@ -23,13 +23,17 @@
import android.os.UserHandle;
import android.provider.Settings;
+import com.android.settingslib.testutils.shadow.ShadowSecure;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
@RunWith(RobolectricTestRunner.class)
+@Config(shadows = {ShadowSecure.class})
public class AccessibilityUtilsTest {
private Context mContext;
@@ -46,7 +50,7 @@
@Test
public void getEnabledServicesFromSettings_badFormat_emptyResult() {
- Settings.Secure.putStringForUser(
+ ShadowSecure.putStringForUser(
mContext.getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
":",
UserHandle.myUserId());
@@ -57,7 +61,7 @@
@Test
public void getEnabledServicesFromSettings_1Service_1result() {
final ComponentName cn = new ComponentName("pkg", "serv");
- Settings.Secure.putStringForUser(
+ ShadowSecure.putStringForUser(
mContext.getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
cn.flattenToString() + ":",
UserHandle.myUserId());
@@ -70,7 +74,7 @@
public void getEnabledServicesFromSettings_2Services_2results() {
final ComponentName cn1 = new ComponentName("pkg", "serv");
final ComponentName cn2 = new ComponentName("pkg", "serv2");
- Settings.Secure.putStringForUser(
+ ShadowSecure.putStringForUser(
mContext.getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
cn1.flattenToString() + ":" + cn2.flattenToString(),
UserHandle.myUserId());
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/applications/RecentAppOpsAccessesTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/applications/RecentAppOpsAccessesTest.java
index cb62a73..f9505dd 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/applications/RecentAppOpsAccessesTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/applications/RecentAppOpsAccessesTest.java
@@ -37,6 +37,8 @@
import android.os.UserManager;
import android.util.LongSparseArray;
+import com.android.settingslib.testutils.shadow.ShadowPermissionChecker;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -45,7 +47,6 @@
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
-import org.robolectric.shadows.ShadowPermissionChecker;
import java.time.Clock;
import java.util.ArrayList;
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/core/instrumentation/MetricsFeatureProviderTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/core/instrumentation/MetricsFeatureProviderTest.java
index dd8d54a..a2e8c59 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/core/instrumentation/MetricsFeatureProviderTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/core/instrumentation/MetricsFeatureProviderTest.java
@@ -38,6 +38,7 @@
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.LooperMode;
import org.robolectric.util.ReflectionHelpers;
import java.util.ArrayList;
@@ -167,6 +168,7 @@
}
@Test
+ @LooperMode(LooperMode.Mode.PAUSED)
public void getAttribution_notSet_shouldReturnUnknown() {
final Activity activity = Robolectric.setupActivity(Activity.class);
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/core/instrumentation/SettingsJankMonitorTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/core/instrumentation/SettingsJankMonitorTest.java
index d67d44b..25833b3 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/core/instrumentation/SettingsJankMonitorTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/core/instrumentation/SettingsJankMonitorTest.java
@@ -36,6 +36,7 @@
import com.android.internal.jank.InteractionJankMonitor;
import com.android.internal.jank.InteractionJankMonitor.CujType;
+import com.android.settingslib.testutils.OverpoweredReflectionHelper;
import com.android.settingslib.testutils.shadow.ShadowInteractionJankMonitor;
import org.junit.Before;
@@ -51,7 +52,6 @@
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.Resetter;
-import org.robolectric.util.ReflectionHelpers;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@@ -83,8 +83,10 @@
public void setUp() {
ShadowInteractionJankMonitor.reset();
when(ShadowInteractionJankMonitor.MOCK_INSTANCE.begin(any())).thenReturn(true);
- ReflectionHelpers.setStaticField(SettingsJankMonitor.class, "scheduledExecutorService",
- mScheduledExecutorService);
+ OverpoweredReflectionHelper
+ .setStaticField(SettingsJankMonitor.class,
+ "scheduledExecutorService",
+ mScheduledExecutorService);
}
@Test
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/core/lifecycle/HideNonSystemOverlayMixinTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/core/lifecycle/HideNonSystemOverlayMixinTest.java
index cf702b53..471dac0 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/core/lifecycle/HideNonSystemOverlayMixinTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/core/lifecycle/HideNonSystemOverlayMixinTest.java
@@ -37,8 +37,10 @@
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.android.controller.ActivityController;
+import org.robolectric.annotation.LooperMode;
@RunWith(RobolectricTestRunner.class)
+@LooperMode(LooperMode.Mode.PAUSED)
public class HideNonSystemOverlayMixinTest {
private ActivityController<TestActivity> mActivityController;
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/development/DevelopmentSettingsEnablerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/development/DevelopmentSettingsEnablerTest.java
index 3475ff7..b009abd 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/development/DevelopmentSettingsEnablerTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/development/DevelopmentSettingsEnablerTest.java
@@ -22,13 +22,14 @@
import android.os.UserManager;
import android.provider.Settings;
+import com.android.settingslib.testutils.shadow.ShadowUserManager;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.shadow.api.Shadow;
-import org.robolectric.shadows.ShadowUserManager;
@RunWith(RobolectricTestRunner.class)
public class DevelopmentSettingsEnablerTest {
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXmlTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXmlTest.java
index 8e33ca3..0cabab2 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXmlTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/license/LicenseHtmlGeneratorFromXmlTest.java
@@ -21,6 +21,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
+import org.robolectric.annotation.LooperMode;
import org.xmlpull.v1.XmlPullParserException;
import java.io.ByteArrayInputStream;
@@ -269,6 +270,7 @@
}
@Test
+ @LooperMode(LooperMode.Mode.PAUSED)
public void testGenerateHtmlWithCustomHeading() throws Exception {
List<File> xmlFiles = new ArrayList<>();
Map<String, Map<String, Set<String>>> fileNameToLibraryToContentIdMap = new HashMap<>();
@@ -292,6 +294,7 @@
}
@Test
+ @LooperMode(LooperMode.Mode.PAUSED)
public void testGenerateNewHtmlWithCustomHeading() throws Exception {
List<File> xmlFiles = new ArrayList<>();
Map<String, Map<String, Set<String>>> fileNameToLibraryToContentIdMap = new HashMap<>();
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/package-info.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/package-info.java
new file mode 100644
index 0000000..9e9725f
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+@LooperMode(LooperMode.Mode.LEGACY)
+package com.android.settingslib;
+
+import org.robolectric.annotation.LooperMode;
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/AnimatedImageViewTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/AnimatedImageViewTest.java
index d41d511..faec02f7 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/AnimatedImageViewTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/AnimatedImageViewTest.java
@@ -27,6 +27,7 @@
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
+import org.robolectric.annotation.LooperMode;
@RunWith(RobolectricTestRunner.class)
public class AnimatedImageViewTest {
@@ -40,6 +41,7 @@
}
@Test
+ @LooperMode(LooperMode.Mode.PAUSED)
public void testAnimation_ViewVisible_AnimationRunning() {
mAnimatedImageView.setVisibility(View.VISIBLE);
mAnimatedImageView.setAnimating(true);
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/BannerMessagePreferenceTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/BannerMessagePreferenceTest.java
index 0a48f19..0d88913 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/BannerMessagePreferenceTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/BannerMessagePreferenceTest.java
@@ -41,6 +41,8 @@
import androidx.preference.PreferenceViewHolder;
import androidx.preference.R;
+import com.android.settingslib.testutils.OverpoweredReflectionHelper;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -502,14 +504,18 @@
private void assumeAndroidR() {
ReflectionHelpers.setStaticField(Build.VERSION.class, "SDK_INT", 30);
ReflectionHelpers.setStaticField(Build.VERSION.class, "CODENAME", "R");
- ReflectionHelpers.setStaticField(BannerMessagePreference.class, "IS_AT_LEAST_S", false);
+ OverpoweredReflectionHelper
+ .setStaticField(BannerMessagePreference.class, "IS_AT_LEAST_S", false);
// Reset view holder to use correct layout.
}
+
+
private void assumeAndroidS() {
ReflectionHelpers.setStaticField(Build.VERSION.class, "SDK_INT", 31);
ReflectionHelpers.setStaticField(Build.VERSION.class, "CODENAME", "S");
- ReflectionHelpers.setStaticField(BannerMessagePreference.class, "IS_AT_LEAST_S", true);
+ OverpoweredReflectionHelper
+ .setStaticField(BannerMessagePreference.class, "IS_AT_LEAST_S", true);
// Re-inflate view to update layout.
setUpViewHolder();
}
diff --git a/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/OverpoweredReflectionHelper.java b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/OverpoweredReflectionHelper.java
new file mode 100644
index 0000000..4fcc5a1
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/OverpoweredReflectionHelper.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.testutils;
+
+import org.robolectric.util.ReflectionHelpers;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+public class OverpoweredReflectionHelper extends ReflectionHelpers {
+
+ /**
+ * Robolectric upstream does not rely on or encourage this behaviour.
+ *
+ * @param field
+ */
+ private static void makeFieldVeryAccessible(Field field) {
+ field.setAccessible(true);
+ // remove 'final' modifier if present
+ if ((field.getModifiers() & Modifier.FINAL) == Modifier.FINAL) {
+ Field modifiersField = getModifiersField();
+ modifiersField.setAccessible(true);
+ try {
+ modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
+ } catch (IllegalAccessException e) {
+
+ throw new AssertionError(e);
+ }
+ }
+ }
+
+ private static Field getModifiersField() {
+ try {
+ return Field.class.getDeclaredField("modifiers");
+ } catch (NoSuchFieldException e) {
+ try {
+ Method getFieldsMethod =
+ Class.class.getDeclaredMethod("getDeclaredFields0", boolean.class);
+ getFieldsMethod.setAccessible(true);
+ Field[] fields = (Field[]) getFieldsMethod.invoke(Field.class, false);
+ for (Field modifiersField : fields) {
+ if ("modifiers".equals(modifiersField.getName())) {
+ return modifiersField;
+ }
+ }
+ } catch (ReflectiveOperationException innerE) {
+ throw new AssertionError(innerE);
+ }
+ }
+ throw new AssertionError();
+ }
+
+ /**
+ * Reflectively set the value of a static field.
+ *
+ * @param field Field object.
+ * @param fieldNewValue The new value.
+ */
+ public static void setStaticField(Field field, Object fieldNewValue) {
+ try {
+ makeFieldVeryAccessible(field);
+ field.setAccessible(true);
+ field.set(null, fieldNewValue);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Reflectively set the value of a static field.
+ *
+ * @param clazz Target class.
+ * @param fieldName The field name.
+ * @param fieldNewValue The new value.
+ */
+ public static void setStaticField(Class<?> clazz, String fieldName, Object fieldNewValue) {
+ try {
+ setStaticField(clazz.getDeclaredField(fieldName), fieldNewValue);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+}
diff --git a/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowActivityManager.java b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowActivityManager.java
index 924eb04..0b9ba8d 100644
--- a/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowActivityManager.java
+++ b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowActivityManager.java
@@ -16,23 +16,27 @@
package com.android.settingslib.testutils.shadow;
+import static android.os.Build.VERSION_CODES.O;
+
import android.app.ActivityManager;
+import android.app.IActivityManager;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.Resetter;
import org.robolectric.shadow.api.Shadow;
+import org.robolectric.util.ReflectionHelpers;
@Implements(ActivityManager.class)
public class ShadowActivityManager {
private static int sCurrentUserId = 0;
- private int mUserSwitchedTo = -1;
+ private static int sUserSwitchedTo = -1;
@Resetter
- public void reset() {
+ public static void reset() {
sCurrentUserId = 0;
- mUserSwitchedTo = 0;
+ sUserSwitchedTo = 0;
}
@Implementation
@@ -42,16 +46,21 @@
@Implementation
protected boolean switchUser(int userId) {
- mUserSwitchedTo = userId;
+ sUserSwitchedTo = userId;
return true;
}
+ @Implementation(minSdk = O)
+ protected static IActivityManager getService() {
+ return ReflectionHelpers.createNullProxy(IActivityManager.class);
+ }
+
public boolean getSwitchUserCalled() {
- return mUserSwitchedTo != -1;
+ return sUserSwitchedTo != -1;
}
public int getUserSwitchedTo() {
- return mUserSwitchedTo;
+ return sUserSwitchedTo;
}
public static void setCurrentUser(int userId) {
diff --git a/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowDefaultDialerManager.java b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowDefaultDialerManager.java
index 2c0792f..bbfdb7f 100644
--- a/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowDefaultDialerManager.java
+++ b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowDefaultDialerManager.java
@@ -29,7 +29,7 @@
private static String sDefaultDialer;
@Resetter
- public void reset() {
+ public static void reset() {
sDefaultDialer = null;
}
diff --git a/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowPermissionChecker.java b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowPermissionChecker.java
new file mode 100644
index 0000000..fae3aea
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowPermissionChecker.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.testutils.shadow;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.content.AttributionSource;
+import android.content.Context;
+import android.content.PermissionChecker;
+
+import org.robolectric.annotation.Implementation;
+import org.robolectric.annotation.Implements;
+
+import java.util.HashMap;
+import java.util.Map;
+/** Shadow class of {@link PermissionChecker}. */
+@Implements(PermissionChecker.class)
+public class ShadowPermissionChecker {
+ private static final Map<String, Map<String, Integer>> RESULTS = new HashMap<>();
+ /** Set the result of permission check for a specific permission. */
+ public static void setResult(String packageName, String permission, int result) {
+ if (!RESULTS.containsKey(packageName)) {
+ RESULTS.put(packageName, new HashMap<>());
+ }
+ RESULTS.get(packageName).put(permission, result);
+ }
+ /** Check the permission of calling package. */
+ @Implementation
+ public static int checkCallingPermissionForDataDelivery(
+ Context context,
+ String permission,
+ String packageName,
+ String attributionTag,
+ String message) {
+ return RESULTS.containsKey(packageName) && RESULTS.get(packageName).containsKey(permission)
+ ? RESULTS.get(packageName).get(permission)
+ : PermissionChecker.checkCallingPermissionForDataDelivery(
+ context, permission, packageName, attributionTag, message);
+ }
+ /** Check general permission. */
+ @Implementation
+ public static int checkPermissionForDataDelivery(
+ Context context,
+ String permission,
+ int pid,
+ int uid,
+ String packageName,
+ String attributionTag,
+ String message) {
+ return RESULTS.containsKey(packageName) && RESULTS.get(packageName).containsKey(permission)
+ ? RESULTS.get(packageName).get(permission)
+ : PermissionChecker.checkPermissionForDataDelivery(
+ context, permission, pid, uid, packageName, attributionTag, message);
+ }
+ /** Check general permission. */
+ @Implementation
+ public static int checkPermissionForPreflight(@NonNull Context context,
+ @NonNull String permission, int pid, int uid, @Nullable String packageName) {
+ return checkPermissionForPreflight(context, permission, new AttributionSource(
+ uid, packageName, null /*attributionTag*/));
+ }
+ /** Check general permission. */
+ @Implementation
+ public static int checkPermissionForPreflight(@NonNull Context context,
+ @NonNull String permission, @NonNull AttributionSource attributionSource) {
+ final String packageName = attributionSource.getPackageName();
+ return RESULTS.containsKey(packageName) && RESULTS.get(packageName).containsKey(permission)
+ ? RESULTS.get(packageName).get(permission)
+ : PermissionChecker.checkPermissionForPreflight(
+ context, permission, attributionSource);
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowSecure.java b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowSecure.java
new file mode 100644
index 0000000..70ebc67
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowSecure.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.testutils.shadow;
+
+import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1;
+
+import android.content.ContentResolver;
+import android.provider.Settings;
+
+import org.robolectric.annotation.Implementation;
+import org.robolectric.annotation.Implements;
+import org.robolectric.shadows.ShadowSettings;
+
+@Implements(value = Settings.Secure.class)
+public class ShadowSecure extends ShadowSettings.ShadowSecure {
+ @Implementation(minSdk = JELLY_BEAN_MR1)
+ public static boolean putStringForUser(ContentResolver cr, String name, String value,
+ int userHandle) {
+ return putString(cr, name, value);
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowSmsApplication.java b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowSmsApplication.java
index 381d072..5ac0a87 100644
--- a/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowSmsApplication.java
+++ b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowSmsApplication.java
@@ -31,7 +31,7 @@
private static ComponentName sDefaultSmsApplication;
@Resetter
- public void reset() {
+ public static void reset() {
sDefaultSmsApplication = null;
}
diff --git a/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowUserManager.java b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowUserManager.java
index ca1eefc..60d7721 100644
--- a/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowUserManager.java
+++ b/packages/SettingsLib/tests/robotests/testutils/com/android/settingslib/testutils/shadow/ShadowUserManager.java
@@ -16,20 +16,28 @@
package com.android.settingslib.testutils.shadow;
+import static android.os.Build.VERSION_CODES.N_MR1;
+
import android.annotation.UserIdInt;
import android.content.Context;
import android.content.pm.UserInfo;
+import android.content.pm.UserProperties;
+import android.os.UserHandle;
import android.os.UserManager;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
+import org.robolectric.shadows.ShadowBuild;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
@Implements(value = UserManager.class)
public class ShadowUserManager extends org.robolectric.shadows.ShadowUserManager {
private List<UserInfo> mUserInfos = addProfile(0, "Owner");
+ private final Map<Integer, UserProperties> mUserPropertiesMap = new HashMap<>();
@Implementation
protected static UserManager get(Context context) {
@@ -62,4 +70,37 @@
protected List<UserInfo> getProfiles(@UserIdInt int userHandle) {
return getProfiles();
}
+
+ /**
+ * @return {@code false} by default, or the value specified via {@link #setIsAdminUser(boolean)}
+ */
+ @Implementation(minSdk = N_MR1)
+ public boolean isAdminUser() {
+ return getUserInfo(UserHandle.myUserId()).isAdmin();
+ }
+
+ /**
+ * Sets that the current user is an admin user; controls the return value of
+ * {@link UserManager#isAdminUser}.
+ */
+ public void setIsAdminUser(boolean isAdminUser) {
+ UserInfo userInfo = getUserInfo(UserHandle.myUserId());
+ if (isAdminUser) {
+ userInfo.flags |= UserInfo.FLAG_ADMIN;
+ } else {
+ userInfo.flags &= ~UserInfo.FLAG_ADMIN;
+ }
+ }
+
+ public void setupUserProperty(int userId, int showInSettings) {
+ UserProperties userProperties = new UserProperties(new UserProperties.Builder()
+ .setShowInSettings(showInSettings).build());
+ mUserPropertiesMap.putIfAbsent(userId, userProperties);
+ }
+
+ @Implementation(minSdk = ShadowBuild.UPSIDE_DOWN_CAKE)
+ protected UserProperties getUserProperties(UserHandle user) {
+ return mUserPropertiesMap.getOrDefault(user.getIdentifier(),
+ new UserProperties(new UserProperties.Builder().build()));
+ }
}
diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/GlobalSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/GlobalSettings.java
index d1f7f2f..fa2d677 100644
--- a/packages/SettingsProvider/src/android/provider/settings/backup/GlobalSettings.java
+++ b/packages/SettingsProvider/src/android/provider/settings/backup/GlobalSettings.java
@@ -24,7 +24,7 @@
/**
* These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in SystemSettings
* and SecureSettings as well. This is because those tables drive both backup and
- * restore, and restore needs to properly whitelist keys that used to live
+ * restore, and restore needs to properly allowlist keys that used to live
* in those namespaces.
*
* NOTE: Settings are backed up and restored in the order they appear
diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
index 423c8a3..2d62e2a 100644
--- a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
+++ b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
@@ -242,6 +242,7 @@
Settings.Secure.HEARING_AID_CALL_ROUTING,
Settings.Secure.HEARING_AID_MEDIA_ROUTING,
Settings.Secure.HEARING_AID_SYSTEM_SOUNDS_ROUTING,
- Settings.Secure.ACCESSIBILITY_FONT_SCALING_HAS_BEEN_CHANGED
+ Settings.Secure.ACCESSIBILITY_FONT_SCALING_HAS_BEEN_CHANGED,
+ Settings.Secure.SEARCH_PRESS_HOLD_NAV_HANDLE_ENABLED
};
}
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java
index 58106c0..bb67bbc3 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java
@@ -441,7 +441,7 @@
String.valueOf(Global.Wearable.TETHERED_CONFIG_TETHERED)
}));
VALIDATORS.put(Global.Wearable.PHONE_SWITCHING_SUPPORTED, BOOLEAN_VALIDATOR);
- VALIDATORS.put(Global.Wearable.WEAR_LAUNCHER_UI_MODE, NON_NEGATIVE_INTEGER_VALIDATOR);
+ VALIDATORS.put(Global.Wearable.WEAR_LAUNCHER_UI_MODE, ANY_INTEGER_VALIDATOR);
VALIDATORS.put(Global.Wearable.WEAR_POWER_ANOMALY_SERVICE_ENABLED, BOOLEAN_VALIDATOR);
}
}
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
index 6c9da97..4494765 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
@@ -200,6 +200,7 @@
VALIDATORS.put(Secure.ASSIST_GESTURE_WAKE_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(Secure.ASSIST_TOUCH_GESTURE_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(Secure.ASSIST_LONG_PRESS_HOME_ENABLED, BOOLEAN_VALIDATOR);
+ VALIDATORS.put(Secure.SEARCH_PRESS_HOLD_NAV_HANDLE_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(Secure.VR_DISPLAY_MODE, new DiscreteValueValidator(new String[] {"0", "1"}));
VALIDATORS.put(Secure.NOTIFICATION_BADGING, BOOLEAN_VALIDATOR);
VALIDATORS.put(Secure.NOTIFICATION_DISMISS_RTL, BOOLEAN_VALIDATOR);
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java
index 0dd8569..80cf6c3 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java
@@ -184,6 +184,7 @@
VALIDATORS.put(System.POINTER_LOCATION, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.SHOW_TOUCHES, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.SHOW_KEY_PRESSES, BOOLEAN_VALIDATOR);
+ VALIDATORS.put(System.SHOW_ROTARY_INPUT, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.WINDOW_ORIENTATION_LISTENER_LOG, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.LOCKSCREEN_SOUNDS_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(System.LOCKSCREEN_DISABLED, BOOLEAN_VALIDATOR);
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
index c830d6b..7b49608 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
@@ -927,7 +927,7 @@
@VisibleForTesting
SettingsBackupWhitelist getBackupWhitelist(Uri contentUri) {
// Figure out the white list and redirects to the global table. We restore anything
- // in either the backup whitelist or the legacy-restore whitelist for this table.
+ // in either the backup allowlist or the legacy-restore allowlist for this table.
String[] whitelist;
Map<String, Validator> validators = null;
if (contentUri.equals(Settings.Secure.CONTENT_URI)) {
@@ -1474,7 +1474,7 @@
}
/**
- * Store the whitelist of settings to be backed up and validators for them.
+ * Store the allowlist of settings to be backed up and validators for them.
*/
@VisibleForTesting
static class SettingsBackupWhitelist {
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
index 1192e00..d2b444b 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java
@@ -1926,6 +1926,9 @@
dumpSetting(s, p,
Settings.Secure.ASSIST_LONG_PRESS_HOME_ENABLED,
SecureSettingsProto.Assist.LONG_PRESS_HOME_ENABLED);
+ dumpSetting(s, p,
+ Settings.Secure.SEARCH_PRESS_HOLD_NAV_HANDLE_ENABLED,
+ SecureSettingsProto.Assist.SEARCH_PRESS_HOLD_NAV_HANDLE_ENABLED);
p.end(assistToken);
final long assistHandlesToken = p.start(SecureSettingsProto.ASSIST_HANDLES);
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 7e97956..5f4f317 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -251,7 +251,7 @@
public static final int WRITE_FALLBACK_SETTINGS_FILES_JOB_ID = 1;
public static final long ONE_DAY_INTERVAL_MILLIS = 24 * 60 * 60 * 1000L;
- // Overlay specified settings whitelisted for Instant Apps
+ // Overlay specified settings allowlisted for Instant Apps
private static final Set<String> OVERLAY_ALLOWED_GLOBAL_INSTANT_APP_SETTINGS = new ArraySet<>();
private static final Set<String> OVERLAY_ALLOWED_SYSTEM_INSTANT_APP_SETTINGS = new ArraySet<>();
private static final Set<String> OVERLAY_ALLOWED_SECURE_INSTANT_APP_SETTINGS = new ArraySet<>();
@@ -1157,8 +1157,6 @@
Slog.v(LOG_TAG, "getConfigSetting(" + name + ")");
}
- Settings.Config.enforceReadPermission(/*namespace=*/name.split("/")[0]);
-
// Get the value.
synchronized (mLock) {
return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_CONFIG,
@@ -1338,9 +1336,6 @@
Slog.v(LOG_TAG, "getAllConfigFlags() for " + prefix);
}
- Settings.Config.enforceReadPermission(
- prefix != null ? prefix.split("/")[0] : null);
-
synchronized (mLock) {
// Get the settings.
SettingsState settingsState = mSettingsRegistry.getSettingsLocked(
@@ -2155,7 +2150,7 @@
@GuardedBy("mLock")
private List<String> getSettingsNamesLocked(int settingsType, int userId) {
- // Don't enforce the instant app whitelist for now -- its too prone to unintended breakage
+ // Don't enforce the instant app allowlist for now -- its too prone to unintended breakage
// in the current form.
return mSettingsRegistry.getSettingsNamesLocked(settingsType, userId);
}
@@ -2196,7 +2191,7 @@
}
if (!getInstantAppAccessibleSettings(settingsType).contains(settingName)
&& !getOverlayInstantAppAccessibleSettings(settingsType).contains(settingName)) {
- // Don't enforce the instant app whitelist for now -- its too prone to unintended
+ // Don't enforce the instant app allowlist for now -- its too prone to unintended
// breakage in the current form.
Slog.w(LOG_TAG, "Instant App " + ai.packageName
+ " trying to access unexposed setting, this will be an error in the future.");
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
index 73ead3c..0a98032 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
@@ -845,6 +845,7 @@
private void doWriteState() {
boolean wroteState = false;
+ String settingFailedToBePersisted = null;
final int version;
final ArrayMap<String, Setting> settings;
final ArrayMap<String, String> namespaceBannedHashes;
@@ -895,8 +896,14 @@
}
}
} catch (IOException ex) {
- Slog.e(LOG_TAG, "[SKIPPED PERSISTING]" + setting.getName()
+ Slog.e(LOG_TAG, "[ABORT PERSISTING]" + setting.getName()
+ " due to error writing to disk", ex);
+ // A setting failed to be written. Abort the serialization to avoid leaving
+ // a partially serialized setting on disk, which can cause parsing errors.
+ // Note down the problematic setting, so that we can delete it before trying
+ // again to persist the rest of the settings.
+ settingFailedToBePersisted = setting.getName();
+ throw ex;
}
}
serializer.endTag(null, TAG_SETTINGS);
@@ -922,14 +929,14 @@
Slog.i(LOG_TAG, "[PERSIST END]");
}
} catch (Throwable t) {
- Slog.wtf(LOG_TAG, "Failed to write settings, restoring backup", t);
+ Slog.wtf(LOG_TAG, "Failed to write settings, restoring old file", t);
if (t instanceof IOException) {
- if (DEBUG) {
- // we failed to create a directory, so log the permissions and existence
- // state for the settings file and directory
- logSettingsDirectoryInformation(destination.getBaseFile());
- }
if (t.getMessage().contains("Couldn't create directory")) {
+ if (DEBUG) {
+ // we failed to create a directory, so log the permissions and existence
+ // state for the settings file and directory
+ logSettingsDirectoryInformation(destination.getBaseFile());
+ }
// attempt to create the directory with Files.createDirectories, which
// throws more informative errors than File.mkdirs.
Path parentPath = destination.getBaseFile().getParentFile().toPath();
@@ -950,7 +957,15 @@
}
}
- if (wroteState) {
+ if (!wroteState) {
+ if (settingFailedToBePersisted != null) {
+ synchronized (mLock) {
+ // Delete the problematic setting. This will schedule a write as well.
+ deleteSettingLocked(settingFailedToBePersisted);
+ }
+ }
+ } else {
+ // success
synchronized (mLock) {
addHistoricalOperationLocked(HISTORICAL_OPERATION_PERSIST, null);
}
@@ -1110,7 +1125,10 @@
} catch (FileNotFoundException fnfe) {
final String message = "No fallback file found for: " + mStatePersistFile;
Slog.wtf(LOG_TAG, message);
- throw new IllegalStateException(message);
+ if (!isConfigSettingsKey(mKey)) {
+ // Allow partially deserialized config settings because they can be updated later
+ throw new IllegalStateException(message);
+ }
}
if (parseStateFromXmlStreamLocked(in)) {
// Parsed state from fallback file. Restore original file with fallback file
@@ -1122,7 +1140,10 @@
} else {
final String message = "Failed parsing settings file: " + mStatePersistFile;
Slog.wtf(LOG_TAG, message);
- throw new IllegalStateException(message);
+ if (!isConfigSettingsKey(mKey)) {
+ // Allow partially deserialized config settings because they can be updated later
+ throw new IllegalStateException(message);
+ }
}
}
diff --git a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
index aed6e03..c697c1f 100644
--- a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
+++ b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
@@ -79,6 +79,7 @@
Settings.System.SHOW_GTALK_SERVICE_STATUS, // candidate for backup?
Settings.System.SHOW_TOUCHES,
Settings.System.SHOW_KEY_PRESSES,
+ Settings.System.SHOW_ROTARY_INPUT,
Settings.System.SIP_ADDRESS_ONLY, // value, not a setting
Settings.System.SIP_ALWAYS, // value, not a setting
Settings.System.SYSTEM_LOCALES, // bug?
@@ -723,7 +724,8 @@
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_ENABLED,
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_LAST_RUN,
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_TURNED_OFF_BY_POLICY,
- Settings.Secure.AUDIO_DEVICE_INVENTORY, // setting not controllable by user
+ Settings.Secure.AUDIO_DEVICE_INVENTORY, // not controllable by user
+ Settings.Secure.AUDIO_SAFE_CSD_AS_A_FEATURE_ENABLED, // not controllable by user
Settings.Secure.BACKUP_AUTO_RESTORE,
Settings.Secure.BACKUP_ENABLED,
Settings.Secure.BACKUP_PROVISIONED,
diff --git a/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsHelperTest.java b/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsHelperTest.java
index ef062df..4b10b56 100644
--- a/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsHelperTest.java
+++ b/packages/SettingsProvider/test/src/com/android/providers/settings/SettingsHelperTest.java
@@ -23,14 +23,16 @@
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import android.content.ContentProvider;
-import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.pm.ApplicationInfo;
+import android.content.res.AssetFileDescriptor;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.MatrixCursor;
@@ -44,8 +46,8 @@
import android.telephony.TelephonyManager;
import android.test.mock.MockContentProvider;
import android.test.mock.MockContentResolver;
+import android.util.ArrayMap;
-import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
import com.android.internal.R;
@@ -77,13 +79,14 @@
@Mock private Context mContext;
@Mock private Resources mResources;
- @Mock private ContentResolver mContentResolver;
@Mock private AudioManager mAudioManager;
@Mock private TelephonyManager mTelephonyManager;
+ @Mock private MockContentResolver mContentResolver;
+ private MockSettingsProvider mSettingsProvider;
+
@Before
public void setUp() {
- clearLongPressPowerValues();
MockitoAnnotations.initMocks(this);
when(mContext.getSystemService(eq(Context.AUDIO_SERVICE))).thenReturn(mAudioManager);
when(mContext.getSystemService(eq(Context.TELEPHONY_SERVICE))).thenReturn(
@@ -91,14 +94,20 @@
when(mContext.getResources()).thenReturn(mResources);
when(mContext.getApplicationContext()).thenReturn(mContext);
when(mContext.getApplicationInfo()).thenReturn(new ApplicationInfo());
- when(mContext.getContentResolver()).thenReturn(getContentResolver());
mSettingsHelper = spy(new SettingsHelper(mContext));
+ mContentResolver = spy(new MockContentResolver());
+ when(mContext.getContentResolver()).thenReturn(mContentResolver);
+ mSettingsProvider = new MockSettingsProvider(mContext);
+ mContentResolver.addProvider(Settings.AUTHORITY, mSettingsProvider);
}
@After
public void tearDown() {
- clearLongPressPowerValues();
+ Settings.Global.putString(mContentResolver, Settings.Global.POWER_BUTTON_LONG_PRESS,
+ null);
+ Settings.Global.putString(mContentResolver, Settings.Global.KEY_CHORD_POWER_VOLUME_UP,
+ null);
}
@Test
@@ -123,33 +132,30 @@
mSettingsHelper.restoreValue(mContext, mContentResolver, new ContentValues(), Uri.EMPTY,
SETTING_KEY, SETTING_VALUE, /* restoredFromSdkInt */ 0);
- verifyZeroInteractions(mContentResolver);
+ // The only time of interaction happened during setUp()
+ verify(mContentResolver, times(1))
+ .addProvider(Settings.AUTHORITY, mSettingsProvider);
+
+ verifyNoMoreInteractions(mContentResolver);
}
@Test
public void testRestoreValue_lppForAssistantEnabled_updatesValue() {
- ContentResolver cr =
- InstrumentationRegistry.getInstrumentation().getTargetContext()
- .getContentResolver();
when(mResources.getBoolean(
R.bool.config_longPressOnPowerForAssistantSettingAvailable)).thenReturn(
true);
- mSettingsHelper.restoreValue(mContext, cr, new ContentValues(), Uri.EMPTY,
+ mSettingsHelper.restoreValue(mContext, mContentResolver, new ContentValues(), Uri.EMPTY,
Settings.Global.POWER_BUTTON_LONG_PRESS, "5", 0);
- assertThat(
- Settings.Global.getInt(cr, Settings.Global.POWER_BUTTON_LONG_PRESS, -1))
- .isEqualTo(5);
- assertThat(Settings.Global.getInt(cr, Settings.Global.KEY_CHORD_POWER_VOLUME_UP,
- -1)).isEqualTo(2);
+ assertThat(Settings.Global.getInt(
+ mContentResolver, Settings.Global.POWER_BUTTON_LONG_PRESS, -1)).isEqualTo(5);
+ assertThat(Settings.Global.getInt(
+ mContentResolver, Settings.Global.KEY_CHORD_POWER_VOLUME_UP, -1)).isEqualTo(2);
}
@Test
public void testRestoreValue_lppForAssistantNotEnabled_updatesValueToDefaultConfig() {
- ContentResolver cr =
- InstrumentationRegistry.getInstrumentation().getTargetContext()
- .getContentResolver();
when(mResources.getBoolean(
R.bool.config_longPressOnPowerForAssistantSettingAvailable)).thenReturn(
true);
@@ -161,21 +167,17 @@
R.integer.config_keyChordPowerVolumeUp)).thenReturn(
1);
- mSettingsHelper.restoreValue(mContext, cr, new ContentValues(), Uri.EMPTY,
+ mSettingsHelper.restoreValue(mContext, mContentResolver, new ContentValues(), Uri.EMPTY,
Settings.Global.POWER_BUTTON_LONG_PRESS, "2", 0);
- assertThat(
- Settings.Global.getInt(cr, Settings.Global.POWER_BUTTON_LONG_PRESS, -1))
- .isEqualTo(1);
- assertThat(Settings.Global.getInt(cr, Settings.Global.KEY_CHORD_POWER_VOLUME_UP,
- -1)).isEqualTo(1);
+ assertThat(Settings.Global.getInt(
+ mContentResolver, Settings.Global.POWER_BUTTON_LONG_PRESS, -1)).isEqualTo(1);
+ assertThat(Settings.Global.getInt(
+ mContentResolver, Settings.Global.KEY_CHORD_POWER_VOLUME_UP, -1)).isEqualTo(1);
}
@Test
public void testRestoreValue_lppForAssistantNotEnabledDefaultConfig_updatesValue() {
- ContentResolver cr =
- InstrumentationRegistry.getInstrumentation().getTargetContext()
- .getContentResolver();
when(mResources.getBoolean(
R.bool.config_longPressOnPowerForAssistantSettingAvailable)).thenReturn(
true);
@@ -187,47 +189,39 @@
R.integer.config_keyChordPowerVolumeUp)).thenReturn(
1);
- mSettingsHelper.restoreValue(mContext, cr, new ContentValues(), Uri.EMPTY,
+ mSettingsHelper.restoreValue(mContext, mContentResolver, new ContentValues(), Uri.EMPTY,
Settings.Global.POWER_BUTTON_LONG_PRESS, "2", 0);
- assertThat(
- Settings.Global.getInt(cr, Settings.Global.POWER_BUTTON_LONG_PRESS, -1))
- .isEqualTo(1);
- assertThat(Settings.Global.getInt(cr, Settings.Global.KEY_CHORD_POWER_VOLUME_UP,
- -1)).isEqualTo(1);
+ assertThat(Settings.Global.getInt(
+ mContentResolver, Settings.Global.POWER_BUTTON_LONG_PRESS, -1)).isEqualTo(1);
+ assertThat(Settings.Global.getInt(
+ mContentResolver, Settings.Global.KEY_CHORD_POWER_VOLUME_UP, -1)).isEqualTo(1);
}
@Test
public void testRestoreValue_lppForAssistantNotAvailable_doesNotRestore() {
- ContentResolver cr =
- InstrumentationRegistry.getInstrumentation().getTargetContext()
- .getContentResolver();
- when(mResources.getBoolean(
- R.bool.config_longPressOnPowerForAssistantSettingAvailable)).thenReturn(
- false);
+ when(mResources.getBoolean(R.bool.config_longPressOnPowerForAssistantSettingAvailable))
+ .thenReturn(false);
- mSettingsHelper.restoreValue(mContext, cr, new ContentValues(), Uri.EMPTY,
- Settings.Global.POWER_BUTTON_LONG_PRESS, "5", 0);
+ mSettingsHelper.restoreValue(mContext, mContentResolver, new ContentValues(), Uri.EMPTY,
+ Settings.Global.POWER_BUTTON_LONG_PRESS, "500", 0);
- assertThat((Settings.Global.getInt(cr, Settings.Global.POWER_BUTTON_LONG_PRESS,
- -1))).isEqualTo(-1);
+ assertThat((Settings.Global.getInt(
+ mContentResolver, Settings.Global.POWER_BUTTON_LONG_PRESS, -1))).isEqualTo(-1);
}
@Test
public void testRestoreValue_lppForAssistantInvalid_doesNotRestore() {
- ContentResolver cr =
- InstrumentationRegistry.getInstrumentation().getTargetContext()
- .getContentResolver();
when(mResources.getBoolean(
R.bool.config_longPressOnPowerForAssistantSettingAvailable)).thenReturn(
false);
- mSettingsHelper.restoreValue(mContext, cr, new ContentValues(), Uri.EMPTY,
+ mSettingsHelper.restoreValue(mContext, mContentResolver, new ContentValues(), Uri.EMPTY,
Settings.Global.POWER_BUTTON_LONG_PRESS, "trees", 0);
- assertThat((Settings.Global.getInt(cr, Settings.Global.POWER_BUTTON_LONG_PRESS,
- -1))).isEqualTo(-1);
+ assertThat((Settings.Global.getInt(
+ mContentResolver, Settings.Global.POWER_BUTTON_LONG_PRESS, -1))).isEqualTo(-1);
}
@Test
@@ -363,9 +357,6 @@
final String newRingtoneValueCanonicalized =
"content://media/internal/audio/media/100?title=Song&canonical=1";
- MockContentResolver mMockContentResolver = new MockContentResolver();
- when(mContext.getContentResolver()).thenReturn(mMockContentResolver);
-
ContentProvider mockMediaContentProvider =
new MockContentProvider(mContext) {
@Override
@@ -386,25 +377,22 @@
}
};
- ContentProvider mockSettingsContentProvider =
- new MockSettingsProvider(mContext, getContentResolver());
- mMockContentResolver.addProvider(MediaStore.AUTHORITY, mockMediaContentProvider);
- mMockContentResolver.addProvider(Settings.AUTHORITY, mockSettingsContentProvider);
+ mContentResolver.addProvider(MediaStore.AUTHORITY, mockMediaContentProvider);
- resetRingtoneSettingsToDefault(mMockContentResolver);
- assertThat(Settings.System.getString(mMockContentResolver, Settings.System.RINGTONE))
+ resetRingtoneSettingsToDefault();
+ assertThat(Settings.System.getString(mContentResolver, Settings.System.RINGTONE))
.isEqualTo(DEFAULT_RINGTONE_VALUE);
mSettingsHelper.restoreValue(
mContext,
- mMockContentResolver,
+ mContentResolver,
new ContentValues(),
Uri.EMPTY,
Settings.System.RINGTONE,
sourceRingtoneValue,
0);
- assertThat(Settings.System.getString(mMockContentResolver, Settings.System.RINGTONE))
+ assertThat(Settings.System.getString(mContentResolver, Settings.System.RINGTONE))
.isEqualTo(newRingtoneValueCanonicalized);
}
@@ -417,9 +405,6 @@
final String newRingtoneValueCanonicalized =
"content://0@media/external/audio/media/100?title=Song&canonical=1";
- MockContentResolver mMockContentResolver = new MockContentResolver();
- when(mContext.getContentResolver()).thenReturn(mMockContentResolver);
-
MatrixCursor cursor = new MatrixCursor(new String[] {BaseColumns._ID});
cursor.addRow(new Object[] {100L});
@@ -458,24 +443,21 @@
}
};
- ContentProvider mockSettingsContentProvider =
- new MockSettingsProvider(mContext, getContentResolver());
- mMockContentResolver.addProvider(MediaStore.AUTHORITY, mockMediaContentProvider);
- mMockContentResolver.addProvider("0@" + MediaStore.AUTHORITY, mockMediaContentProvider);
- mMockContentResolver.addProvider(Settings.AUTHORITY, mockSettingsContentProvider);
+ mContentResolver.addProvider(MediaStore.AUTHORITY, mockMediaContentProvider);
+ mContentResolver.addProvider("0@" + MediaStore.AUTHORITY, mockMediaContentProvider);
- resetRingtoneSettingsToDefault(mMockContentResolver);
+ resetRingtoneSettingsToDefault();
mSettingsHelper.restoreValue(
mContext,
- mMockContentResolver,
+ mContentResolver,
new ContentValues(),
Uri.EMPTY,
Settings.System.RINGTONE,
sourceRingtoneValue,
0);
- assertThat(Settings.System.getString(mMockContentResolver, Settings.System.RINGTONE))
+ assertThat(Settings.System.getString(mContentResolver, Settings.System.RINGTONE))
.isEqualTo(newRingtoneValueCanonicalized);
}
@@ -488,9 +470,6 @@
final String newRingtoneValueCanonicalized =
"content://0@media/external/audio/media/200?title=notificationPing&canonicalize=1";
- MockContentResolver mMockContentResolver = new MockContentResolver();
- when(mContext.getContentResolver()).thenReturn(mMockContentResolver);
-
MatrixCursor cursor = new MatrixCursor(new String[] {BaseColumns._ID});
cursor.addRow(new Object[] {200L});
@@ -529,17 +508,14 @@
}
};
- ContentProvider mockSettingsContentProvider =
- new MockSettingsProvider(mContext, getContentResolver());
- mMockContentResolver.addProvider(MediaStore.AUTHORITY, mockMediaContentProvider);
- mMockContentResolver.addProvider("0@" + MediaStore.AUTHORITY, mockMediaContentProvider);
- mMockContentResolver.addProvider(Settings.AUTHORITY, mockSettingsContentProvider);
+ mContentResolver.addProvider(MediaStore.AUTHORITY, mockMediaContentProvider);
+ mContentResolver.addProvider("0@" + MediaStore.AUTHORITY, mockMediaContentProvider);
- resetRingtoneSettingsToDefault(mMockContentResolver);
+ resetRingtoneSettingsToDefault();
mSettingsHelper.restoreValue(
mContext,
- mMockContentResolver,
+ mContentResolver,
new ContentValues(),
Uri.EMPTY,
Settings.System.NOTIFICATION_SOUND,
@@ -548,7 +524,7 @@
assertThat(
Settings.System.getString(
- mMockContentResolver, Settings.System.NOTIFICATION_SOUND))
+ mContentResolver, Settings.System.NOTIFICATION_SOUND))
.isEqualTo(newRingtoneValueCanonicalized);
}
@@ -561,9 +537,6 @@
final String newRingtoneValueCanonicalized =
"content://0@media/external/audio/media/300?title=alarmSound&canonical=1";
- MockContentResolver mMockContentResolver = new MockContentResolver();
- when(mContext.getContentResolver()).thenReturn(mMockContentResolver);
-
MatrixCursor cursor = new MatrixCursor(new String[] {BaseColumns._ID});
cursor.addRow(new Object[] {300L});
@@ -600,26 +573,29 @@
assertThat(selectionArgs).isEqualTo(new String[] {"alarmSound"});
return cursor;
}
+
+ @Override
+ public AssetFileDescriptor openTypedAssetFile(Uri url, String mimeType,
+ Bundle opts) {
+ return null;
+ }
};
- ContentProvider mockSettingsContentProvider =
- new MockSettingsProvider(mContext, getContentResolver());
- mMockContentResolver.addProvider(MediaStore.AUTHORITY, mockMediaContentProvider);
- mMockContentResolver.addProvider("0@" + MediaStore.AUTHORITY, mockMediaContentProvider);
- mMockContentResolver.addProvider(Settings.AUTHORITY, mockSettingsContentProvider);
+ mContentResolver.addProvider(MediaStore.AUTHORITY, mockMediaContentProvider);
+ mContentResolver.addProvider("0@" + MediaStore.AUTHORITY, mockMediaContentProvider);
- resetRingtoneSettingsToDefault(mMockContentResolver);
+ resetRingtoneSettingsToDefault();
mSettingsHelper.restoreValue(
mContext,
- mMockContentResolver,
+ mContentResolver,
new ContentValues(),
Uri.EMPTY,
Settings.System.ALARM_ALERT,
sourceRingtoneValue,
0);
- assertThat(Settings.System.getString(mMockContentResolver, Settings.System.ALARM_ALERT))
+ assertThat(Settings.System.getString(mContentResolver, Settings.System.ALARM_ALERT))
.isEqualTo(newRingtoneValueCanonicalized);
}
@@ -628,9 +604,6 @@
final String sourceRingtoneValue =
"content://0@media/external/audio/media/1?title=Song&canonical=1";
- MockContentResolver mMockContentResolver = new MockContentResolver();
- when(mContext.getContentResolver()).thenReturn(mMockContentResolver);
-
// This is to mock the case that there are multiple results by querying title +
// ringtone_type.
MatrixCursor cursor = new MatrixCursor(new String[] {BaseColumns._ID});
@@ -651,32 +624,26 @@
}
};
- ContentProvider mockSettingsContentProvider =
- new MockSettingsProvider(mContext, getContentResolver());
- mMockContentResolver.addProvider(MediaStore.AUTHORITY, mockMediaContentProvider);
- mMockContentResolver.addProvider("0@" + MediaStore.AUTHORITY, mockMediaContentProvider);
- mMockContentResolver.addProvider(Settings.AUTHORITY, mockSettingsContentProvider);
+ mContentResolver.addProvider(MediaStore.AUTHORITY, mockMediaContentProvider);
+ mContentResolver.addProvider("0@" + MediaStore.AUTHORITY, mockMediaContentProvider);
- resetRingtoneSettingsToDefault(mMockContentResolver);
+ resetRingtoneSettingsToDefault();
mSettingsHelper.restoreValue(
mContext,
- mMockContentResolver,
+ mContentResolver,
new ContentValues(),
Uri.EMPTY,
Settings.System.RINGTONE,
sourceRingtoneValue,
0);
- assertThat(Settings.System.getString(mMockContentResolver, Settings.System.RINGTONE))
+ assertThat(Settings.System.getString(mContentResolver, Settings.System.RINGTONE))
.isEqualTo(DEFAULT_RINGTONE_VALUE);
}
@Test
public void testRestoreValue_customRingtone_restoreSilentValue() {
- MockContentResolver mMockContentResolver = new MockContentResolver();
- when(mContext.getContentResolver()).thenReturn(mMockContentResolver);
-
ContentProvider mockMediaContentProvider =
new MockContentProvider(mContext) {
@Override
@@ -691,37 +658,46 @@
}
};
- ContentProvider mockSettingsContentProvider =
- new MockSettingsProvider(mContext, getContentResolver());
- mMockContentResolver.addProvider(MediaStore.AUTHORITY, mockMediaContentProvider);
- mMockContentResolver.addProvider(Settings.AUTHORITY, mockSettingsContentProvider);
+ mContentResolver.addProvider(MediaStore.AUTHORITY, mockMediaContentProvider);
- resetRingtoneSettingsToDefault(mMockContentResolver);
+ resetRingtoneSettingsToDefault();
mSettingsHelper.restoreValue(
mContext,
- mMockContentResolver,
+ mContentResolver,
new ContentValues(),
Uri.EMPTY,
Settings.System.RINGTONE,
"_silent",
0);
- assertThat(Settings.System.getString(mMockContentResolver, Settings.System.RINGTONE))
+ assertThat(Settings.System.getString(mContentResolver, Settings.System.RINGTONE))
.isEqualTo(null);
}
- public static class MockSettingsProvider extends MockContentProvider {
- ContentResolver mBaseContentResolver;
-
- public MockSettingsProvider(Context context, ContentResolver baseContentResolver) {
+ private static class MockSettingsProvider extends MockContentProvider {
+ private final ArrayMap<String, String> mKeyValueStore = new ArrayMap<>();
+ MockSettingsProvider(Context context) {
super(context);
- this.mBaseContentResolver = baseContentResolver;
}
@Override
public Bundle call(String method, String request, Bundle args) {
- return mBaseContentResolver.call(Settings.AUTHORITY, method, request, args);
+ if (method.startsWith("PUT_")) {
+ mKeyValueStore.put(request, args.getString("value"));
+ return null;
+ } else if (method.startsWith("GET_")) {
+ return Bundle.forPair("value", mKeyValueStore.getOrDefault(request, ""));
+ }
+ return null;
+ }
+
+ @Override
+ public Uri insert(Uri uri, ContentValues values) {
+ String name = values.getAsString("name");
+ String value = values.getAsString("value");
+ mKeyValueStore.put(name, value);
+ return null;
}
}
@@ -752,15 +728,13 @@
}
private int getAutoRotationSettingValue() {
- return Settings.System.getInt(
- getContentResolver(),
+ return Settings.System.getInt(mContentResolver,
Settings.System.ACCELEROMETER_ROTATION,
/* default= */ -1);
}
private void setAutoRotationSettingValue(int value) {
- Settings.System.putInt(
- getContentResolver(),
+ Settings.System.putInt(mContentResolver,
Settings.System.ACCELEROMETER_ROTATION,
value
);
@@ -769,7 +743,7 @@
private void restoreAutoRotationSetting(int newValue) {
mSettingsHelper.restoreValue(
mContext,
- getContentResolver(),
+ mContentResolver,
new ContentValues(),
/* destination= */ Settings.System.CONTENT_URI,
/* name= */ Settings.System.ACCELEROMETER_ROTATION,
@@ -777,31 +751,19 @@
/* restoredFromSdkInt= */ 0);
}
- private ContentResolver getContentResolver() {
- return InstrumentationRegistry.getInstrumentation().getTargetContext()
- .getContentResolver();
- }
-
- private void clearLongPressPowerValues() {
- ContentResolver cr = InstrumentationRegistry.getInstrumentation().getTargetContext()
- .getContentResolver();
- Settings.Global.putString(cr, Settings.Global.POWER_BUTTON_LONG_PRESS, null);
- Settings.Global.putString(cr, Settings.Global.KEY_CHORD_POWER_VOLUME_UP, null);
- }
-
- private void resetRingtoneSettingsToDefault(ContentResolver contentResolver) {
+ private void resetRingtoneSettingsToDefault() {
Settings.System.putString(
- contentResolver, Settings.System.RINGTONE, DEFAULT_RINGTONE_VALUE);
+ mContentResolver, Settings.System.RINGTONE, DEFAULT_RINGTONE_VALUE);
Settings.System.putString(
- contentResolver, Settings.System.NOTIFICATION_SOUND, DEFAULT_NOTIFICATION_VALUE);
+ mContentResolver, Settings.System.NOTIFICATION_SOUND, DEFAULT_NOTIFICATION_VALUE);
Settings.System.putString(
- contentResolver, Settings.System.ALARM_ALERT, DEFAULT_ALARM_VALUE);
+ mContentResolver, Settings.System.ALARM_ALERT, DEFAULT_ALARM_VALUE);
- assertThat(Settings.System.getString(contentResolver, Settings.System.RINGTONE))
+ assertThat(Settings.System.getString(mContentResolver, Settings.System.RINGTONE))
.isEqualTo(DEFAULT_RINGTONE_VALUE);
- assertThat(Settings.System.getString(contentResolver, Settings.System.NOTIFICATION_SOUND))
+ assertThat(Settings.System.getString(mContentResolver, Settings.System.NOTIFICATION_SOUND))
.isEqualTo(DEFAULT_NOTIFICATION_VALUE);
- assertThat(Settings.System.getString(contentResolver, Settings.System.ALARM_ALERT))
+ assertThat(Settings.System.getString(mContentResolver, Settings.System.ALARM_ALERT))
.isEqualTo(DEFAULT_ALARM_VALUE);
}
}
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/values-night/styles.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/values-night/styles.xml
index 81b3152..1f57654 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/values-night/styles.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/values-night/styles.xml
@@ -16,6 +16,10 @@
-->
<resources>
+ <style name="AccessibilityMenuSettings" parent="android:Theme.DeviceDefault.DayNight">
+ <item name="android:windowLightStatusBar">false</item>
+ </style>
+
<!--Adds the theme to support SnackBar component and user configurable theme. -->
<style name="ServiceTheme" parent="android:Theme.DeviceDefault.DayNight">
<item name="android:colorControlNormal">@color/colorControlNormal</item>
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/res/values/styles.xml b/packages/SystemUI/accessibility/accessibilitymenu/res/values/styles.xml
index 2009cd1..a2508cd 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/res/values/styles.xml
+++ b/packages/SystemUI/accessibility/accessibilitymenu/res/values/styles.xml
@@ -17,7 +17,9 @@
<resources>
<!--The theme is for preference CollapsingToolbarBaseActivity settings-->
- <style name="AccessibilityMenuSettings" parent="android:Theme.DeviceDefault.DayNight" />
+ <style name="AccessibilityMenuSettings" parent="android:Theme.DeviceDefault.DayNight">
+ <item name="android:windowLightStatusBar">true</item>
+ </style>
<!--Adds the theme to support SnackBar component and user configurable theme. -->
<style name="ServiceTheme" parent="android:Theme.DeviceDefault.Light">
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt b/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt
index 889c026..dd71dfa 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt
@@ -48,6 +48,7 @@
Column(
modifier =
modifier
+ .element(key = Notifications.Elements.Notifications)
.fillMaxWidth()
.defaultMinSize(minHeight = 300.dp)
.clip(RoundedCornerShape(32.dp))
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromGoneToQuickSettingsTransition.kt b/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromGoneToQuickSettingsTransition.kt
index 38712b0..291617f 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromGoneToQuickSettingsTransition.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromGoneToQuickSettingsTransition.kt
@@ -1,11 +1,12 @@
package com.android.systemui.scene.ui.composable.transitions
import androidx.compose.animation.core.tween
+import com.android.compose.animation.scene.Edge
import com.android.compose.animation.scene.TransitionBuilder
import com.android.systemui.scene.ui.composable.QuickSettings
fun TransitionBuilder.goneToQuickSettingsTransition() {
spec = tween(durationMillis = 500)
- fade(QuickSettings.rootElementKey)
+ translate(QuickSettings.rootElementKey, Edge.Top, true)
}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromGoneToShadeTransition.kt b/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromGoneToShadeTransition.kt
index 1d57c1a..45df2b1 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromGoneToShadeTransition.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromGoneToShadeTransition.kt
@@ -1,11 +1,12 @@
package com.android.systemui.scene.ui.composable.transitions
import androidx.compose.animation.core.tween
+import com.android.compose.animation.scene.Edge
import com.android.compose.animation.scene.TransitionBuilder
import com.android.systemui.scene.ui.composable.Shade
fun TransitionBuilder.goneToShadeTransition() {
spec = tween(durationMillis = 500)
- fade(Shade.rootElementKey)
+ translate(Shade.rootElementKey, Edge.Top, true)
}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromLockscreenToQuickSettingsTransition.kt b/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromLockscreenToQuickSettingsTransition.kt
index 9a8a3e2..e63bc4e 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromLockscreenToQuickSettingsTransition.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromLockscreenToQuickSettingsTransition.kt
@@ -1,11 +1,12 @@
package com.android.systemui.scene.ui.composable.transitions
import androidx.compose.animation.core.tween
+import com.android.compose.animation.scene.Edge
import com.android.compose.animation.scene.TransitionBuilder
import com.android.systemui.scene.ui.composable.QuickSettings
fun TransitionBuilder.lockscreenToQuickSettingsTransition() {
spec = tween(durationMillis = 500)
- fade(QuickSettings.rootElementKey)
+ translate(QuickSettings.rootElementKey, Edge.Top, true)
}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromShadeToQuickSettingsTransition.kt b/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromShadeToQuickSettingsTransition.kt
index 6c7964b..21a10b1 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromShadeToQuickSettingsTransition.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/transitions/FromShadeToQuickSettingsTransition.kt
@@ -10,6 +10,5 @@
spec = tween(durationMillis = 500)
translate(Notifications.Elements.Notifications, Edge.Bottom)
- fade(Notifications.Elements.Notifications)
timestampRange(endMillis = 83) { fade(QuickSettings.Elements.FooterActions) }
}
diff --git a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/ClockRegistry.kt b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/ClockRegistry.kt
index 798bdec4..ab0225d 100644
--- a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/ClockRegistry.kt
+++ b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/ClockRegistry.kt
@@ -409,6 +409,18 @@
scope.launch(bgDispatcher) { mutateSetting { it.copy(seedColor = value) } }
}
+ // Returns currentClockId if clock is connected, otherwise DEFAULT_CLOCK_ID. Since this
+ // is dependent on which clocks are connected, it may change when a clock is installed or
+ // removed from the device (unlike currentClockId).
+ // TODO: Merge w/ CurrentClockId when we convert to a flow. We shouldn't need both behaviors.
+ val activeClockId: String
+ get() {
+ if (!availableClocks.containsKey(currentClockId)) {
+ return DEFAULT_CLOCK_ID
+ }
+ return currentClockId
+ }
+
init {
// Register default clock designs
for (clock in defaultClockProvider.getClocks()) {
diff --git a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockController.kt b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockController.kt
index e539c95..b28920c 100644
--- a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockController.kt
+++ b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockController.kt
@@ -62,9 +62,10 @@
private val burmeseLineSpacing =
resources.getFloat(R.dimen.keyguard_clock_line_spacing_scale_burmese)
private val defaultLineSpacing = resources.getFloat(R.dimen.keyguard_clock_line_spacing_scale)
+ protected var onSecondaryDisplay: Boolean = false
override val events: DefaultClockEvents
- override val config = ClockConfig()
+ override val config = ClockConfig(DEFAULT_CLOCK_ID)
init {
val parent = FrameLayout(ctx)
@@ -142,6 +143,11 @@
view.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSizePx)
recomputePadding(targetRegion)
}
+
+ override fun onSecondaryDisplayChanged(onSecondaryDisplay: Boolean) {
+ this@DefaultClockController.onSecondaryDisplay = onSecondaryDisplay
+ recomputePadding(null)
+ }
}
open fun recomputePadding(targetRegion: Rect?) {}
@@ -182,13 +188,19 @@
override fun recomputePadding(targetRegion: Rect?) {
// We center the view within the targetRegion instead of within the parent
// view by computing the difference and adding that to the padding.
- val parent = view.parent
- val yDiff =
- if (targetRegion != null && parent is View && parent.isLaidOut())
- targetRegion.centerY() - parent.height / 2f
- else 0f
val lp = view.getLayoutParams() as FrameLayout.LayoutParams
- lp.topMargin = (-0.5f * view.bottom + yDiff).toInt()
+ lp.topMargin =
+ if (onSecondaryDisplay) {
+ // On the secondary display we don't want any additional top/bottom margin.
+ 0
+ } else {
+ val parent = view.parent
+ val yDiff =
+ if (targetRegion != null && parent is View && parent.isLaidOut())
+ targetRegion.centerY() - parent.height / 2f
+ else 0f
+ (-0.5f * view.bottom + yDiff).toInt()
+ }
view.setLayoutParams(lp)
}
diff --git a/packages/SystemUI/docs/qs-tiles.md b/packages/SystemUI/docs/qs-tiles.md
index 488f8c7..bd0b4ab 100644
--- a/packages/SystemUI/docs/qs-tiles.md
+++ b/packages/SystemUI/docs/qs-tiles.md
@@ -123,7 +123,7 @@
### API classes
-The classes that define the public API are in [core/java/android/service/quicksettings](core/java/android/service/quicksettings).
+The classes that define the public API are in [core/java/android/service/quicksettings](/core/java/android/service/quicksettings).
#### Tile
diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockProviderPlugin.kt b/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockProviderPlugin.kt
index d962732..e2f4793 100644
--- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockProviderPlugin.kt
+++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockProviderPlugin.kt
@@ -177,6 +177,9 @@
* targetRegion is relative to the parent view.
*/
fun onTargetRegionChanged(targetRegion: Rect?)
+
+ /** Called to notify the clock about its display. */
+ fun onSecondaryDisplayChanged(onSecondaryDisplay: Boolean)
}
/** Tick rates for clocks */
@@ -196,6 +199,8 @@
/** Render configuration for the full clock. Modifies the way systemUI behaves with this clock. */
data class ClockConfig(
+ val id: String,
+
/** Transition to AOD should move smartspace like large clock instead of small clock */
val useAlternateSmartspaceAODTransition: Boolean = false,
diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/VolumeDialogController.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/VolumeDialogController.java
index cf7d2c5..3d9645a 100644
--- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/VolumeDialogController.java
+++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/VolumeDialogController.java
@@ -58,9 +58,26 @@
void userActivity();
void getState();
- boolean areCaptionsEnabled();
- void setCaptionsEnabled(boolean isEnabled);
+ /**
+ * Get Captions enabled state
+ *
+ * @param checkForSwitchState set true when we'd like to switch captions enabled state after
+ * getting the latest captions state.
+ */
+ void getCaptionsEnabledState(boolean checkForSwitchState);
+ /**
+ * Set Captions enabled state
+ *
+ * @param enabled the captions enabled state we'd like to update.
+ */
+ void setCaptionsEnabledState(boolean enabled);
+
+ /**
+ * Get Captions component state
+ *
+ * @param fromTooltip if it's triggered from tooltip.
+ */
void getCaptionsComponentState(boolean fromTooltip);
@ProvidesInterface(version = StreamState.VERSION)
@@ -192,7 +209,22 @@
void onScreenOff();
void onShowSafetyWarning(int flags);
void onAccessibilityModeChanged(Boolean showA11yStream);
+
+ /**
+ * Callback function for captions component state changed event
+ *
+ * @param isComponentEnabled the lateset captions component state.
+ * @param fromTooltip if it's triggered from tooltip.
+ */
void onCaptionComponentStateChanged(Boolean isComponentEnabled, Boolean fromTooltip);
+
+ /**
+ * Callback function for captions enabled state changed event
+ *
+ * @param isEnabled the lateset captions enabled state.
+ * @param checkBeforeSwitch intend to switch captions enabled state after the callback.
+ */
+ void onCaptionEnabledStateChanged(Boolean isEnabled, Boolean checkBeforeSwitch);
// requires version 2
void onShowCsdWarning(@AudioManager.CsdWarning int csdWarning, int durationMs);
}
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_clock_presentation.xml b/packages/SystemUI/res-keyguard/layout/keyguard_clock_presentation.xml
new file mode 100644
index 0000000..593f507f
--- /dev/null
+++ b/packages/SystemUI/res-keyguard/layout/keyguard_clock_presentation.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+**
+** Copyright 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.
+*/
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/presentation"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <com.android.keyguard.KeyguardStatusView
+ android:id="@+id/clock"
+ android:layout_width="410dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:orientation="vertical">
+
+ <include
+ android:id="@+id/keyguard_clock_container"
+ layout="@layout/keyguard_clock_switch"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+ </com.android.keyguard.KeyguardStatusView>
+
+</FrameLayout>
diff --git a/packages/SystemUI/res-keyguard/layout/shade_carrier_new.xml b/packages/SystemUI/res-keyguard/layout/shade_carrier_new.xml
new file mode 100644
index 0000000..952f056
--- /dev/null
+++ b/packages/SystemUI/res-keyguard/layout/shade_carrier_new.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 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.
+*/
+-->
+<com.android.systemui.statusbar.pipeline.mobile.ui.view.ModernShadeCarrierGroupMobileView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/carrier_combo"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:gravity="center_vertical"
+ android:orientation="horizontal" >
+
+ <com.android.systemui.util.AutoMarqueeTextView
+ android:id="@+id/mobile_carrier_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_marginEnd="@dimen/qs_carrier_margin_width"
+ android:visibility="gone"
+ android:textDirection="locale"
+ android:marqueeRepeatLimit="marquee_forever"
+ android:singleLine="true"
+ android:maxEms="7"/>
+
+ <include layout="@layout/status_bar_mobile_signal_group_new" />
+
+</com.android.systemui.statusbar.pipeline.mobile.ui.view.ModernShadeCarrierGroupMobileView>
+
diff --git a/packages/SystemUI/res-keyguard/values-af/strings.xml b/packages/SystemUI/res-keyguard/values-af/strings.xml
index fc92e01..2eb1bb5 100644
--- a/packages/SystemUI/res-keyguard/values-af/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-af/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN word vereis ná vassluit"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Wagwoord word vereis ná vassluit"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Patroon word vereis ná vassluit"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Die opdatering sal installeer wanneer die toestel nie gebruik word nie"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Meer sekuriteit vereis. PIN ruk lank nie gebruik nie."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Meer sekuriteit vereis. Wagwoord ruk lank nie gebruik nie."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Meer sekuriteit vereis. Patroon ruk lank nie gebruik nie."</string>
diff --git a/packages/SystemUI/res-keyguard/values-am/strings.xml b/packages/SystemUI/res-keyguard/values-am/strings.xml
index 88670cd..5fd946b 100644
--- a/packages/SystemUI/res-keyguard/values-am/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-am/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"ከመቆለፊያ በኋላ ፒን ያስፈልጋል"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"ከመቆለፊያ በኋላ የይለፍ ቃል ያስፈልጋል"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"ከመቆለፊያ በኋላ ስርዓተ ጥለት ያስፈልጋል"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"መሣሪያው ጥቅም ላይ በማይውልበት ጊዜ ዝማኔ ይጫናል"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"ተጨማሪ የደህንነት ጥበቃ ያስፈልጋል። ፒን ለተወሰነ ጊዜ ጥቅም ላይ አልዋለም።"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"ተጨማሪ የደህንነት ጥበቃ ያስፈልጋል። የይለፍ ቃል ለተወሰነ ጊዜ ጥቅም ላይ አልዋለም።"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"ተጨማሪ የደህንነት ጥበቃ ያስፈልጋል። ስርዓተ ጥለት ለተወሰነ ጊዜ ጥቅም ላይ አልዋለም።"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ar/strings.xml b/packages/SystemUI/res-keyguard/values-ar/strings.xml
index b66f6fd..b6479f4 100644
--- a/packages/SystemUI/res-keyguard/values-ar/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ar/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"يجب إدخال رقم التعريف الشخصي بعد إلغاء التأمين."</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"يجب إدخال كلمة المرور بعد إلغاء التأمين."</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"يجب رسم النقش بعد إلغاء التأمين."</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"سيتم تثبيت التحديث عندما لا يكون الجهاز قيد الاستخدام."</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"يجب تعزيز الأمان. لم يُستخدَم رقم PIN لبعض الوقت."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"يجب تعزيز الأمان. لم تستخدَم كلمة المرور لبعض الوقت."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"يجب تعزيز الأمان. لم يُستخدَم النقش لبعض الوقت."</string>
diff --git a/packages/SystemUI/res-keyguard/values-as/strings.xml b/packages/SystemUI/res-keyguard/values-as/strings.xml
index 6796756..a41a704 100644
--- a/packages/SystemUI/res-keyguard/values-as/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-as/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"লকডাউনৰ পাছত পিন দিয়াৰ আৱশ্যক"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"লকডাউনৰ পাছত পাছৱৰ্ড দিয়াৰ আৱশ্যক"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"লকডাউনৰ পাছত আৰ্হি দিয়াৰ আৱশ্যক"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"ডিভাইচটো ব্যৱহাৰ হৈ নাথাকোঁতে আপডে’ট ইনষ্টল হ’ব"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"অতিৰিক্ত সুৰক্ষাৰ আৱশ্যক। কিছু সময় ধৰি আৰ্হি ব্যৱহাৰ কৰা হোৱা নাই।"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"অতিৰিক্ত সুৰক্ষাৰ আৱশ্যক। কিছু সময় ধৰি পাছৱৰ্ড ব্যৱহাৰ কৰা হোৱা নাই।"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"অতিৰিক্ত সুৰক্ষাৰ আৱশ্যক। কিছু সময় ধৰি আৰ্হি ব্যৱহাৰ কৰা হোৱা নাই।"</string>
diff --git a/packages/SystemUI/res-keyguard/values-az/strings.xml b/packages/SystemUI/res-keyguard/values-az/strings.xml
index d8cf6c0..f66fb3c 100644
--- a/packages/SystemUI/res-keyguard/values-az/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-az/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Kilidləmədən sonra PIN tələb edilir"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Kilidləmədən sonra parol tələb edilir"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Kilidləmədən sonra model tələb edilir"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Cihaz istifadə edilmədikdə güncəllənmə quraşdırılacaq"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Qoruma lazımdır. PIN bir müddət işlənməyib."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Qoruma lazımdır. Parol bir müddət işlənməyib."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Qoruma lazımdır. Model bir müddət işlənməyib."</string>
diff --git a/packages/SystemUI/res-keyguard/values-b+sr+Latn/strings.xml b/packages/SystemUI/res-keyguard/values-b+sr+Latn/strings.xml
index 72067e7..b0a6471 100644
--- a/packages/SystemUI/res-keyguard/values-b+sr+Latn/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-b+sr+Latn/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN je obavezan posle zaključavanja"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Lozinka je obavezna posle zaključavanja"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Šablon je obavezan posle zaključavanja"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Ažuriranje će se instalirati kada se uređaj ne koristi"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Potrebna je dodatna zaštita. PIN dugo nije korišćen."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Potrebna je dodatna zaštita. Lozinka dugo nije korišćena."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Potrebna je dodatna zaštita. Šablon dugo nije korišćen."</string>
diff --git a/packages/SystemUI/res-keyguard/values-be/strings.xml b/packages/SystemUI/res-keyguard/values-be/strings.xml
index 12c693f..11cc77d 100644
--- a/packages/SystemUI/res-keyguard/values-be/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-be/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Пасля блакіроўкі неабходна ўвесці PIN-код"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Пасля блакіроўкі неабходна ўвесці пароль"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Пасля блакіроўкі неабходна ўвесці ўзор разблакіроўкі"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Абнаўленне будзе ўсталявана, калі прылада не выкарыстоўваецца"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Патрабуецца дадатковая праверка. Даўно не выкарыстоўваўся PIN-код."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Патрабуецца дадатковая праверка. Даўно не выкарыстоўваўся пароль."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Патрабуецца дадатковая праверка. Даўно не выкарыстоўваўся ўзор разблакіроўкі."</string>
diff --git a/packages/SystemUI/res-keyguard/values-bg/strings.xml b/packages/SystemUI/res-keyguard/values-bg/strings.xml
index 6726d42..c554a27 100644
--- a/packages/SystemUI/res-keyguard/values-bg/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-bg/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"След заключването се изисква ПИН код"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"След заключването се изисква парола"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"След заключването се изисква фигура"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Актуализацията ще се инсталира, когато устройството не се използва"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Изисква се допъл. защита. ПИН кодът не е ползван скоро."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Изисква се допъл. защита. Паролата не е ползвана скоро."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Изисква се допъл. защита. Фигурата не е ползвана скоро."</string>
diff --git a/packages/SystemUI/res-keyguard/values-bn/strings.xml b/packages/SystemUI/res-keyguard/values-bn/strings.xml
index 457f85d..69f533c 100644
--- a/packages/SystemUI/res-keyguard/values-bn/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-bn/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"লকডাউন হওয়ার পরে পিন দিতে হবে"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"লকডাউন হওয়ার পরে পাসওয়ার্ড দিতে হবে"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"লকডাউন হওয়ার পরে প্যাটার্ন দিতে হবে"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"ডিভাইস ব্যবহার না করাকালীন আপডেট ইনস্টল করা হবে"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"অতিরিক্ত সুরক্ষা দরকার। পিন কিছুক্ষণ ব্যবহার করা হয়নি।"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"অতিরিক্ত সুরক্ষা দরকার। পাসওয়ার্ড কিছুক্ষণ ব্যবহার করা হয়নি।"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"অতিরিক্ত সুরক্ষা দরকার। প্যাটার্ন কিছুক্ষণ ব্যবহার করা হয়নি।"</string>
diff --git a/packages/SystemUI/res-keyguard/values-bs/strings.xml b/packages/SystemUI/res-keyguard/values-bs/strings.xml
index 6dc147f..4c519c8 100644
--- a/packages/SystemUI/res-keyguard/values-bs/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-bs/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN je potreban nakon zaključavanja"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Lozinka je potrebna nakon zaključavanja"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Uzorak je potreban nakon zaključavanja"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Ažuriranje će se instalirati dok se uređaj ne koristi"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Potrebna je dodatna zaštita. PIN dugo nije unošen."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Potrebna je dodatna zaštita. Lozinka dugo nije unošena."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Potrebna je dodatna zaštita. Uzorak dugo nije unošen."</string>
diff --git a/packages/SystemUI/res-keyguard/values-ca/strings.xml b/packages/SystemUI/res-keyguard/values-ca/strings.xml
index 8b901c0..3bd6508 100644
--- a/packages/SystemUI/res-keyguard/values-ca/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ca/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Cal el PIN després del bloqueig de seguretat"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Cal la contrasenya després del bloqueig de seguretat"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Cal el patró després del bloqueig de seguretat"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"L\'actualització s\'instal·larà quan el dispositiu no estigui en ús"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Cal més seguretat. Fa temps que no utilitzes el PIN."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Cal més seguretat. Contrasenya no utilitzada fa temps."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Cal més seguretat. Fa temps que no utilitzes el patró."</string>
diff --git a/packages/SystemUI/res-keyguard/values-cs/strings.xml b/packages/SystemUI/res-keyguard/values-cs/strings.xml
index b4c0343..e075d85 100644
--- a/packages/SystemUI/res-keyguard/values-cs/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-cs/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Po uzamčení je třeba zadat PIN"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Po uzamčení je třeba zadat heslo"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Po uzamčení je třeba zadat gesto"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Aktualizace se nainstaluje, až zařízení nebudete používat"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Je potřeba další krok. PIN dlouho nepoužit."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Je potřeba další krok. Heslo dlouho nepoužito."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Je potřeba další krok. Gesto dlouho nepoužito."</string>
diff --git a/packages/SystemUI/res-keyguard/values-da/strings.xml b/packages/SystemUI/res-keyguard/values-da/strings.xml
index 3840785..027166f 100644
--- a/packages/SystemUI/res-keyguard/values-da/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-da/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Pinkode er påkrævet efter brug af låsning"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Adgangskode er påkrævet efter brug af låsning"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Mønster er påkrævet efter brug af låsning"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Opdateringen installeres, når enheden ikke er i brug"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Mere sikkerhed er påkrævet. Pinkoden er ikke blevet brugt i et stykke tid."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Mere sikkerhed er påkrævet. Adgangskoden er ikke blevet brugt i et stykke tid."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Mere sikkerhed er påkrævet. Mønsteret er ikke blevet brugt i et stykke tid."</string>
diff --git a/packages/SystemUI/res-keyguard/values-de/strings.xml b/packages/SystemUI/res-keyguard/values-de/strings.xml
index 5d069ff..117f7a9 100644
--- a/packages/SystemUI/res-keyguard/values-de/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-de/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Nach einer Sperre muss die PIN eingegeben werden"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Nach einer Sperre muss das Passwort eingegeben werden"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Nach einer Sperre muss das Muster gezeichnet werden"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Update wird installiert, wenn das Gerät nicht verwendet wird"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Zusätzliche Sicherheitsmaßnahme erforderlich. Die PIN wurde länger nicht genutzt."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Zusätzliche Sicherheitsmaßnahme erforderlich. Passwort wurde länger nicht genutzt."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Zusätzliche Sicherheitsmaßnahme erforderlich. Muster wurde länger nicht genutzt."</string>
diff --git a/packages/SystemUI/res-keyguard/values-el/strings.xml b/packages/SystemUI/res-keyguard/values-el/strings.xml
index f02be89..cd7637c 100644
--- a/packages/SystemUI/res-keyguard/values-el/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-el/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Απαιτείται PIN μετά από κλείδωμα"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Απαιτείται κωδικός πρόσβασης μετά από κλείδωμα"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Απαιτείται μοτίβο μετά από κλείδωμα"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Η ενημέρωση θα εγκατασταθεί όταν δεν χρησιμοποιείται η συσκευή"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Απαιτ. πρόσθ. ασφάλ. Το PIN έχει καιρό να χρησιμοπ."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Απαιτ. πρόσθ. ασφάλ. Ο κωδ. πρ. έχει καιρό να χρησ."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Απαιτ. πρόσθ. ασφάλ. Το μοτίβο έχει καιρό να χρησιμ."</string>
diff --git a/packages/SystemUI/res-keyguard/values-en-rAU/strings.xml b/packages/SystemUI/res-keyguard/values-en-rAU/strings.xml
index ab7208b..0ace8a7 100644
--- a/packages/SystemUI/res-keyguard/values-en-rAU/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-en-rAU/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN is required after lockdown"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Password is required after lockdown"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Pattern is required after lockdown"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Update will be installed when the device is not in use"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Added security required. PIN not used for a while."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Added security required. Password not used for a while."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Added security required. Pattern not used for a while."</string>
diff --git a/packages/SystemUI/res-keyguard/values-en-rGB/strings.xml b/packages/SystemUI/res-keyguard/values-en-rGB/strings.xml
index ab7208b..0ace8a7 100644
--- a/packages/SystemUI/res-keyguard/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-en-rGB/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN is required after lockdown"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Password is required after lockdown"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Pattern is required after lockdown"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Update will be installed when the device is not in use"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Added security required. PIN not used for a while."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Added security required. Password not used for a while."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Added security required. Pattern not used for a while."</string>
diff --git a/packages/SystemUI/res-keyguard/values-en-rIN/strings.xml b/packages/SystemUI/res-keyguard/values-en-rIN/strings.xml
index ab7208b..0ace8a7 100644
--- a/packages/SystemUI/res-keyguard/values-en-rIN/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-en-rIN/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN is required after lockdown"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Password is required after lockdown"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Pattern is required after lockdown"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Update will be installed when the device is not in use"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Added security required. PIN not used for a while."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Added security required. Password not used for a while."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Added security required. Pattern not used for a while."</string>
diff --git a/packages/SystemUI/res-keyguard/values-es-rUS/strings.xml b/packages/SystemUI/res-keyguard/values-es-rUS/strings.xml
index 2aa9c04..debbeb1 100644
--- a/packages/SystemUI/res-keyguard/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-es-rUS/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Se requiere el PIN después del bloqueo"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Se requiere la contraseña después del bloqueo"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Se requiere el patrón después del bloqueo"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Se instalará la actualización cuando el dispositivo esté en desuso"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Reforzar seguridad. PIN sin uso mucho tiempo."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Reforzar seguridad. Contraseña sin uso mucho tiempo."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Reforzar seguridad. Patrón sin uso mucho tiempo."</string>
diff --git a/packages/SystemUI/res-keyguard/values-es/strings.xml b/packages/SystemUI/res-keyguard/values-es/strings.xml
index 78ecc85..0ea98a8 100644
--- a/packages/SystemUI/res-keyguard/values-es/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-es/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Se necesita el PIN después del bloqueo"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Se necesita la contraseña después del bloqueo"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Se necesita el patrón después del bloqueo"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"La actualización se instalará cuando el dispositivo no esté en uso"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Se debe reforzar la seguridad. PIN no usado en mucho tiempo."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Se debe reforzar la seguridad. Contraseña no usada en mucho tiempo."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Se debe reforzar la seguridad. Patrón no usado en mucho tiempo."</string>
diff --git a/packages/SystemUI/res-keyguard/values-et/strings.xml b/packages/SystemUI/res-keyguard/values-et/strings.xml
index 26ead1f..722a022 100644
--- a/packages/SystemUI/res-keyguard/values-et/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-et/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Pärast lukustamist on PIN-kood nõutav"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Pärast lukustamist on parool nõutav"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Pärast lukustamist on muster nõutav"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Värskendus installitakse, kui seadet ei kasutata"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Turvalisuse suurendamine on nõutav. PIN-koodi ei ole mõnda aega kasutatud."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Turvalisuse suurendamine on nõutav. Parooli ei ole mõnda aega kasutatud."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Turvalisuse suurendamine on nõutav. Mustrit ei ole mõnda aega kasutatud."</string>
diff --git a/packages/SystemUI/res-keyguard/values-eu/strings.xml b/packages/SystemUI/res-keyguard/values-eu/strings.xml
index 52d2336..d329369 100644
--- a/packages/SystemUI/res-keyguard/values-eu/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-eu/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PINa behar da blokeoa desgaitu ostean"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Pasahitza behar da blokeoa desgaitu ostean"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Eredua behar da blokeoa desgaitu ostean"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Gailua erabiltzen ari ez zarenean instalatuko da eguneratzea"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Segurtasuna areagotu behar da. PINa ez da erabili aldi batez."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Segurtasuna areagotu behar da. Pasahitza ez da erabili aldi batez."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Segurtasuna areagotu behar da. Eredua ez da erabili aldi batez."</string>
diff --git a/packages/SystemUI/res-keyguard/values-fa/strings.xml b/packages/SystemUI/res-keyguard/values-fa/strings.xml
index 1e7978e..4815815 100644
--- a/packages/SystemUI/res-keyguard/values-fa/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-fa/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"بعداز قفل همه باید از پین استفاده کرد"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"بعداز قفل همه باید از گذرواژه استفاده کرد"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"بعداز قفل همه باید از الگو استفاده کرد"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"بهروزرسانی وقتی دستگاه درحال استفاده نیست نصب خواهد شد"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"امنیت بیشتر لازم است. مدتی از پین استفاده نشده است."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"امنیت بیشتر لازم است. گذرواژه مدتی استفاده نشده است."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"امنیت بیشتر لازم است. مدتی از الگو استفاده نشده است."</string>
diff --git a/packages/SystemUI/res-keyguard/values-fi/strings.xml b/packages/SystemUI/res-keyguard/values-fi/strings.xml
index 2ec0c99..02d41d8 100644
--- a/packages/SystemUI/res-keyguard/values-fi/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-fi/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN-koodi tarvitaan lukitustilan jälkeen"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Salasana tarvitaan lukitustilan jälkeen"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Kuvio tarvitaan lukitustilan jälkeen"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Päivitys asennetaan, kun laite ei ole käytössä"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Lisäsuojausta tarvitaan. PIN-koodia ei ole käytetty."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Lisäsuojausta tarvitaan. Salasanaa ei ole käytetty."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Lisäsuojausta tarvitaan. Kuviota ei ole käytetty."</string>
diff --git a/packages/SystemUI/res-keyguard/values-fr-rCA/strings.xml b/packages/SystemUI/res-keyguard/values-fr-rCA/strings.xml
index b0bfa33..fa1a191 100644
--- a/packages/SystemUI/res-keyguard/values-fr-rCA/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-fr-rCA/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Le NIP est requis après le verrouillage"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Le mot de passe est requis après le verrouillage"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Le schéma est requis après le verrouillage"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"La mise à jour sera installée lorsque l\'appareil n\'est pas utilisé"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Plus de sécurité requise. NIP non utilisé pour un temps."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Plus de sécurité requise. MDP non utilisé pour un temps."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Plus de sécurité requise. Schéma non utilisé pour un temps."</string>
diff --git a/packages/SystemUI/res-keyguard/values-fr/strings.xml b/packages/SystemUI/res-keyguard/values-fr/strings.xml
index 5161832..d687a1d 100644
--- a/packages/SystemUI/res-keyguard/values-fr/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-fr/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Code requis après un blocage"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Mot de passe requis après un blocage"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Schéma requis après un blocage"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"La mise à jour aura lieu lorsque votre appareil n\'est pas utilisé"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Code inutilisé depuis un moment. Renforcez la sécurité."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Mot de passe inutilisé depuis un moment. Renforcez la sécurité."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Schéma inutilisé depuis un moment. Renforcez la sécurité."</string>
diff --git a/packages/SystemUI/res-keyguard/values-gl/strings.xml b/packages/SystemUI/res-keyguard/values-gl/strings.xml
index e33a899..3faa7ca 100644
--- a/packages/SystemUI/res-keyguard/values-gl/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-gl/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Requírese o PIN tras o bloqueo"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Requírese o contrasinal tras o bloqueo"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Requírese o padrón tras o bloqueo"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"A actualización instalarase cando o dispositivo non se estea usando"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Requírese seguranza adicional. O PIN non se usou desde hai tempo."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Requírese seguranza adicional. O contrasinal non se usou desde hai tempo."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Requírese seguranza adicional. O padrón non se usou desde hai tempo."</string>
diff --git a/packages/SystemUI/res-keyguard/values-gu/strings.xml b/packages/SystemUI/res-keyguard/values-gu/strings.xml
index 1d806ca..99c9883 100644
--- a/packages/SystemUI/res-keyguard/values-gu/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-gu/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"પિન પછી પાસવર્ડ આવશ્યક છે"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"લૉકડાઉન પછી પાસવર્ડ આવશ્યક છે"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"પૅટર્ન પછી પાસવર્ડ આવશ્યક છે"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"જ્યારે ડિવાઇસ ઉપયોગમાં ન હોય ત્યારે અપડેટ ઇન્સ્ટૉલ કરવામાં આવશે"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"વધારાની સુરક્ષા આવશ્યક છે. થોડા સમય માટે પિનનો ઉપયોગ થયો નથી."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"વધારાની સુરક્ષા આવશ્યક છે. થોડા સમય માટે પાસવર્ડનો ઉપયોગ થયો નથી."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"વધારાની સુરક્ષા આવશ્યક છે. થોડા સમય માટે પૅટર્નનો ઉપયોગ થયો નથી."</string>
diff --git a/packages/SystemUI/res-keyguard/values-hi/strings.xml b/packages/SystemUI/res-keyguard/values-hi/strings.xml
index 808950e..9d32f04 100644
--- a/packages/SystemUI/res-keyguard/values-hi/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-hi/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"लॉकडाउन के बाद, पिन डालना ज़रूरी है"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"लॉकडाउन के बाद, पासवर्ड डालना ज़रूरी है"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"लॉकडाउन के बाद, पैटर्न ड्रॉ करना ज़रूरी है"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"अपडेट तब इंस्टॉल किया जाएगा, जब डिवाइस का इस्तेमाल न किया जा रहा हो"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"अतिरिक्त सुरक्षा ज़रूरी है. कुछ समय से पिन नहीं डाला गया."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"अतिरिक्त सुरक्षा ज़रूरी है. कुछ समय से पासवर्ड नहीं डाला गया."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"अतिरिक्त सुरक्षा ज़रूरी है. कुछ समय से पैटर्न ड्रॉ नहीं किया गया."</string>
diff --git a/packages/SystemUI/res-keyguard/values-hr/strings.xml b/packages/SystemUI/res-keyguard/values-hr/strings.xml
index 970ae5c..b4224bf 100644
--- a/packages/SystemUI/res-keyguard/values-hr/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-hr/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN je obavezan nakon zaključavanja"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Zaporka je obavezna nakon zaključavanja"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Uzorak je obavezan nakon zaključavanja"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Ažuriranje će se instalirati kad uređaj nije u upotrebi"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Potrebna je dodatna sigurnost. PIN nije upotrijebljen duže vrijeme."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Potrebna je dodatna sigurnost. Zaporka nije upotrijebljena duže vrijeme."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Potrebna je dodatna sigurnost. Uzorak nije upotrijebljen duže vrijeme."</string>
diff --git a/packages/SystemUI/res-keyguard/values-hu/strings.xml b/packages/SystemUI/res-keyguard/values-hu/strings.xml
index bc0a98d..bc712c7 100644
--- a/packages/SystemUI/res-keyguard/values-hu/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-hu/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN-kód megadása szükséges a zárolás után"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Jelszó megadása szükséges a zárolás után"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Minta megadása szükséges a zárolás után"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"A frissítést telepíti a rendszer, amikor nincs használatban az eszköz"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Fokozott biztonság szükséges. Régóta nem használta a PIN-t."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Fokozott biztonság szükséges. Régóta nem használta jelszavát."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Fokozott biztonság szükséges. Régóta nem használta a mintát."</string>
diff --git a/packages/SystemUI/res-keyguard/values-hy/strings.xml b/packages/SystemUI/res-keyguard/values-hy/strings.xml
index 230c6ba..4d7bbbe 100644
--- a/packages/SystemUI/res-keyguard/values-hy/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-hy/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Արգելափակումից հետո հարկավոր է մուտքագրել PIN կոդը"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Արգելափակումից հետո հարկավոր է մուտքագրել գաղտնաբառը"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Արգելափակումից հետո հարկավոր է գծել նախշը"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Թարմացումը կտեղադրվի, երբ սարքն օգտագործվելիս չլինի"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"PIN կոդը որոշ ժամանակ չի օգտագործվել։"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Գաղտնաբառը որոշ ժամանակ չի օգտագործվել։"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Նախշը որոշ ժամանակ չի օգտագործվել։"</string>
diff --git a/packages/SystemUI/res-keyguard/values-in/strings.xml b/packages/SystemUI/res-keyguard/values-in/strings.xml
index cf01634..aa766e9 100644
--- a/packages/SystemUI/res-keyguard/values-in/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-in/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN diperlukan setelah kunci total"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Sandi diperlukan setelah kunci total"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Pola diperlukan setelah kunci total"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Update akan diinstal saat perangkat sedang tidak digunakan"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Perlu keamanan tambahan. PIN tidak digunakan selama beberapa waktu."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Perlu keamanan tambahan. Sandi tidak digunakan selama beberapa waktu."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Perlu keamanan tambahan. Pola tidak digunakan selama beberapa waktu."</string>
diff --git a/packages/SystemUI/res-keyguard/values-is/strings.xml b/packages/SystemUI/res-keyguard/values-is/strings.xml
index ca36400..99f1779 100644
--- a/packages/SystemUI/res-keyguard/values-is/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-is/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN-númers er krafist eftir læsingu"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Aðgangsorðs er krafist eftir læsingu"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Mynsturs er krafist eftir læsingu"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Uppfærslan verður sett upp þegar tækið er ekki í notkun"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Viðbótaröryggis krafist. PIN-númer var ekki notað um hríð."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Viðbótaröryggis krafist. Aðgangsorð var ekki notað um hríð."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Viðbótaröryggis krafist. Mynstur var ekki notað um hríð."</string>
diff --git a/packages/SystemUI/res-keyguard/values-it/strings.xml b/packages/SystemUI/res-keyguard/values-it/strings.xml
index e46ae37..e5079c7 100644
--- a/packages/SystemUI/res-keyguard/values-it/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-it/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN richiesto dopo il blocco"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Password richiesta dopo il blocco"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Sequenza richiesta dopo il blocco"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"L\'aggiornamento verrà installato quando il dispositivo non sarà in uso"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Occorre maggiore sicurezza. PIN non usato per un po\' di tempo."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Occorre maggiore sicurezza. Password non usata per un po\' di tempo."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Occorre maggiore sicurezza. Sequenza non usata per un po\' di tempo."</string>
diff --git a/packages/SystemUI/res-keyguard/values-iw/strings.xml b/packages/SystemUI/res-keyguard/values-iw/strings.xml
index 667bf9b..bc66355 100644
--- a/packages/SystemUI/res-keyguard/values-iw/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-iw/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"נדרש קוד אימות לאחר הפעלת \'ללא \'ביטול נעילה בטביעת אצבע\'\'"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"נדרשת סיסמה לאחר הפעלת \'ללא \'ביטול נעילה בטביעת אצבע\'\'"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"נדרש קו ביטול נעילה לאחר הפעלת \'ללא \'ביטול נעילה בטביעת אצבע\'\'"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"העדכון יותקן כשהמכשיר לא יהיה בשימוש"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"נדרשת אבטחה מוגברת. לא השתמשת בקוד אימות זמן מה."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"נדרשת אבטחה מוגברת. לא השתמשת בסיסמה זמן מה."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"נדרשת אבטחה מוגברת. לא השתמשת בקו ביטול נעילה זמן מה."</string>
diff --git a/packages/SystemUI/res-keyguard/values-ja/strings.xml b/packages/SystemUI/res-keyguard/values-ja/strings.xml
index 5230984..1d59a63 100644
--- a/packages/SystemUI/res-keyguard/values-ja/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ja/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"ロックダウン後は PIN の入力が必要になります"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"ロックダウン後はパスワードの入力が必要になります"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"ロックダウン後はパターンの入力が必要になります"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"アップデートは、デバイスを使用していないときにインストールされます"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"セキュリティ強化が必要: PIN がしばらく未使用です。"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"セキュリティ強化が必要: パスワードがしばらく未使用です。"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"セキュリティ強化が必要: パターンがしばらく未使用です。"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ka/strings.xml b/packages/SystemUI/res-keyguard/values-ka/strings.xml
index 04a7b0d..5bd6b2e 100644
--- a/packages/SystemUI/res-keyguard/values-ka/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ka/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"დაბლოკვის შემდეგ საჭიროა PIN-კოდი"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"დაბლოკვის შემდეგ საჭიროა პაროლი"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"დაბლოკვის შემდეგ საჭიროა ნიმუში"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"განახლება დაინსტალირდება, როცა მოწყობილობა არ გამოიყენება"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"საჭიროა დამ. უსაფრთ. PIN-კოდი ერთხანს არ გამოიყენ."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"საჭ. დამ. უსაფრთ. პაროლი ერთხანს არ გამოიყენება."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"საჭიროა დამ. უსაფრთ. ნიმუში ერთხანს არ გამოიყენება."</string>
diff --git a/packages/SystemUI/res-keyguard/values-kk/strings.xml b/packages/SystemUI/res-keyguard/values-kk/strings.xml
index deab7b8..83d270d 100644
--- a/packages/SystemUI/res-keyguard/values-kk/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-kk/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Құлыпталғаннан кейін PIN кодын енгізу қажет."</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Құлыпталғаннан кейін құпия сөз енгізу қажет."</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Құлыпталғаннан кейін өрнек енгізу қажет."</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Құрылғы қолданылмағанда жаңартылады."</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Қауіпсіздікті күшейту қажет. PIN коды біраз уақыт қолданылмаған."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Қауіпсіздікті күшейту қажет. Құпия сөз біраз уақыт қолданылмаған."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Қауіпсіздікті күшейту қажет. Өрнек біраз уақыт қолданылмаған."</string>
diff --git a/packages/SystemUI/res-keyguard/values-km/strings.xml b/packages/SystemUI/res-keyguard/values-km/strings.xml
index 1325151..5306cb1 100644
--- a/packages/SystemUI/res-keyguard/values-km/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-km/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"ត្រូវការកូដ PIN បន្ទាប់ពីការចាក់សោ"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"ត្រូវការពាក្យសម្ងាត់បន្ទាប់ពីការចាក់សោ"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"ត្រូវការលំនាំបន្ទាប់ពីការចាក់សោ"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"កំណែថ្មីនឹងត្រូវបានដំឡើង នៅពេលឧបករណ៍មិនជាប់ប្រើ"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"ត្រូវការសុវត្ថិភាពបន្ថែម។ មិនបានប្រើកូដ PIN មួយរយៈ។"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"ត្រូវការសុវត្ថិភាពបន្ថែម។ មិនបានប្រើពាក្យសម្ងាត់មួយរយៈ។"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"ត្រូវការសុវត្ថិភាពបន្ថែម។ មិនបានប្រើលំនាំមួយរយៈ។"</string>
diff --git a/packages/SystemUI/res-keyguard/values-kn/strings.xml b/packages/SystemUI/res-keyguard/values-kn/strings.xml
index 749ebb6..d609a23 100644
--- a/packages/SystemUI/res-keyguard/values-kn/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-kn/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"ಲಾಕ್ಡೌನ್ ಮಾಡಿದ ನಂತರ ಪಿನ್ ಬಳಸುವ ಅಗತ್ಯವಿದೆ"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"ಲಾಕ್ಡೌನ್ನ ನಂತರ ಪಾಸ್ವರ್ಡ್ನ ಅಗತ್ಯವಿದೆ"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"ಲಾಕ್ಡೌನ್ ಮಾಡಿದ ನಂತರ ಪ್ಯಾಟರ್ನ್ ಬಳಸುವ ಅಗತ್ಯವಿದೆ"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"ಸಾಧನವನ್ನು ಬಳಕೆ ಮಾಡದ ಸಮಯದಲ್ಲಿ ಅಪ್ಡೇಟ್ ಅನ್ನು ಇನ್ಸ್ಟಾಲ್ ಮಾಡಲಾಗುತ್ತದೆ"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"ಹೆಚ್ಚುವರಿ ಸುರಕ್ಷತೆಯ ಅಗತ್ಯವಿದೆ. ಪಿನ್ ಅನ್ನು ಸ್ವಲ್ಪ ಕಾಲದಿಂದ ಬಳಸಿಲ್ಲ."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"ಹೆಚ್ಚುವರಿ ಸುರಕ್ಷತೆಯ ಅಗತ್ಯವಿದೆ. ಪಾಸ್ವರ್ಡ್ ಅನ್ನು ಸ್ವಲ್ಪ ಕಾಲದಿಂದ ಬಳಸಿಲ್ಲ."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"ಹೆಚ್ಚುವರಿ ಸುರಕ್ಷತೆಯ ಅಗತ್ಯವಿದೆ. ಪ್ಯಾಟರ್ನ್ ಅನ್ನು ಸ್ವಲ್ಪ ಕಾಲದಿಂದ ಬಳಸಿಲ್ಲ."</string>
diff --git a/packages/SystemUI/res-keyguard/values-ko/strings.xml b/packages/SystemUI/res-keyguard/values-ko/strings.xml
index ae75286..532253e 100644
--- a/packages/SystemUI/res-keyguard/values-ko/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ko/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"기기가 잠겨 PIN을 입력해야 합니다."</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"기기가 잠겨 비밀번호를 입력해야 합니다."</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"기기가 잠겨 패턴을 입력해야 합니다."</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"기기를 사용하지 않을 때 업데이트가 설치됩니다."</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"보안을 강화해야 합니다. 한동안 PIN이 사용되지 않았습니다."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"보안을 강화해야 합니다. 한동안 비밀번호가 사용되지 않았습니다."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"보안을 강화해야 합니다. 한동안 패턴이 사용되지 않았습니다."</string>
diff --git a/packages/SystemUI/res-keyguard/values-ky/strings.xml b/packages/SystemUI/res-keyguard/values-ky/strings.xml
index 638fd98..9ad9d56 100644
--- a/packages/SystemUI/res-keyguard/values-ky/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ky/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Бекем кулпулангандан кийин PIN код талап кылынат"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Бекем кулпулангандан кийин сырсөз талап кылынат"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Бекем кулпулангандан кийн грфикалык ачкыч талп клынт"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Жаңыртуу түзмөк колдонулбай турганда орнотулат"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Кошмча кпсуздук тлап клнат. PIN код бир нче убкыт бою клднулгн эмeс."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Кошмча кпсуздук тлап клнат. Сырсз бир нче убкыт бою клднулгн эмeс."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Кошмча кпсуздук тлап клнат. Грфиклык ачкч бир нче убкыт бою клднулгн эмeс."</string>
diff --git a/packages/SystemUI/res-keyguard/values-lo/strings.xml b/packages/SystemUI/res-keyguard/values-lo/strings.xml
index efe5377..0059d7f 100644
--- a/packages/SystemUI/res-keyguard/values-lo/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-lo/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"ຕ້ອງໃສ່ PIN ຫຼັງຈາກທີ່ລັອກໄວ້"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"ຕ້ອງໃສ່ລະຫັດຜ່ານຫຼັງຈາກທີ່ລັອກໄວ້"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"ຕ້ອງແຕ້ມຮູບແບບຫຼັງຈາກທີ່ລັອກໄວ້"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"ລະບົບຈະຕິດຕັ້ງການອັບເດດເມື່ອບໍ່ມີການນຳໃຊ້ອຸປະກອນ"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"ຕ້ອງເພີ່ມຄວາມປອດໄພ. ບໍ່ໄດ້ໃຊ້ PIN ມາໄລຍະໜຶ່ງແລ້ວ."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"ຕ້ອງເພີ່ມຄວາມປອດໄພ. ບໍ່ໄດ້ໃຊ້ລະຫັດຜ່ານມາໄລຍະໜຶ່ງແລ້ວ."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"ຕ້ອງເພີ່ມຄວາມປອດໄພ. ບໍ່ໄດ້ໃຊ້ຮູບແບບມາໄລຍະໜຶ່ງແລ້ວ."</string>
diff --git a/packages/SystemUI/res-keyguard/values-lt/strings.xml b/packages/SystemUI/res-keyguard/values-lt/strings.xml
index 59f0aa3..01e2f88 100644
--- a/packages/SystemUI/res-keyguard/values-lt/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-lt/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Po užrakinimo reikalingas PIN kodas"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Po užrakinimo reikalingas slaptažodis"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Po užrakinimo reikalingas atrakinimo piešinys"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Naujinys bus įdiegtas, kai įrenginys nebus naudojamas"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Reikalinga papildoma sauga. PIN kodas nebuvo naudojamas kurį laiką."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Reikalinga papildoma sauga. Slaptažodis nebuvo naudojamas kurį laiką."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Reikalinga papildoma sauga. Atrakinimo piešinys nebuvo naudojamas kurį laiką."</string>
diff --git a/packages/SystemUI/res-keyguard/values-lv/strings.xml b/packages/SystemUI/res-keyguard/values-lv/strings.xml
index ee9e8c2..2133694 100644
--- a/packages/SystemUI/res-keyguard/values-lv/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-lv/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Pēc bloķēšanas ir jāievada PIN"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Pēc bloķēšanas ir jāievada parole"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Pēc bloķēšanas ir jāzīmē kombinācija"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Atjauninājums tiks instalēts, kad ierīce netiks izmantota."</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Jāveic papildu drošības darbība. PIN ilgu laiku nav lietots."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Jāveic papildu drošības darbība. Parole ilgu laiku nav lietota."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Jāveic papildu drošības darbība. Kombinācija ilgu laiku nav lietota."</string>
diff --git a/packages/SystemUI/res-keyguard/values-mk/strings.xml b/packages/SystemUI/res-keyguard/values-mk/strings.xml
index a869d60..2771c7f 100644
--- a/packages/SystemUI/res-keyguard/values-mk/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-mk/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Потребен е PIN-код по заклучување"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Потребна е лозинка по заклучување"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Потребна е шема по заклучување"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Ажурирањето ќе се инсталира кога нема да се користи уредот"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Потребна е дополнителна безбедност. PIN-кодот не бил користен некое време."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Потребна е дополнителна безбедност. Лозинката не била користена некое време."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Потребна е дополнителна безбедност. Шемата не била користена некое време."</string>
diff --git a/packages/SystemUI/res-keyguard/values-ml/strings.xml b/packages/SystemUI/res-keyguard/values-ml/strings.xml
index e247cc7..02ee66f 100644
--- a/packages/SystemUI/res-keyguard/values-ml/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ml/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"ലോക്ക്ഡൗണിന് ശേഷം പിൻ നൽകേണ്ടതുണ്ട്"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"ലോക്ക്ഡൗണിന് ശേഷം പാസ്വേഡ് നൽകേണ്ടതുണ്ട്"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"ലോക്ക്ഡൗണിന് ശേഷം പാറ്റേൺ വരയ്ക്കേണ്ടതുണ്ട്"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"ഉപകരണം ഉപയോഗിക്കാതിരിക്കുമ്പോൾ അപ്ഡേറ്റ് ഇൻസ്റ്റാൾ ആകും"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"അധിക സുരക്ഷ വേണം. അൽപകാലം പിൻ ഉപയോഗിച്ചില്ല."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"അധിക സുരക്ഷ വേണം. അൽപകാലം പാസ്വേഡ് ഉപയോഗിച്ചില്ല."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"അധിക സുരക്ഷ വേണം. അൽപകാലം പാറ്റേൺ ഉപയോഗിച്ചില്ല."</string>
diff --git a/packages/SystemUI/res-keyguard/values-mn/strings.xml b/packages/SystemUI/res-keyguard/values-mn/strings.xml
index 7b555fb64..2b9f81e 100644
--- a/packages/SystemUI/res-keyguard/values-mn/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-mn/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Түгжсэний дараа ПИН шаардлагатай"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Түгжсэний дараа нууц үг шаардлагатай"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Түгжсэний дараа хээ шаардлагатай"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Төхөөрөмжийг ашиглаагүй үед шинэчлэлтийг суулгана"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Нэмэлт аюулгүй байдал шаардлагатай. ПИН-г хэсэг хугацаанд ашиглаагүй."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Нэмэлт аюулгүй байдал шаардлагатай. Нууц үгийг хэсэг хугацаанд ашиглаагүй."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Нэмэлт аюулгүй байдал шаардлагатай. Хээг хэсэг хугацаанд ашиглаагүй."</string>
diff --git a/packages/SystemUI/res-keyguard/values-mr/strings.xml b/packages/SystemUI/res-keyguard/values-mr/strings.xml
index ada2f11..7aa7bdd 100644
--- a/packages/SystemUI/res-keyguard/values-mr/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-mr/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"लॉकडाउननंतर पिन आवश्यक आहे"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"लॉकडाउननंतर पासवर्ड आवश्यक आहे"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"लॉकडाउननंतर पॅटर्न आवश्यक आहे"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"डिव्हाइस वापरात नसताना अपडेट इंस्टॉल केले जाईल"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"अतिरिक्त सुरक्षा आवश्यक आहे. काही वेळेसाठी पिन अनलॉक केला गेला नव्हता."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"अतिरिक्त सुरक्षा आवश्यक आहे. काही वेळेसाठी पासवर्ड अनलॉक केला गेला नव्हता."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"अतिरिक्त सुरक्षा आवश्यक आहे. काही वेळेसाठी पॅटर्न अनलॉक केला गेला नव्हता."</string>
diff --git a/packages/SystemUI/res-keyguard/values-ms/strings.xml b/packages/SystemUI/res-keyguard/values-ms/strings.xml
index 60c4531..bdfa4a7 100644
--- a/packages/SystemUI/res-keyguard/values-ms/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ms/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN diperlukan selepas kunci semua"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Kata laluan diperlukan selepas kunci semua"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Corak diperlukan selepas kunci semua"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Kemaskinian akan dipasang apabila peranti tidak digunakan"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Keselamatan tambahan diperlukan. PIN tidak digunakan."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Keselamatan tambahan diperlukan. Kata laluan tidak digunakan."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Keselamatan tambahan diperlukan. Corak tidak digunakan."</string>
diff --git a/packages/SystemUI/res-keyguard/values-my/strings.xml b/packages/SystemUI/res-keyguard/values-my/strings.xml
index 4092c9a..e85cf8a 100644
--- a/packages/SystemUI/res-keyguard/values-my/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-my/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"လော့ခ်ဒေါင်းလုပ်ပြီးနောက် ပင်နံပါတ်လိုအပ်သည်"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"လော့ခ်ဒေါင်းလုပ်ပြီးနောက် စကားဝှက်လိုအပ်သည်"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"လော့ခ်ဒေါင်းလုပ်ပြီးနောက် ပုံဖော်ခြင်းလိုအပ်သည်"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"စက်သုံးနေခြင်း မရှိချိန်တွင် အပ်ဒိတ် ထည့်သွင်းပါမည်"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"ထပ်ဆောင်းလုံခြုံရေး လိုအပ်သည်။ ပင်နံပါတ်မသုံးသည်မှာ အနည်းငယ်ကြာပြီ။"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"ထပ်ဆောင်းလုံခြုံရေး လိုအပ်သည်။ စကားဝှက်မသုံးသည်မှာ အနည်းငယ်ကြာပြီ။"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"ထပ်ဆောင်းလုံခြုံရေး လိုအပ်သည်။ ပုံဖော်ခြင်းမသုံးသည်မှာ အနည်းငယ်ကြာပြီ။"</string>
diff --git a/packages/SystemUI/res-keyguard/values-nb/strings.xml b/packages/SystemUI/res-keyguard/values-nb/strings.xml
index deb1421..455d086 100644
--- a/packages/SystemUI/res-keyguard/values-nb/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-nb/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN-koden kreves etter låsing"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Passordet kreves etter låsing"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Mønsteret kreves etter låsing"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Oppdateringen installeres når enheten ikke brukes"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Økt sikkerhet kreves. Har ikke brukt PIN-koden nylig"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Økt sikkerhet kreves. Har ikke brukt passordet nylig"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Økt sikkerhet kreves. Har ikke brukt mønsteret nylig"</string>
diff --git a/packages/SystemUI/res-keyguard/values-ne/strings.xml b/packages/SystemUI/res-keyguard/values-ne/strings.xml
index 4cc238d..f0094a3 100644
--- a/packages/SystemUI/res-keyguard/values-ne/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ne/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"लकडाउन गरेपछि PIN हाल्नु पर्ने हुन्छ"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"लकडाउन गरेपछि पासवर्ड हाल्नु पर्ने हुन्छ"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"लकडाउन गरेपछि प्याटर्न कोर्नु पर्ने हुन्छ"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"डिभाइस नचलाइएका बेला अपडेट इन्स्टल हुने छ"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"थप सुरक्षित बनाउनु पर्ने हुन्छ। केही समयदेखि PIN प्रयोग गरिएको छैन।"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"थप सुरक्षित बनाउनु पर्ने हुन्छ। केही समयदेखि पासवर्ड प्रयोग गरिएको छैन।"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"थप सुरक्षित बनाउनु पर्ने हुन्छ। केही समयदेखि प्याटर्न प्रयोग गरिएको छैन।"</string>
diff --git a/packages/SystemUI/res-keyguard/values-nl/strings.xml b/packages/SystemUI/res-keyguard/values-nl/strings.xml
index 60578fa..a236639 100644
--- a/packages/SystemUI/res-keyguard/values-nl/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-nl/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Na lockdown is de pincode vereist"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Na lockdown is het wachtwoord vereist"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Na lockdown is het patroon vereist"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Update wordt geïnstalleerd als het apparaat niet wordt gebruikt"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Extra beveiliging. Pincode is lang niet gebruikt."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Extra beveiliging. Wachtwoord is lang niet gebruikt."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Extra beveiliging. Patroon is lang niet gebruikt."</string>
diff --git a/packages/SystemUI/res-keyguard/values-or/strings.xml b/packages/SystemUI/res-keyguard/values-or/strings.xml
index 4baae48..b31c9c0 100644
--- a/packages/SystemUI/res-keyguard/values-or/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-or/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"ଲକଡାଉନ ହେବା ପରେ PIN ଆବଶ୍ୟକ"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"ଲକଡାଉନ ହେବା ପରେ ପାସୱାର୍ଡ ଆବଶ୍ୟକ"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"ଲକଡାଉନ ହେବା ପରେ ପାଟର୍ନ ଆବଶ୍ୟକ"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"ଡିଭାଇସ ବ୍ୟବହାର କରାଯାଉନଥିବା ବେଳେ ଅପଡେଟ ଇନଷ୍ଟଲ ହେବ"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"ଅତିରିକ୍ତ ସୁରକ୍ଷା ଆବଶ୍ୟକ। କିଛି ସମୟ ପାଇଁ PIN ବ୍ୟବହାର କରାଯାଇନାହିଁ।"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"ଅତିରିକ୍ତ ସୁରକ୍ଷା ଆବଶ୍ୟକ। କିଛି ସମୟ ପାଇଁ ପାସୱାର୍ଡ ବ୍ୟବହାର କରାଯାଇନାହିଁ।"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"ଅତିରିକ୍ତ ସୁରକ୍ଷା ଆବଶ୍ୟକ। କିଛି ସମୟ ପାଇଁ ପାଟର୍ନ ବ୍ୟବହାର କରାଯାଇନାହିଁ।"</string>
diff --git a/packages/SystemUI/res-keyguard/values-pa/strings.xml b/packages/SystemUI/res-keyguard/values-pa/strings.xml
index 2306832..209b63f 100644
--- a/packages/SystemUI/res-keyguard/values-pa/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-pa/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"ਲਾਕਡਾਊਨ ਤੋਂ ਬਾਅਦ ਪਿੰਨ ਦੀ ਲੋੜ ਹੁੰਦੀ ਹੈ"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"ਲਾਕਡਾਊਨ ਤੋਂ ਬਾਅਦ ਪਾਸਵਰਡ ਦੀ ਲੋੜ ਹੁੰਦੀ ਹੈ"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"ਲਾਕਡਾਊਨ ਤੋਂ ਬਾਅਦ ਪੈਟਰਨ ਦੀ ਲੋੜ ਹੁੰਦੀ ਹੈ"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"ਡੀਵਾਈਸ ਵਰਤੋਂ ਵਿੱਚ ਨਾ ਹੋਣ \'ਤੇ ਅੱਪਡੇਟ ਸਥਾਪਤ ਹੋ ਜਾਵੇਗਾ"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"ਵਾਧੂ ਸੁਰੱਖਿਆ ਦੀ ਲੋੜ ਹੈ। ਪਿੰਨ ਨੂੰ ਕੁਝ ਸਮੇਂ ਲਈ ਵਰਤਿਆ ਨਹੀਂ ਗਿਆ।"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"ਵਾਧੂ ਸੁਰੱਖਿਆ ਦੀ ਲੋੜ ਹੈ। ਪਾਸਵਰਡ ਨੂੰ ਕੁਝ ਸਮੇਂ ਲਈ ਵਰਤਿਆ ਨਹੀਂ ਗਿਆ।"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"ਵਾਧੂ ਸੁਰੱਖਿਆ ਦੀ ਲੋੜ ਹੈ। ਪੈਟਰਨ ਨੂੰ ਕੁਝ ਸਮੇਂ ਲਈ ਵਰਤਿਆ ਨਹੀਂ ਗਿਆ।"</string>
diff --git a/packages/SystemUI/res-keyguard/values-pl/strings.xml b/packages/SystemUI/res-keyguard/values-pl/strings.xml
index f30d2cf..7ec988e 100644
--- a/packages/SystemUI/res-keyguard/values-pl/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-pl/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Po zablokowaniu wymagany jest kod PIN"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Po zablokowaniu wymagane jest hasło"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Po zablokowaniu wymagany jest wzór"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Instalacja aktualizacji nastąpi, gdy urządzenie nie będzie w użyciu"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Wzmocnij ochronę. Od dawna nie używano kodu PIN."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Wzmocnij ochronę. Od dawna nie używano hasła."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Wzmocnij ochronę. Od dawna nie używano wzoru."</string>
diff --git a/packages/SystemUI/res-keyguard/values-pt-rBR/strings.xml b/packages/SystemUI/res-keyguard/values-pt-rBR/strings.xml
index e9b21ed..78a8091 100644
--- a/packages/SystemUI/res-keyguard/values-pt-rBR/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-pt-rBR/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"O PIN é obrigatório após o Bloqueio total"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"A senha é obrigatória após o Bloqueio total"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"O padrão é obrigatório após o Bloqueio total"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"A atualização será instalada quando o dispositivo não estiver em uso"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Segurança necessária. PIN não usado há um tempo."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Segurança necessária. Senha não usada há um tempo."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Segurança necessária. Padrão não usado há um tempo."</string>
diff --git a/packages/SystemUI/res-keyguard/values-pt-rPT/strings.xml b/packages/SystemUI/res-keyguard/values-pt-rPT/strings.xml
index b10f313..2dc7d27 100644
--- a/packages/SystemUI/res-keyguard/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-pt-rPT/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"O PIN é necessário após o bloqueio"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"A palavra-passe é necessária após o bloqueio"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"O padrão é necessário após o bloqueio"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"A atualização é instalada quando o dispositivo não estiver a ser usado"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Mais segurança necessária. PIN não usado há muito."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Mais segurança necessária. Não usada há muito."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"+ segurança necessária. Padrão não usado há muito."</string>
diff --git a/packages/SystemUI/res-keyguard/values-pt/strings.xml b/packages/SystemUI/res-keyguard/values-pt/strings.xml
index e9b21ed..78a8091 100644
--- a/packages/SystemUI/res-keyguard/values-pt/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-pt/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"O PIN é obrigatório após o Bloqueio total"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"A senha é obrigatória após o Bloqueio total"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"O padrão é obrigatório após o Bloqueio total"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"A atualização será instalada quando o dispositivo não estiver em uso"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Segurança necessária. PIN não usado há um tempo."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Segurança necessária. Senha não usada há um tempo."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Segurança necessária. Padrão não usado há um tempo."</string>
diff --git a/packages/SystemUI/res-keyguard/values-ro/strings.xml b/packages/SystemUI/res-keyguard/values-ro/strings.xml
index 3799ce7..e5be788 100644
--- a/packages/SystemUI/res-keyguard/values-ro/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ro/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Codul PIN este solicitat după blocarea strictă"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Parola este solicitată după blocarea strictă"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Modelul este solicitat după blocarea strictă"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Actualizarea se va instala când dispozitivul nu este folosit"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Mai multă securitate necesară. PIN-ul nu a fost folosit de ceva timp."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Mai multă securitate necesară. Parola nu a fost folosită de ceva timp."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Mai multă securitate necesară. Modelul nu a fost folosit de ceva timp."</string>
diff --git a/packages/SystemUI/res-keyguard/values-ru/strings.xml b/packages/SystemUI/res-keyguard/values-ru/strings.xml
index 184b28d..45149a5 100644
--- a/packages/SystemUI/res-keyguard/values-ru/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ru/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"После блокировки необходимо ввести PIN-код."</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"После блокировки необходимо ввести пароль."</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"После блокировки необходимо ввести графический ключ."</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Обновление будет установлено, когда устройство не используется."</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"PIN-код давно не использовался. Усильте защиту."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Пароль давно не использовался. Усильте защиту."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Граф. ключ давно не использовался. Усильте защиту."</string>
diff --git a/packages/SystemUI/res-keyguard/values-si/strings.xml b/packages/SystemUI/res-keyguard/values-si/strings.xml
index a484119..17ced75 100644
--- a/packages/SystemUI/res-keyguard/values-si/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-si/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"අගුළු දැමීමෙන් පසු PIN අවශ්ය වේ"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"අගුළු දැමීමෙන් පසු මුරපදය අවශ්ය වේ"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"අගුළු දැමීමෙන් පසු රටාව අවශ්ය වේ"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"උපාංගය භාවිතයේ නොමැති විට යාවත්කාලීනය ස්ථාපනය වනු ඇත"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"අමතර ආරක්ෂාවක් අවශ්යයි. PIN ටික කලකට භාවිතා කර නැත."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"අමතර ආරක්ෂාවක් අවශ්යයි. මුරපදය ටික කලකට භාවිතා කර නැත."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"අමතර ආරක්ෂාවක් අවශ්යයි. රටාව ටික කලකට භාවිතා කර නැත."</string>
diff --git a/packages/SystemUI/res-keyguard/values-sk/strings.xml b/packages/SystemUI/res-keyguard/values-sk/strings.xml
index 4730273..ef08a6c 100644
--- a/packages/SystemUI/res-keyguard/values-sk/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-sk/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Po silnej zámke sa vyžaduje PIN"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Po silnej zámke sa vyžaduje heslo"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Po silnej zámke sa vyžaduje vzor"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Aktualizácia sa nainštaluje, keď zariadenie nebudete používať"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Treba lepšie zabezp. Kód PIN nebol dlhšie použitý."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Treba lepšie zabezp. Heslo nebolo dlhšie použité."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Treba lepšie zabezp. Vzor nebol dlhšie použitý."</string>
diff --git a/packages/SystemUI/res-keyguard/values-sl/strings.xml b/packages/SystemUI/res-keyguard/values-sl/strings.xml
index bddb9ad..a42989c 100644
--- a/packages/SystemUI/res-keyguard/values-sl/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-sl/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Po zaklepu se zahteva vnos kode PIN"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Po zaklepu se zahteva vnos gesla"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Po zaklepu se zahteva vnos vzorca"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Posodobitev bo nameščena, ko naprava ne bo v uporabi"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Zahtevana je dodatna varnost. Koda PIN nekaj časa ni bila uporabljena."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Zahtevana je dodatna varnost. Geslo nekaj časa ni bilo uporabljeno."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Zahtevana je dodatna varnost. Vzorec nekaj časa ni bil uporabljen."</string>
diff --git a/packages/SystemUI/res-keyguard/values-sq/strings.xml b/packages/SystemUI/res-keyguard/values-sq/strings.xml
index 1739119..84f7bb5 100644
--- a/packages/SystemUI/res-keyguard/values-sq/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-sq/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Pas bllokimit kërkohet kodi PIN"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Pas bllokimit kërkohet fjalëkalimi"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Pas bllokimit kërkohet motivi"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Përditësimi do të instalohet kur pajisja të mos përdoret"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Kërkohet një siguri më e lartë. Kodi PIN nuk është përdorur për njëfarë kohe."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Kërkohet një siguri më e lartë. Fjalëkalimi nuk është përdorur për njëfarë kohe."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Kërkohet një siguri më e lartë. Motivi nuk është përdorur për njëfarë kohe."</string>
diff --git a/packages/SystemUI/res-keyguard/values-sr/strings.xml b/packages/SystemUI/res-keyguard/values-sr/strings.xml
index b8c4b55..437018d 100644
--- a/packages/SystemUI/res-keyguard/values-sr/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-sr/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN је обавезан после закључавања"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Лозинка је обавезна после закључавања"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Шаблон је обавезан после закључавања"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Ажурирање ће се инсталирати када се уређај не користи"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Потребна је додатна заштита. PIN дуго није коришћен."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Потребна је додатна заштита. Лозинка дуго није коришћена."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Потребна је додатна заштита. Шаблон дуго није коришћен."</string>
diff --git a/packages/SystemUI/res-keyguard/values-sv/strings.xml b/packages/SystemUI/res-keyguard/values-sv/strings.xml
index bec1771..b4b1996 100644
--- a/packages/SystemUI/res-keyguard/values-sv/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-sv/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Pinkod krävs efter låsning"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Lösenord krävs efter låsning"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Mönster krävs efter låsning"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Uppdateringen installeras när enheten inte används"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Ökad säkerhet krävs. Pinkoden har inte använts på länge."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Ökad säkerhet krävs. Lösenordet har inte använts på länge."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Ökad säkerhet krävs. Mönstret har inte använts på länge."</string>
diff --git a/packages/SystemUI/res-keyguard/values-sw/strings.xml b/packages/SystemUI/res-keyguard/values-sw/strings.xml
index c6a8ed5..8ca9046 100644
--- a/packages/SystemUI/res-keyguard/values-sw/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-sw/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"PIN inahitajika baada ya kufunga"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Nenosiri linahitajika baada ya kufunga"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Mchoro unahitajika baada ya kufunga"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Sasisho litasakinishwa wakati hutumii kifaa"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Usalama wa ziada unahitajika. PIN haikutumika kwa muda."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Usalama wa ziada unahitajika. Nenosiri halikutumika kwa muda."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Usalama wa ziada unahitajika. Mchoro haukutumika kwa muda."</string>
diff --git a/packages/SystemUI/res-keyguard/values-ta/strings.xml b/packages/SystemUI/res-keyguard/values-ta/strings.xml
index 147b36b..7671194 100644
--- a/packages/SystemUI/res-keyguard/values-ta/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ta/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"முழுப் பூட்டு காரணமாகப் பின் தேவை"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"முழுப் பூட்டு காரணமாகக் கடவுச்சொல் தேவை"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"முழுப் பூட்டு காரணமாகப் பேட்டர்ன் தேவை"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"சாதனம் உபயோகத்தில் இல்லாதபோது புதுப்பிப்பு நிறுவப்படும்"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"சேர்த்த பாதுகாப்பு தேவை. பின் உபயோகிக்கவில்லை."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"சேர்த்த பாதுகாப்பு தேவை. கடவுச்சொல் உபயோகிக்கவில்லை."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"சேர்த்த பாதுகாப்பு தேவை. பேட்டர்ன் உபயோகிக்கவில்லை."</string>
diff --git a/packages/SystemUI/res-keyguard/values-te/strings.xml b/packages/SystemUI/res-keyguard/values-te/strings.xml
index 317fb30..623b589 100644
--- a/packages/SystemUI/res-keyguard/values-te/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-te/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"లాక్డౌన్ తర్వాత PIN అవసరం"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"లాక్డౌన్ తర్వాత పాస్వర్డ్ అవసరం"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"లాక్డౌన్ తర్వాత ఆకృతి అవసరం"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"పరికరం ఉపయోగంలో లేనప్పుడు అప్డేట్ ఇన్స్టాల్ చేయబడుతుంది"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"మరింత సెక్యూరిటీ యాడ్ చెయ్యాలి. PINని ఈమధ్య వాడలేదు."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"యాడెడ్ సెక్యూరిటీ కావాలి. పాస్వర్డ్ ఈ మధ్య వాడలేదు."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"మరింత సెక్యూరిటీ కావాలి. ఆకృతిని ఈ మధ్య వాడలేదు."</string>
diff --git a/packages/SystemUI/res-keyguard/values-th/strings.xml b/packages/SystemUI/res-keyguard/values-th/strings.xml
index 85a14fa..c244107 100644
--- a/packages/SystemUI/res-keyguard/values-th/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-th/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"ต้องป้อน PIN หลังจากการปิดล็อก"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"ต้องป้อนรหัสผ่านหลังจากการปิดล็อก"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"ต้องวาดรูปแบบหลังจากการปิดล็อก"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"ระบบจะติดตั้งการอัปเดตเมื่อไม่มีการใช้งานอุปกรณ์"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"ต้องเพิ่มความปลอดภัย ไม่ได้ใช้ PIN มาระยะหนึ่ง"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"ต้องเพิ่มความปลอดภัย ไม่ได้ใช้รหัสผ่านมาระยะหนึ่ง"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"ต้องเพิ่มความปลอดภัย ไม่ได้ใช้รูปแบบมาระยะหนึ่ง"</string>
diff --git a/packages/SystemUI/res-keyguard/values-tl/strings.xml b/packages/SystemUI/res-keyguard/values-tl/strings.xml
index 1e51e0b..cd8f810 100644
--- a/packages/SystemUI/res-keyguard/values-tl/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-tl/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Kailangan ang PIN pagkatapos ng lockdown"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Kailangan ang password pagkatapos ng lockdown"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Kailangan ang pattern pagkatapos ng lockdown"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Ii-install ang update kapag hindi ginagamit ang device"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Kailangan pa ng seguridad. Matagal na hindi ginamit ang PIN."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Kailangan pa ng seguridad. Matagal na hindi ginamit ang password."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Kailangan pa ng seguridad. Matagal na hindi ginamit ang pattern."</string>
diff --git a/packages/SystemUI/res-keyguard/values-tr/strings.xml b/packages/SystemUI/res-keyguard/values-tr/strings.xml
index 05a9c95..ddeba67 100644
--- a/packages/SystemUI/res-keyguard/values-tr/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-tr/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Tam kilitlemenin ardından PIN gerekli"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Tam kilitlemenin ardından şifre gerekli"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Tam kilitlemenin ardından desen gerekli"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Güncelleme, cihazın kullanılmadığı bir sırada yüklenecek"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Daha fazla güvenlik gerekli. PIN bir süredir kullanılmamış."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Daha fazla güvenlik gerekli. Şifre bir süredir kullanılmamış."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Daha fazla güvenlik gerekli. Desen bir süredir kullanılmamış."</string>
diff --git a/packages/SystemUI/res-keyguard/values-uk/strings.xml b/packages/SystemUI/res-keyguard/values-uk/strings.xml
index 1c3c3ca..f06d17d 100644
--- a/packages/SystemUI/res-keyguard/values-uk/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-uk/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Після блокування входу потрібно ввести PIN-код"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Після блокування входу потрібно ввести пароль"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Після блокування входу потрібно намалювати ключ"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Оновлення встановиться, коли пристрій не використовуватиметься"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Потрібен додатковий захист. PIN-код довго не використовувався."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Потрібен додатковий захист. Пароль довго не використовувався."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Потрібен додатковий захист. Ключ довго не використовувався."</string>
diff --git a/packages/SystemUI/res-keyguard/values-ur/strings.xml b/packages/SystemUI/res-keyguard/values-ur/strings.xml
index 7784766..8adbaca 100644
--- a/packages/SystemUI/res-keyguard/values-ur/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-ur/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"لاک ڈاؤن کے بعد PIN کی ضرورت ہوتی ہے"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"لاک ڈاؤن کے بعد پاس ورڈ کی ضرورت ہوتی ہے"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"لاک ڈاؤن کے بعد پیٹرن کی ضرورت ہوتی ہے"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"آلہ استعمال میں نہ ہونے پر اپ ڈیٹ انسٹال ہو جائے گی"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"مزید سیکیورٹی چاہیے۔ PIN کچھ عرصے اسے استعمال نہیں ہوا ہے۔"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"مزید سیکیورٹی چاہیے۔ پاس ورڈ کچھ عرصے سے استعمال نہیں ہوا ہے۔"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"مزید سیکیورٹی چاہیے۔ پیٹرن کچھ عرصے سے استعمال نہیں ہوا ہے۔"</string>
diff --git a/packages/SystemUI/res-keyguard/values-uz/strings.xml b/packages/SystemUI/res-keyguard/values-uz/strings.xml
index 28d18da..96dfa05 100644
--- a/packages/SystemUI/res-keyguard/values-uz/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-uz/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Bloklangandan keyin PIN kodni kiritish kerak"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Bloklangandan keyin parolni kiritish kerak"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Bloklangandan keyin grafik kalitni chizish kerak"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Yangilanish qurilma ishlatilmaganda oʻrnatiladi"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Xavfsizlikni oshiring. PIN kod ancha vaqt ishlatilmadi."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Xavfsizlikni oshiring. Parol ancha vaqt ishlatilmadi."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Xavfsizlikni oshiring. Grafik kalit ancha vaqt chizilmadi"</string>
diff --git a/packages/SystemUI/res-keyguard/values-vi/strings.xml b/packages/SystemUI/res-keyguard/values-vi/strings.xml
index 726a9e7..94d4fe2 100644
--- a/packages/SystemUI/res-keyguard/values-vi/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-vi/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Cần nhập mã PIN sau khi hết thời gian khoá"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Cần nhập mật khẩu sau khi hết thời gian khoá"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Cần vẽ hình mở khoá sau khi hết thời gian khoá"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Bản cập nhật sẽ được cài đặt khi bạn không sử dụng thiết bị"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Cần tăng cường bảo mật. Đã lâu chưa dùng mã PIN."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Cần tăng cường bảo mật. Đã lâu chưa dùng mật khẩu"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Cần tăng cường bảo mật. Đã lâu chưa dùng hình mở khoá."</string>
diff --git a/packages/SystemUI/res-keyguard/values-zh-rCN/strings.xml b/packages/SystemUI/res-keyguard/values-zh-rCN/strings.xml
index 0efe3bf..59261a3 100644
--- a/packages/SystemUI/res-keyguard/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-zh-rCN/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"一旦设备被锁定,必须输入 PIN 码才能解锁"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"一旦设备被锁定,必须输入密码才能解锁"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"一旦设备被锁定,必须绘制图案才能解锁"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"更新会在设备处于未使用状态时安装"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"需要锁定设备以提高安全性。已有一段时间未使用 PIN 码了。"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"需要锁定设备以提高安全性。已有一段时间未使用密码了。"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"需要锁定设备以提高安全性。已有一段时间未使用图案了。"</string>
diff --git a/packages/SystemUI/res-keyguard/values-zh-rHK/strings.xml b/packages/SystemUI/res-keyguard/values-zh-rHK/strings.xml
index 58c3034..dad6f31 100644
--- a/packages/SystemUI/res-keyguard/values-zh-rHK/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-zh-rHK/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"需要輸入 PIN 才能解除鎖定"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"需要輸入密碼解才能解除鎖定"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"需要畫出解鎖圖案才能解除鎖定"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"系統會在裝置未使用時安裝更新"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"需要加強安全設定:已有一段時間沒有使用 PIN。"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"需要加強安全設定:已有一段時間沒有使用密碼。"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"需要加強安全設定:已有一段時間沒有使用解鎖圖案。"</string>
diff --git a/packages/SystemUI/res-keyguard/values-zh-rTW/strings.xml b/packages/SystemUI/res-keyguard/values-zh-rTW/strings.xml
index 35e7824..88b7e43 100644
--- a/packages/SystemUI/res-keyguard/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-zh-rTW/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"裝置鎖定後,必須輸入 PIN 碼才能解鎖"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"裝置鎖定後,必須輸入密碼才能解鎖"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"裝置鎖定後,必須畫出解鎖圖案才能解鎖"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"系統會在裝置處於未使用狀態時安裝更新"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"裝置已有一段時間未鎖定,請使用 PIN 碼鎖定裝置以策安全。"</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"裝置已有一段時間未鎖定,請使用密碼鎖定裝置以策安全。"</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"裝置已有一段時間未鎖定,請使用解鎖圖案鎖定裝置以策安全。"</string>
diff --git a/packages/SystemUI/res-keyguard/values-zu/strings.xml b/packages/SystemUI/res-keyguard/values-zu/strings.xml
index e229c7e..c5e99ab 100644
--- a/packages/SystemUI/res-keyguard/values-zu/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-zu/strings.xml
@@ -76,8 +76,7 @@
<string name="kg_prompt_after_user_lockdown_pin" msgid="5374732179740050373">"Iphinikhodi iyadingeka ngemva kokukhiya"</string>
<string name="kg_prompt_after_user_lockdown_password" msgid="9097968458291129795">"Iphasiwedi iyadingeka ngemuva kokukhiya"</string>
<string name="kg_prompt_after_user_lockdown_pattern" msgid="215072203613597906">"Iphethini iyadingeka ngemva kokukhiya"</string>
- <!-- no translation found for kg_prompt_unattended_update (4366635751738712452) -->
- <skip />
+ <string name="kg_prompt_unattended_update" msgid="4366635751738712452">"Isibuyekezo sizofakwa lapho idivayisi ingasetshenziswa"</string>
<string name="kg_prompt_pin_auth_timeout" msgid="5868644725126275245">"Ukuphepha okwengeziwe kuyadingeka. Iphinikhodi ayisetshenziswanga isikhathi eside."</string>
<string name="kg_prompt_password_auth_timeout" msgid="5809110458491920871">"Ukuphepha okwengeziwe kuyadingeka. Iphasiwedi ayisetshenziswanga isikhathi eside."</string>
<string name="kg_prompt_pattern_auth_timeout" msgid="1860605401869262178">"Ukuphepha okwengeziwe kuyadingeka. Iphethini ayisetshenziswanga isikhathi eside."</string>
diff --git a/packages/SystemUI/res-product/values-zh-rCN/strings.xml b/packages/SystemUI/res-product/values-zh-rCN/strings.xml
index 6895219..de308ddb 100644
--- a/packages/SystemUI/res-product/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res-product/values-zh-rCN/strings.xml
@@ -38,8 +38,8 @@
<string name="kg_failed_attempts_almost_at_erase_profile" product="default" msgid="3280816298678433681">"您尝试解锁手机后失败的次数已达 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统将移除此工作资料,而这将删除所有的工作资料数据。"</string>
<string name="kg_failed_attempts_now_erasing_profile" product="tablet" msgid="4417100487251371559">"您尝试解锁平板电脑后失败的次数已达 <xliff:g id="NUMBER">%d</xliff:g> 次。系统将移除此工作资料,而这将删除所有的工作资料数据。"</string>
<string name="kg_failed_attempts_now_erasing_profile" product="default" msgid="4682221342671290678">"您尝试解锁手机后失败的次数已达 <xliff:g id="NUMBER">%d</xliff:g> 次。系统将移除此工作资料,而这将删除所有的工作资料数据。"</string>
- <string name="kg_failed_attempts_almost_at_login" product="tablet" msgid="1860049973474855672">"您已 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次画错解锁图案。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您使用自己的电子邮件帐号解锁平板电脑。\n\n请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
- <string name="kg_failed_attempts_almost_at_login" product="default" msgid="44112553371516141">"您已 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次画错解锁图案。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您使用自己的电子邮件帐号解锁手机。\n\n请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
+ <string name="kg_failed_attempts_almost_at_login" product="tablet" msgid="1860049973474855672">"您已 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次画错解锁图案。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您使用自己的电子邮件账号解锁平板电脑。\n\n请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
+ <string name="kg_failed_attempts_almost_at_login" product="default" msgid="44112553371516141">"您已 <xliff:g id="NUMBER_0">%1$d</xliff:g> 次画错解锁图案。如果再尝试 <xliff:g id="NUMBER_1">%2$d</xliff:g> 次后仍不成功,系统就会要求您使用自己的电子邮件账号解锁手机。\n\n请在 <xliff:g id="NUMBER_2">%3$d</xliff:g> 秒后重试。"</string>
<string name="thermal_shutdown_title" product="default" msgid="8039593017174903505">"手机先前因过热而关机"</string>
<string name="thermal_shutdown_title" product="device" msgid="2954206342842856379">"设备先前因过热而关机"</string>
<string name="thermal_shutdown_title" product="tablet" msgid="8941033526856177533">"平板电脑先前因过热而关机"</string>
diff --git a/packages/SystemUI/res/drawable-television/ic_volume_media.xml b/packages/SystemUI/res/drawable-television/ic_volume_media.xml
deleted file mode 100644
index 6a368d5..0000000
--- a/packages/SystemUI/res/drawable-television/ic_volume_media.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License
- -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="@dimen/tv_volume_icons_size"
- android:height="@dimen/tv_volume_icons_size"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <path
- android:fillColor="@color/tv_volume_dialog_accent"
- android:pathData="M3,9v6h4l5,5L12,4L7,9L3,9zM10,8.83v6.34L7.83,13L5,13v-2h2.83L10,8.83zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,3.23v2.06c2.89,0.86 5,3.54 5,6.71s-2.11,5.85 -5,6.71v2.06c4.01,-0.91 7,-4.49 7,-8.77 0,-4.28 -2.99,-7.86 -7,-8.77z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable-television/ic_volume_media_low.xml b/packages/SystemUI/res/drawable-television/ic_volume_media_low.xml
deleted file mode 100644
index 6eb944f..0000000
--- a/packages/SystemUI/res/drawable-television/ic_volume_media_low.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License
- -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="@dimen/tv_volume_icons_size"
- android:height="@dimen/tv_volume_icons_size"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <group android:translateX="-2">
- <path
- android:fillColor="@color/tv_volume_dialog_accent"
- android:pathData="M16,7.97v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02 0,-1.77 -1.02,-3.29 -2.5,-4.03zM5,9v6h4l5,5L14,4L9,9L5,9zM12,8.83v6.34L9.83,13L7,13v-2h2.83L12,8.83z"/>
- </group>
-</vector>
diff --git a/packages/SystemUI/res/drawable-television/ic_volume_media_mute.xml b/packages/SystemUI/res/drawable-television/ic_volume_media_mute.xml
deleted file mode 100644
index b683089..0000000
--- a/packages/SystemUI/res/drawable-television/ic_volume_media_mute.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License
- -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="@dimen/tv_volume_icons_size"
- android:height="@dimen/tv_volume_icons_size"
- android:viewportWidth="24.0"
- android:viewportHeight="24.0">
- <group android:translateX="-4">
- <path
- android:fillColor="@color/tv_volume_dialog_accent"
- android:pathData="M14,8.83v6.34L11.83,13H9v-2h2.83L14,8.83M16,4l-5,5H7v6h4l5,5V4z"/>
- </group>
-</vector>
diff --git a/packages/SystemUI/res/drawable-television/ic_volume_media_off.xml b/packages/SystemUI/res/drawable-television/ic_volume_media_off.xml
deleted file mode 100644
index 7a44aa6..0000000
--- a/packages/SystemUI/res/drawable-television/ic_volume_media_off.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2020 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License
- -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="@dimen/tv_volume_icons_size"
- android:height="@dimen/tv_volume_icons_size"
- android:viewportHeight="24"
- android:viewportWidth="24">
- <path
- android:fillColor="@color/tv_volume_dialog_accent"
- android:pathData="M4.34,2.93L2.93,4.34 7.29,8.7 7,9L3,9v6h4l5,5v-6.59l4.18,4.18c-0.65,0.49 -1.38,0.88 -2.18,1.11v2.06c1.34,-0.3 2.57,-0.92 3.61,-1.75l2.05,2.05 1.41,-1.41L4.34,2.93zM10,15.17L7.83,13L5,13v-2h2.83l0.88,-0.88L10,11.41v3.76zM19,12c0,0.82 -0.15,1.61 -0.41,2.34l1.53,1.53c0.56,-1.17 0.88,-2.48 0.88,-3.87 0,-4.28 -2.99,-7.86 -7,-8.77v2.06c2.89,0.86 5,3.54 5,6.71zM12,4l-1.88,1.88L12,7.76zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v1.79l2.48,2.48c0.01,-0.08 0.02,-0.16 0.02,-0.24z"/>
-</vector>
diff --git a/packages/SystemUI/res/drawable-television/volume_row_seekbar.xml b/packages/SystemUI/res/drawable-television/volume_row_seekbar.xml
deleted file mode 100644
index e49fc15..0000000
--- a/packages/SystemUI/res/drawable-television/volume_row_seekbar.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2021 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
- android:paddingMode="stack">
- <item android:id="@android:id/background"
- android:gravity="center_vertical|fill_horizontal">
- <layer-list>
- <item android:id="@+id/volume_seekbar_background_solid">
- <shape>
- <size android:height="@dimen/volume_dialog_slider_width" />
- <solid android:color="@color/tv_volume_dialog_seek_bar_background"/>
- <corners android:radius="@dimen/volume_dialog_slider_corner_radius" />
- </shape>
- </item>
- </layer-list>
- </item>
- <item android:id="@android:id/progress"
- android:gravity="center_vertical|fill_horizontal">
- <com.android.systemui.util.RoundedCornerProgressDrawable
- android:drawable="@drawable/volume_row_seekbar_progress"
- />
- </item>
-</layer-list>
diff --git a/packages/SystemUI/res/drawable-television/volume_row_seekbar_progress.xml b/packages/SystemUI/res/drawable-television/volume_row_seekbar_progress.xml
deleted file mode 100644
index bce193a..0000000
--- a/packages/SystemUI/res/drawable-television/volume_row_seekbar_progress.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2021 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<!-- Progress drawable for volume row SeekBars. This is the accent-colored round rect that moves up
- and down as the progress value changes. -->
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
- android:autoMirrored="true">
- <item android:id="@+id/volume_seekbar_progress_solid">
- <shape android:shape="rectangle">
- <size android:height="@dimen/volume_dialog_slider_width"/>
- <solid android:color="@color/tv_volume_dialog_seek_bar_fill" />
- <corners android:radius="@dimen/volume_dialog_slider_width" />
- </shape>
- </item>
-</layer-list>
diff --git a/packages/SystemUI/res/drawable/auth_credential_emergency_button_background.xml b/packages/SystemUI/res/drawable/auth_credential_emergency_button_background.xml
new file mode 100644
index 0000000..85450b4
--- /dev/null
+++ b/packages/SystemUI/res/drawable/auth_credential_emergency_button_background.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+<inset xmlns:android="http://schemas.android.com/apk/res/android">
+ <shape android:shape="rectangle">
+ <corners android:radius="25dp"/>
+ <solid android:color="@android:color/system_accent3_100" />
+ </shape>
+</inset>
diff --git a/packages/SystemUI/res/drawable/stat_sys_ringer_silent.xml b/packages/SystemUI/res/drawable/stat_sys_ringer_silent.xml
index 4a9d41f..b83f15a 100644
--- a/packages/SystemUI/res/drawable/stat_sys_ringer_silent.xml
+++ b/packages/SystemUI/res/drawable/stat_sys_ringer_silent.xml
@@ -14,6 +14,4 @@
limitations under the License.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:insetLeft="3dp"
- android:insetRight="3dp"
android:drawable="@drawable/ic_speaker_mute" />
diff --git a/packages/SystemUI/res/layout-land/auth_credential_password_pin_content_view.xml b/packages/SystemUI/res/layout-land/auth_credential_password_pin_content_view.xml
new file mode 100644
index 0000000..24222f7
--- /dev/null
+++ b/packages/SystemUI/res/layout-land/auth_credential_password_pin_content_view.xml
@@ -0,0 +1,101 @@
+<!--
+ ~ Copyright (C) 2019 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <RelativeLayout
+ android:id="@+id/auth_credential_header"
+ style="?headerStyle"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1">
+
+ <ImageView
+ android:id="@+id/icon"
+ style="?headerIconStyle"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:contentDescription="@null"/>
+
+ <TextView
+ android:id="@+id/title"
+ style="?titleTextAppearance"
+ android:layout_below="@id/icon"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+
+ <TextView
+ android:id="@+id/subtitle"
+ style="?subTitleTextAppearance"
+ android:layout_below="@id/title"
+ android:layout_alignParentLeft="true"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+
+ <TextView
+ android:id="@+id/description"
+ style="?descriptionTextAppearance"
+ android:layout_below="@id/subtitle"
+ android:layout_alignParentLeft="true"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+
+ </RelativeLayout>
+
+ <FrameLayout
+ android:id="@+id/auth_credential_input"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:orientation="vertical">
+
+ <ImeAwareEditText
+ android:id="@+id/lockPassword"
+ style="?passwordTextAppearance"
+ android:layout_width="208dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
+ android:inputType="textPassword"
+ android:minHeight="48dp"/>
+
+ <TextView
+ android:id="@+id/error"
+ style="?errorTextAppearance"
+ android:layout_gravity="center_horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+ </LinearLayout>
+
+ <Button
+ android:id="@+id/emergencyCallButton"
+ style="@style/AuthCredentialEmergencyButtonStyle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ android:layout_gravity="center_horizontal|bottom"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="12dp"
+ android:text="@string/work_challenge_emergency_button_text"/>
+ </FrameLayout>
+
+</merge>
diff --git a/packages/SystemUI/res/layout-land/auth_credential_password_view.xml b/packages/SystemUI/res/layout-land/auth_credential_password_view.xml
index e2ce34f..8ac7583 100644
--- a/packages/SystemUI/res/layout-land/auth_credential_password_view.xml
+++ b/packages/SystemUI/res/layout-land/auth_credential_password_view.xml
@@ -23,67 +23,6 @@
android:elevation="@dimen/biometric_dialog_elevation"
android:theme="?app:attr/lockPinPasswordStyle">
- <RelativeLayout
- android:id="@+id/auth_credential_header"
- style="?headerStyle"
- android:layout_width="wrap_content"
- android:layout_height="match_parent">
-
- <ImageView
- android:id="@+id/icon"
- style="?headerIconStyle"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:contentDescription="@null"/>
-
- <TextView
- android:id="@+id/title"
- style="?titleTextAppearance"
- android:layout_below="@id/icon"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
-
- <TextView
- android:id="@+id/subtitle"
- style="?subTitleTextAppearance"
- android:layout_below="@id/title"
- android:layout_alignParentLeft="true"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
-
- <TextView
- android:id="@+id/description"
- style="?descriptionTextAppearance"
- android:layout_below="@id/subtitle"
- android:layout_alignParentLeft="true"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
-
- </RelativeLayout>
-
- <LinearLayout
- android:id="@+id/auth_credential_input"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <ImeAwareEditText
- android:id="@+id/lockPassword"
- style="?passwordTextAppearance"
- android:layout_width="208dp"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
- android:inputType="textPassword"
- android:minHeight="48dp" />
-
- <TextView
- android:id="@+id/error"
- style="?errorTextAppearance"
- android:layout_gravity="center"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
-
- </LinearLayout>
+ <include layout="@layout/auth_credential_password_pin_content_view" />
</com.android.systemui.biometrics.ui.CredentialPasswordView>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout-land/auth_credential_pattern_view.xml b/packages/SystemUI/res/layout-land/auth_credential_pattern_view.xml
index 88f138f..d5af377 100644
--- a/packages/SystemUI/res/layout-land/auth_credential_pattern_view.xml
+++ b/packages/SystemUI/res/layout-land/auth_credential_pattern_view.xml
@@ -60,27 +60,44 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
+ <TextView
+ android:id="@+id/error"
+ style="?errorTextAppearanceLand"
+ android:layout_below="@id/description"
+ android:layout_alignParentLeft="true"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+
</RelativeLayout>
- <FrameLayout
+ <RelativeLayout
android:layout_weight="1"
- style="?containerStyle"
android:layout_width="0dp"
android:layout_height="match_parent">
- <com.android.internal.widget.LockPatternView
- android:id="@+id/lockPattern"
- android:layout_gravity="center"
- android:layout_width="@dimen/biometric_auth_pattern_view_size"
- android:layout_height="@dimen/biometric_auth_pattern_view_size"/>
-
- <TextView
- android:id="@+id/error"
- style="?errorTextAppearance"
+ <FrameLayout
+ style="?containerStyle"
+ android:layout_above="@id/emergencyCallButton"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal|bottom"/>
+ android:layout_height="match_parent">
- </FrameLayout>
+ <com.android.internal.widget.LockPatternView
+ android:id="@+id/lockPattern"
+ android:layout_gravity="center"
+ android:layout_width="@dimen/biometric_auth_pattern_view_size"
+ android:layout_height="@dimen/biometric_auth_pattern_view_size"/>
+ </FrameLayout>
+
+ <Button
+ android:id="@+id/emergencyCallButton"
+ style="@style/AuthCredentialEmergencyButtonStyle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="35dp"
+ android:visibility="gone"
+ android:layout_alignParentBottom="true"
+ android:layout_centerHorizontal="true"
+ android:text="@string/work_challenge_emergency_button_text"/>
+ </RelativeLayout>
</com.android.systemui.biometrics.ui.CredentialPatternView>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout-land/auth_credential_pin_view.xml b/packages/SystemUI/res/layout-land/auth_credential_pin_view.xml
new file mode 100644
index 0000000..8ac7583
--- /dev/null
+++ b/packages/SystemUI/res/layout-land/auth_credential_pin_view.xml
@@ -0,0 +1,28 @@
+<!--
+ ~ Copyright (C) 2020 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<com.android.systemui.biometrics.ui.CredentialPasswordView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ android:elevation="@dimen/biometric_dialog_elevation"
+ android:theme="?app:attr/lockPinPasswordStyle">
+
+ <include layout="@layout/auth_credential_password_pin_content_view" />
+
+</com.android.systemui.biometrics.ui.CredentialPasswordView>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/auth_credential_password_pin_content_view.xml b/packages/SystemUI/res/layout/auth_credential_password_pin_content_view.xml
new file mode 100644
index 0000000..11284fd
--- /dev/null
+++ b/packages/SystemUI/res/layout/auth_credential_password_pin_content_view.xml
@@ -0,0 +1,104 @@
+<!--
+ ~ Copyright (C) 2019 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <RelativeLayout
+ android:id="@+id/auth_credential_header"
+ style="?headerStyle"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingBottom="0dp">
+
+ <ImageView
+ android:id="@+id/icon"
+ style="?headerIconStyle"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:contentDescription="@null" />
+
+ <TextView
+ android:id="@+id/title"
+ style="?titleTextAppearance"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/icon" />
+
+ <TextView
+ android:id="@+id/subtitle"
+ style="?subTitleTextAppearance"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/title" />
+
+ <TextView
+ android:id="@+id/description"
+ style="?descriptionTextAppearance"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/subtitle" />
+
+ </RelativeLayout>
+
+ </ScrollView>
+
+ <FrameLayout
+ android:id="@+id/auth_credential_input"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:orientation="vertical">
+
+ <ImeAwareEditText
+ android:id="@+id/lockPassword"
+ style="?passwordTextAppearance"
+ android:layout_width="208dp"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
+ android:inputType="textPassword"
+ android:minHeight="48dp"/>
+
+ <TextView
+ android:id="@+id/error"
+ style="?errorTextAppearance"
+ android:layout_gravity="center_horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ </LinearLayout>
+
+ <Button
+ android:id="@+id/emergencyCallButton"
+ style="@style/AuthCredentialEmergencyButtonStyle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ android:layout_gravity="center_horizontal|bottom"
+ android:layout_marginTop="12dp"
+ android:layout_marginBottom="12dp"
+ android:text="@string/work_challenge_emergency_button_text"/>
+ </FrameLayout>
+
+</merge>
diff --git a/packages/SystemUI/res/layout/auth_credential_password_view.xml b/packages/SystemUI/res/layout/auth_credential_password_view.xml
index 33f1b10..f8d9a87 100644
--- a/packages/SystemUI/res/layout/auth_credential_password_view.xml
+++ b/packages/SystemUI/res/layout/auth_credential_password_view.xml
@@ -23,71 +23,6 @@
android:orientation="vertical"
android:theme="?app:attr/lockPinPasswordStyle">
- <ScrollView
- android:id="@+id/auth_credential_header"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <RelativeLayout
- style="?headerStyle"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <ImageView
- android:id="@+id/icon"
- style="?headerIconStyle"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:contentDescription="@null" />
-
- <TextView
- android:id="@+id/title"
- style="?titleTextAppearance"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/icon" />
-
- <TextView
- android:id="@+id/subtitle"
- style="?subTitleTextAppearance"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/title" />
-
- <TextView
- android:id="@+id/description"
- style="?descriptionTextAppearance"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/subtitle" />
-
- </RelativeLayout>
-
- </ScrollView>
-
- <LinearLayout
- android:id="@+id/auth_credential_input"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <ImeAwareEditText
- android:id="@+id/lockPassword"
- style="?passwordTextAppearance"
- android:layout_width="208dp"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:imeOptions="actionNext|flagNoFullscreen|flagForceAscii"
- android:inputType="textPassword"
- android:minHeight="48dp" />
-
- <TextView
- android:id="@+id/error"
- style="?errorTextAppearance"
- android:layout_gravity="center_horizontal"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
-
- </LinearLayout>
+ <include layout="@layout/auth_credential_password_pin_content_view" />
</com.android.systemui.biometrics.ui.CredentialPasswordView>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/auth_credential_pattern_view.xml b/packages/SystemUI/res/layout/auth_credential_pattern_view.xml
index 81ca3718..59828fd 100644
--- a/packages/SystemUI/res/layout/auth_credential_pattern_view.xml
+++ b/packages/SystemUI/res/layout/auth_credential_pattern_view.xml
@@ -58,24 +58,42 @@
android:layout_height="wrap_content"/>
</RelativeLayout>
- <FrameLayout
+ <RelativeLayout
android:id="@+id/auth_credential_container"
- style="?containerStyle"
android:layout_width="match_parent"
android:layout_height="match_parent">
- <com.android.internal.widget.LockPatternView
- android:id="@+id/lockPattern"
- android:layout_gravity="center"
- android:layout_width="@dimen/biometric_auth_pattern_view_size"
- android:layout_height="@dimen/biometric_auth_pattern_view_size"/>
+ <FrameLayout
+ android:layout_centerInParent="true"
+ android:layout_above="@id/emergencyCallButton"
+ style="?containerStyle"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
- <TextView
- android:id="@+id/error"
- style="?errorTextAppearance"
- android:layout_width="match_parent"
+ <com.android.internal.widget.LockPatternView
+ android:id="@+id/lockPattern"
+ android:layout_gravity="center"
+ android:layout_width="@dimen/biometric_auth_pattern_view_size"
+ android:layout_height="@dimen/biometric_auth_pattern_view_size"/>
+
+ <TextView
+ android:id="@+id/error"
+ style="?errorTextAppearance"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal|bottom"/>
+ </FrameLayout>
+
+ <Button
+ android:id="@+id/emergencyCallButton"
+ style="@style/AuthCredentialEmergencyButtonStyle"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal|bottom"/>
- </FrameLayout>
+ android:layout_alignParentBottom="true"
+ android:visibility="gone"
+ android:layout_marginBottom="35dp"
+ android:layout_centerHorizontal="true"
+ android:text="@string/work_challenge_emergency_button_text"/>
+ </RelativeLayout>
</com.android.systemui.biometrics.ui.CredentialPatternView>
diff --git a/packages/SystemUI/res/layout/auth_credential_pin_view.xml b/packages/SystemUI/res/layout/auth_credential_pin_view.xml
new file mode 100644
index 0000000..a1cf807
--- /dev/null
+++ b/packages/SystemUI/res/layout/auth_credential_pin_view.xml
@@ -0,0 +1,28 @@
+<!--
+ ~ Copyright (C) 2019 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<com.android.systemui.biometrics.ui.CredentialPasswordView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:elevation="@dimen/biometric_dialog_elevation"
+ android:orientation="vertical"
+ android:theme="?app:attr/lockPinPasswordStyle">
+
+ <include layout="@layout/auth_credential_password_pin_content_view" />
+
+</com.android.systemui.biometrics.ui.CredentialPasswordView>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/combined_qs_header.xml b/packages/SystemUI/res/layout/combined_qs_header.xml
index 12f13e9..3a15ae4 100644
--- a/packages/SystemUI/res/layout/combined_qs_header.xml
+++ b/packages/SystemUI/res/layout/combined_qs_header.xml
@@ -127,6 +127,8 @@
android:gravity="center_vertical"
android:paddingStart="@dimen/shade_header_system_icons_padding_start"
android:paddingEnd="@dimen/shade_header_system_icons_padding_end"
+ android:paddingTop="@dimen/shade_header_system_icons_padding_top"
+ android:paddingBottom="@dimen/shade_header_system_icons_padding_bottom"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/privacy_container"
app:layout_constraintTop_toTopOf="@id/clock">
diff --git a/packages/SystemUI/res/layout/internet_connectivity_dialog.xml b/packages/SystemUI/res/layout/internet_connectivity_dialog.xml
index f14be41..ec006c5 100644
--- a/packages/SystemUI/res/layout/internet_connectivity_dialog.xml
+++ b/packages/SystemUI/res/layout/internet_connectivity_dialog.xml
@@ -416,11 +416,22 @@
android:focusable="true"/>
</LinearLayout>
- <LinearLayout
+ <RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_gravity="end|center_vertical">
+ android:gravity="center_vertical">
+ <Button
+ android:id="@+id/share_wifi_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/share_wifi_button_text"
+ style="?android:attr/buttonBarNeutralButtonStyle"
+ android:maxLines="1"
+ android:ellipsize="end"
+ android:clickable="true"
+ android:focusable="true"
+ android:layout_alignParentLeft="true"
+ android:visibility="gone"/>
<Button
android:id="@+id/done_button"
android:layout_width="wrap_content"
@@ -430,8 +441,9 @@
android:maxLines="1"
android:ellipsize="end"
android:clickable="true"
- android:focusable="true"/>
- </LinearLayout>
+ android:focusable="true"
+ android:layout_alignParentRight="true"/>
+ </RelativeLayout>
</LinearLayout>
</LinearLayout>
diff --git a/packages/SystemUI/res/layout/screen_share_dialog.xml b/packages/SystemUI/res/layout/screen_share_dialog.xml
index 9af46c5..3796415 100644
--- a/packages/SystemUI/res/layout/screen_share_dialog.xml
+++ b/packages/SystemUI/res/layout/screen_share_dialog.xml
@@ -64,8 +64,7 @@
android:layout_height="wrap_content"
android:text="@string/screenrecord_permission_dialog_warning_entire_screen"
style="@style/TextAppearance.Dialog.Body.Message"
- android:gravity="start"
- android:lineHeight="@dimen/screenrecord_warning_line_height"/>
+ android:gravity="start"/>
<!-- Buttons -->
<LinearLayout
diff --git a/packages/SystemUI/res/layout/screenshot_work_profile_first_run.xml b/packages/SystemUI/res/layout/screenshot_work_profile_first_run.xml
index 78cd718..39ec09b 100644
--- a/packages/SystemUI/res/layout/screenshot_work_profile_first_run.xml
+++ b/packages/SystemUI/res/layout/screenshot_work_profile_first_run.xml
@@ -34,8 +34,8 @@
android:layout_height="@dimen/overlay_dismiss_button_tappable_size"
android:contentDescription="@string/screenshot_dismiss_work_profile">
<ImageView
- android:layout_width="16dp"
- android:layout_height="16dp"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
android:layout_gravity="center"
android:background="@drawable/circular_background"
android:backgroundTint="?androidprv:attr/materialColorSurfaceContainerHigh"
diff --git a/packages/SystemUI/res/values-af/strings.xml b/packages/SystemUI/res/values-af/strings.xml
index 2355341..fe80355 100644
--- a/packages/SystemUI/res/values-af/strings.xml
+++ b/packages/SystemUI/res/values-af/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g>-limiet"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> waarskuwing"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Werkprogramme"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Onderbreek"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Aandbeligting"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Aan by sonsondergang"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Tot sonsopkoms"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Vergroot \'n deel van die skerm"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Maak vergrotinginstellings oop"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Maak vergrotinginstellings toe"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Sleep hoek om grootte te verander"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Laat diagonale rollees toe"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Verander grootte"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Maak <xliff:g id="APPNAME">%1$s</xliff:g> oop"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Om die Wallet-app as ’n kortpad by te voeg, moet jy seker maak dat die app geïnstalleer is"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Om die Wallet-app as ’n kortpad by te voeg, moet jy seker maak dat minstens een kaart bygevoeg is"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Om die QR-kodeskandeerder as ’n kortpad by te voeg, moet jy seker maak dat ’n kamera-app geïnstalleer is"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Om die Home-app as ’n kortpad by te voeg, moet jy seker maak dat die app geïnstalleer is"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Minstens een toestel beskikbaar is"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Kies ’n versteknotasapp om die notaneemkortpad te gebruik"</string>
diff --git a/packages/SystemUI/res/values-am/strings.xml b/packages/SystemUI/res/values-am/strings.xml
index 0fd3f11..63f1765 100644
--- a/packages/SystemUI/res/values-am/strings.xml
+++ b/packages/SystemUI/res/values-am/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ገደብ"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"የ<xliff:g id="DATA_LIMIT">%s</xliff:g> ማስጠንቀቂያ"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"የሥራ መተግበሪያዎች"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"ባለበት ቆሟል"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"የምሽት ብርሃን"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"ፀሐይ ስትጠልቅ ይበራል"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"ፀሐይ እስክትወጣ ድረስ"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"የማያ ገጹን ክፍል አጉላ"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"የማጉያ ቅንብሮችን ክፈት"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"የማጉላት ቅንብሮችን ዝጋ"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"መጠን ለመቀየር ጠርዙን ይዘው ይጎትቱ"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"ሰያፍ ሽብለላን ፍቀድ"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"መጠን ቀይር"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> ይክፈቱ"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"የWallet መተግበሪያን እንደ አቋራጭ ለማከል መተግበሪያው መጫኑን ያረጋግጡ"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"የWallet መተግበሪያን እንደ አቋራጭ ለማከል ቢያንስ አንድ ካርድ መታከሉን ያረጋግጡ"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"የQR ኮድ መቃኛውን እንደ አቋራጭ ለማከል የካሜራ መተግበሪያ መጫኑን ያረጋግጡ"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"የHome መተግበሪያውን እንደ አቋራጭ ለማከል መተግበሪያው እንደተጫነ ያረጋግጡ"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• ቢያንስ አንድ መሣሪያ ይገኛል"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"የማስታወሻ አያያዝ አቋራጭን ለመጠቀም ነባሪ የማስታወሻ መተግበሪያ ይምረጡ"</string>
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index bb99e2c..8128fae 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"قيد <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"تحذير <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"تطبيقات العمل"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"متوقّف مؤقَّتًا"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"الإضاءة الليلية"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"تفعيل عند غروب الشمس"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"حتى شروق الشمس"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"تكبير جزء من الشاشة"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"فتح إعدادات التكبير"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"إغلاق إعدادات التكبير"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"اسحب الزاوية لتغيير الحجم."</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"السماح بالتمرير القطري"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"تغيير الحجم"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"فتح \"<xliff:g id="APPNAME">%1$s</xliff:g>\""</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"لإضافة تطبيق \"محفظة Google\" كاختصار، تأكَّد من أنّ التطبيق مثبَّت."</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"لإضافة تطبيق \"محفظة Google\" كاختصار، تأكَّد من إضافة بطاقة واحدة على الأقل."</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"لإضافة تطبيق الماسح الضوئي لرمز الاستجابة السريعة كاختصار، تأكَّد من أنّ تطبيق الكاميرا مثبَّت."</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"لإضافة تطبيق Home كاختصار، تأكَّد من أنّ التطبيق مثبَّت."</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• توفُّر جهاز واحد على الأقل"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"اختَر تطبيقًا تلقائيًا لتدوين الملاحظات لاستخدام اختصار تدوين الملاحظات."</string>
diff --git a/packages/SystemUI/res/values-as/strings.xml b/packages/SystemUI/res/values-as/strings.xml
index d52301c..4915257 100644
--- a/packages/SystemUI/res/values-as/strings.xml
+++ b/packages/SystemUI/res/values-as/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> সীমা"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> সকীয়নি"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"কৰ্মস্থানৰ এপ্"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"পজ হৈ আছে"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"ৰাতিৰ পোহৰ"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"সূৰ্যাস্তত অন কৰক"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"সূৰ্যোদয়ৰ লৈকে"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"স্ক্ৰীনৰ কিছু অংশ বিবৰ্ধন কৰক"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"বিবৰ্ধন কৰাৰ ছেটিং খোলক"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"বিবৰ্ধনৰ ছেটিং বন্ধ কৰক"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"আকাৰ সলনি কৰিবলৈ চুককেইটা টানি আনি এৰক"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"কোণীয়াকৈ স্ক্ৰ’ল কৰাৰ অনুমতি দিয়ক"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"আকাৰ সলনি কৰক"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> খোলক"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Wallet এপ্টোক এটা শ্বৰ্টকাট হিচাপে যোগ দিবলৈ, এপ্টো ইনষ্টল কৰি থোৱাটো নিশ্চিত কৰক"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Wallet এপ্টোক এটা শ্বৰ্টকাট হিচাপে যোগ দিবলৈ, কমেও এখন কাৰ্ড যোগ দিয়াটো নিশ্চিত কৰক"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"কিউআৰ ক’ড স্কেনাৰক এটা শ্বৰ্টকাট হিচাপে যোগ দিবলৈ, কেমেৰা এপ্টো ইনষ্টল কৰি থোৱাটো নিশ্চিত কৰক"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home এপ্টোক এটা শ্বৰ্টকাট হিচাপে যোগ দিবলৈ, এপ্টো ইনষ্টল কৰি থোৱাটো নিশ্চিত কৰক"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• অতি কমেও এটা ডিভাইচ উপলব্ধ"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"টোকা গ্ৰহণৰ শ্বৰ্টকাটটো ব্যৱহাৰ কৰিবলৈ এটা ডিফ’ল্ট টোকা গ্ৰহণৰ এপ্ বাছনি কৰক"</string>
diff --git a/packages/SystemUI/res/values-az/strings.xml b/packages/SystemUI/res/values-az/strings.xml
index 85220a6..8d9fcbd 100644
--- a/packages/SystemUI/res/values-az/strings.xml
+++ b/packages/SystemUI/res/values-az/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> limit"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> xəbərdarlığı"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"İş tətbiqləri"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Durdurulub"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Gecə işığı"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Qürubda aktiv ediləcək"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Şəfəq vaxtına qədər"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Ekran hissəsinin böyüdülməsi"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Böyütmə ayarlarını açın"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Böyütmə ayarlarını bağlayın"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Ölçüsünü dəyişmək üçün küncündən sürüşdürün"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Diaqonal sürüşdürməyə icazə verin"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Ölçüsünü dəyişin"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> tətbiqini açın"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Pulqabı tətbiqini qısayol kimi əlavə etmək üçün tətbiq quraşdırılmalıdır"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Pulqabı tətbiqini qısayol kimi əlavə etmək üçün kart əlavə edilməlidir"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR kod skanerini qısayol kimi əlavə etmək üçün kamera tətbiqi quraşdırılmalıdır"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home tətbiqini qısayol kimi əlavə etmək üçün tətbiq quraşdırılmalıdır"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Ən azı bir cihaz əlçatandır"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Qeydgötürmə qısayolu üçün defolt qeyd tətbiqi seçin"</string>
diff --git a/packages/SystemUI/res/values-b+sr+Latn/strings.xml b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
index 3790300..e1bd89d 100644
--- a/packages/SystemUI/res/values-b+sr+Latn/strings.xml
+++ b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Ograničenje od <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Upozorenje za <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Poslovne aplikacije"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Pauzirano"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Noćno svetlo"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Uključuje se po zalasku sunca"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Do izlaska sunca"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Uvećajte deo ekrana"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Otvori podešavanja uvećanja"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Zatvori podešavanja uvećanja"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Zatvori režim izmene"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Prevucite ugao da biste promenili veličinu"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Dozvoli dijagonalno skrolovanje"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Promeni veličinu"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Otvorite: <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Da biste dodali aplikaciju Novčanik kao prečicu, uverite se da je aplikacija instalirana"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Da biste dodali aplikaciju Novčanik kao prečicu, uverite se da je dodata bar jedna kartica"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Da biste dodali Skener QR koda kao prečicu, uverite se da je aplikacija za kameru instalirana"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Da biste dodali aplikaciju Home kao prečicu, uverite se da je aplikacija instalirana"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Dostupan je bar jedan uređaj"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Izaberite podrazumevanu aplikaciju za beleške da biste koristili prečicu za pravljenje beleški"</string>
diff --git a/packages/SystemUI/res/values-be/strings.xml b/packages/SystemUI/res/values-be/strings.xml
index def25b4..5d1b65c 100644
--- a/packages/SystemUI/res/values-be/strings.xml
+++ b/packages/SystemUI/res/values-be/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Ліміт <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Папярэджанне: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Працоўныя праграмы"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Профіль прыпынены"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Начная падсветка"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Уключаць увечары"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Да ўсходу сонца"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Павялічыць частку экрана"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Адкрыць налады павелічэння"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Закрыць налады павелічэння"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Каб змяніць памер, перацягніце вугал"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Дазволіць прагортванне па дыяганалі"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Змяніць памер"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Адкрыць праграму \"<xliff:g id="APPNAME">%1$s</xliff:g>\""</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Вы можаце дадаць ярлык праграмы \"Кашалёк\", толькі калі яна ўсталявана"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Вы можаце дадаць ярлык праграмы \"Кашалёк\", толькі калі дададзена хаця б адна картка"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Вы можаце дадаць ярлык сканера QR-кодаў, толькі калі ўсталявана праграма камеры"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Вы можаце дадаць ярлык праграмы Home, толькі калі яна ўсталявана"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Даступная хаця б адна прылада"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Выберыце стандартную праграму для нататак, якая будзе адкрывацца пры націсканні на ярлык"</string>
diff --git a/packages/SystemUI/res/values-bg/strings.xml b/packages/SystemUI/res/values-bg/strings.xml
index 224ff1f..94ab2c9 100644
--- a/packages/SystemUI/res/values-bg/strings.xml
+++ b/packages/SystemUI/res/values-bg/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Ограничение от <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Предупреждение: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Служебни приложения"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"На пауза"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Нощно осветление"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Ще се вкл. по залез"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"До изгрев"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Увеличаване на част от екрана"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Отваряне на настройките за увеличението"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Затваряне на настройките за увеличение"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Изход от режима на редактиране"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Плъзнете ъгъла за преоразмеряване"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Разрешаване на диагонално превъртане"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Преоразмеряване"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Отваряне на <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"За да добавите пряк път към приложението Wallet, уверете се, че то е инсталирано"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"За да добавите пряк път към приложението Wallet, уверете се, че е добавена поне една карта"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"За да добавите пряк път към скенера за QR кодове, уверете се, че е инсталирано приложение за камера"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"За да добавите пряк път към приложението Home, уверете се, че то е инсталирано"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Налице е поне едно устройство."</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Изберете стандартно приложение за бележки, за да използвате прекия път за водене на бележки"</string>
diff --git a/packages/SystemUI/res/values-bn/strings.xml b/packages/SystemUI/res/values-bn/strings.xml
index aca0931..f80c301 100644
--- a/packages/SystemUI/res/values-bn/strings.xml
+++ b/packages/SystemUI/res/values-bn/strings.xml
@@ -295,6 +295,8 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"সীমা <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> সতর্কতা"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"অফিসের অ্যাপ"</string>
+ <!-- no translation found for quick_settings_work_mode_paused_state (6681788236383735976) -->
+ <skip />
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"নাইট লাইট"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"সূর্যাস্তে চালু হবে"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"সূর্যোদয় পর্যন্ত"</string>
@@ -864,6 +866,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"স্ক্রিনের কিছুটা অংশ বড় করুন"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"বড় করে দেখার সেটিংস খুলুন"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"\'বড় করে দেখা\' সেটিংস বন্ধ করুন"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"ছোট বড় করার জন্য কোণ টেনে আনুন"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"কোনাকুনি স্ক্রল করার অনুমতি দেওয়া"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"ছোট বড় করা"</string>
@@ -1133,7 +1137,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> খুলুন"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Wallet অ্যাপ, শর্টকাট হিসেবে যোগ করতে, অ্যাপ ইনস্টল করা আছে কিনা তা ভালভাবে দেখে নিন"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Wallet অ্যাপ, শর্টকাট হিসেবে যোগ করতে, অন্তত একটি কার্ড যোগ করা হয়েছে কিনা তা ভালভাবে দেখে নিন"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR কোড স্ক্যানার, শর্টকাট হিসেবে যোগ করতে, ক্যামেরা অ্যাপ ইনস্টল করা আছে কিনা তা ভালভাবে দেখে নিন"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home অ্যাপ, শর্টকাট হিসেবে যোগ করতে, অ্যাপ ইনস্টল করা আছে কিনা তা ভালভাবে দেখে নিন"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• অন্তত একটি ডিভাইস উপলভ্য আছে"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"নোট নেওয়ার শর্টকাট ব্যবহার করতে, ডিফল্ট কোনও নোট অ্যাপ বেছে নিন"</string>
diff --git a/packages/SystemUI/res/values-bs/strings.xml b/packages/SystemUI/res/values-bs/strings.xml
index 1e4588d..364e847 100644
--- a/packages/SystemUI/res/values-bs/strings.xml
+++ b/packages/SystemUI/res/values-bs/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Ograničenje <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Upozorenje <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Poslovne aplikacije"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Pauzirano"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Noćno svjetlo"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Uključuje se u sumrak"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Do svitanja"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Uvećavanje dijela ekrana"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Otvori postavke uvećavanja"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Zatvori postavke uvećavanja"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Izađi iz načina rada za uređivanje"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Prevucite ugao da promijenite veličinu"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Dozvoli dijagonalno klizanje"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Promijeni veličinu"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Otvori aplikaciju <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Da dodate aplikaciju Novčanik kao prečicu, instalirajte aplikaciju"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Da dodate aplikaciju Novčanik kao prečicu, dodajte barem jednu karticu"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Da dodate skener QR koda kao prečicu, instalirajte aplikaciju kamere"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Da dodate aplikaciju Home kao prečicu, instalirajte aplikaciju"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Dostupan je najmanje jedan uređaj"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Odaberite zadanu aplikaciju za bilješke da koristite prečicu za zapisivanje bilješki"</string>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index a25cda6..557a7e6 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Límit: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Advertiment: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Aplicacions de treball"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"En pausa"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Llum nocturna"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Al vespre"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Fins a l\'alba"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Amplia una part de la pantalla"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Obre la configuració de l\'ampliació"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Tanca la configuració de l\'ampliació"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Arrossega el cantó per canviar la mida"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Permet el desplaçament en diagonal"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Canvia la mida"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Obre <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Per afegir l\'aplicació Wallet com a drecera, assegura\'t que estigui instal·lada"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Per afegir l\'aplicació Wallet com a drecera, assegura\'t que s\'hagi afegit almenys una targeta"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Per afegir l\'escàner de codis QR com a drecera, assegura\'t que hi hagi una aplicació de càmera instal·lada"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Per afegir l\'aplicació Home com a drecera, assegura\'t que estigui instal·lada"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Almenys un dispositiu està disponible."</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Selecciona una aplicació de notes predeterminada per utilitzar la drecera de presa de notes"</string>
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index 638c26a..0a83c86 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Limit: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Upozornění při <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Pracovní aplikace"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Pozastaveno"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Noční režim"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Při soumraku"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Do svítání"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Zvětšit část obrazovky"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Otevřít nastavení zvětšení"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Zavřít nastavení zvětšení"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Ukončit režim úprav"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Velikost změníte přetažením rohu"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Povolit diagonální posouvání"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Změnit velikost"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Otevřít <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Pokud chcete přidat aplikaci Peněženka jako zkratku, nainstalujte ji"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Pokud chcete přidat aplikaci Peněženka jako zkratku, přidejte alespoň jednu kartu"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Pokud chcete přidat skener QR kódů jako zkratku, ujistěte se, že je nainstalována aplikace k focení a natáčení"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Pokud chcete přidat aplikaci Home jako zkratku, nainstalujte ji"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Je k dispozici alespoň jedno zařízení"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Vyberte výchozí aplikaci k psaní poznámek, ke které přidružíte zkratku pro poznámky"</string>
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index 663aac4..9ebbebb 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Grænse: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Advarsel ved <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Arbejdsapps"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Sat på pause"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Nattelys"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Tænd ved solnedgang"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Indtil solopgang"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Forstør en del af skærmen"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Åbn indstillinger for forstørrelse"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Luk indstillinger for forstørrelse"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Træk i hjørnet for at justere størrelsen"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Tillad diagonal rulning"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Juster"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Åbn <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Hvis du vil tilføje en genvej til Wallet-appen, skal du sørge for, at appen er installeret"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Hvis du vil tilføje en genvej til Wallet-appen, skal du sørge for, at du har tilføjet mindst ét kort"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Hvis du vil tilføje en genvej til QR-kodescanneren, skal du sørge for, at kameraappen er installeret"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Hvis du vil tilføje en genvej til Home-appen, skal du sørge for, at appen er installeret"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Mindst én enhed er tilgængelig"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Vælg en standardapp til noter for at bruge genvejen til notetagning"</string>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index ead5001..206e832 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> Datenlimit"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Warnung für <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Geschäftliche Apps"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Pausiert"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Nachtlicht"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"An bei Sonnenuntergang"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Bis Sonnenaufgang"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Teil des Bildschirms vergrößern"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Vergrößerungseinstellungen öffnen"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Vergrößerungseinstellungen schließen"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Zum Anpassen der Größe Ecke ziehen"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Diagonales Scrollen erlauben"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Größe ändern"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> öffnen"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Damit du die Wallet App als Verknüpfung hinzufügen kannst, muss die App installiert sein"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Damit du die Wallet App als Verknüpfung hinzufügen kannst, muss mindestens eine Karte hinzugefügt sein"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Damit du den QR-Code-Scanner als Verknüpfung hinzufügen kannst, muss eine Kamera-App installiert sein"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Damit du die Home App als Verknüpfung hinzufügen kannst, muss die App installiert sein"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Mindestens ein Gerät ist verfügbar"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Wähle eine Standard-App für Notizen aus, die du für die Verknüpfung verwenden möchtest"</string>
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index 7a74831..c32cd17 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Όριο <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Προειδοποίηση για <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Εφαρμογές εργασιών"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Σε παύση"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Νυχτερινός φωτισμός"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Κατά τη δύση"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Μέχρι την ανατολή"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Μεγέθυνση μέρους της οθόνης"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Άνοιγμα ρυθμίσεων μεγιστοποίησης"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Κλείσιμο ρυθμίσεων μεγιστοποίησης"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Σύρετε τη γωνία για αλλαγή μεγέθους"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Να επιτρέπεται η διαγώνια κύλιση"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Αλλαγή μεγέθους"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Άνοιγμα <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Για να προσθέσετε ως συντόμευση την εφαρμογή Πορτοφόλι, βεβαιωθείτε ότι έχει εγκατασταθεί η εφαρμογή"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Για να προσθέσετε ως συντόμευση την εφαρμογή Πορτοφόλι, βεβαιωθείτε ότι έχει προστεθεί τουλάχιστον μία κάρτα"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Για να προσθέσετε ως συντόμευση τη Σάρωση κωδικών QR, βεβαιωθείτε ότι η εφαρμογή κάμερας είναι εγκατεστημένη"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Για να προσθέσετε την εφαρμογή Home ως συντόμευση, βεβαιωθείτε ότι η εφαρμογή είναι εγκατεστημένη"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Είναι διαθέσιμη τουλάχιστον μία συσκευή"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Επιλέξτε μια προεπιλεγμένη εφαρμογή σημειώσεων για να χρησιμοποιήσετε τη συντόμευση δημιουργίας σημειώσεων"</string>
diff --git a/packages/SystemUI/res/values-en-rAU/strings.xml b/packages/SystemUI/res/values-en-rAU/strings.xml
index 5d713bb..313f617 100644
--- a/packages/SystemUI/res/values-en-rAU/strings.xml
+++ b/packages/SystemUI/res/values-en-rAU/strings.xml
@@ -295,6 +295,8 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> limit"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> warning"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Work apps"</string>
+ <!-- no translation found for quick_settings_work_mode_paused_state (6681788236383735976) -->
+ <skip />
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Night Light"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"On at sunset"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Until sunrise"</string>
@@ -864,6 +866,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Magnify part of screen"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Open magnification settings"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Close magnification settings"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Drag corner to resize"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Allow diagonal scrolling"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Resize"</string>
@@ -1133,7 +1137,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Open <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"To add the Wallet app as a shortcut, make sure that the app is installed"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"To add the Wallet app as a shortcut, make sure that at least one card has been added"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"To add the QR code scanner as a shortcut, make sure that a camera app is installed"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"To add the Home app as a shortcut, make sure that the app is installed"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• At least one device is available"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Select a default notes app to use the note-taking shortcut"</string>
@@ -1166,7 +1169,7 @@
<string name="assistant_attention_content_description" msgid="6830215897604642875">"Assistant attention on"</string>
<string name="set_default_notes_app_toast_content" msgid="2812374329662610753">"Set default notes app in Settings"</string>
<string name="install_app" msgid="5066668100199613936">"Install app"</string>
- <string name="privacy_dialog_title" msgid="7839968133469098311">"Microphone & Camera"</string>
+ <string name="privacy_dialog_title" msgid="7839968133469098311">"Microphone and Camera"</string>
<string name="privacy_dialog_summary" msgid="2458769652125995409">"Recent app use"</string>
<string name="privacy_dialog_more_button" msgid="7610604080293562345">"See recent access"</string>
<string name="privacy_dialog_done_button" msgid="4504330708531434263">"Done"</string>
diff --git a/packages/SystemUI/res/values-en-rCA/strings.xml b/packages/SystemUI/res/values-en-rCA/strings.xml
index 9d4a4fe..157570a 100644
--- a/packages/SystemUI/res/values-en-rCA/strings.xml
+++ b/packages/SystemUI/res/values-en-rCA/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> limit"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> warning"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Work apps"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Paused"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Night Light"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"On at sunset"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Until sunrise"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Magnify part of screen"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Open magnification settings"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Close magnification settings"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Exit edit mode"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Drag corner to resize"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Allow diagonal scrolling"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Resize"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Open <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"To add the Wallet app as a shortcut, make sure the app is installed"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"To add the Wallet app as a shortcut, make sure at least one card has been added"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"To add the QR code scanner as a shortcut, make sure a camera app is installed"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"To add the Home app as a shortcut, make sure the app is installed"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• At least one device is available"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Select a default notes app to use the notetaking shortcut"</string>
diff --git a/packages/SystemUI/res/values-en-rGB/strings.xml b/packages/SystemUI/res/values-en-rGB/strings.xml
index 5d713bb..313f617 100644
--- a/packages/SystemUI/res/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings.xml
@@ -295,6 +295,8 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> limit"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> warning"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Work apps"</string>
+ <!-- no translation found for quick_settings_work_mode_paused_state (6681788236383735976) -->
+ <skip />
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Night Light"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"On at sunset"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Until sunrise"</string>
@@ -864,6 +866,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Magnify part of screen"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Open magnification settings"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Close magnification settings"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Drag corner to resize"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Allow diagonal scrolling"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Resize"</string>
@@ -1133,7 +1137,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Open <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"To add the Wallet app as a shortcut, make sure that the app is installed"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"To add the Wallet app as a shortcut, make sure that at least one card has been added"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"To add the QR code scanner as a shortcut, make sure that a camera app is installed"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"To add the Home app as a shortcut, make sure that the app is installed"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• At least one device is available"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Select a default notes app to use the note-taking shortcut"</string>
@@ -1166,7 +1169,7 @@
<string name="assistant_attention_content_description" msgid="6830215897604642875">"Assistant attention on"</string>
<string name="set_default_notes_app_toast_content" msgid="2812374329662610753">"Set default notes app in Settings"</string>
<string name="install_app" msgid="5066668100199613936">"Install app"</string>
- <string name="privacy_dialog_title" msgid="7839968133469098311">"Microphone & Camera"</string>
+ <string name="privacy_dialog_title" msgid="7839968133469098311">"Microphone and Camera"</string>
<string name="privacy_dialog_summary" msgid="2458769652125995409">"Recent app use"</string>
<string name="privacy_dialog_more_button" msgid="7610604080293562345">"See recent access"</string>
<string name="privacy_dialog_done_button" msgid="4504330708531434263">"Done"</string>
diff --git a/packages/SystemUI/res/values-en-rIN/strings.xml b/packages/SystemUI/res/values-en-rIN/strings.xml
index 5d713bb..313f617 100644
--- a/packages/SystemUI/res/values-en-rIN/strings.xml
+++ b/packages/SystemUI/res/values-en-rIN/strings.xml
@@ -295,6 +295,8 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> limit"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> warning"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Work apps"</string>
+ <!-- no translation found for quick_settings_work_mode_paused_state (6681788236383735976) -->
+ <skip />
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Night Light"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"On at sunset"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Until sunrise"</string>
@@ -864,6 +866,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Magnify part of screen"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Open magnification settings"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Close magnification settings"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Drag corner to resize"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Allow diagonal scrolling"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Resize"</string>
@@ -1133,7 +1137,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Open <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"To add the Wallet app as a shortcut, make sure that the app is installed"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"To add the Wallet app as a shortcut, make sure that at least one card has been added"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"To add the QR code scanner as a shortcut, make sure that a camera app is installed"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"To add the Home app as a shortcut, make sure that the app is installed"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• At least one device is available"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Select a default notes app to use the note-taking shortcut"</string>
@@ -1166,7 +1169,7 @@
<string name="assistant_attention_content_description" msgid="6830215897604642875">"Assistant attention on"</string>
<string name="set_default_notes_app_toast_content" msgid="2812374329662610753">"Set default notes app in Settings"</string>
<string name="install_app" msgid="5066668100199613936">"Install app"</string>
- <string name="privacy_dialog_title" msgid="7839968133469098311">"Microphone & Camera"</string>
+ <string name="privacy_dialog_title" msgid="7839968133469098311">"Microphone and Camera"</string>
<string name="privacy_dialog_summary" msgid="2458769652125995409">"Recent app use"</string>
<string name="privacy_dialog_more_button" msgid="7610604080293562345">"See recent access"</string>
<string name="privacy_dialog_done_button" msgid="4504330708531434263">"Done"</string>
diff --git a/packages/SystemUI/res/values-en-rXC/strings.xml b/packages/SystemUI/res/values-en-rXC/strings.xml
index 6a172f0..db7133c 100644
--- a/packages/SystemUI/res/values-en-rXC/strings.xml
+++ b/packages/SystemUI/res/values-en-rXC/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> limit"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> warning"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Work apps"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Paused"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Night Light"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"On at sunset"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Until sunrise"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Magnify part of screen"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Open magnification settings"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Close magnification settings"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Exit edit mode"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Drag corner to resize"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Allow diagonal scrolling"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Resize"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Open <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"To add the Wallet app as a shortcut, make sure the app is installed"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"To add the Wallet app as a shortcut, make sure at least one card has been added"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"To add the QR code scanner as a shortcut, make sure a camera app is installed"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"To add the Home app as a shortcut, make sure the app is installed"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• At least one device is available"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Select a default notes app to use the notetaking shortcut"</string>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index 4d0ed14..23d2edc 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Límite de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Advertencia de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Apps de trabajo"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"En pausa"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Luz nocturna"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Al atardecer"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Hasta el amanecer"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Ampliar parte de la pantalla"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Abrir la configuración de ampliación"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Cerrar configuración de ampliación"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Salir del modo de edición"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Arrastra la esquina para cambiar el tamaño"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Desplazamiento en diagonal"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Cambiar tamaño"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Abrir <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Para agregar la app de Billetera como acceso directo, asegúrate de haber instalado la app"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Para agregar la app de Billetera como acceso directo, asegúrate de haber agregado al menos una tarjeta"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Para agregar el escáner de código QR como acceso directo, asegúrate de haber instalado la app de la cámara"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Para agregar la app de Home como acceso directo, asegúrate de haber instalado la app"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Hay al menos un dispositivo disponible"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Selecciona una app de notas predeterminada para usar el acceso directo de toma de notas"</string>
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index 953171a..1eb0abc 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Límite de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Advertencia de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Aplicaciones de trabajo"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"En pausa"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Luz nocturna"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Al atardecer"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Hasta el amanecer"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Ampliar parte de la pantalla"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Abrir ajustes de ampliación"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Cerrar ajustes de ampliación"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Arrastra la esquina para cambiar el tamaño"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Permitir ir en diagonal"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Cambiar tamaño"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Abrir <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Para añadir la aplicación Wallet como acceso directo, asegúrate de que está instalada"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Para añadir la aplicación Wallet como acceso directo, asegúrate de haber añadido al menos una tarjeta"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Para añadir el escáner de códigos QR como acceso directo, asegúrate de que hay instalada una aplicación de cámara"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Para añadir la aplicación Home como acceso directo, asegúrate de que está instalada"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Al menos un dispositivo debe estar disponible"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Selecciona una aplicación de notas predeterminada para usar el acceso directo de toma de notas"</string>
diff --git a/packages/SystemUI/res/values-et/strings.xml b/packages/SystemUI/res/values-et/strings.xml
index 1e7bbf4..3881635 100644
--- a/packages/SystemUI/res/values-et/strings.xml
+++ b/packages/SystemUI/res/values-et/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Limiit: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> hoiatus"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Töörakendused"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Peatatud"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Öövalgus"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Sissel. päikeselooj."</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Kuni päikesetõusuni"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Ekraanikuva osa suurendamine"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Ava suurendamisseaded"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Sule suurendamisseaded"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Suuruse muutmiseks lohistage nurka"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Luba diagonaalne kerimine"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Muuda suurust"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Ava <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Rahakotirakenduse otsetee lisamiseks veenduge, et rakendus oleks installitud"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Rahakotirakenduse otsetee lisamiseks veenduge, et vähemalt üks kaart oleks lisatud"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR-koodi skanneri otsetee lisamiseks veenduge, et kaamerarakendus oleks installitud"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Rakenduse Home otsetee lisamiseks veenduge, et rakendus oleks installitud"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Vähemalt üks seade on saadaval"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Valige märkmete tegemise vaikerakendus, et kasutada märkmete tegemise otseteed"</string>
@@ -1167,7 +1169,7 @@
<string name="set_default_notes_app_toast_content" msgid="2812374329662610753">"Määrake seadetes märkmete vaikerakendus."</string>
<string name="install_app" msgid="5066668100199613936">"Installi rakendus"</string>
<string name="privacy_dialog_title" msgid="7839968133469098311">"Mikrofon ja kaamera"</string>
- <string name="privacy_dialog_summary" msgid="2458769652125995409">"Rakenduse hiljutine kasutamine"</string>
+ <string name="privacy_dialog_summary" msgid="2458769652125995409">"Rakenduste hiljutine kasutamine"</string>
<string name="privacy_dialog_more_button" msgid="7610604080293562345">"Kuva hiljutine juurdepääs"</string>
<string name="privacy_dialog_done_button" msgid="4504330708531434263">"Valmis"</string>
<string name="privacy_dialog_expand_action" msgid="9129262348628331377">"Laiendamine ja valikute kuvamine"</string>
diff --git a/packages/SystemUI/res/values-eu/strings.xml b/packages/SystemUI/res/values-eu/strings.xml
index 3ce64b2..0121abc 100644
--- a/packages/SystemUI/res/values-eu/strings.xml
+++ b/packages/SystemUI/res/values-eu/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Muga: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Abisua: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Laneko aplikazioak"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Pausatuta"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Gaueko argia"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Ilunabarrean"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Ilunabarrera arte"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Handitu pantailaren zati bat"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Ireki luparen ezarpenak"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Itxi luparen ezarpenak"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Arrastatu izkina bat tamaina aldatzeko"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Eman diagonalki gora eta behera egiteko aukera erabiltzeko baimena"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Aldatu tamaina"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Ireki <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Diru-zorroa aplikazioa lasterbide gisa gehitzeko, ziurtatu aplikazioa instalatuta dagoela."</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Diru-zorroa aplikazioa lasterbide gisa gehitzeko, ziurtatu gutxienez txartel bat gehitu dela."</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR kodeen eskanerra lasterbide gisa gehitzeko, ziurtatu kameraren aplikazioa instalatuta dagoela."</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home aplikazioa lasterbide gisa gehitzeko, ziurtatu aplikazioa instalatuta dagoela."</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Gutxienez gailu bat erabilgarri dago."</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Oharrak idazteko lasterbidea erabiltzeko, hautatu oharretarako aplikazio lehenetsia."</string>
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index 33bd9f4..a22f6da 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> محدودیت"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"هشدار <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"برنامههای کاری"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"موقتاً متوقف شد"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"نور شب"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"غروب روشن میشود"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"تا طلوع"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"درشتنمایی بخشی از صفحه"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"باز کردن تنظیمات درشتنمایی"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"بستن تنظیمات درشتنمایی"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"برای تغییر اندازه، گوشه را بکشید"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"اجازه دادن برای پیمایش قطری"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"تغییر اندازه"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"باز کردن <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"برای افزودن برنامه «کیف پول» بهعنوان میانبر، مطمئن شوید این برنامه نصب شده باشد"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"برای افزودن برنامه «کیف پول» بهعنوان میانبر، مطمئن شوید حداقل یک کارت اضافه شده باشد"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"برای افزودن «کدخوان پاسخسریع» بهعنوان میانبر، مطمئن شوید برنامه دوربین نصب شده باشد"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"برای افزودن برنامه Home بهعنوان میانبر، مطمئن شوید این برنامه نصب شده باشد"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• حداقل یک دستگاه دردسترس باشد"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"برای استفاده از میانبر یادداشتبرداری، برنامه یادداشت پیشفرضی را انتخاب کنید"</string>
diff --git a/packages/SystemUI/res/values-fi/strings.xml b/packages/SystemUI/res/values-fi/strings.xml
index 6da1262..d87f2f6 100644
--- a/packages/SystemUI/res/values-fi/strings.xml
+++ b/packages/SystemUI/res/values-fi/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"kiintiö <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> – varoitus"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Työsovellukset"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Keskeytetty"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Yövalo"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Auringon laskiessa"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Auringonnousuun"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Suurenna osa näytöstä"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Avaa suurennusasetukset"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Sulje suurennusasetukset"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Muuta kokoa vetämällä kulmaa"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Salli diagonaalinen vierittäminen"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Muuta kokoa"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Avaa <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Jos haluat lisätä Wallet-sovelluksen pikakuvakkeena, varmista, että se on asennettuna"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Jos haluat lisätä Wallet-sovelluksen pikakuvakkeena, varmista, että lisättynä on vähintään yksi kortti"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Jos haluat lisätä QR-koodiskannerin pikakuvakkeena, varmista, että kamerasovellus on asennettuna"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Jos haluat lisätä Home-sovelluksen pikakuvakkeena, varmista, että se on asennettuna"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Ainakin yksi laite on käytettävissä"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Valitse muistiinpanojen tekemisen oletussovellus, jota käytetään pikakuvakkeen avulla"</string>
diff --git a/packages/SystemUI/res/values-fr-rCA/strings.xml b/packages/SystemUI/res/values-fr-rCA/strings.xml
index 2f8fcfb..1c6b508 100644
--- a/packages/SystemUI/res/values-fr-rCA/strings.xml
+++ b/packages/SystemUI/res/values-fr-rCA/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Limite : <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Avertissement : <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Applications professionnelles"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"En pause"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Éclairage nocturne"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Activé la nuit"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Jusqu\'à l\'aube"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Agrandir une partie de l\'écran"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Ouvrir les paramètres d\'agrandissement"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Fermer les paramètres d\'agrandissement"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Faire glisser le coin pour redimensionner"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Autoriser défilement diagonal"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Redimensionner"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Ouvrir <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Pour ajouter l\'application portefeuille sous forme de raccourci, assurez-vous que l\'application est installée"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Pour ajouter l\'application Portefeuille sous forme de raccourci, assurez-vous qu\'au moins une carte a été ajoutée"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Pour ajouter le numériseur de code QR sous forme de raccourci, assurez-vous qu\'une application d\'appareil photo est installée"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Pour ajouter l\'application Home sous forme de raccourci, assurez-vous que l\'application est installée"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• qu\'au moins un appareil est utilisable;"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Sélectionnez une application de prise de notes par défaut pour utiliser le raccourci de prise de notes"</string>
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index 3a77d37..420fd85 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> au maximum"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Avertissement : <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Applis pro"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"En pause"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Éclairage nocturne"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Activé la nuit"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Jusqu\'à l\'aube"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Agrandir une partie de l\'écran"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Ouvrir les paramètres d\'agrandissement"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Fermer les paramètres d\'agrandissement"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Faire glisser le coin pour redimensionner"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Autoriser le défilement diagonal"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Redimensionner"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Ouvrir <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Pour ajouter l\'appli Wallet comme raccourci, vérifiez que l\'appli est installée"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Pour ajouter l\'appli Wallet comme raccourci, assurez-vous qu\'au moins une carte a été ajoutée"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Pour ajouter le lecteur de code QR comme raccourci, assurez-vous qu\'une appli d\'appareil photo est installée"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Pour ajouter l\'application Home comme raccourci, vérifiez que l\'appli est installée"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Au moins un appareil est disponible"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Sélectionnez une appli de notes par défaut pour utiliser le raccourci de prise de notes"</string>
diff --git a/packages/SystemUI/res/values-gl/strings.xml b/packages/SystemUI/res/values-gl/strings.xml
index 6390dc8..3389dd8 100644
--- a/packages/SystemUI/res/values-gl/strings.xml
+++ b/packages/SystemUI/res/values-gl/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Límite de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Advertencia <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Aplicacións do traballo"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"En pausa"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Luz nocturna"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Activación ao solpor"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Ata o amencer"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Amplía parte da pantalla"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Abrir configuración da ampliación"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Pechar configuración de ampliación"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Arrastrar a esquina para cambiar o tamaño"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Permitir desprazamento diagonal"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Cambiar tamaño"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Abrir <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Para engadir a aplicación Wallet como atallo, asegúrate de que estea instalada"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Para engadir a aplicación Wallet como atallo, asegúrate de que se incluíse polo menos unha tarxeta"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Para engadir o escáner de códigos QR como atallo, asegúrate de que a aplicación de cámara estea instalada"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Para engadir a aplicación Google Home como atallo, asegúrate de que estea instalada"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Ten que haber polo menos un dispositivo dispoñible"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Selecciona unha aplicación de notas predeterminada para usar o atallo de tomar notas"</string>
diff --git a/packages/SystemUI/res/values-gu/strings.xml b/packages/SystemUI/res/values-gu/strings.xml
index 6a4fa7f..92ab77f 100644
--- a/packages/SystemUI/res/values-gu/strings.xml
+++ b/packages/SystemUI/res/values-gu/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> મર્યાદા"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ચેતવણી"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"ઑફિસ માટેની ઍપ"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"થોભાવ્યું"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"રાત્રિ પ્રકાશ"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"સૂર્યાસ્ત વખતે"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"સૂર્યોદય સુધી"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"સ્ક્રીનનો કોઈ ભાગ મોટો કરો"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"મોટા કરવાના સેટિંગ ખોલો"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"મોટા કરવાના સેટિંગ બંધ કરો"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"કદ બદલવા માટે ખૂણો ખેંચો"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"ડાયગોનલ સ્ક્રોલિંગને મંજૂરી આપો"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"કદ બદલો"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> ખોલો"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Wallet ઍપને શૉર્ટકટ તરીકે ઉમેરવા માટે, ખાતરી કરો કે ઍપ ઇન્સ્ટૉલ કરેલી હોય"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Wallet ઍપને શૉર્ટકટ તરીકે ઉમેરવા માટે, ખાતરી કરો કે ઓછામાં ઓછું એક કાર્ડ ઉમેરવામાં આવ્યું હોય"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR કોડ સ્કૅનરને શૉર્ટકટ તરીકે ઉમેરવા માટે, ખાતરી કરો કે કૅમેરા ઍપ ઇન્સ્ટૉલ કરેલી હોય"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home ઍપને શૉર્ટકટ તરીકે ઉમેરવા માટે, ખાતરી કરો કે ઍપ ઇન્સ્ટૉલ કરેલી હોય"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• ઓછામાં ઓછું એક ડિવાઇસ ઉપલબ્ધ છે"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"નોંધ લેવાના શૉર્ટકટનો ઉપયોગ કરવા માટે, નોંધ માટેની ડિફૉલ્ટ ઍપ પસંદ કરો"</string>
diff --git a/packages/SystemUI/res/values-hi/strings.xml b/packages/SystemUI/res/values-hi/strings.xml
index 091dd75..29f80aa 100644
--- a/packages/SystemUI/res/values-hi/strings.xml
+++ b/packages/SystemUI/res/values-hi/strings.xml
@@ -295,6 +295,8 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> सीमा"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> चेतावनी"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"वर्क ऐप्लिकेशन"</string>
+ <!-- no translation found for quick_settings_work_mode_paused_state (6681788236383735976) -->
+ <skip />
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"नाइट लाइट"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"शाम को चालू की जाएगी"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"सुबह तक चालू रहेगी"</string>
@@ -864,6 +866,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"स्क्रीन के किसी हिस्से को ज़ूम करें"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"ज़ूम करने की सुविधा वाली सेटिंग खोलें"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"ज़ूम करने की सुविधा वाली सेटिंग को बंद करें"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"साइज़ बदलने के लिए, कोने को खींचें और छोड़ें"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"तिरछी दिशा में स्क्रोल करने की अनुमति दें"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"साइज़ बदलें"</string>
@@ -1133,7 +1137,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> खोलें"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Wallet ऐप्लिकेशन को शॉर्टकट के तौर पर जोड़ने के लिए, पक्का करें कि ऐप्लिकेशन इंस्टॉल किया गया हो"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Wallet ऐप्लिकेशन को शॉर्टकट के तौर पर जोड़ने के लिए, पक्का करें कि कम से कम एक कार्ड जोड़ा गया हो"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"क्यूआर कोड स्कैनर को शॉर्टकट के तौर पर जोड़ने के लिए, पक्का करें कि कैमरा ऐप्लिकेशन इंस्टॉल किया गया हो"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home ऐप्लिकेशन को शॉर्टकट के तौर पर जोड़ने के लिए, पक्का करें कि ऐप्लिकेशन इंस्टॉल किया गया हो"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• कम से कम एक डिवाइस उपलब्ध है"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"नोट लेने से जुड़ा शॉर्टकट इस्तेमाल करने के लिए, नोट लेने का डिफ़ॉल्ट ऐप्लिकेशन चुनें"</string>
@@ -1168,7 +1171,7 @@
<string name="install_app" msgid="5066668100199613936">"ऐप्लिकेशन इंस्टॉल करें"</string>
<string name="privacy_dialog_title" msgid="7839968133469098311">"माइक्रोफ़ोन और कैमरा"</string>
<string name="privacy_dialog_summary" msgid="2458769652125995409">"हाल ही में इस्तेमाल करने वाला ऐप्लिकेशन"</string>
- <string name="privacy_dialog_more_button" msgid="7610604080293562345">"हाल ही का ऐक्सेस देखें"</string>
+ <string name="privacy_dialog_more_button" msgid="7610604080293562345">"हाल में ऐक्सेस करने वाले ऐप"</string>
<string name="privacy_dialog_done_button" msgid="4504330708531434263">"हो गया"</string>
<string name="privacy_dialog_expand_action" msgid="9129262348628331377">"बड़ा करें और विकल्प दिखाएं"</string>
<string name="privacy_dialog_collapse_action" msgid="277419962019466347">"छोटा करें"</string>
@@ -1179,7 +1182,7 @@
<string name="privacy_dialog_active_call_usage" msgid="7858746847946397562">"फ़ोन कॉल पर इस्तेमाल किया जा रहा है"</string>
<string name="privacy_dialog_recent_call_usage" msgid="1214810644978167344">"हाल ही में, फ़ोन कॉल में इस्तेमाल किया गया"</string>
<string name="privacy_dialog_active_app_usage" msgid="631997836335929880">"<xliff:g id="APP_NAME">%1$s</xliff:g> पर इस्तेमाल किया जा रहा है"</string>
- <string name="privacy_dialog_recent_app_usage" msgid="4883417856848222450">"हाल ही में, <xliff:g id="APP_NAME">%1$s</xliff:g> ने इस्तेमाल किया"</string>
+ <string name="privacy_dialog_recent_app_usage" msgid="4883417856848222450">"हाल ही में <xliff:g id="APP_NAME">%1$s</xliff:g> पर इस्तेमाल किया गया"</string>
<string name="privacy_dialog_active_app_usage_1" msgid="9047570143069220911">"<xliff:g id="APP_NAME">%1$s</xliff:g> (<xliff:g id="ATTRIBUTION_LABEL">%2$s</xliff:g>) पर इस्तेमाल किया जा रहा है"</string>
<string name="privacy_dialog_recent_app_usage_1" msgid="2551340497722370109">"हाल ही में, <xliff:g id="APP_NAME">%1$s</xliff:g> (<xliff:g id="ATTRIBUTION_LABEL">%2$s</xliff:g>) ने इस्तेमाल किया"</string>
<string name="privacy_dialog_active_app_usage_2" msgid="2770926061339921767">"<xliff:g id="APP_NAME">%1$s</xliff:g> (<xliff:g id="ATTRIBUTION_LABEL">%2$s</xliff:g> • <xliff:g id="PROXY_LABEL">%3$s</xliff:g>) पर इस्तेमाल किया जा रहा है"</string>
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index baf74d2..e58bc76 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Ograničenje od <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Upozorenje <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Poslovne aplikacije"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Pauzirano"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Noćno svjetlo"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Uključuje se u suton"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Do izlaska sunca"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Povećaj dio zaslona"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Otvori postavke povećavanja"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Zatvori postavke povećavanja"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Zatvaranje načina uređivanja"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Povucite kut da biste promijenili veličinu"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Dopusti dijagonalno pomicanje"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Promijeni veličinu"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Otvorite <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Za dodavanje aplikacije Wallet kao prečaca provjerite je li instalirana"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Provjerite je li dodana barem jedna kartica kako biste dodali aplikaciju Wallet kao prečac"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Provjerite je li instalirana aplikacija kamere kako biste dodali čitač QR koda kao prečac"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Provjerite je li aplikacija Home instalirana kako biste je dodali kao prečac"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Dostupan je najmanje jedan uređaj"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Odaberite zadanu aplikaciju za bilješke da biste koristili prečac za pisanje bilježaka"</string>
diff --git a/packages/SystemUI/res/values-hu/strings.xml b/packages/SystemUI/res/values-hu/strings.xml
index e225682..49ba82b 100644
--- a/packages/SystemUI/res/values-hu/strings.xml
+++ b/packages/SystemUI/res/values-hu/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> korlát"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Figyelem! <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Munkahelyi alkalmazások"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Szüneteltetve"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Éjszakai fény"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Be: naplemente"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Napfelkeltéig"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Képernyő bizonyos részének nagyítása"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Nagyítási beállítások megnyitása"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Nagyítási beállítások bezárása"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Az átméretezéshez húzza a kívánt sarkot"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Átlós görgetés engedélyezése"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Átméretezés"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"A(z) <xliff:g id="APPNAME">%1$s</xliff:g> megnyitása"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Ha szeretné felvenni Wallet alkalmazást gyorsparancsként, gondoskodjon az app telepítéséről"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Ha szeretné felvenni Wallet alkalmazást gyorsparancsként, győződjön meg róla, hogy hozzáadott legalább egy kártyát a szolgáltatáshoz"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Ha szeretné felvenni a QR-kód-szkennelőt gyorsparancsként, győződjön meg róla, hogy van az eszközre telepítve kameraalkalmazás"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Ha szeretné felvenni Home appot gyorsparancsként, gondoskodjon az alkalmazás telepítéséről"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Legalább egy eszköz rendelkezésre áll"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Válassza ki az alapértelmezett jegyzetkészítő alkalmazást, amelyet a jegyzetelési gyorsparancshoz szeretne használni"</string>
diff --git a/packages/SystemUI/res/values-hy/strings.xml b/packages/SystemUI/res/values-hy/strings.xml
index e573682..7b72456 100644
--- a/packages/SystemUI/res/values-hy/strings.xml
+++ b/packages/SystemUI/res/values-hy/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Սահմանաչափ՝ <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> զգուշացում"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Աշխատանքային հավելվածներ"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Դադարեցված է"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Գիշերային ռեժիմ"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Կմիացվի մայրամուտին"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Մինչև լուսաբաց"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Խոշորացնել էկրանի որոշակի հատվածը"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Բացել խոշորացման կարգավորումները"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Փակել խոշորացման կարգավորումները"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Քաշեք անկյունը՝ չափը փոխելու համար"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Թույլատրել անկյունագծով ոլորումը"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Փոխել չափը"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Բացել <xliff:g id="APPNAME">%1$s</xliff:g> հավելվածը"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Wallet հավելվածի դյուրանցումն ավելացնելու համար համոզվեք, որ հավելվածը տեղադրված է"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Wallet հավելվածի դյուրանցումն ավելացնելու համար համոզվեք, որ առնվազն մեկ քարտ ավելացված է"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR կոդերի սկաների դյուրանցումն ավելացնելու համար համոզվեք, որ տեսախցիկի հավելվածը տեղադրված է"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home հավելվածի դյուրանցումն ավելացնելու համար համոզվեք, որ հավելվածը տեղադրված է"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Հասանելի է առնվազն մեկ սարք"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Ընտրեք նշումների կանխադրված հավելված՝ նշումների ստեղծման դյուրանցումն օգտագործելու համար"</string>
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index 0e8c3a1..fc12a14 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Batas <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Peringatan <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Aplikasi kerja"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Dijeda"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Cahaya Malam"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Aktif saat malam"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Sampai pagi"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Perbesar sebagian layar"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Buka setelan pembesaran"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Tutup setelan pembesaran"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Tarik pojok persegi untuk mengubah ukuran"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Izinkan scrolling diagonal"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Ubah ukuran"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Buka <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Untuk menambahkan aplikasi Wallet sebagai pintasan, pastikan aplikasi sudah diinstal"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Untuk menambahkan aplikasi Wallet sebagai pintasan, pastikan minimal satu kartu telah ditambahkan"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Untuk menambahkan pemindai kode QR sebagai pintasan, pastikan aplikasi kamera sudah diinstal"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Untuk menambahkan aplikasi Home sebagai pintasan, pastikan aplikasi sudah diinstal"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Tersedia minimal satu perangkat"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Pilih aplikasi catatan default untuk menggunakan pintasan pembuatan catatan"</string>
diff --git a/packages/SystemUI/res/values-is/strings.xml b/packages/SystemUI/res/values-is/strings.xml
index 8411db4..2c784a6 100644
--- a/packages/SystemUI/res/values-is/strings.xml
+++ b/packages/SystemUI/res/values-is/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> hámark"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> viðvörun"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Vinnuforrit"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Hlé"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Næturljós"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Kveikt við sólsetur"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Til sólarupprásar"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Stækka hluta skjásins"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Opna stillingar stækkunar"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Loka stillingum stækkunar"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Dragðu horn til að breyta stærð"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Leyfa skáflettingu"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Breyta stærð"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Opna <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Til að bæta Veskisforritinu við sem flýtileið skaltu ganga úr skugga um að forritið sé uppsett"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Til að bæta Veskisforritinu við sem flýtileið skaltu ganga úr skugga um að hafa bætt að minnsta kosti einu korti við"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Til að bæta QR-kóðaskanna við sem flýtileið skaltu ganga úr skugga um að myndavélarforrit sé uppsett"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Til að bæta Home-forritinu við sem flýtileið skaltu ganga úr skugga um að forritið sé uppsett"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Að minnsta kosti eitt tæki er tiltækt"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Veldu sjálfgefið glósuforrit til að nota flýtileið fyrir glósugerð"</string>
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index 561da81..7c22297 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Limite di <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Avviso <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"App di lavoro"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"In pausa"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Luminosità notturna"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Attivata al tramonto"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Fino all\'alba"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Ingrandisci parte dello schermo"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Apri le impostazioni di ingrandimento"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Chiudi impostazioni di ingrandimento"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Trascina l\'angolo per ridimensionare"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Scorrimento diagonale"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Ridimensiona"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Apri <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Per aggiungere l\'app Wallet come scorciatoia, assicurati che l\'app sia installata"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Per aggiungere l\'app Wallet come scorciatoia, assicurati che sia stata aggiunta almeno una carta"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Per aggiungere lo scanner di codici QR come scorciatoia, assicurati che ci sia un\'app fotocamera installata"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Per aggiungere l\'app Home come scorciatoia, assicurati che l\'app sia installata"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Ci sia almeno un dispositivo disponibile"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Seleziona un\'app per le note predefinita per usare la scorciatoia per l\'aggiunta di note"</string>
diff --git a/packages/SystemUI/res/values-iw/strings.xml b/packages/SystemUI/res/values-iw/strings.xml
index c905b04..f1dd497 100644
--- a/packages/SystemUI/res/values-iw/strings.xml
+++ b/packages/SystemUI/res/values-iw/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"הגבלה של <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"אזהרה – <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"אפליקציות לעבודה"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"בהשהיה"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"תאורת לילה"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"התכונה מופעלת בשקיעה"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"עד הזריחה"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"הגדלת חלק מהמסך"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"פתיחת הגדרות ההגדלה"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"סגירת הגדרות ההגדלה"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"צריך לגרור את הפינה כדי לשנות את הגודל"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"הפעלת גלילה באלכסון"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"שינוי גודל"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"פתיחת <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"כדי להוסיף את אפליקציית Wallet כקיצור דרך, צריך לוודא שהאפליקציה מותקנת"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"כדי להוסיף את אפליקציית Wallet כקיצור דרך, צריך לוודא שנוסף לפחות כרטיס אחד"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"כדי להוסיף את סורק קודי ה-QR כקיצור דרך, צריך לוודא שמותקנת אפליקציית מצלמה"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"כדי להוסיף את אפליקציית Home כקיצור דרך, צריך לוודא שהאפליקציה מותקנת"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• יש לפחות מכשיר אחד זמין"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"צריך לבחור אפליקציית פתקים שתיפתח כברירת מחדל כשייעשה שימוש במקש הקיצור לכתיבת פתקים"</string>
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index 8a40d71..5d3919e 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"上限: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"警告: 上限は<xliff:g id="DATA_LIMIT">%s</xliff:g>です"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"仕事用アプリ"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"一時停止中"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"夜間モード"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"日の入りに ON"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"日の出まで"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"画面の一部を拡大します"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"画面の拡大設定を開く"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"拡大の設定を閉じる"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"編集モードを終了"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"サイズを変更するには角をドラッグ"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"斜めスクロールを許可"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"サイズ変更"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> を開く"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"ウォレット アプリをショートカットとして追加するには、アプリがインストールされていることを確認してください"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"ウォレット アプリをショートカットとして追加するには、カードが 1 枚以上追加されていることを確認してください"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR コードスキャナをショートカットとして追加するには、カメラアプリがインストールされていることを確認してください"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Google Home アプリをショートカットとして追加するには、アプリがインストールされていることを確認してください"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• 利用できるデバイスが 1 台以上ある"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"メモのショートカットを使用するデフォルトのメモアプリを選択してください"</string>
diff --git a/packages/SystemUI/res/values-ka/strings.xml b/packages/SystemUI/res/values-ka/strings.xml
index 0c5c76e..daa0ae7 100644
--- a/packages/SystemUI/res/values-ka/strings.xml
+++ b/packages/SystemUI/res/values-ka/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"ლიმიტი: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> გაფრთხილება"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"სამსახურის აპები"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"დაპაუზებულია"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"ღამის განათება"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"ჩაირთოს მზის ჩასვლისას"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"მზის ამოსვლამდე"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"ეკრანის ნაწილის გადიდება"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"გახსენით გადიდების პარამეტრები"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"გადიდების პარამეტრების დახურვა"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"რედაქტირების რეჟიმიდან გასვლა"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"ჩავლებით გადაიტანეთ კუთხე ზომის შესაცვლელად"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"დიაგონალური გადაადგილების დაშვება"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"ზომის შეცვლა"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> აპის გახსნა"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"საფულის აპის მალსახმობის დასამატებლად დარწმუნდით, რომ აპი დაინსტალირებულია"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"საფულის აპის მალსახმობის დასამატებლად დარწმუნდით, რომ დამატებულია მინიმუმ ერთი ბარათი"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR კოდის სკანერის მალსახმობის დასამატებლად დარწმუნდით, რომ დაინსტალირებულია კამერის აპი"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"მთავარი აპის მალსახმობის დასამატებლად დარწმუნდით, რომ აპი დაინსტალირებულია"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• ხელმისაწვდომია მინიმუმ ერთი მოწყობილობა"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"აირჩიეთ ჩანიშვნების ნაგულისხმევი აპი, რათა ჩანიშვნების შექმნის მალსახმობი გამოიყენოთ"</string>
diff --git a/packages/SystemUI/res/values-kk/strings.xml b/packages/SystemUI/res/values-kk/strings.xml
index 953292d..18f7855 100644
--- a/packages/SystemUI/res/values-kk/strings.xml
+++ b/packages/SystemUI/res/values-kk/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> шегі"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> туралы ескерту"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Жұмыс қолданбалары"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Кідіртілген"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Түнгі жарық"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Күн батқанда қосу"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Күн шыққанға дейін"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Экранның бөлігін ұлғайту"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Ұлғайту параметрлерін ашу"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Ұлғайту параметрлерін жабу"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Өлшемін өзгерту үшін бұрышынан сүйреңіз."</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Диагональ бойынша айналдыруға рұқсат беру"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Өлшемін өзгерту"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> ашу"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Wallet қолданбасын таңбаша ретінде қосу үшін қолданбаның орнатылғанын тексеріңіз."</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Wallet қолданбасын таңбаша ретінде қосу үшін кемінде бір картаның қосылғанын тексеріңіз."</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR кодының сканерін таңбаша ретінде қосу үшін камера қолданбасының орнатылғанын тексеріңіз."</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home қолданбасын таңбаша ретінде қосу үшін қолданбаның орнатылғанын тексеріңіз."</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Кемінде бір құрылғы қолжетімді."</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Жазба жазу таңбашасын пайдалану үшін әдепкі жазба қолданбаны таңдаңыз."</string>
diff --git a/packages/SystemUI/res/values-km/strings.xml b/packages/SystemUI/res/values-km/strings.xml
index 535400f..d5ef4b5 100644
--- a/packages/SystemUI/res/values-km/strings.xml
+++ b/packages/SystemUI/res/values-km/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"ដែនកំណត់ <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ការព្រមាន"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"កម្មវិធីការងារ"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"បានផ្អាក"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"ពន្លឺពេលយប់"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"បើកនៅពេលថ្ងៃលិច"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"រហូតដល់ពេលថ្ងៃរះ"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"ពង្រីកផ្នែកនៃអេក្រង់"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"បើកការកំណត់ការពង្រីក"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"បិទការកំណត់ការពង្រីក"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"អូសជ្រុងដើម្បីប្ដូរទំហំ"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"អនុញ្ញាតការរំកិលបញ្ឆិត"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"ប្ដូរទំហំ"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"បើក <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"ដើម្បីបញ្ចូលកម្មវិធី Wallet ជាផ្លូវកាត់ សូមប្រាកដថាកម្មវិធីត្រូវបានដំឡើង"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"ដើម្បីបញ្ចូលកម្មវិធី Wallet ជាផ្លូវកាត់ សូមប្រាកដថាបានបញ្ចូលកាតយ៉ាងហោចណាស់មួយ"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"ដើម្បីបញ្ចូលកម្មវិធីស្កេនកូដ QR ជាផ្លូវកាត់ សូមប្រាកដថាកម្មវិធីកាមេរ៉ាត្រូវបានដំឡើង"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"ដើម្បីបញ្ចូលកម្មវិធី Home ជាផ្លូវកាត់ សូមប្រាកដថាកម្មវិធីត្រូវបានដំឡើង"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• ឧបករណ៍យ៉ាងតិចមួយអាចប្រើបាន"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"ជ្រើសរើសកម្មវិធីកំណត់ចំណាំលំនាំដើម ដើម្បីប្រើផ្លូវកាត់សម្រាប់ការកត់ចំណាំ"</string>
diff --git a/packages/SystemUI/res/values-kn/strings.xml b/packages/SystemUI/res/values-kn/strings.xml
index 0a2bb64..0b82b55 100644
--- a/packages/SystemUI/res/values-kn/strings.xml
+++ b/packages/SystemUI/res/values-kn/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ಮಿತಿ"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ಎಚ್ಚರಿಕೆ"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"ಕೆಲಸಕ್ಕೆ ಸಂಬಂಧಿಸಿದ ಆ್ಯಪ್ಗಳು"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"ವಿರಾಮಗೊಳಿಸಲಾಗಿದೆ"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"ನೈಟ್ ಲೈಟ್"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"ಸೂರ್ಯಾಸ್ತದಲ್ಲಿ"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"ಸೂರ್ಯೋದಯದವರೆಗೆ"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"ಸ್ಕ್ರೀನ್ನ ಅರ್ಧಭಾಗವನ್ನು ಝೂಮ್ ಮಾಡಿ"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"ಹಿಗ್ಗಿಸುವಿಕೆ ಸೆಟ್ಟಿಂಗ್ಗಳನ್ನು ತೆರೆಯಿರಿ"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"ಮ್ಯಾಗ್ನಿಫಿಕೇಶನ್ ಸೆಟ್ಟಿಂಗ್ಗಳನ್ನು ಮುಚ್ಚಿರಿ"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"ಎಡಿಟ್ ಮೋಡ್ನಿಂದ ನಿರ್ಗಮಿಸಿ"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"ಮರುಗಾತ್ರಗೊಳಿಸಲು ಮೂಲೆಯನ್ನು ಡ್ರ್ಯಾಗ್ ಮಾಡಿ"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"ಡಯಾಗನಲ್ ಸ್ಕ್ರೋಲಿಂಗ್ ಅನ್ನು ಅನುಮತಿಸಿ"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"ಮರುಗಾತ್ರಗೊಳಿಸಿ"</string>
@@ -1038,7 +1040,7 @@
<string name="game_status" msgid="1340694320630973259">"ಪ್ಲೇ ಮಾಡಲಾಗುತ್ತಿದೆ"</string>
<string name="empty_user_name" msgid="3389155775773578300">"ಸ್ನೇಹಿತರು"</string>
<string name="empty_status" msgid="5938893404951307749">"ರಾತ್ರಿ ಚಾಟ್ ಮಾಡೋಣ!"</string>
- <string name="status_before_loading" msgid="1500477307859631381">"ವಿಷಯ ಶೀಘ್ರದಲ್ಲೇ ಕಾಣಿಸಿಕೊಳ್ಳುತ್ತವೆ"</string>
+ <string name="status_before_loading" msgid="1500477307859631381">"ಕಂಟೆಂಟ್ ಶೀಘ್ರದಲ್ಲೇ ಕಾಣಿಸಿಕೊಳ್ಳುತ್ತವೆ"</string>
<string name="missed_call" msgid="4228016077700161689">"ಮಿಸ್ಡ್ ಕಾಲ್"</string>
<string name="messages_count_overflow_indicator" msgid="7850934067082006043">"<xliff:g id="NUMBER">%d</xliff:g>+"</string>
<string name="people_tile_description" msgid="8154966188085545556">"ಇತ್ತೀಚಿನ ಸಂದೇಶಗಳು, ಮಿಸ್ಡ್ ಕಾಲ್ಗಳು ಮತ್ತು ಸ್ಥಿತಿ ಅಪ್ಡೇಟ್ಗಳು"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> ಅನ್ನು ತೆರೆಯಿರಿ"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"ವಾಲೆಟ್ ಆ್ಯಪ್ ಅನ್ನು ಶಾರ್ಟ್ಕಟ್ ಆಗಿ ಸೇರಿಸಲು, ಆ್ಯಪ್ ಅನ್ನು ಇನ್ಸ್ಟಾಲ್ ಮಾಡಲಾಗಿದೆಯೇ ಎಂಬುದನ್ನು ಖಚಿತಪಡಿಸಿಕೊಳ್ಳಿ"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"ವಾಲೆಟ್ ಆ್ಯಪ್ ಅನ್ನು ಶಾರ್ಟ್ಕಟ್ ಆಗಿ ಸೇರಿಸಲು, ಕನಿಷ್ಠ ಒಂದು ಕಾರ್ಡ್ ಅನ್ನು ಸೇರಿಸಲಾಗಿದೆಯೇ ಎಂಬುದನ್ನು ಖಚಿತಪಡಿಸಿಕೊಳ್ಳಿ"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR ಕೋಡ್ ಸ್ಕ್ಯಾನರ್ ಅನ್ನು ಶಾರ್ಟ್ಕಟ್ ಆಗಿ ಸೇರಿಸಲು, ಕ್ಯಾಮರಾ ಆ್ಯಪ್ ಅನ್ನು ಇನ್ಸ್ಟಾಲ್ ಮಾಡಲಾಗಿದೆಯೇ ಎಂಬುದನ್ನು ಖಚಿತಪಡಿಸಿಕೊಳ್ಳಿ"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home ಆ್ಯಪ್ ಅನ್ನು ಶಾರ್ಟ್ಕಟ್ ಆಗಿ ಸೇರಿಸಲು, ಆ್ಯಪ್ ಇನ್ಸ್ಟಾಲ್ ಆಗಿದೆಯೇ ಎಂಬುದನ್ನು ಖಚಿತಪಡಿಸಿಕೊಳ್ಳಿ"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• ಕನಿಷ್ಠ ಒಂದು ಸಾಧನ ಲಭ್ಯವಿದೆ"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"ನೋಟ್ಸ್ ಮಾಡಿಕೊಳ್ಳುವಿಕೆ ಶಾರ್ಟ್ಕಟ್ ಅನ್ನು ಬಳಸಲು ಡೀಫಾಲ್ಟ್ ಟಿಪ್ಪಣಿಗಳ ಆ್ಯಪ್ ಆಯ್ಕೆಮಾಡಿ"</string>
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index d267fed..ea7d5c2 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"한도: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> 경고"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"직장 앱"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"일시중지됨"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"야간 조명"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"일몰에"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"일출까지"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"화면 일부 확대"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"확대 설정 열기"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"확대 설정 닫기"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"모서리를 드래그하여 크기 조절"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"대각선 스크롤 허용"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"크기 조절"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> 열기"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"월렛 앱을 바로가기로 추가하려면 앱이 설치되어 있는지 확인하세요."</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"월렛 앱을 바로가기로 추가하려면 하나 이상의 카드가 추가되어 있는지 확인하세요."</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR 코드 스캐너를 바로가기로 추가하려면 카메라 앱이 설치되어 있는지 확인하세요."</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home 앱을 바로가기로 추가하려면 앱이 설치되어 있는지 확인하세요."</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• 1대 이상의 기기를 사용할 수 있습니다."</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"메모 바로가기를 사용하려면 기본 메모 앱을 선택합니다."</string>
diff --git a/packages/SystemUI/res/values-ky/strings.xml b/packages/SystemUI/res/values-ky/strings.xml
index 768e8a5..cb9e67a 100644
--- a/packages/SystemUI/res/values-ky/strings.xml
+++ b/packages/SystemUI/res/values-ky/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> чектөө"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> эскертүү"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Жумуш колдонмолору"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Тындырылды"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Түнкү режим"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Күн батканда күйөт"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Күн чыкканга чейин"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Экрандын бир бөлүгүн чоңойтуу"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Чоңойтуу параметрлерин ачуу"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Чоңойтуу параметрлерин жабуу"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Өлчөмүн өзгөртүү үчүн бурчун сүйрөңүз"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Диагональ боюнча сыдырууга уруксат берүү"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Өлчөмүн өзгөртүү"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> ачуу"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Капчык колдонмосун ыкчам баскыч катары кошуу үчүн колдонмону орнотуу керек"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Капчык колдонмосун ыкчам баскыч катары кошуу үчүн кеминде бир картаны кошуу керек"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR кодунун сканерин ыкчам баскыч катары кошуу үчүн камера колдонмосун орнотуу керек"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home колдонмосун ыкчам баскыч катары кошуу үчүн колдонмону орнотуу керек"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Кеминде бир түзмөк жеткиликтүү"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Эскертме жазуу ыкчам баскычын колдонуу үчүн демейки эскертме жазуу колдонмосун тандаңыз"</string>
diff --git a/packages/SystemUI/res/values-lo/strings.xml b/packages/SystemUI/res/values-lo/strings.xml
index e8b4003..3e26137 100644
--- a/packages/SystemUI/res/values-lo/strings.xml
+++ b/packages/SystemUI/res/values-lo/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"ຈຳກັດ <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"ຄຳເຕືອນ <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"ແອັບບ່ອນເຮັດວຽກ"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"ຢຸດໄວ້ຊົ່ວຄາວ"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"ແສງກາງຄືນ"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"ເປີດຕອນຕາເວັນຕົກ"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"ຈົນກວ່າຕາເວັນຂຶ້ນ"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"ຂະຫຍາຍບາງສ່ວນຂອງໜ້າຈໍ"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"ເປີດການຕັ້ງຄ່າການຂະຫຍາຍ"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"ປິດການຕັ້ງຄ່າການຂະຫຍາຍ"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"ລາກຢູ່ມຸມເພື່ອປັບຂະໜາດ"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"ອະນຸຍາດໃຫ້ເລື່ອນທາງຂວາງ"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"ປ່ຽນຂະໜາດ"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"ເປີດ <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"ເພື່ອເພີ່ມແອັບ Wallet ເປັນທາງລັດ, ກະລຸນາກວດສອບໃຫ້ແນ່ໃຈວ່າໄດ້ຕິດຕັ້ງແອັບແລ້ວ"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"ເພື່ອເພີ່ມແອັ Wallet ເປັນທາງລັດ, ກະລຸນາກວດສອບໃຫ້ແນ່ໃຈວ່າໄດ້ເພີ່ມຢ່າງໜ້ອຍ 1 ບັດແລ້ວ"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"ເພື່ອເພີ່ມຕົວສະແກນລະຫັດ QR ເປັນທາງລັດ, ກະລຸນາກວດສອບໃຫ້ແນ່ໃຈວ່າໄດ້ຕິດຕັ້ງແອັບກ້ອງຖ່າຍຮູບແລ້ວ"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"ເພື່ອເພີ່ມແອັບ Home ເປັນທາງລັດ, ກະລຸນາກວດສອບໃຫ້ແນ່ໃຈວ່າໄດ້ຕິດຕັ້ງແອັບແລ້ວ"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• ມີຢ່າງໜ້ອຍ 1 ອຸປະກອນພ້ອມໃຫ້ນຳໃຊ້"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"ເລືອກແອັບບັນທຶກເລີ່ມຕົ້ນເພື່ອໃຊ້ທາງລັດການຈົດບັນທຶກ"</string>
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index 2426533..a7d874c 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Limitas: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> įspėjimas"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Darbo programos"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Pristabdyta"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Nakties šviesa"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Per saulėlydį"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Iki saulėtekio"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Didinti ekrano dalį"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Atidaryti didinimo nustatymus"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Uždaryti didinimo nustatymus"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Norėdami keisti dydį, vilkite kampą"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Slinkimo įstrižai leidimas"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Pakeisti dydį"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Atidaryti „<xliff:g id="APPNAME">%1$s</xliff:g>“"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Jei norite pridėti programą „Wallet“ kaip šaukinį, įsitikinkite, kad programa įdiegta"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Jei norite pridėti programą „Wallet“ kaip šaukinį, įsitikinkite, kad pridėta bent viena kortelė"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Jei norite pridėti QR kodų skaitytuvą kaip šaukinį, įsitikinkite, kad fotoaparato programa įdiegta"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Jei norite pridėti programą „Home“ kaip šaukinį, įsitikinkite, kad programa įdiegta"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Pasiekiamas bent vienas įrenginys"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Pasirinkite numatytąją užrašų programą, kuriai norite naudoti užrašų kūrimo šaukinį"</string>
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index 9bda2b8..972380c 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Ierobežojums: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> brīdinājums"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Darba lietotnes"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Darbība apturēta"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Nakts režīms"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Saulrietā"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Līdz saullēktam"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Palielināt ekrāna daļu"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Atvērt palielinājuma iestatījumus"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Aizvērt palielinājuma iestatījumus"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Velciet stūri, lai mainītu izmērus"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Atļaut ritināšanu pa diagonāli"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Mainīt lielumu"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Atvērt lietotni <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Lai varētu pievienot lietotni Maks kā saīsni, lietotnei ir jābūt instalētai."</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Lai varētu pievienot lietotni Maks kā saīsni, ir jābūt pievienotai vismaz vienai kartei."</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Lai varētu pievienot lietotni Kvadrātkoda skeneris kā saīsni, ir jābūt instalētai kameras lietotnei."</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Lai varētu pievienot lietotni Home kā saīsni, lietotnei ir jābūt instalētai."</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Ir pieejama vismaz viena ierīce."</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Atlasiet noklusējuma piezīmju lietotni, lai izmantotu piezīmju pierakstīšanas saīsni."</string>
diff --git a/packages/SystemUI/res/values-mk/strings.xml b/packages/SystemUI/res/values-mk/strings.xml
index 9b8b04c..4b1e5a8 100644
--- a/packages/SystemUI/res/values-mk/strings.xml
+++ b/packages/SystemUI/res/values-mk/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Лимит: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Предупредување: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Работни апликации"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Паузирано"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Ноќно светло"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Вклуч. на зајдисонце"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"До изгрејсонце"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Зголемувајте дел од екранот"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Отвори поставки за зголемување"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Затворете ги поставките за зголемување"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Повлечете на аголот за да ја промените големината"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Дозволете дијагонално лизгање"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Промени големина"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Отворете ја <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"За да ја додадете апликацијата Wallet како кратенка, апликацијата мора да е инсталирана"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"За да ја додадете апликацијата Wallet како кратенка, мора да имате додадено најмалку една картичка"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"За да го додадете скенерот на QR-кодови како кратенка, погрижете се дека имате инсталирано апликација за камера"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"За да ја додадете апликацијата Home како кратенка, апликацијата мора да е инсталирана"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• достапен е најмалку еден уред"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Изберете стандардна апликација за белешки за да ја користите кратенката за фаќање белешки"</string>
diff --git a/packages/SystemUI/res/values-ml/strings.xml b/packages/SystemUI/res/values-ml/strings.xml
index b7a03d8..7202f5e 100644
--- a/packages/SystemUI/res/values-ml/strings.xml
+++ b/packages/SystemUI/res/values-ml/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> പരിധി"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> മുന്നറിയിപ്പ്"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"ഔദ്യോഗിക ആപ്പുകൾ"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"തൽക്കാലം നിർത്തി"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"നൈറ്റ് ലൈറ്റ്"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"സൂര്യാസ്തമയത്തിന്"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"സൂര്യോദയം വരെ"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"സ്ക്രീനിന്റെ ഭാഗം മാഗ്നിഫൈ ചെയ്യുക"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"മാഗ്നിഫിക്കേഷൻ ക്രമീകരണം തുറക്കുക"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"മാഗ്നിഫിക്കേഷൻ ക്രമീകരണം അടയ്ക്കുക"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"എഡിറ്റ് മോഡിൽ നിന്ന് പുറത്തുകടക്കുക"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"വലുപ്പം മാറ്റാൻ മൂല വലിച്ചിടുക"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"ഡയഗണൽ സ്ക്രോളിംഗ് അനുവദിക്കുക"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"വലുപ്പം മാറ്റുക"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> തുറക്കുക"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"കുറുക്കുവഴിയായി Wallet ആപ്പ് ചേർക്കാൻ, ആപ്പ് ഇൻസ്റ്റാൾ ചെയ്തിട്ടുണ്ടെന്ന് ഉറപ്പാക്കുക"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"കുറുക്കുവഴിയായി Wallet ആപ്പ് ചേർക്കാൻ, ഒരു കാർഡെങ്കിലും ചേർത്തിട്ടുണ്ടെന്ന് ഉറപ്പാക്കുക"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"കുറുക്കുവഴിയായി QR കോഡ് സ്കാനർ ചേർക്കാൻ, ക്യാമറാ ആപ്പ് ഇൻസ്റ്റാൾ ചെയ്തിട്ടുണ്ടെന്ന് ഉറപ്പാക്കുക"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"കുറുക്കുവഴിയായി Home ആപ്പ് ചേർക്കാൻ, ആപ്പ് ഇൻസ്റ്റാൾ ചെയ്തിട്ടുണ്ടെന്ന് ഉറപ്പാക്കുക"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• ഒരു ഉപകരണമെങ്കിലും ലഭ്യമാണ്"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"കുറിപ്പ് രേഖപ്പെടുത്തൽ കുറുക്കുവഴി ഉപയോഗിക്കുന്നതിന് ഒരു ഡിഫോൾട്ട് കുറിപ്പ് ആപ്പ് തിരഞ്ഞെടുക്കുക"</string>
diff --git a/packages/SystemUI/res/values-mn/strings.xml b/packages/SystemUI/res/values-mn/strings.xml
index 7a2ca61..470e0fd 100644
--- a/packages/SystemUI/res/values-mn/strings.xml
+++ b/packages/SystemUI/res/values-mn/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> хязгаар"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> анхааруулга"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Ажлын аппууд"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Түр зогсоосон"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Шөнийн гэрэл"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Нар жаргах үед"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Нар мандах хүртэл"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Дэлгэцийн нэг хэсгийг томруулах"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Томруулах тохиргоог нээх"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Томруулах тохиргоог хаах"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Хэмжээг өөрчлөхийн тулд булангаас чирнэ үү"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Хөндлөн гүйлгэхийг зөвшөөрөх"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Хэмжээг өөрчлөх"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g>-г нээх"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Wallet аппыг товчлолоор нэмэхийн тулд уг аппыг суулгасан эсэхийг шалгана уу"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Wallet аппыг товчлолоор нэмэхийн тулд дор хаяж нэг карт нэмсэн эсэхийг шалгана уу"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR код сканнерыг товчлолоор нэмэхийн тулд камерын аппыг суулгасан эсэхийг шалгана уу"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home аппыг товчлолоор нэмэхийн тулд уг аппыг суулгасан эсэхийг шалгана уу"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Дор хаяж нэг төхөөрөмж боломжтой"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Тэмдэглэл хөтлөх товчлолыг ашиглахын тулд тэмдэглэлийн өгөгдмөл аппыг сонгоно уу"</string>
diff --git a/packages/SystemUI/res/values-mr/strings.xml b/packages/SystemUI/res/values-mr/strings.xml
index ccbc209..f5abe78 100644
--- a/packages/SystemUI/res/values-mr/strings.xml
+++ b/packages/SystemUI/res/values-mr/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> मर्यादा"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> चेतावणी"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"कामाशी संबंधित अॅप्स"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"थांबवले आहे"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"रात्रीचा प्रकाश"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"संध्याकाळी सुरू असते"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"सूर्योदयापर्यंत"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"स्क्रीनचा काही भाग मॅग्निफाय करा"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"मॅग्निफिकेशन सेटिंग्ज उघडा"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"मॅग्निफिकेशन सेटिंग्ज बंद करा"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"आकार बदलण्यासाठी कोपरा ड्रॅग करा"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"तिरपे स्क्रोल करण्याची अनुमती द्या"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"आकार बदला"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> उघडा"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Wallet ॲप शॉर्टकट म्हणून जोडण्यासाठी ॲप इंस्टॉल केले असल्याची खात्री करा"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Wallet ॲप शॉर्टकट म्हणून जोडण्यासाठी किमान एक कार्ड जोडले असल्याची खात्री करा"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR कोड स्कॅनर शॉर्टकट म्हणून जोडण्यासाठी कॅमेरा ॲप इंस्टॉल केले असल्याची खात्री करा"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home अॅप शॉर्टकट म्हणून जोडण्यासाठी ॲप इंस्टॉल केले असल्याची खात्री करा"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• किमान एक डिव्हाइस उपलब्ध करणे"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"टिपा घेण्यासंबंधित शॉर्टकट वापरण्याकरिता टिपांसाठीचे डीफॉल्ट अॅप निवडा"</string>
diff --git a/packages/SystemUI/res/values-ms/strings.xml b/packages/SystemUI/res/values-ms/strings.xml
index 586c96e..6b74c43 100644
--- a/packages/SystemUI/res/values-ms/strings.xml
+++ b/packages/SystemUI/res/values-ms/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> had"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Amaran <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Apl kerja"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Dijeda"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Cahaya Malam"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Dihidupkan pd senja"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Hingga matahari terbit"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Besarkan sebahagian skrin"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Buka tetapan pembesaran"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Tutup tetapan pembesaran"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Keluar daripada mod edit"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Seret sudut untuk mengubah saiz"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Benarkan penatalan pepenjuru"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Ubah saiz"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Buka <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Untuk menambahkan apl Wallet sebagai pintasan, pastikan apl telah dipasang"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Untuk menambahkan apl Wallet sebagai pintasan, pastikan sekurang-kurangnya satu kad telah ditambahkan"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Untuk menambahkan pengimbas kod QR sebagai pintasan, pastikan apl kamera telah dipasang"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Untuk menambahkan apl Home sebagai pintasan, pastikan apl telah dipasang"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Sekurang-kurangnya satu peranti tersedia"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Pilih apl nota lalai untuk menggunakan pintasan pengambilan nota"</string>
diff --git a/packages/SystemUI/res/values-my/strings.xml b/packages/SystemUI/res/values-my/strings.xml
index aa5853f..2e2567d 100644
--- a/packages/SystemUI/res/values-my/strings.xml
+++ b/packages/SystemUI/res/values-my/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ကန့်သတ်ချက်"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> သတိပေးချက်"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"အလုပ်သုံးအက်ပ်များ"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"ခဏရပ်ထားသည်"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"ညအလင်းရောင်"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"နေဝင်ချိန်၌ ဖွင့်ရန်"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"နေထွက်ချိန် အထိ"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"ဖန်သားပြင် တစ်စိတ်တစ်ပိုင်းကို ချဲ့ပါ"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"ချဲ့ခြင်း ဆက်တင်များ ဖွင့်ရန်"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"ချဲ့ခြင်း ဆက်တင်များ ပိတ်ရန်"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"ပြင်ဆင်မုဒ်မှ ထွက်ရန်"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"အရွယ်အစားပြန်ပြုပြင်ရန် ထောင့်စွန်းကို ဖိဆွဲပါ"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"ထောင့်ဖြတ် လှိမ့်ခွင့်ပြုရန်"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"အရွယ်အစားပြန်ပြုပြင်ရန်"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> ဖွင့်ရန်"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Wallet အက်ပ်ကို ဖြတ်လမ်းလင့်ခ်အဖြစ်ထည့်ရန် ၎င်းအားထည့်သွင်းထားကြောင်း သေချာပါစေ"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Wallet အက်ပ်ကို ဖြတ်လမ်းလင့်ခ်အဖြစ်ထည့်ရန် အနည်းဆုံး ကတ်တစ်ခုထည့်ထားကြောင်း သေချာပါစေ"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR ကုဒ် စကင်ဖတ်စနစ်ကို ဖြတ်လမ်းလင့်ခ်အဖြစ်ထည့်ရန် ကင်မရာအက်ပ်အားထည့်သွင်းထားကြောင်း သေချာပါစေ"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home အက်ပ်ကို ဖြတ်လမ်းလင့်ခ်အဖြစ်ထည့်ရန် ၎င်းအားထည့်သွင်းထားကြောင်း သေချာပါစေ"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• အနည်းဆုံး စက်တစ်ခုသုံးနိုင်ရမည်"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"မှတ်စုရေးသည့် ဖြတ်လမ်းလင့်ခ်သုံးရန်အတွက် မူရင်းမှတ်စုများအက်ပ် ရွေးရန်"</string>
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index 90025c6..8ef7794 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Grense på <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Advarsel for <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Jobbapper"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Satt på pause"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Nattlys"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"På ved solnedgang"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Til soloppgang"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Forstørr en del av skjermen"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Åpne innstillinger for forstørring"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Lukk forstørringsinnstillingene"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Dra hjørnet for å endre størrelse"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Tillat diagonal rulling"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Endre størrelse"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Åpne <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"For å legge til Wallet-appen som snarvei, sørg for at appen er installert"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"For å legge til Wallet-appen som snarvei, sørg for at minst ett kort er lagt til"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"For å legge til QR-kodeskanneren som snarvei, sørg for at du har en kameraapp installert"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"For å legge til Home-appen som snarvei, sørg for at appen er installert"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• minst én enhet er tilgjengelig"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Velg en standard notatapp du vil bruke med notatsnarveien"</string>
diff --git a/packages/SystemUI/res/values-ne/strings.xml b/packages/SystemUI/res/values-ne/strings.xml
index dd15313..c56ebb6 100644
--- a/packages/SystemUI/res/values-ne/strings.xml
+++ b/packages/SystemUI/res/values-ne/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> सीमा"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> चेतावनी दिँदै"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"कामसम्बन्धी एपहरू"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"पज गरिएको छ"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Night Light"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"सूर्यास्तमा सक्रिय"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"सूर्योदयसम्म"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"स्क्रिनको केही भाग म्याग्निफाइ गर्नुहोस्"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"जुम इनसम्बन्धी सेटिङ खोल्नुहोस्"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"जुम इन गर्ने सुविधाको सेटिङ बन्द गर्नुहोस्"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"आकार बदल्न कुनाबाट ड्र्याग गर्नुहोस्"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"डायगोनल तरिकाले स्क्रोल गर्ने अनुमति दिनुहोस्"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"आकार बदल्नुहोस्"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> खोल्नुहोस्"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"सर्टकटका रूपमा Wallet एप हाल्न उक्त एप इन्स्टल गरिएको छ भन्ने कुरा सुनिश्चित गर्नुहोस्"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"सर्टकटका रूपमा Wallet एप हाल्न कम्तीमा एउटा कार्ड हालिएको छ भन्ने कुरा सुनिश्चित गर्नुहोस्"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"सर्टकटका रूपमा QR कोड स्क्यानर हाल्न क्यामेरा एप इन्स्टल गरिएको छ भन्ने कुरा सुनिश्चित गर्नुहोस्"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home एपलाई सर्टकटका रूपमा हाल्न उक्त एप इन्स्टल गरिएको छ भन्ने कुरा सुनिश्चित गर्नुहोस्"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• कम्तीमा एउटा डिभाइस उपलब्ध छ"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"नोट बनाउनेसम्बन्धी सर्टकट प्रयोग गर्न नोट बनाउने डिफल्ट एप चयन गर्नुहोस्"</string>
diff --git a/packages/SystemUI/res/values-nl/strings.xml b/packages/SystemUI/res/values-nl/strings.xml
index 1b657c9..088bcbd 100644
--- a/packages/SystemUI/res/values-nl/strings.xml
+++ b/packages/SystemUI/res/values-nl/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Limiet van <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Waarschuwing voor <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Werk-apps"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Onderbroken"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Nachtverlichting"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Aan bij zonsondergang"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Tot zonsopkomst"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Deel van het scherm vergroten"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Instellingen voor vergroting openen"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Instellingen voor vergroting sluiten"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Bewerkingsmodus sluiten"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Sleep een hoek om het formaat te wijzigen"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Diagonaal scrollen toestaan"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Formaat aanpassen"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> openen"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Als je de Wallet-app wilt toevoegen als sneltoets, zorg je dat de app is geïnstalleerd"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Als je de Wallet-app wilt toevoegen als sneltoets, zorg je dat er minstens één kaart is toegevoegd"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Als je de QR-codescanner wilt toevoegen als sneltoets, zorg je dat er een camera-app is geïnstalleerd"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Als je de Home-app wilt toevoegen als sneltoets, zorg je dat de app is geïnstalleerd"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Er is minstens één apparaat beschikbaar"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Selecteer een standaard notitie-app om de sneltoets voor notities maken te gebruiken"</string>
diff --git a/packages/SystemUI/res/values-or/strings.xml b/packages/SystemUI/res/values-or/strings.xml
index 3da07a8..64955e4 100644
--- a/packages/SystemUI/res/values-or/strings.xml
+++ b/packages/SystemUI/res/values-or/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ସୀମା"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ଚେତାବନୀ"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"ୱାର୍କ ଆପ୍ସ"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"ବିରତ କରାଯାଇଛି"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"ନାଇଟ୍ ଲାଇଟ୍"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"ସୂର୍ଯ୍ୟାସ୍ତ ବେଳେ ଅନ୍ ହେବ"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"ସୂର୍ଯ୍ୟୋଦୟ ପର୍ଯ୍ୟନ୍ତ"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"ସ୍କ୍ରିନର ଅଂଶ ମାଗ୍ନିଫାଏ କରନ୍ତୁ"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"ମାଗ୍ନିଫିକେସନ ସେଟିଂସ ଖୋଲନ୍ତୁ"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"ମେଗ୍ନିଫିକେସନ ସେଟିଂସକୁ ବନ୍ଦ କରନ୍ତୁ"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"ରିସାଇଜ କରିବା ପାଇଁ କୋଣକୁ ଡ୍ରାଗ କରନ୍ତୁ"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"ଡାଏଗୋନାଲ ସ୍କ୍ରୋଲିଂକୁ ଅନୁମତି ଦିଅନ୍ତୁ"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"ରିସାଇଜ କରନ୍ତୁ"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> ଖୋଲନ୍ତୁ"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"ଏକ ସର୍ଟକଟ ଭାବେ Wallet ଆପ ଯୋଗ କରିବା ପାଇଁ ଏହି ଆପ ଇନଷ୍ଟଲ କରାଯାଇଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"ଏକ ସର୍ଟକଟ ଭାବେ Wallet ଆପ ଯୋଗ କରିବାକୁ ଅତିକମରେ ଗୋଟିଏ ଆପ ଯୋଗ କରାଯାଇଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"ଏକ ସର୍ଟକଟ ଭାବେ QR କୋଡ ସ୍କାନର ଯୋଗ କରିବାକୁ ଏକ କେମେରା ଆପ ଇନଷ୍ଟଲ କରାଯାଇଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"ଏକ ସର୍ଟକଟ ଭାବେ Home ଆପ ଯୋଗ କରିବା ପାଇଁ ଏହି ଆପ ଇନଷ୍ଟଲ କରାଯାଇଥିବା ସୁନିଶ୍ଚିତ କରନ୍ତୁ"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• ଅତିକମରେ ଗୋଟିଏ ଡିଭାଇସ ଉପଲବ୍ଧ ଅଛି"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"ନୋଟଟେକିଂ ସର୍ଟକଟ ବ୍ୟବହାର କରିବାକୁ ଏକ ଡିଫଲ୍ଟ ନୋଟ୍ସ ଆପ୍ସ ଚୟନ କରନ୍ତୁ"</string>
diff --git a/packages/SystemUI/res/values-pa/strings.xml b/packages/SystemUI/res/values-pa/strings.xml
index b8a92c2..b3d4482 100644
--- a/packages/SystemUI/res/values-pa/strings.xml
+++ b/packages/SystemUI/res/values-pa/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ਸੀਮਾ"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ਚਿਤਾਵਨੀ"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"ਕੰਮ ਸੰਬੰਧੀ ਐਪਾਂ"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"ਰੋਕਿਆ ਗਿਆ"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"ਰਾਤ ਦੀ ਰੋਸ਼ਨੀ"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"ਸੂਰਜ ਛਿਪਣ \'ਤੇ ਚਾਲੂ"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"ਸੂਰਜ ਚੜ੍ਹਨ ਤੱਕ"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"ਸਕ੍ਰੀਨ ਦੇ ਹਿੱਸੇ ਨੂੰ ਵੱਡਾ ਕਰੋ"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"ਵੱਡਦਰਸ਼ੀਕਰਨ ਸੈਟਿੰਗਾਂ ਖੋਲ੍ਹੋ"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"ਵੱਡਦਰਸ਼ੀਕਰਨ ਸੈਟਿੰਗਾਂ ਬੰਦ ਕਰੋ"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"ਆਕਾਰ ਬਦਲਣ ਲਈ ਕੋਨਾ ਘਸੀਟੋ"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"ਟੇਡੀ ਦਿਸ਼ਾ ਵਿੱਚ ਸਕ੍ਰੋਲ ਕਰਨ ਦਿਓ"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"ਆਕਾਰ ਬਦਲੋ"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> ਖੋਲ੍ਹੋ"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Wallet ਐਪ ਨੂੰ ਸ਼ਾਰਟਕੱਟ ਵਜੋਂ ਸ਼ਾਮਲ ਕਰਨ ਲਈ, ਪੱਕਾ ਕਰੋ ਕਿ ਐਪ ਸਥਾਪਤ ਹੈ"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Wallet ਐਪ ਨੂੰ ਸ਼ਾਰਟਕੱਟ ਵਜੋਂ ਸ਼ਾਮਲ ਕਰਨ ਲਈ, ਪੱਕਾ ਕਰੋ ਕਿ ਘੱਟੋ-ਘੱਟ ਇੱਕ ਕਾਰਡ ਸ਼ਾਮਲ ਕੀਤਾ ਗਿਆ ਹੈ"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR ਕੋਡ ਸਕੈਨਰ ਨੂੰ ਸ਼ਾਰਟਕੱਟ ਵਜੋਂ ਸ਼ਾਮਲ ਕਰਨ ਲਈ, ਪੱਕਾ ਕਰੋ ਕਿ ਕੈਮਰਾ ਐਪ ਸਥਾਪਤ ਹੈ"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home ਐਪ ਨੂੰ ਸ਼ਾਰਟਕੱਟ ਵਜੋਂ ਸ਼ਾਮਲ ਕਰਨ ਲਈ, ਪੱਕਾ ਕਰੋ ਕਿ ਐਪ ਸਥਾਪਤ ਹੈ"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• ਘੱਟੋ-ਘੱਟ ਇੱਕ ਡੀਵਾਈਸ ਉਪਲਬਧ ਹੈ"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"ਨੋਟ ਬਣਾਉਣ ਵਾਲੇ ਸ਼ਾਰਟਕੱਟ ਦੀ ਵਰਤੋਂ ਕਰਨ ਲਈ ਪੂਰਵ-ਨਿਰਧਾਰਿਤ ਨੋਟ ਐਪ ਚੁਣੋ"</string>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index 8c0a78e..e3beef0 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Limit <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Ostrzeżenie: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Aplikacje służbowe"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Wstrzymano"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Podświetlenie nocne"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Włącz o zachodzie"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Do wschodu słońca"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Powiększ część ekranu"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Otwórz ustawienia powiększenia"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Zamknij ustawienia powiększenia"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Przeciągnij róg, aby zmienić rozmiar"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Zezwalaj na przewijanie poprzeczne"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Zmień rozmiar"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Otwórz: <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Aby dodać aplikację Portfel jako skrót, upewnij się, że jest zainstalowana"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Aby dodać aplikację Portfel jako skrót, upewnij się, że została dodana co najmniej 1 karta"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Aby dodać Skaner kodów QR jako skrót, upewnij się, że jest zainstalowana aplikacja aparatu"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Aby dodać aplikację Home jako skrót, upewnij się, że jest zainstalowana"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Dostępne jest co najmniej 1 urządzenie."</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Wybierz domyślną aplikację do obsługi notatek, której skrótu będziesz używać do funkcji notowania"</string>
diff --git a/packages/SystemUI/res/values-pt-rBR/strings.xml b/packages/SystemUI/res/values-pt-rBR/strings.xml
index bf976f7..8f5d7fa 100644
--- a/packages/SystemUI/res/values-pt-rBR/strings.xml
+++ b/packages/SystemUI/res/values-pt-rBR/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Limite: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Aviso de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Apps de trabalho"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Pausado"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Modo noturno"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Ativ. ao pôr do sol"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Até o nascer do sol"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Ampliar parte da tela"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Abrir as configurações de ampliação"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Fechar configurações de ampliação"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Sair do modo de edição"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Arraste o canto para redimensionar"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Permitir rolagem diagonal"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Redimensionar"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Abrir <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Para adicionar o app Carteira como um atalho, verifique se ele está instalado"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Para adicionar o app Carteira como um atalho, verifique se pelo menos um cartão foi adicionado"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Para adicionar o leitor de código QR como um atalho, verifique se algum app de câmera está instalado"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Para adicionar o app Home como um atalho, verifique se ele está instalado"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Pelo menos um dispositivo está disponível"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Selecione um app de notas padrão para usar o atalho de anotações"</string>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings.xml b/packages/SystemUI/res/values-pt-rPT/strings.xml
index 9974df1..a4f17b6 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Limite de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Aviso de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Apps trabalho"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Pausado"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Luz noturna"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Ativ. ao pôr-do-sol"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Até ao amanhecer"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Ampliar parte do ecrã"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Abrir definições de ampliação"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Fechar definições de ampliação"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Sair do modo de edição"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Arrastar o canto para redimensionar"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Permitir deslocamento da página na diagonal"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Redimensionar"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Abrir <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Para adicionar a app Carteira como um atalho, certifique-se de que a app está instalada"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Para adicionar a app Carteira como um atalho, certifique-se de que foi adicionado, pelo menos, um cartão"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Para adicionar o Leitor de códigos QR como um atalho, certifique-se de que está instalada uma app de câmara"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Para adicionar a app Home como um atalho, certifique-se de que a app está instalada"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Está disponível, pelo menos, um dispositivo"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Selecione uma app de notas predefinida para usar o atalho de anotação"</string>
diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml
index bf976f7..8f5d7fa 100644
--- a/packages/SystemUI/res/values-pt/strings.xml
+++ b/packages/SystemUI/res/values-pt/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Limite: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Aviso de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Apps de trabalho"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Pausado"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Modo noturno"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Ativ. ao pôr do sol"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Até o nascer do sol"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Ampliar parte da tela"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Abrir as configurações de ampliação"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Fechar configurações de ampliação"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Sair do modo de edição"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Arraste o canto para redimensionar"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Permitir rolagem diagonal"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Redimensionar"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Abrir <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Para adicionar o app Carteira como um atalho, verifique se ele está instalado"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Para adicionar o app Carteira como um atalho, verifique se pelo menos um cartão foi adicionado"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Para adicionar o leitor de código QR como um atalho, verifique se algum app de câmera está instalado"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Para adicionar o app Home como um atalho, verifique se ele está instalado"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Pelo menos um dispositivo está disponível"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Selecione um app de notas padrão para usar o atalho de anotações"</string>
diff --git a/packages/SystemUI/res/values-ro/strings.xml b/packages/SystemUI/res/values-ro/strings.xml
index 1ed3a37..749106b 100644
--- a/packages/SystemUI/res/values-ro/strings.xml
+++ b/packages/SystemUI/res/values-ro/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Limită de <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Avertizare: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Aplicații pentru lucru"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Întreruptă"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Lumină de noapte"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Activată la apus"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Până la răsărit"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Mărește o parte a ecranului"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Deschide setările pentru mărire"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Închide setările de mărire"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Trage de colț pentru a redimensiona"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Permite derularea pe diagonală"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Redimensionează"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Deschide <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Pentru a adăuga aplicația Portofel drept comandă rapidă, asigură-te că aplicația este instalată"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Pentru a adăuga aplicația Portofel drept comandă rapidă, asigură-te că ai adăugat cel puțin un card"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Pentru a adăuga Scanner de coduri QR drept comandă rapidă, asigură-te că este instalată o aplicație pentru camera foto"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Pentru a adăuga aplicația Home drept comandă rapidă, asigură-te că aplicația este instalată"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Este disponibil cel puțin un dispozitiv"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Selectează o aplicație prestabilită pentru note ca să folosești comanda rapidă de luat note"</string>
@@ -1167,7 +1169,7 @@
<string name="set_default_notes_app_toast_content" msgid="2812374329662610753">"Setează aplicația prestabilită de note din Setări"</string>
<string name="install_app" msgid="5066668100199613936">"Instalează aplicația"</string>
<string name="privacy_dialog_title" msgid="7839968133469098311">"Microfon și cameră"</string>
- <string name="privacy_dialog_summary" msgid="2458769652125995409">"Folosit recent de aplicații"</string>
+ <string name="privacy_dialog_summary" msgid="2458769652125995409">"Utilizare recentă în aplicații"</string>
<string name="privacy_dialog_more_button" msgid="7610604080293562345">"Vezi accesarea recentă"</string>
<string name="privacy_dialog_done_button" msgid="4504330708531434263">"Gata"</string>
<string name="privacy_dialog_expand_action" msgid="9129262348628331377">"Extinde și afișează opțiunile"</string>
@@ -1178,10 +1180,10 @@
<string name="privacy_dialog_manage_permissions" msgid="2543451567190470413">"Gestionează accesul"</string>
<string name="privacy_dialog_active_call_usage" msgid="7858746847946397562">"Folosit de un apel telefonic"</string>
<string name="privacy_dialog_recent_call_usage" msgid="1214810644978167344">"Folosit recent într-un apel telefonic"</string>
- <string name="privacy_dialog_active_app_usage" msgid="631997836335929880">"Folosit de <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
- <string name="privacy_dialog_recent_app_usage" msgid="4883417856848222450">"Folosit recent de <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
- <string name="privacy_dialog_active_app_usage_1" msgid="9047570143069220911">"Folosit de <xliff:g id="APP_NAME">%1$s</xliff:g> (<xliff:g id="ATTRIBUTION_LABEL">%2$s</xliff:g>)"</string>
+ <string name="privacy_dialog_active_app_usage" msgid="631997836335929880">"Se folosește pentru <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
+ <string name="privacy_dialog_recent_app_usage" msgid="4883417856848222450">"S-a folosit recent de <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
+ <string name="privacy_dialog_active_app_usage_1" msgid="9047570143069220911">"Se folosește pentru <xliff:g id="APP_NAME">%1$s</xliff:g> (<xliff:g id="ATTRIBUTION_LABEL">%2$s</xliff:g>)"</string>
<string name="privacy_dialog_recent_app_usage_1" msgid="2551340497722370109">"Folosit recent de <xliff:g id="APP_NAME">%1$s</xliff:g> (<xliff:g id="ATTRIBUTION_LABEL">%2$s</xliff:g>)"</string>
- <string name="privacy_dialog_active_app_usage_2" msgid="2770926061339921767">"Folosit de <xliff:g id="APP_NAME">%1$s</xliff:g> (<xliff:g id="ATTRIBUTION_LABEL">%2$s</xliff:g> • <xliff:g id="PROXY_LABEL">%3$s</xliff:g>)"</string>
+ <string name="privacy_dialog_active_app_usage_2" msgid="2770926061339921767">"Se folosește pentru <xliff:g id="APP_NAME">%1$s</xliff:g> (<xliff:g id="ATTRIBUTION_LABEL">%2$s</xliff:g> • <xliff:g id="PROXY_LABEL">%3$s</xliff:g>)"</string>
<string name="privacy_dialog_recent_app_usage_2" msgid="2874689735085367167">"Folosit recent de <xliff:g id="APP_NAME">%1$s</xliff:g> (<xliff:g id="ATTRIBUTION_LABEL">%2$s</xliff:g> • <xliff:g id="PROXY_LABEL">%3$s</xliff:g>)"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index 400db7b..5f7445a 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Ограничение: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Предупреждение: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Рабочие приложения"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Приостановлен"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Ночная подсветка"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Вкл. на закате"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"До рассвета"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Увеличить часть экрана"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Открыть настройки увеличения"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Закрыть настройки увеличения"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Потяните за угол, чтобы изменить размер"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Разрешить прокручивать по диагонали"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Изменить размер"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Открыть \"<xliff:g id="APPNAME">%1$s</xliff:g>\""</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Вы можете добавить ярлык приложения \"Кошелек\", только если оно установлено."</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Вы можете добавить ярлык приложения \"Кошелек\", только если добавлена хотя бы одна карта."</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Вы можете добавить ярлык сканера QR-кодов, только если установлено приложение камеры."</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Вы можете добавить ярлык приложения Home, только если оно установлено."</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Доступно хотя бы одно устройство."</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Выберите стандартное приложение для заметок, которое будет открываться при нажатии на ярлык."</string>
diff --git a/packages/SystemUI/res/values-si/strings.xml b/packages/SystemUI/res/values-si/strings.xml
index 37a14f9..5cc1fa9 100644
--- a/packages/SystemUI/res/values-si/strings.xml
+++ b/packages/SystemUI/res/values-si/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> සීමිත"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> අවවාද කිරීම"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"කාර්යාල යෙදුම්"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"විරාමයි"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"රාත්රී ආලෝකය"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"හිරු බැසීමේදී ක්රි."</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"හිරු නගින තෙක්"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"තිරයේ කොටසක් විශාලනය කරන්න"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"විශාලන සැකසීම් විවෘත කරන්න"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"විශාලන සැකසීම් වසන්න"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"ප්රමාණය වෙනස් කිරීමට කොන අදින්න"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"විකර්ණ අනුචලනයට ඉඩ දෙන්න"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"ප්රතිප්රමාණය කරන්න"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> විවෘත කරන්න"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"කෙටිමඟක් ලෙස Wallet යෙදුම එක් කිරීම සඳහා, යෙදුම ස්ථාපනය කර ඇති බවට වග බලා ගන්න"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"කෙටිමඟක් ලෙස Wallet යෙදුම එක් කිරීම සඳහා, අවම වශයෙන් එක් කාඩ්පතක් එක් කර ඇති බවට වග බලා ගන්න"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"කෙටිමඟක් ලෙස QR කේත ස්කෑනරය එක් කිරීම සඳහා, කැමරා යෙදුමක් ස්ථාපනය කර ඇති බවට වග බලා ගන්න"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home යෙදුම කෙටිමඟක් ලෙස එක් කිරීම සඳහා, යෙදුම ස්ථාපනය කර ඇති බව සහතික කර ගන්න"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• අවම වශයෙන් එක උපාංගයක් ලැබේ"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"සටහන් ගැනීමේ කෙටිමඟ භාවිතා කිරීමට පෙරනිමි සටහන් යෙදුමක් තෝරන්න"</string>
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index baa9b4f..1da7aca 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Limit: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Upozornenie pri <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Pracovné aplikácie"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Pozastavené"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Nočný režim"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Zapne sa pri západe slnka"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Do východu slnka"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Zväčšiť časť obrazovky"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Otvoriť nastavenia zväčšenia"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Zavrieť nastavenia zväčšenia"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Veľkosť zmeníte presunutím rohu"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Povoliť diagonálne posúvanie"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Zmeniť veľkosť"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Otvoriť <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Ak chcete pridať aplikáciu Peňaženka ako odkaz, uistite sa, že je nainštalovaná"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Ak chcete pridať aplikáciu Peňaženka ako odkaz, uistite sa, že bola pridaná aspoň jedna karta"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Ak chcete pridať skener QR kódov ako odkaz, uistite, že je nainštalovaná aplikácia fotoaparátu"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Ak chcete pridať aplikáciu Home ako odkaz, uistite sa, že je nainštalovaná"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• K dispozícii je minimálne jedno zariadenie"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Ak chcete používať odkaz na písanie poznámok, vyberte predvolenú aplikáciu na písanie poznámok"</string>
diff --git a/packages/SystemUI/res/values-sl/strings.xml b/packages/SystemUI/res/values-sl/strings.xml
index 3608293..79e5437 100644
--- a/packages/SystemUI/res/values-sl/strings.xml
+++ b/packages/SystemUI/res/values-sl/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Omejitev: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Opozorilo – <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Delovne aplikacije"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Začasno zaustavljeno"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Nočna svetloba"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Ob sončnem zahodu"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Do sončnega vzhoda"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Povečava dela zaslona"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Odpri nastavitve povečave"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Zapri nastavitve povečave"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Zapri način za urejanje"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Povlecite vogal, da spremenite velikost."</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Dovoli diagonalno pomikanje"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Spremeni velikost"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Odpri aplikacijo <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Če želite aplikacijo Denarnica dodati kot bližnjico, poskrbite, da je aplikacija nameščena."</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Če želite aplikacijo Denarnica dodati kot bližnjico, poskrbite, da je dodana vsaj ena kartica."</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Če želite optični bralnik kod QR dodati kot bližnjico, poskrbite, da je nameščena fotografska aplikacija."</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Če želite aplikacijo Home dodati kot bližnjico, poskrbite, da je aplikacija nameščena."</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Na voljo mora biti vsaj ena naprava."</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Izberite privzeto aplikacijo za zapiske, ki jo želite povezati z bližnjico do ustvarjanja zapiskov."</string>
diff --git a/packages/SystemUI/res/values-sq/strings.xml b/packages/SystemUI/res/values-sq/strings.xml
index 6e1edff..5b58fc7 100644
--- a/packages/SystemUI/res/values-sq/strings.xml
+++ b/packages/SystemUI/res/values-sq/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Kufiri: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Paralajmërim për kufirin prej <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Aplikacionet e punës"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Vendosur në pauzë"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Drita e natës"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Në perëndim të diellit"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Deri në lindje të diellit"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Zmadho një pjesë të ekranit"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Hap cilësimet e zmadhimit"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Mbyll cilësimet e zmadhimit"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Zvarrit këndin për të ndryshuar përmasat"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Lejo lëvizjen diagonale"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Ndrysho përmasat"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Hap \"<xliff:g id="APPNAME">%1$s</xliff:g>\""</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Për të shtuar aplikacionin \"Portofoli\" si një shkurtore, sigurohu që aplikacioni të jetë i instaluar"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Për të shtuar aplikacionin \"Portofoli\" si një shkurtore, sigurohu që të jetë shtuar të paktën një kartë"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Për të shtuar skanerin e kodeve QR si një shkurtore, sigurohu që aplikacioni i kamerës të jetë i instaluar"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Për të shtuar aplikacionin Home si një shkurtore, sigurohu që aplikacioni të jetë i instaluar"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Ofrohet të paktën një pajisje"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Zgjidh një aplikacion të parazgjedhur shënimesh për të përdorur shkurtoren e mbajtjes së shënimeve"</string>
diff --git a/packages/SystemUI/res/values-sr/strings.xml b/packages/SystemUI/res/values-sr/strings.xml
index 0a73cf5..eee0fe6 100644
--- a/packages/SystemUI/res/values-sr/strings.xml
+++ b/packages/SystemUI/res/values-sr/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Ограничење од <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Упозорење за <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Пословне апликације"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Паузирано"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Ноћно светло"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Укључује се по заласку сунца"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"До изласка сунца"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Увећајте део екрана"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Отвори подешавања увећања"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Затвори подешавања увећања"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"Затвори режим измене"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Превуците угао да бисте променили величину"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Дозволи дијагонално скроловање"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Промени величину"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Отворите: <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Да бисте додали апликацију Новчаник као пречицу, уверите се да је апликација инсталирана"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Да бисте додали апликацију Новчаник као пречицу, уверите се да је додата бар једна картица"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Да бисте додали Скенер QR кода као пречицу, уверите се да је апликација за камеру инсталирана"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Да бисте додали апликацију Home као пречицу, уверите се да је апликација инсталирана"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Доступан је бар један уређај"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Изаберите подразумевану апликацију за белешке да бисте користили пречицу за прављење белешки"</string>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index 9329e19..b996649 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Gräns: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Varning <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Jobbappar"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Pausad"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Nattljus"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"På från solnedgången"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Till soluppgången"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Förstora en del av skärmen"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Öppna inställningarna för förstoring"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Stäng inställningarna för förstoring"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Dra i hörnet för att ändra storlek"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Tillåt diagonal scrollning"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Ändra storlek"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Öppna <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Se till att Wallet-appen är installerad om du vill lägga till den som genväg"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Se till att minst ett kort har lagts till om du vill lägga till Wallet-appen som genväg"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Se till att en kameraapp är installerad om du vill lägga till QR-skannern som genväg"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Se till att Home-appen är installerad om du vill lägga till den som genväg"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• minst en enhet är tillgänglig"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Välj en standardapp för anteckningar om du vill använda genvägen för anteckningar"</string>
diff --git a/packages/SystemUI/res/values-sw/strings.xml b/packages/SystemUI/res/values-sw/strings.xml
index 7c0df30..b00f9b6 100644
--- a/packages/SystemUI/res/values-sw/strings.xml
+++ b/packages/SystemUI/res/values-sw/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"kikomo <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Onyo <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Programu za kazini"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Umesitishwa"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Mwanga wa Usiku"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Itawashwa machweo"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Hadi macheo"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Kuza sehemu ya skrini"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Fungua mipangilio ya ukuzaji"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Funga mipangilio ya ukuzaji"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Buruta kona ili ubadilishe ukubwa"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Ruhusu usogezaji wa kimshazari"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Badilisha ukubwa"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Fungua <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Ili uweke programu ya Pochi kuwa njia ya mkato, hakikisha umesakinisha programu hiyo"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Ili uweke programu ya Pochi kuwa njia ya mkato, hakikisha umeweka angalau kadi moja"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Ili uweke kichanganuzi cha msimbo wa QR kuwa njia ya mkato, hakikisha umesakinisha programu ya kamera"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Ili uweke programu ya Google Home kuwa njia ya mkato, hakikisha umesakinisha programu hiyo"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Angalau kifaa kimoja kinapatikana"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Chagua programu chaguomsingi ya madokezo ili utumie njia ya mkato ya kuandika madokezo"</string>
diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml
index d85e012..915dcdb 100644
--- a/packages/SystemUI/res/values-sw600dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp/dimens.xml
@@ -82,6 +82,8 @@
<!-- start padding is smaller to account for status icon margins coming from drawable itself -->
<dimen name="shade_header_system_icons_padding_start">3dp</dimen>
<dimen name="shade_header_system_icons_padding_end">4dp</dimen>
+ <dimen name="shade_header_system_icons_padding_top">2dp</dimen>
+ <dimen name="shade_header_system_icons_padding_bottom">2dp</dimen>
<!-- Lockscreen shade transition values -->
<dimen name="lockscreen_shade_transition_by_tap_distance">200dp</dimen>
diff --git a/packages/SystemUI/res/values-ta/strings.xml b/packages/SystemUI/res/values-ta/strings.xml
index 4c6816b..57f537f 100644
--- a/packages/SystemUI/res/values-ta/strings.xml
+++ b/packages/SystemUI/res/values-ta/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> வரம்பு"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> எச்சரிக்கை"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"பணி ஆப்ஸ்"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"இடைநிறுத்தப்பட்டது"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"நைட் லைட்"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"மாலையில் ஆன் செய்"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"காலை வரை"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"திரையின் ஒரு பகுதியைப் பெரிதாக்கும்"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"பெரிதாக்கல் அமைப்புகளைத் திற"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"பெரிதாக்கல் அமைப்புகளை மூடுக"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"அளவை மாற்ற மூலையை இழுக்கவும்"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"குறுக்கே ஸ்க்ரோல் செய்வதை அனுமதி"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"அளவை மாற்று"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> ஆப்ஸைத் திற"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Wallet ஆப்ஸை ஷார்ட்கட்டாகச் சேர்க்க, அந்த ஆப்ஸ் நிறுவப்பட்டுள்ளதை உறுதிசெய்துகொள்ளவும்"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Wallet ஆப்ஸை ஷார்ட்கட்டாகச் சேர்க்க, அதில் குறைந்தது ஒரு கார்டாவது சேர்க்கப்பட்டுள்ளதை உறுதிசெய்துகொள்ளவும்"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR குறியீடு ஸ்கேனரை ஷார்ட்கட்டாகச் சேர்க்க, கேமரா ஆப்ஸ் நிறுவப்பட்டுள்ளதை உறுதிசெய்துகொள்ளவும்"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home ஆப்ஸை ஷார்ட்கட்டாகச் சேர்க்க, அந்த ஆப்ஸ் நிறுவப்பட்டுள்ளதை உறுதிசெய்துகொள்ளவும்"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• குறைந்தபட்சம் ஒரு சாதனமாவது இருக்கிறது"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"குறிப்பெடுத்தல் ஷார்ட்கட்டைப் பயன்படுத்த, குறிப்பெடுப்பதற்கான இயல்புநிலை ஆப்ஸைத் தேர்ந்தெடுக்கவும்"</string>
diff --git a/packages/SystemUI/res/values-te/strings.xml b/packages/SystemUI/res/values-te/strings.xml
index f501d32..124f273 100644
--- a/packages/SystemUI/res/values-te/strings.xml
+++ b/packages/SystemUI/res/values-te/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> పరిమితి"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> హెచ్చరిక"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"వర్క్ యాప్లు"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"పాజ్ చేయబడింది"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"రాత్రి కాంతి"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"సూర్యాస్తమయానికి"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"సూర్యోదయం వరకు"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"స్క్రీన్లో భాగాన్ని మ్యాగ్నిఫై చేయండి"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"మ్యాగ్నిఫికేషన్ సెట్టింగ్లను తెరవండి"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"మాగ్నిఫికేషన్ సెట్టింగ్లను మూసివేయండి"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"సవరణ మోడ్ నుండి ఎగ్జిట్ అవ్వండి"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"సైజ్ మార్చడానికి మూలను లాగండి"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"డయాగనల్ స్క్రోలింగ్ను అనుమతించండి"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"సైజ్ మార్చండి"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g>ను తెరవండి"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Wallet యాప్ను షార్ట్కట్గా జోడించడానికి, యాప్ ఇన్స్టాల్ చేయబడిందని నిర్ధారించుకోండి"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Wallet యాప్ను షార్ట్కట్గా జోడించడానికి, కనీసం ఒక కార్డ్ జోడించబడిందని నిర్ధారించుకోండి"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR కోడ్ స్కానర్ను షార్ట్కట్గా జోడించడానికి, కెమెరా యాప్ ఇన్స్టాల్ చేయబడిందని నిర్ధారించుకోండి"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home యాప్ను షార్ట్కట్గా జోడించడానికి, యాప్ ఇన్స్టాల్ చేయబడిందని నిర్ధారించుకోండి"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• కనీసం ఒక పరికరమైనా అందుబాటులో ఉందని"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"నోట్టేకింగ్ షార్ట్కట్ను ఉపయోగించడానికి ఆటోమేటిక్ సెట్టింగ్ నోట్స్ యాప్ను ఎంచుకోండి"</string>
diff --git a/packages/SystemUI/res/values-th/strings.xml b/packages/SystemUI/res/values-th/strings.xml
index 7c524d9..46fec04 100644
--- a/packages/SystemUI/res/values-th/strings.xml
+++ b/packages/SystemUI/res/values-th/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"ขีดจำกัด <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"คำเตือน <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"แอปงาน"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"หยุดชั่วคราว"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"แสงตอนกลางคืน"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"เปิดตอนพระอาทิตย์ตก"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"จนพระอาทิตย์ขึ้น"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"ขยายบางส่วนของหน้าจอ"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"เปิดการตั้งค่าการขยาย"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"ปิดการตั้งค่าการขยาย"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"ออกจากโหมดแก้ไข"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"ลากที่มุมเพื่อปรับขนาด"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"อนุญาตการเลื่อนแบบทแยงมุม"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"ปรับขนาด"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"เปิด <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"หากต้องการเพิ่มแอป Wallet เป็นทางลัด โปรดตรวจสอบว่าได้ติดตั้งแอปแล้ว"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"หากต้องการเพิ่มแอป Wallet เป็นทางลัด โปรดตรวจสอบว่าได้เพิ่มบัตรอย่างน้อย 1 ใบแล้ว"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"หากต้องการเพิ่มเครื่องมือสแกนคิวอาร์โค้ดเป็นทางลัด โปรดตรวจสอบว่าได้ติดตั้งแอปกล้องแล้ว"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"หากต้องการเพิ่มแอป Home เป็นทางลัด โปรดตรวจสอบว่าได้ติดตั้งแอปแล้ว"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• มีอุปกรณ์พร้อมใช้งานอย่างน้อย 1 รายการ"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"เลือกแอปโน้ตเริ่มต้นเพื่อใช้ทางลัดการจดบันทึก"</string>
diff --git a/packages/SystemUI/res/values-tl/strings.xml b/packages/SystemUI/res/values-tl/strings.xml
index fc2d8cf..079bd9b 100644
--- a/packages/SystemUI/res/values-tl/strings.xml
+++ b/packages/SystemUI/res/values-tl/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> ang limitasyon"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Babala sa <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Mga app para sa trabaho"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Naka-pause"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Night Light"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Mao-on sa sunset"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Hanggang sunrise"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"I-magnify ang isang bahagi ng screen"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Buksan ang mga setting ng pag-magnify"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Isara ang mga setting ng pag-magnify"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"I-drag ang sulok para i-resize"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Payagan ang diagonal na pag-scroll"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"I-resize"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Buksan ang <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Para maidagdag ang Wallet app bilang shortcut, siguraduhing naka-install ang app"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Para maidagdag ang Wallet app bilang shortcut, siguraduhing may naidagdag na kahit isang card man lang"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Para maidagdag ang scanner ng QR code bilang shortcut, siguraduhing may naka-install na camera app"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Para maidagdag ang Home app bilang shortcut, siguraduhing naka-install ang app"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• May kahit isang device na available"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Pumili ng default na app ng mga tala para magamit ang shortcut sa paggawa ng tala"</string>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index 803acae..7ba95ec 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Sınır: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> uyarısı"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"İş uygulamaları"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Duraklatıldı"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Gece Işığı"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Gün batımı açılacak"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Sabaha kadar"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Ekranın bir parçasını büyütün"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Büyütme ayarlarını aç"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Büyütme ayarlarını kapat"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Yeniden boyutlandırmak için köşeyi sürükleyin"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Çapraz kaydırmaya izin ver"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Yeniden boyutlandır"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> uygulamasını aç"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Cüzdan uygulamasını kısayol olarak eklemek için uygulamanın yüklü olduğundan emin olun"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Cüzdan uygulamasını kısayol olarak eklemek için en az bir kart eklendiğinden emin olun"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR kodu tarayıcıyı kısayol olarak eklemek için bir kamera uygulamasının yüklü olduğundan emin olun"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home uygulamasını kısayol olarak eklemek için uygulamanın yüklü olduğundan emin olun"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• En az bir cihaz mevcut olmalıdır"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Not alma kısayolunu kullanmak için varsayılan bir notlar uygulaması seçin"</string>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index 668fb59..3feefef 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Обмеження: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Застереження: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Робочі додатки"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Призупинено"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Нічний екран"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Вмикається ввечері"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"До сходу сонця"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Збільшити частину екрана"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Відкрити налаштування збільшення"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Закрити налаштування збільшення"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Потягніть кут, щоб змінити розмір"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Дозволити прокручування по діагоналі"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Змінити розмір"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Відкрити <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Щоб додати ярлик для запуску додатка Google Гаманець, переконайтеся, що додаток установлено"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Щоб додати ярлик для запуску додатка Google Гаманець, переконайтеся, що він містить дані принаймні однієї картки"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Щоб додати ярлик для запуску сканера QR-коду, переконайтеся, що встановлено додаток для камери"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Щоб додати ярлик для запуску додатка Google Home, переконайтеся, що додаток установлено"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Принаймні один пристрій доступний"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Виберіть стандартний додаток для нотаток, щоб створювати їх за допомогою ярлика"</string>
diff --git a/packages/SystemUI/res/values-ur/strings.xml b/packages/SystemUI/res/values-ur/strings.xml
index 33d11d9..29d3762 100644
--- a/packages/SystemUI/res/values-ur/strings.xml
+++ b/packages/SystemUI/res/values-ur/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> حد"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> وارننگ"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"دفتری ایپس"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"موقوف ہے"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"نائٹ لائٹ"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"غروب آفتاب کے وقت آن ہوگی"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"طلوع آفتاب تک"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"اسکرین کا حصہ بڑا کریں"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"میگنیفکیشن کی ترتیبات کھولیں"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"میگنیفکیشن کی ترتیبات بند کریں"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"سائز تبدیل کرنے کے لیے کونے کو گھسیٹیں"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"وتری سکرولنگ کی اجازت دیں"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"سائز تبدیل کریں"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"<xliff:g id="APPNAME">%1$s</xliff:g> کھولیں"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"والٹ ایپ کو شارٹ کٹ کے طور پر شامل کرنے کے لیے، یقینی بنائیں کہ ایپ انسٹال ہے"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"والٹ ایپ کو شارٹ کٹ کے طور پر شامل کرنے کے لیے، یقینی بنائیں کہ کم از کم ایک کارڈ شامل کیا گیا ہے"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR کوڈ اسکینر کو شارٹ کٹ کے طور پر شامل کرنے کے لیے، یقینی بنائیں کہ کیمرا ایپ انسٹال ہے"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"ہوم ایپ کو شارٹ کٹ کے طور پر شامل کرنے کے لیے، یقینی بنائیں کہ ایپ انسٹال ہے"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• کم از کم ایک آلہ دستیاب ہے"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"نوٹ لینے والے شارٹ کٹ کا استعمال کرنے کے لیے ڈیفالٹ نوٹس ایپ منتخب کریں"</string>
@@ -1178,8 +1180,8 @@
<string name="privacy_dialog_manage_permissions" msgid="2543451567190470413">"رسائی کا نظم کریں"</string>
<string name="privacy_dialog_active_call_usage" msgid="7858746847946397562">"فون کال کے زیر استعمال"</string>
<string name="privacy_dialog_recent_call_usage" msgid="1214810644978167344">"فون کال میں حال ہی میں استعمال کیا گیا"</string>
- <string name="privacy_dialog_active_app_usage" msgid="631997836335929880">"<xliff:g id="APP_NAME">%1$s</xliff:g> کے زیر استعمال"</string>
- <string name="privacy_dialog_recent_app_usage" msgid="4883417856848222450">"<xliff:g id="APP_NAME">%1$s</xliff:g> کے ذریعے حال ہی میں استعمال کیا گیا"</string>
+ <string name="privacy_dialog_active_app_usage" msgid="631997836335929880">"<xliff:g id="APP_NAME">%1$s</xliff:g> کے زیر استعمال"</string>
+ <string name="privacy_dialog_recent_app_usage" msgid="4883417856848222450">"حال ہی میں <xliff:g id="APP_NAME">%1$s</xliff:g> نے استعمال کیا"</string>
<string name="privacy_dialog_active_app_usage_1" msgid="9047570143069220911">"<xliff:g id="APP_NAME">%1$s</xliff:g> (<xliff:g id="ATTRIBUTION_LABEL">%2$s</xliff:g>) کے زیر استعمال"</string>
<string name="privacy_dialog_recent_app_usage_1" msgid="2551340497722370109">"<xliff:g id="APP_NAME">%1$s</xliff:g> (<xliff:g id="ATTRIBUTION_LABEL">%2$s</xliff:g>) کے ذریعے حال ہی میں استعمال کیا گیا"</string>
<string name="privacy_dialog_active_app_usage_2" msgid="2770926061339921767">"<xliff:g id="APP_NAME">%1$s</xliff:g> (<xliff:g id="ATTRIBUTION_LABEL">%2$s</xliff:g> • <xliff:g id="PROXY_LABEL">%3$s</xliff:g>) کے زیر استعمال"</string>
diff --git a/packages/SystemUI/res/values-uz/strings.xml b/packages/SystemUI/res/values-uz/strings.xml
index 65f5653..b7defbb 100644
--- a/packages/SystemUI/res/values-uz/strings.xml
+++ b/packages/SystemUI/res/values-uz/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Cheklov: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Ogohlantirish: <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Ish ilovalari"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Pauzada"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Tungi rejim"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Kunbotarda yoqish"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Quyosh chiqqunicha"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Ekran qismini kattalashtirish"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Kattalashtirish sozlamalarini ochish"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Kattalashtirish sozlamalarini yopish"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Oʻlchamini oʻzgartirish uchun burchakni torting"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Diagonal aylantirishga ruxsat berish"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Oʻlchamini oʻzgartirish"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Ochish: <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Wallet ilovasini yorliq sifatida qoʻshish uchun ilova oʻrnatilganiga ishonch hosil qiling"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Wallet ilovasini yorliq sifatida qoʻshish uchun kamida bitta karta kiritilganiga ishonch hosil qiling"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"QR kod skanerini yorliq sifatida qoʻshish uchun kamera ilovasi oʻrnatilganiga ishonch hosil qiling"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Home ilovasini yorliq sifatida qoʻshish uchun ilova oʻrnatilganiga ishonch hosil qiling"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Kamida bitta qurilma mavjud"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Qayd yozish yorligʻidan foydalanish uchun birlamchi qayd ilovasini tanlang"</string>
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index 8be1dd5..2d49b02 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"Giới hạn <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"Cảnh báo <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Ứng dụng công việc"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Đã tạm dừng"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Ánh sáng đêm"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Bật khi trời tối"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Cho đến khi trời sáng"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Phóng to một phần màn hình"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Mở chế độ cài đặt phóng to"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Đóng bảng cài đặt tính năng phóng to"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Kéo góc để thay đổi kích thước"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Cho phép cuộn chéo"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Đổi kích thước"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Mở <xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Để tạo lối tắt cho ứng dụng Wallet, hãy đảm bảo bạn đã cài đặt ứng dụng đó"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Để tạo lối tắt cho ứng dụng Wallet, hãy đảm bảo bạn đã thêm ít nhất một thẻ"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Để tạo lối tắt cho Trình quét mã QR, hãy đảm bảo rằng bạn đã cài đặt một ứng dụng máy ảnh"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Để tạo lối tắt cho ứng dụng Home, hãy đảm bảo bạn đã cài đặt ứng dụng đó"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Có ít nhất một thiết bị đang hoạt động"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Chọn một ứng dụng ghi chú mặc định để dùng lối tắt ghi chú"</string>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index 299ebf9..8d2b89b 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"上限为<xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g>警告"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"工作应用"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"已暂停"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"护眼模式"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"在日落时开启"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"在日出时关闭"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"放大部分屏幕"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"打开放大功能设置"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"关闭放大设置"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"退出修改模式"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"拖动一角即可调整大小"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"允许沿对角线滚动"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"调整大小"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"打开<xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"若要将 Google 钱包应用添加为快捷方式,请确保已安装该应用"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"若要将 Google 钱包应用添加为快捷方式,请确保至少已添加一张银行卡"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"若要将二维码扫描器添加为快捷方式,请确保已安装相机应用"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"若要将 Home 应用添加为快捷方式,请确保已安装该应用"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• 至少有一台设备可用"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"选择默认记事应用即可使用记事快捷方式"</string>
diff --git a/packages/SystemUI/res/values-zh-rHK/strings.xml b/packages/SystemUI/res/values-zh-rHK/strings.xml
index fb40f32..9e408f2 100644
--- a/packages/SystemUI/res/values-zh-rHK/strings.xml
+++ b/packages/SystemUI/res/values-zh-rHK/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"上限為 <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> 警告"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"工作應用程式"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"已暫停"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"夜間模式"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"在日落時開啟"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"在日出時關閉"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"放大部分螢幕畫面"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"開啟放大設定"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"關閉放大設定"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"結束編輯模式"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"拖曳角落即可調整大小"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"允許斜角捲動"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"調整大小"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"開啟「<xliff:g id="APPNAME">%1$s</xliff:g>」"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"如要將「錢包」應用程式新增為捷徑,請確認已安裝該應用程式"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"如要將「錢包」應用程式新增為捷徑,請確認已新增至少一張付款卡"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"如要將 QR 碼掃瞄器新增為捷徑,請確認已安裝相機應用程式"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"如要將 Home 應用程式新增為捷徑,請確認已安裝該應用程式"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• 至少一部裝置可用"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"選取預設的筆記應用程式,即可使用筆記捷徑"</string>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index 4750b5b..5831ac5 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"上限為 <xliff:g id="DATA_LIMIT">%s</xliff:g>"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> 警告"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"工作應用程式"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"已暫停"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"夜燈"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"於日落時開啟"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"於日出時關閉"</string>
@@ -864,6 +865,7 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"放大局部螢幕畫面"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"開啟放大功能設定"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"關閉放大設定"</string>
+ <string name="magnification_exit_edit_mode_click_label" msgid="1664818325144887117">"結束編輯模式"</string>
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"拖曳角落即可調整大小"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"允許沿對角線捲動"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"調整大小"</string>
@@ -1133,7 +1135,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"開啟「<xliff:g id="APPNAME">%1$s</xliff:g>」"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"如要將錢包應用程式新增為捷徑,請確認已安裝該應用程式"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"如要將錢包應用程式新增為捷徑,請確認已新增至少一張卡片"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"如要將 QR code 掃描器新增為捷徑,請確認已安裝相機應用程式"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"如要將 Google Home 應用程式新增為捷徑,請確認已安裝該應用程式"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• 至少要有一部可用裝置"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"選取預設的記事應用程式,即可使用筆記捷徑"</string>
diff --git a/packages/SystemUI/res/values-zu/strings.xml b/packages/SystemUI/res/values-zu/strings.xml
index e22d1d7..5013f8d 100644
--- a/packages/SystemUI/res/values-zu/strings.xml
+++ b/packages/SystemUI/res/values-zu/strings.xml
@@ -295,6 +295,7 @@
<string name="quick_settings_cellular_detail_data_limit" msgid="1791389609409211628">"<xliff:g id="DATA_LIMIT">%s</xliff:g> umkhawulo"</string>
<string name="quick_settings_cellular_detail_data_warning" msgid="7957253810481086455">"<xliff:g id="DATA_LIMIT">%s</xliff:g> isexwayiso"</string>
<string name="quick_settings_work_mode_label" msgid="6440531507319809121">"Ama-app omsebenzi"</string>
+ <string name="quick_settings_work_mode_paused_state" msgid="6681788236383735976">"Kumisiwe"</string>
<string name="quick_settings_night_display_label" msgid="8180030659141778180">"Ukukhanya kwasebusuku"</string>
<string name="quick_settings_night_secondary_label_on_at_sunset" msgid="3358706312129866626">"Kuvulwe ekushoneni kwelanga"</string>
<string name="quick_settings_night_secondary_label_until_sunrise" msgid="4063448287758262485">"Kuze kube sekuphumeni kwelanga"</string>
@@ -864,6 +865,8 @@
<string name="magnification_mode_switch_state_window" msgid="8597100249594076965">"Khulisa ingxenye eyesikrini"</string>
<string name="magnification_open_settings_click_label" msgid="6151849212725923363">"Vula amasethingi okukhuliswa"</string>
<string name="magnification_close_settings_click_label" msgid="4642477260651704517">"Vala amasethingi okukhuliswa"</string>
+ <!-- no translation found for magnification_exit_edit_mode_click_label (1664818325144887117) -->
+ <skip />
<string name="magnification_drag_corner_to_resize" msgid="1249766311052418130">"Hudula ikhona ukuze usayize kabusha"</string>
<string name="accessibility_allow_diagonal_scrolling" msgid="3258050349191496398">"Vumela ukuskrola oku-diagonal"</string>
<string name="accessibility_resize" msgid="5733759136600611551">"Shintsha usayizi"</string>
@@ -1133,7 +1136,6 @@
<string name="keyguard_affordance_enablement_dialog_action_template" msgid="8164857863036314664">"Vula i-<xliff:g id="APPNAME">%1$s</xliff:g>"</string>
<string name="wallet_quick_affordance_unavailable_install_the_app" msgid="7298552910007208368">"Ukuze ungeze i-app ye-Wallet njengesinqamuleli, qinisekisa ukuthi i-app ifakiwe"</string>
<string name="wallet_quick_affordance_unavailable_configure_the_app" msgid="4387433357429873258">"Ukuze ungeze i-app ye-Wallet njengesinqamuleli, qinisekisa ukuthi okungenani ikhadi elilodwa lingeziwe"</string>
- <string name="qr_scanner_quick_affordance_unavailable_explanation" msgid="3049582306241150946">"Ukuze ungeze Iskena sekhodi ye-QR njengesinqamuleli, qinisekisa ukuthi i-app yekhamera ifakiwe"</string>
<string name="home_quick_affordance_unavailable_install_the_app" msgid="6187820778998446168">"Ukuze ungeze i-App yasekhaya njengesinqamuleli, qinisekisa ukuthi i-app ifakiwe"</string>
<string name="home_quick_affordance_unavailable_configure_the_app" msgid="7953595390775156839">"• Okungenani idivayisi eyodwa iyatholakala"</string>
<string name="notes_app_quick_affordance_unavailable_explanation" msgid="4796955161600178530">"Khetha i-app yamanothi azenzakalelayo ukuze usebenzise isinqamuleli sokubhala amanothi"</string>
diff --git a/packages/SystemUI/res/values/attrs.xml b/packages/SystemUI/res/values/attrs.xml
index d693631..8bc3eed 100644
--- a/packages/SystemUI/res/values/attrs.xml
+++ b/packages/SystemUI/res/values/attrs.xml
@@ -221,6 +221,7 @@
<attr name="descriptionTextAppearance" format="reference" />
<attr name="passwordTextAppearance" format="reference" />
<attr name="errorTextAppearance" format="reference"/>
+ <attr name="errorTextAppearanceLand" format="reference"/>
</declare-styleable>
<declare-styleable name="LogAccessPermissionGrantDialog">
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 5c42e45..eb9d0b3 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -923,4 +923,7 @@
"$packageName" part that will be replaced by the code with the package name of the target app.
-->
<string name="config_appStoreAppLinkTemplate" translatable="false"></string>
+
+ <!-- Flag controlling whether visual query attention detection has been enabled. -->
+ <bool name="config_enableVisualQueryAttentionDetection">false</bool>
</resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 8310b95..2dc1b45 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -496,9 +496,10 @@
<dimen name="large_screen_shade_header_min_height">@dimen/qs_header_row_min_height</dimen>
<dimen name="large_screen_shade_header_left_padding">@dimen/qs_horizontal_margin</dimen>
<dimen name="shade_header_system_icons_height">@dimen/large_screen_shade_header_min_height</dimen>
- <dimen name="shade_header_system_icons_height_large_screen">32dp</dimen>
<dimen name="shade_header_system_icons_padding_start">0dp</dimen>
<dimen name="shade_header_system_icons_padding_end">0dp</dimen>
+ <dimen name="shade_header_system_icons_padding_top">0dp</dimen>
+ <dimen name="shade_header_system_icons_padding_bottom">0dp</dimen>
<!-- The top margin of the panel that holds the list of notifications.
On phones it's always 0dp but it's overridden in Car UI
diff --git a/packages/SystemUI/res/values/flags.xml b/packages/SystemUI/res/values/flags.xml
index 261b08d..0d45422 100644
--- a/packages/SystemUI/res/values/flags.xml
+++ b/packages/SystemUI/res/values/flags.xml
@@ -39,7 +39,7 @@
<bool name="flag_battery_shield_icon">false</bool>
<!-- Whether face auth will immediately stop when the display state is OFF -->
- <bool name="flag_stop_face_auth_on_display_off">false</bool>
+ <bool name="flag_stop_face_auth_on_display_off">true</bool>
<!-- Whether we want to stop pulsing while running the face scanning animation -->
<bool name="flag_stop_pulsing_face_scanning_animation">true</bool>
diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml
index 4e72518..04eae64 100644
--- a/packages/SystemUI/res/values/ids.xml
+++ b/packages/SystemUI/res/values/ids.xml
@@ -222,4 +222,13 @@
<!-- Communal mode -->
<item type="id" name="communal_widget_wrapper" />
+
+ <!-- Values assigned to the views in Biometrics Prompt -->
+ <item type="id" name="pin_pad"/>
+
+ <!--
+ Used to tag views programmatically added to the smartspace area so they can be more easily
+ removed later.
+ -->
+ <item type="id" name="tag_smartspace_view" />
</resources>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index cddfda2..77ffe19 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -156,6 +156,9 @@
<!-- Button label for declining language change [CHAR LIMIT=25] -->
<string name="hdmi_cec_set_menu_language_decline">Keep current language</string>
+ <!-- Button label to share wifi [CHAR_LIMIT=20] -->
+ <string name="share_wifi_button_text">Share Wi\u2011Fi</string>
+
<!-- Title of confirmation dialog for wireless debugging [CHAR LIMIT=NONE] -->
<string name="wifi_debugging_title">Allow wireless debugging on this network?</string>
@@ -386,6 +389,8 @@
<string name="biometric_dialog_wrong_password">Wrong password</string>
<!-- Error string shown when the user enters too many incorrect attempts [CHAR LIMIT=120]-->
<string name="biometric_dialog_credential_too_many_attempts">Too many incorrect attempts.\nTry again in <xliff:g id="number">%d</xliff:g> seconds.</string>
+ <!-- Button text shown on an authentication screen giving the user the option to make an emergency call without unlocking their device [CHAR LIMIT=20] -->
+ <string name="work_challenge_emergency_button_text">Emergency</string>
<!-- Error string shown when the user enters an incorrect PIN/pattern/password and it counts towards the max attempts before the data on the device is wiped. [CHAR LIMIT=NONE]-->
<string name="biometric_dialog_credential_attempts_before_wipe">Try again. Attempt <xliff:g id="attempts" example="1">%1$d</xliff:g> of <xliff:g id="max_attempts" example="3">%2$d</xliff:g>.</string>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index 10340c6..6991b96 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -236,6 +236,13 @@
<item name="android:gravity">center</item>
</style>
+ <style name="TextAppearance.AuthNonBioCredential.ErrorLand">
+ <item name="android:layout_marginTop">20dp</item>
+ <item name="android:textSize">14sp</item>
+ <item name="android:textColor">?android:attr/colorError</item>
+ <item name="android:gravity">start</item>
+ </style>
+
<style name="TextAppearance.AuthCredential.PasswordEntry" parent="@android:style/TextAppearance.DeviceDefault">
<item name="android:gravity">center</item>
<item name="android:paddingTop">28dp</item>
@@ -276,6 +283,17 @@
<item name="android:minWidth">200dp</item>
</style>
+ <style name="AuthCredentialEmergencyButtonStyle">
+ <item name="android:background">@drawable/auth_credential_emergency_button_background</item>
+ <item name="android:textColor">@android:color/system_accent3_900</item>
+ <item name="android:outlineProvider">none</item>
+ <item name="android:paddingTop">15dp</item>
+ <item name="android:paddingBottom">15dp</item>
+ <item name="android:paddingLeft">30dp</item>
+ <item name="android:paddingRight">30dp</item>
+ <item name="android:textSize">16sp</item>
+ </style>
+
<style name="DeviceManagementDialogTitle">
<item name="android:gravity">center</item>
<item name="android:textAppearance">@style/TextAppearance.Dialog.Title</item>
@@ -353,6 +371,7 @@
<item name="descriptionTextAppearance">@style/TextAppearance.AuthNonBioCredential.Description</item>
<item name="passwordTextAppearance">@style/TextAppearance.AuthCredential.PasswordEntry</item>
<item name="errorTextAppearance">@style/TextAppearance.AuthNonBioCredential.Error</item>
+ <item name="errorTextAppearanceLand">@style/TextAppearance.AuthNonBioCredential.ErrorLand</item>
</style>
<style name="LockPatternViewStyle" >
diff --git a/packages/SystemUI/res/xml/large_screen_shade_header.xml b/packages/SystemUI/res/xml/large_screen_shade_header.xml
index 2ec6180..fe61c46 100644
--- a/packages/SystemUI/res/xml/large_screen_shade_header.xml
+++ b/packages/SystemUI/res/xml/large_screen_shade_header.xml
@@ -56,7 +56,7 @@
<Constraint android:id="@+id/shade_header_system_icons">
<Layout
android:layout_width="wrap_content"
- android:layout_height="@dimen/shade_header_system_icons_height_large_screen"
+ android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/privacy_container"
app:layout_constraintTop_toTopOf="parent"
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java
index 45a5ce3..80040a3 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java
@@ -200,11 +200,12 @@
@Override
public void onAnimationStart(IRecentsAnimationController controller,
RemoteAnimationTarget[] apps, RemoteAnimationTarget[] wallpapers,
- Rect homeContentInsets, Rect minimizedHomeBounds) {
+ Rect homeContentInsets, Rect minimizedHomeBounds,
+ Bundle extras) {
final RecentsAnimationControllerCompat controllerCompat =
new RecentsAnimationControllerCompat(controller);
animationHandler.onAnimationStart(controllerCompat, apps,
- wallpapers, homeContentInsets, minimizedHomeBounds);
+ wallpapers, homeContentInsets, minimizedHomeBounds, extras);
}
@Override
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java
index c844db7..77f6d03 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java
@@ -28,8 +28,6 @@
import java.lang.annotation.RetentionPolicy;
public final class InteractionJankMonitorWrapper {
- private static final String TAG = "JankMonitorWrapper";
-
// Launcher journeys.
public static final int CUJ_APP_LAUNCH_FROM_RECENTS =
InteractionJankMonitor.CUJ_LAUNCHER_APP_LAUNCH_FROM_RECENTS;
@@ -37,6 +35,8 @@
InteractionJankMonitor.CUJ_LAUNCHER_APP_LAUNCH_FROM_ICON;
public static final int CUJ_APP_CLOSE_TO_HOME =
InteractionJankMonitor.CUJ_LAUNCHER_APP_CLOSE_TO_HOME;
+ public static final int CUJ_APP_CLOSE_TO_HOME_FALLBACK =
+ InteractionJankMonitor.CUJ_LAUNCHER_APP_CLOSE_TO_HOME_FALLBACK;
public static final int CUJ_APP_CLOSE_TO_PIP =
InteractionJankMonitor.CUJ_LAUNCHER_APP_CLOSE_TO_PIP;
public static final int CUJ_QUICK_SWITCH =
@@ -68,6 +68,7 @@
CUJ_APP_LAUNCH_FROM_RECENTS,
CUJ_APP_LAUNCH_FROM_ICON,
CUJ_APP_CLOSE_TO_HOME,
+ CUJ_APP_CLOSE_TO_HOME_FALLBACK,
CUJ_APP_CLOSE_TO_PIP,
CUJ_QUICK_SWITCH,
CUJ_APP_LAUNCH_FROM_WIDGET,
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java
index 8bddf21..2407350 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationListener.java
@@ -17,6 +17,7 @@
package com.android.systemui.shared.system;
import android.graphics.Rect;
+import android.os.Bundle;
import android.view.RemoteAnimationTarget;
import com.android.systemui.shared.recents.model.ThumbnailData;
@@ -29,7 +30,7 @@
*/
void onAnimationStart(RecentsAnimationControllerCompat controller,
RemoteAnimationTarget[] apps, RemoteAnimationTarget[] wallpapers,
- Rect homeContentInsets, Rect minimizedHomeBounds);
+ Rect homeContentInsets, Rect minimizedHomeBounds, Bundle extras);
/**
* Called when the animation into Recents was canceled. This call is made on the binder thread.
diff --git a/packages/SystemUI/src-debug/com/android/systemui/flags/FlagsModule.kt b/packages/SystemUI/src-debug/com/android/systemui/flags/FlagsModule.kt
index f005bab..fae9fec 100644
--- a/packages/SystemUI/src-debug/com/android/systemui/flags/FlagsModule.kt
+++ b/packages/SystemUI/src-debug/com/android/systemui/flags/FlagsModule.kt
@@ -33,8 +33,7 @@
SettingsUtilModule::class,
])
abstract class FlagsModule {
- @Binds
- abstract fun bindsFeatureFlagDebug(impl: FeatureFlagsDebug): FeatureFlags
+ @Binds abstract fun bindsFeatureFlagDebug(impl: FeatureFlagsClassicDebug): FeatureFlagsClassic
@Binds
@IntoSet
diff --git a/packages/SystemUI/src-release/com/android/systemui/flags/FlagsModule.kt b/packages/SystemUI/src-release/com/android/systemui/flags/FlagsModule.kt
index 927d4604b..7aacb4e 100644
--- a/packages/SystemUI/src-release/com/android/systemui/flags/FlagsModule.kt
+++ b/packages/SystemUI/src-release/com/android/systemui/flags/FlagsModule.kt
@@ -29,7 +29,7 @@
])
abstract class FlagsModule {
@Binds
- abstract fun bindsFeatureFlagRelease(impl: FeatureFlagsRelease): FeatureFlags
+ abstract fun bindsFeatureFlagRelease(impl: FeatureFlagsClassicRelease): FeatureFlagsClassic
@Binds
@IntoSet
diff --git a/packages/SystemUI/src/com/android/keyguard/ConnectedDisplayKeyguardPresentation.kt b/packages/SystemUI/src/com/android/keyguard/ConnectedDisplayKeyguardPresentation.kt
new file mode 100644
index 0000000..899cad89
--- /dev/null
+++ b/packages/SystemUI/src/com/android/keyguard/ConnectedDisplayKeyguardPresentation.kt
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.keyguard
+
+import android.app.Presentation
+import android.content.Context
+import android.graphics.Color
+import android.os.Bundle
+import android.view.Display
+import android.view.LayoutInflater
+import android.view.View
+import android.view.WindowManager
+import com.android.keyguard.dagger.KeyguardStatusViewComponent
+import com.android.systemui.R
+import dagger.assisted.Assisted
+import dagger.assisted.AssistedFactory
+import dagger.assisted.AssistedInject
+
+/** [Presentation] shown in connected displays while on keyguard. */
+class ConnectedDisplayKeyguardPresentation
+@AssistedInject
+constructor(
+ @Assisted display: Display,
+ context: Context,
+ private val keyguardStatusViewComponentFactory: KeyguardStatusViewComponent.Factory,
+) :
+ Presentation(
+ context,
+ display,
+ R.style.Theme_SystemUI_KeyguardPresentation,
+ WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG
+ ) {
+
+ private lateinit var keyguardStatusViewController: KeyguardStatusViewController
+ private lateinit var clock: KeyguardStatusView
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ setContentView(
+ LayoutInflater.from(context)
+ .inflate(R.layout.keyguard_clock_presentation, /* root= */ null)
+ )
+ val window = window ?: error("no window available.")
+
+ // Logic to make the lock screen fullscreen
+ window.decorView.systemUiVisibility =
+ (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or
+ View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
+ View.SYSTEM_UI_FLAG_LAYOUT_STABLE)
+ window.attributes.fitInsetsTypes = 0
+ window.isNavigationBarContrastEnforced = false
+ window.navigationBarColor = Color.TRANSPARENT
+
+ clock = findViewById(R.id.clock)
+ keyguardStatusViewController =
+ keyguardStatusViewComponentFactory.build(clock).keyguardStatusViewController.apply {
+ setDisplayedOnSecondaryDisplay()
+ init()
+ }
+ }
+
+ /** [ConnectedDisplayKeyguardPresentation] factory. */
+ @AssistedFactory
+ interface Factory {
+ /** Creates a new [Presentation] for the given [display]. */
+ fun create(
+ display: Display,
+ ): ConnectedDisplayKeyguardPresentation
+ }
+}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
index b81e081..e3f9de1 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
@@ -102,6 +102,12 @@
super.onViewAttached();
mView.setKeyDownListener(mKeyDownListener);
mEmergencyButtonController.setEmergencyButtonCallback(mEmergencyButtonCallback);
+ // if the user is currently locked out, enforce it.
+ long deadline = mLockPatternUtils.getLockoutAttemptDeadline(
+ KeyguardUpdateMonitor.getCurrentUser());
+ if (shouldLockout(deadline)) {
+ handleAttemptLockout(deadline);
+ }
}
@Override
@@ -278,12 +284,6 @@
@Override
public void onResume(int reason) {
mResumed = true;
- // if the user is currently locked out, enforce it.
- long deadline = mLockPatternUtils.getLockoutAttemptDeadline(
- KeyguardUpdateMonitor.getCurrentUser());
- if (shouldLockout(deadline)) {
- handleAttemptLockout(deadline);
- }
}
@Override
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java
index 30b8ed0..06b6692 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java
@@ -1,10 +1,5 @@
package com.android.keyguard;
-import static android.view.View.ALPHA;
-import static android.view.View.SCALE_X;
-import static android.view.View.SCALE_Y;
-import static android.view.View.TRANSLATION_Y;
-
import static com.android.keyguard.KeyguardStatusAreaView.TRANSLATE_X_CLOCK_DESIGN;
import static com.android.keyguard.KeyguardStatusAreaView.TRANSLATE_Y_CLOCK_DESIGN;
import static com.android.keyguard.KeyguardStatusAreaView.TRANSLATE_Y_CLOCK_SIZE;
@@ -44,6 +39,7 @@
public class KeyguardClockSwitch extends RelativeLayout {
private static final String TAG = "KeyguardClockSwitch";
+ public static final String MISSING_CLOCK_ID = "CLOCK_MISSING";
private static final long CLOCK_OUT_MILLIS = 133;
private static final long CLOCK_IN_MILLIS = 167;
@@ -149,6 +145,13 @@
updateStatusArea(/* animate= */false);
}
+ /** Sets whether the large clock is being shown on a connected display. */
+ public void setLargeClockOnSecondaryDisplay(boolean onSecondaryDisplay) {
+ if (mClock != null) {
+ mClock.getLargeClock().getEvents().onSecondaryDisplayChanged(onSecondaryDisplay);
+ }
+ }
+
/**
* Enable or disable split shade specific positioning
*/
@@ -194,6 +197,14 @@
return mLogBuffer;
}
+ /** Returns the id of the currently rendering clock */
+ public String getClockId() {
+ if (mClock == null) {
+ return MISSING_CLOCK_ID;
+ }
+ return mClock.getConfig().getId();
+ }
+
void setClock(ClockController clock, int statusBarState) {
mClock = clock;
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
index 3d48f3c..6d2880e 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
@@ -104,6 +104,7 @@
private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController;
+ private boolean mShownOnSecondaryDisplay = false;
private boolean mOnlyClock = false;
private boolean mIsActiveDreamLockscreenHosted = false;
private FeatureFlags mFeatureFlags;
@@ -185,8 +186,18 @@
}
/**
- * Mostly used for alternate displays, limit the information shown
+ * When set, limits the information shown in an external display.
*/
+ public void setShownOnSecondaryDisplay(boolean shownOnSecondaryDisplay) {
+ mShownOnSecondaryDisplay = shownOnSecondaryDisplay;
+ }
+
+ /**
+ * Mostly used for alternate displays, limit the information shown
+ *
+ * @deprecated use {@link KeyguardClockSwitchController#setShownOnSecondaryDisplay}
+ */
+ @Deprecated
public void setOnlyClock(boolean onlyClock) {
mOnlyClock = onlyClock;
}
@@ -211,8 +222,10 @@
mSmallClockFrame = mView.findViewById(R.id.lockscreen_clock_view);
mLargeClockFrame = mView.findViewById(R.id.lockscreen_clock_view_large);
- mDumpManager.unregisterDumpable(getClass().getSimpleName()); // unregister previous clocks
- mDumpManager.registerDumpable(getClass().getSimpleName(), this);
+ if (!mOnlyClock) {
+ mDumpManager.unregisterDumpable(getClass().getSimpleName()); // unregister previous
+ mDumpManager.registerDumpable(getClass().getSimpleName(), this);
+ }
if (mFeatureFlags.isEnabled(LOCKSCREEN_WALLPAPER_DREAM_ENABLED)) {
mStatusArea = mView.findViewById(R.id.keyguard_status_area);
@@ -221,6 +234,15 @@
}
}
+ private void hideSliceViewAndNotificationIconContainer() {
+ View ksv = mView.findViewById(R.id.keyguard_slice_view);
+ ksv.setVisibility(View.GONE);
+
+ View nic = mView.findViewById(
+ R.id.left_aligned_notification_icon_container);
+ nic.setVisibility(View.GONE);
+ }
+
@Override
protected void onViewAttached() {
mClockRegistry.registerClockChangeListener(mClockChangedListener);
@@ -234,13 +256,15 @@
mKeyguardDateWeatherViewInvisibility =
mView.getResources().getInteger(R.integer.keyguard_date_weather_view_invisibility);
- if (mOnlyClock) {
- View ksv = mView.findViewById(R.id.keyguard_slice_view);
- ksv.setVisibility(View.GONE);
+ if (mShownOnSecondaryDisplay) {
+ mView.setLargeClockOnSecondaryDisplay(true);
+ displayClock(LARGE, /* animate= */ false);
+ hideSliceViewAndNotificationIconContainer();
+ return;
+ }
- View nic = mView.findViewById(
- R.id.left_aligned_notification_icon_container);
- nic.setVisibility(View.GONE);
+ if (mOnlyClock) {
+ hideSliceViewAndNotificationIconContainer();
return;
}
updateAodIcons();
@@ -269,7 +293,7 @@
int viewIndex = mStatusArea.indexOfChild(ksv);
ksv.setVisibility(View.GONE);
- mSmartspaceController.removeViewsFromParent(mStatusArea);
+ removeViewsFromStatusArea();
addSmartspaceView();
// TODO(b/261757708): add content observer for the Settings toggle and add/remove
// weather according to the Settings.
@@ -293,6 +317,7 @@
setClock(null);
mSecureSettings.unregisterContentObserver(mDoubleLineClockObserver);
+ mSecureSettings.unregisterContentObserver(mShowWeatherObserver);
mKeyguardUnlockAnimationController.removeKeyguardUnlockAnimationListener(
mKeyguardUnlockAnimationListener);
@@ -300,7 +325,7 @@
void onLocaleListChanged() {
if (mSmartspaceController.isEnabled()) {
- mSmartspaceController.removeViewsFromParent(mStatusArea);
+ removeViewsFromStatusArea();
addSmartspaceView();
if (mSmartspaceController.isDateWeatherDecoupled()) {
mDateWeatherView.removeView(mWeatherView);
@@ -595,4 +620,13 @@
return ((mCurrentClockSize == LARGE) ? clock.getLargeClock() : clock.getSmallClock())
.getConfig().getHasCustomWeatherDataDisplay();
}
+
+ private void removeViewsFromStatusArea() {
+ for (int i = mStatusArea.getChildCount() - 1; i >= 0; i--) {
+ final View childView = mStatusArea.getChildAt(i);
+ if (childView.getTag(R.id.tag_smartspace_view) != null) {
+ mStatusArea.removeViewAt(i);
+ }
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
index 9f21a31..1c5a575 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardDisplayManager.java
@@ -43,16 +43,19 @@
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dagger.qualifiers.UiBackground;
+import com.android.systemui.flags.FeatureFlags;
+import com.android.systemui.flags.Flags;
import com.android.systemui.navigationbar.NavigationBarController;
import com.android.systemui.navigationbar.NavigationBarView;
import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.statusbar.policy.KeyguardStateController;
+import dagger.Lazy;
+
import java.util.concurrent.Executor;
import javax.inject.Inject;
-import dagger.Lazy;
@SysUISingleton
public class KeyguardDisplayManager {
@@ -64,6 +67,9 @@
private final DisplayTracker mDisplayTracker;
private final Lazy<NavigationBarController> mNavigationBarControllerLazy;
private final KeyguardStatusViewComponent.Factory mKeyguardStatusViewComponentFactory;
+ private final ConnectedDisplayKeyguardPresentation.Factory
+ mConnectedDisplayKeyguardPresentationFactory;
+ private final FeatureFlags mFeatureFlags;
private final Context mContext;
private boolean mShowing;
@@ -105,7 +111,10 @@
@Main Executor mainExecutor,
@UiBackground Executor uiBgExecutor,
DeviceStateHelper deviceStateHelper,
- KeyguardStateController keyguardStateController) {
+ KeyguardStateController keyguardStateController,
+ ConnectedDisplayKeyguardPresentation.Factory
+ connectedDisplayKeyguardPresentationFactory,
+ FeatureFlags featureFlags) {
mContext = context;
mNavigationBarControllerLazy = navigationBarControllerLazy;
mKeyguardStatusViewComponentFactory = keyguardStatusViewComponentFactory;
@@ -115,6 +124,8 @@
mDisplayTracker.addDisplayChangeCallback(mDisplayCallback, mainExecutor);
mDeviceStateHelper = deviceStateHelper;
mKeyguardStateController = keyguardStateController;
+ mConnectedDisplayKeyguardPresentationFactory = connectedDisplayKeyguardPresentationFactory;
+ mFeatureFlags = featureFlags;
}
private boolean isKeyguardShowable(Display display) {
@@ -185,8 +196,12 @@
return false;
}
- KeyguardPresentation createPresentation(Display display) {
- return new KeyguardPresentation(mContext, display, mKeyguardStatusViewComponentFactory);
+ Presentation createPresentation(Display display) {
+ if (mFeatureFlags.isEnabled(Flags.ENABLE_CLOCK_KEYGUARD_PRESENTATION)) {
+ return mConnectedDisplayKeyguardPresentationFactory.create(display);
+ } else {
+ return new KeyguardPresentation(mContext, display, mKeyguardStatusViewComponentFactory);
+ }
}
/**
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardFingerprintListenModel.kt b/packages/SystemUI/src/com/android/keyguard/KeyguardFingerprintListenModel.kt
index f23ae67..4160ae1 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardFingerprintListenModel.kt
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardFingerprintListenModel.kt
@@ -42,7 +42,6 @@
var keyguardIsVisible: Boolean = false,
var keyguardOccluded: Boolean = false,
var occludingAppRequestingFp: Boolean = false,
- var shouldListenSfpsState: Boolean = false,
var shouldListenForFingerprintAssistant: Boolean = false,
var strongerAuthRequired: Boolean = false,
var switchingUser: Boolean = false,
@@ -74,7 +73,6 @@
keyguardIsVisible.toString(),
keyguardOccluded.toString(),
occludingAppRequestingFp.toString(),
- shouldListenSfpsState.toString(),
shouldListenForFingerprintAssistant.toString(),
strongerAuthRequired.toString(),
switchingUser.toString(),
@@ -115,7 +113,6 @@
keyguardIsVisible = model.keyguardIsVisible
keyguardOccluded = model.keyguardOccluded
occludingAppRequestingFp = model.occludingAppRequestingFp
- shouldListenSfpsState = model.shouldListenSfpsState
shouldListenForFingerprintAssistant = model.shouldListenForFingerprintAssistant
strongerAuthRequired = model.strongerAuthRequired
switchingUser = model.switchingUser
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
index 20e4656..42dbc48 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java
@@ -30,13 +30,13 @@
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardSecurityModel.SecurityMode;
import com.android.systemui.R;
+import com.android.systemui.bouncer.domain.interactor.BouncerMessageInteractor;
+import com.android.systemui.bouncer.ui.BouncerMessageView;
+import com.android.systemui.bouncer.ui.binder.BouncerMessageViewBinder;
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
-import com.android.systemui.bouncer.domain.interactor.BouncerMessageInteractor;
-import com.android.systemui.bouncer.ui.BouncerMessageView;
-import com.android.systemui.bouncer.ui.binder.BouncerMessageViewBinder;
import com.android.systemui.log.BouncerLogger;
import com.android.systemui.statusbar.policy.DevicePostureController;
import com.android.systemui.util.ViewController;
@@ -95,6 +95,12 @@
@CallSuper
protected void onViewAttached() {
updateMessageAreaVisibility();
+ if (TextUtils.isEmpty(mMessageAreaController.getMessage())
+ && getInitialMessageResId() != 0) {
+ mMessageAreaController.setMessage(
+ mView.getResources().getString(getInitialMessageResId()),
+ /* animate= */ false);
+ }
}
private void updateMessageAreaVisibility() {
@@ -147,12 +153,6 @@
}
public void startAppearAnimation() {
- if (TextUtils.isEmpty(mMessageAreaController.getMessage())
- && getInitialMessageResId() != 0) {
- mMessageAreaController.setMessage(
- mView.getResources().getString(getInitialMessageResId()),
- /* animate= */ false);
- }
mView.startAppearAnimation();
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
index 49f788c..a30b447 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
@@ -238,6 +238,12 @@
}
mView.onDevicePostureChanged(mPostureController.getDevicePosture());
mPostureController.addCallback(mPostureCallback);
+ // if the user is currently locked out, enforce it.
+ long deadline = mLockPatternUtils.getLockoutAttemptDeadline(
+ KeyguardUpdateMonitor.getCurrentUser());
+ if (deadline != 0) {
+ handleAttemptLockout(deadline);
+ }
}
@Override
@@ -268,12 +274,6 @@
@Override
public void onResume(int reason) {
super.onResume(reason);
- // if the user is currently locked out, enforce it.
- long deadline = mLockPatternUtils.getLockoutAttemptDeadline(
- KeyguardUpdateMonitor.getCurrentUser());
- if (deadline != 0) {
- handleAttemptLockout(deadline);
- }
}
@Override
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java
index b3e08c0..574a059 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinViewController.java
@@ -79,6 +79,10 @@
mPasswordEntry.setUserActivityListener(this::onUserInput);
mView.onDevicePostureChanged(mPostureController.getDevicePosture());
mPostureController.addCallback(mPostureCallback);
+ if (mFeatureFlags.isEnabled(Flags.AUTO_PIN_CONFIRMATION)) {
+ mPasswordEntry.setUsePinShapes(true);
+ updateAutoConfirmationState();
+ }
}
protected void onUserInput() {
@@ -100,10 +104,6 @@
@Override
public void startAppearAnimation() {
- if (mFeatureFlags.isEnabled(Flags.AUTO_PIN_CONFIRMATION)) {
- mPasswordEntry.setUsePinShapes(true);
- updateAutoConfirmationState();
- }
super.startAppearAnimation();
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
index d9a1dc6..9f3908a 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
@@ -27,6 +27,7 @@
import static com.android.keyguard.KeyguardSecurityContainer.USER_TYPE_SECONDARY_USER;
import static com.android.keyguard.KeyguardSecurityContainer.USER_TYPE_WORK_PROFILE;
import static com.android.systemui.DejankUtils.whitelistIpcs;
+import static com.android.systemui.flags.Flags.LOCKSCREEN_ENABLE_LANDSCAPE;
import static com.android.systemui.flags.Flags.REVAMPED_BOUNCER_MESSAGES;
import android.app.ActivityManager;
@@ -84,6 +85,7 @@
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.shared.system.SysUiStatsLog;
import com.android.systemui.statusbar.policy.ConfigurationController;
+import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.UserSwitcherController;
import com.android.systemui.user.domain.interactor.UserInteractor;
@@ -146,8 +148,19 @@
private int mLastOrientation;
private SecurityMode mCurrentSecurityMode = SecurityMode.Invalid;
+ private int mCurrentUser = UserHandle.USER_NULL;
private UserSwitcherController.UserSwitchCallback mUserSwitchCallback =
- () -> showPrimarySecurityScreen(false);
+ new UserSwitcherController.UserSwitchCallback() {
+ @Override
+ public void onUserSwitched() {
+ if (mCurrentUser == KeyguardUpdateMonitor.getCurrentUser()) {
+ return;
+ }
+ mCurrentUser = KeyguardUpdateMonitor.getCurrentUser();
+ showPrimarySecurityScreen(false);
+ reinflateViewFlipper((l) -> {});
+ }
+ };
@VisibleForTesting
final Gefingerpoken mGlobalTouchListener = new Gefingerpoken() {
@@ -343,7 +356,6 @@
@Override
public void onThemeChanged() {
reloadColors();
- reset();
}
@Override
@@ -359,8 +371,12 @@
@Override
public void onOrientationChanged(int orientation) {
- KeyguardSecurityContainerController.this
+ if (mFeatureFlags.isEnabled(LOCKSCREEN_ENABLE_LANDSCAPE)) {
+ // TODO(b/295603468)
+ // Fix reinflation of views when flag is enabled.
+ KeyguardSecurityContainerController.this
.onDensityOrFontScaleOrOrientationChanged();
+ }
}
};
private final KeyguardUpdateMonitorCallback mKeyguardUpdateMonitorCallback =
@@ -401,6 +417,7 @@
private final UserInteractor mUserInteractor;
private final Provider<AuthenticationInteractor> mAuthenticationInteractor;
private final Provider<JavaAdapter> mJavaAdapter;
+ private final DeviceProvisionedController mDeviceProvisionedController;
@Nullable private Job mSceneTransitionCollectionJob;
@Inject
@@ -429,6 +446,7 @@
BouncerMessageInteractor bouncerMessageInteractor,
Provider<JavaAdapter> javaAdapter,
UserInteractor userInteractor,
+ DeviceProvisionedController deviceProvisionedController,
FaceAuthAccessibilityDelegate faceAuthAccessibilityDelegate,
KeyguardTransitionInteractor keyguardTransitionInteractor,
Provider<AuthenticationInteractor> authenticationInteractor
@@ -463,6 +481,7 @@
mAuthenticationInteractor = authenticationInteractor;
mJavaAdapter = javaAdapter;
mKeyguardTransitionInteractor = keyguardTransitionInteractor;
+ mDeviceProvisionedController = deviceProvisionedController;
}
@Override
@@ -847,9 +866,11 @@
// Shortcut for SIM PIN/PUK to go to directly to user's security screen or home
SecurityMode securityMode = mSecurityModel.getSecurityMode(targetUserId);
boolean isLockscreenDisabled = mLockPatternUtils.isLockScreenDisabled(
- KeyguardUpdateMonitor.getCurrentUser());
- if (securityMode == SecurityMode.None || isLockscreenDisabled) {
- finish = isLockscreenDisabled;
+ KeyguardUpdateMonitor.getCurrentUser())
+ || !mDeviceProvisionedController.isUserSetup(targetUserId);
+
+ if (securityMode == SecurityMode.None && isLockscreenDisabled) {
+ finish = true;
eventSubtype = BOUNCER_DISMISS_SIM;
uiEvent = BouncerUiEvent.BOUNCER_DISMISS_SIM;
} else {
@@ -1164,7 +1185,7 @@
}
private void reloadColors() {
- reinflateViewFlipper(controller -> mView.reloadColors());
+ mView.reloadColors();
}
/** Handles density or font scale changes. */
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
index 757022d..c314586 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java
@@ -187,6 +187,11 @@
mConfigurationController.removeCallback(mConfigurationListener);
}
+ /** Sets the StatusView as shown on an external display. */
+ public void setDisplayedOnSecondaryDisplay() {
+ mKeyguardClockSwitchController.setShownOnSecondaryDisplay(true);
+ }
+
/**
* Called in notificationPanelViewController to avoid leak
*/
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 853a62a..0ba6c05 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -3128,18 +3128,9 @@
&& !strongerAuthRequired
&& userDoesNotHaveTrust);
- boolean shouldListenSideFpsState = true;
- if (isSideFps) {
- final boolean interactiveToAuthEnabled =
- mFingerprintInteractiveToAuthProvider != null &&
- mFingerprintInteractiveToAuthProvider.isEnabled(getCurrentUser());
- shouldListenSideFpsState =
- interactiveToAuthEnabled ? isDeviceInteractive() && !mGoingToSleep : true;
- }
boolean shouldListen = shouldListenKeyguardState && shouldListenUserState
- && shouldListenBouncerState && shouldListenUdfpsState
- && shouldListenSideFpsState;
+ && shouldListenBouncerState && shouldListenUdfpsState;
logListenerModelData(
new KeyguardFingerprintListenModel(
System.currentTimeMillis(),
@@ -3160,7 +3151,6 @@
isKeyguardVisible(),
mKeyguardOccluded,
mOccludingAppRequestingFp,
- shouldListenSideFpsState,
shouldListenForFingerprintAssistant,
strongerAuthRequired,
mSwitchingUser,
@@ -3314,6 +3304,9 @@
mFingerprintDetectionCallback,
new FingerprintAuthenticateOptions.Builder()
.setUserId(userId)
+ .setVendorReason(
+ mFingerprintInteractiveToAuthProvider.getVendorExtension(
+ getCurrentUser()))
.build());
} else {
mLogger.v("startListeningForFingerprint");
@@ -3322,6 +3315,9 @@
null /* handler */,
new FingerprintAuthenticateOptions.Builder()
.setUserId(userId)
+ .setVendorReason(
+ mFingerprintInteractiveToAuthProvider.getVendorExtension(
+ getCurrentUser()))
.build()
);
}
@@ -4497,14 +4493,6 @@
} else if (isSfpsSupported()) {
pw.println(" sfpsEnrolled=" + isSfpsEnrolled());
pw.println(" shouldListenForSfps=" + shouldListenForFingerprint(false));
- if (isSfpsEnrolled()) {
- final boolean interactiveToAuthEnabled =
- mFingerprintInteractiveToAuthProvider != null &&
- mFingerprintInteractiveToAuthProvider
- .isEnabled(getCurrentUser());
- pw.println(" interactiveToAuthEnabled="
- + interactiveToAuthEnabled);
- }
}
new DumpsysTableLogger(
"KeyguardFingerprintListen",
diff --git a/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java b/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
index 340bf3f..eec16e6 100644
--- a/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
@@ -34,7 +34,6 @@
import android.permission.PermissionManager;
import android.util.ArraySet;
import android.util.Log;
-import android.util.Slog;
import android.util.SparseArray;
import androidx.annotation.WorkerThread;
@@ -122,8 +121,7 @@
AppOpsManager.OP_SYSTEM_ALERT_WINDOW
};
-
- protected static final int[] OPS = concatOps(OPS_MIC, OPS_CAMERA, OPS_LOC, OPS_OTHERS);
+ protected static final int[] OPS = concatOps(OPS_MIC, OPS_CAMERA, OPS_LOC, OPS_OTHERS);
/**
* @param opArrays the given op arrays.
diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
index 2b83e6b..590056f 100644
--- a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
+++ b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
@@ -23,6 +23,8 @@
import android.util.Log;
import com.android.internal.app.AssistUtils;
+import com.android.internal.app.IVisualQueryDetectionAttentionListener;
+import com.android.internal.app.IVisualQueryRecognitionStatusListener;
import com.android.internal.app.IVoiceInteractionSessionListener;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
@@ -39,10 +41,13 @@
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.util.settings.SecureSettings;
-import javax.inject.Inject;
-
import dagger.Lazy;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.inject.Inject;
+
/**
* Class to manage everything related to assist in SystemUI.
*/
@@ -78,6 +83,18 @@
void hide();
}
+ /**
+ * An interface for a listener that receives notification that visual query attention has
+ * either been gained or lost.
+ */
+ public interface VisualQueryAttentionListener {
+ /** Called when visual query attention has been gained. */
+ void onAttentionGained();
+
+ /** Called when visual query attention has been lost. */
+ void onAttentionLost();
+ }
+
private static final String TAG = "AssistManager";
// Note that VERBOSE logging may leak PII (e.g. transcription contents).
@@ -127,6 +144,23 @@
private final SecureSettings mSecureSettings;
private final DeviceProvisionedController mDeviceProvisionedController;
+
+ private final List<VisualQueryAttentionListener> mVisualQueryAttentionListeners =
+ new ArrayList<>();
+
+ private final IVisualQueryDetectionAttentionListener mVisualQueryDetectionAttentionListener =
+ new IVisualQueryDetectionAttentionListener.Stub() {
+ @Override
+ public void onAttentionGained() {
+ mVisualQueryAttentionListeners.forEach(VisualQueryAttentionListener::onAttentionGained);
+ }
+
+ @Override
+ public void onAttentionLost() {
+ mVisualQueryAttentionListeners.forEach(VisualQueryAttentionListener::onAttentionLost);
+ }
+ };
+
private final CommandQueue mCommandQueue;
protected final AssistUtils mAssistUtils;
@@ -157,6 +191,7 @@
mSecureSettings = secureSettings;
registerVoiceInteractionSessionListener();
+ registerVisualQueryRecognitionStatusListener();
mUiController = defaultUiController;
@@ -266,6 +301,24 @@
mAssistUtils.hideCurrentSession();
}
+ /**
+ * Add the given {@link VisualQueryAttentionListener} to the list of listeners awaiting
+ * notification of gaining/losing visual query attention.
+ */
+ public void addVisualQueryAttentionListener(VisualQueryAttentionListener listener) {
+ if (!mVisualQueryAttentionListeners.contains(listener)) {
+ mVisualQueryAttentionListeners.add(listener);
+ }
+ }
+
+ /**
+ * Remove the given {@link VisualQueryAttentionListener} from the list of listeners awaiting
+ * notification of gaining/losing visual query attention.
+ */
+ public void removeVisualQueryAttentionListener(VisualQueryAttentionListener listener) {
+ mVisualQueryAttentionListeners.remove(listener);
+ }
+
private void startAssistInternal(Bundle args, @NonNull ComponentName assistComponent,
boolean isService) {
if (isService) {
@@ -326,6 +379,27 @@
null, null);
}
+ private void registerVisualQueryRecognitionStatusListener() {
+ if (!mContext.getResources()
+ .getBoolean(R.bool.config_enableVisualQueryAttentionDetection)) {
+ return;
+ }
+
+ mAssistUtils.subscribeVisualQueryRecognitionStatus(
+ new IVisualQueryRecognitionStatusListener.Stub() {
+ @Override
+ public void onStartPerceiving() {
+ mAssistUtils.enableVisualQueryDetection(
+ mVisualQueryDetectionAttentionListener);
+ }
+
+ @Override
+ public void onStopPerceiving() {
+ mAssistUtils.disableVisualQueryDetection();
+ }
+ });
+ }
+
public void launchVoiceAssistFromKeyguard() {
mAssistUtils.launchVoiceAssistFromKeyguard();
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
index 58c8000..7464c88 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
@@ -73,9 +73,7 @@
import com.android.systemui.biometrics.domain.model.BiometricModalities;
import com.android.systemui.biometrics.ui.BiometricPromptLayout;
import com.android.systemui.biometrics.ui.CredentialView;
-import com.android.systemui.biometrics.ui.binder.AuthBiometricFingerprintViewBinder;
import com.android.systemui.biometrics.ui.binder.BiometricViewBinder;
-import com.android.systemui.biometrics.ui.viewmodel.AuthBiometricFingerprintViewModel;
import com.android.systemui.biometrics.ui.viewmodel.CredentialViewModel;
import com.android.systemui.biometrics.ui.viewmodel.PromptViewModel;
import com.android.systemui.dagger.qualifiers.Background;
@@ -142,8 +140,6 @@
// TODO: these should be migrated out once ready
private final Provider<PromptCredentialInteractor> mPromptCredentialInteractor;
- private final Provider<AuthBiometricFingerprintViewModel>
- mAuthBiometricFingerprintViewModelProvider;
private final @NonNull Provider<PromptSelectorInteractor> mPromptSelectorInteractorProvider;
// TODO(b/251476085): these should be migrated out of the view
private final Provider<CredentialViewModel> mCredentialViewModelProvider;
@@ -283,8 +279,6 @@
@NonNull UserManager userManager,
@NonNull LockPatternUtils lockPatternUtils,
@NonNull InteractionJankMonitor jankMonitor,
- @NonNull Provider<AuthBiometricFingerprintViewModel>
- authBiometricFingerprintViewModelProvider,
@NonNull Provider<PromptCredentialInteractor> promptCredentialInteractor,
@NonNull Provider<PromptSelectorInteractor> promptSelectorInteractor,
@NonNull PromptViewModel promptViewModel,
@@ -293,9 +287,9 @@
@NonNull VibratorHelper vibratorHelper) {
this(config, featureFlags, applicationCoroutineScope, fpProps, faceProps,
wakefulnessLifecycle, panelInteractionDetector, userManager, lockPatternUtils,
- jankMonitor, authBiometricFingerprintViewModelProvider, promptSelectorInteractor,
- promptCredentialInteractor, promptViewModel, credentialViewModelProvider,
- new Handler(Looper.getMainLooper()), bgExecutor, vibratorHelper);
+ jankMonitor, promptSelectorInteractor, promptCredentialInteractor, promptViewModel,
+ credentialViewModelProvider, new Handler(Looper.getMainLooper()), bgExecutor,
+ vibratorHelper);
}
@VisibleForTesting
@@ -309,8 +303,6 @@
@NonNull UserManager userManager,
@NonNull LockPatternUtils lockPatternUtils,
@NonNull InteractionJankMonitor jankMonitor,
- @NonNull Provider<AuthBiometricFingerprintViewModel>
- authBiometricFingerprintViewModelProvider,
@NonNull Provider<PromptSelectorInteractor> promptSelectorInteractorProvider,
@NonNull Provider<PromptCredentialInteractor> credentialInteractor,
@NonNull PromptViewModel promptViewModel,
@@ -359,7 +351,6 @@
mBackgroundExecutor = bgExecutor;
mInteractionJankMonitor = jankMonitor;
mPromptCredentialInteractor = credentialInteractor;
- mAuthBiometricFingerprintViewModelProvider = authBiometricFingerprintViewModelProvider;
mPromptSelectorInteractorProvider = promptSelectorInteractorProvider;
mCredentialViewModelProvider = credentialViewModelProvider;
mPromptViewModel = promptViewModel;
@@ -442,9 +433,6 @@
fingerprintAndFaceView.updateOverrideIconLayoutParamsSize();
fingerprintAndFaceView.setFaceClass3(
faceProperties.sensorStrength == STRENGTH_STRONG);
- final AuthBiometricFingerprintViewModel fpAndFaceViewModel =
- mAuthBiometricFingerprintViewModelProvider.get();
- AuthBiometricFingerprintViewBinder.bind(fingerprintAndFaceView, fpAndFaceViewModel);
mBiometricView = fingerprintAndFaceView;
} else if (fpProperties != null) {
final AuthBiometricFingerprintView fpView =
@@ -453,9 +441,6 @@
fpView.setSensorProperties(fpProperties);
fpView.setScaleFactorProvider(config.mScaleProvider);
fpView.updateOverrideIconLayoutParamsSize();
- final AuthBiometricFingerprintViewModel fpViewModel =
- mAuthBiometricFingerprintViewModelProvider.get();
- AuthBiometricFingerprintViewBinder.bind(fpView, fpViewModel);
mBiometricView = fpView;
} else if (faceProperties != null) {
mBiometricView = (AuthBiometricFaceView) layoutInflater.inflate(
@@ -514,6 +499,8 @@
R.layout.auth_credential_pattern_view, null, false);
break;
case Utils.CREDENTIAL_PIN:
+ mCredentialView = factory.inflate(R.layout.auth_credential_pin_view, null, false);
+ break;
case Utils.CREDENTIAL_PASSWORD:
mCredentialView = factory.inflate(
R.layout.auth_credential_password_view, null, false);
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
index 7b288a8..d5289a4 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
@@ -73,7 +73,6 @@
import com.android.systemui.biometrics.domain.interactor.LogContextInteractor;
import com.android.systemui.biometrics.domain.interactor.PromptCredentialInteractor;
import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteractor;
-import com.android.systemui.biometrics.ui.viewmodel.AuthBiometricFingerprintViewModel;
import com.android.systemui.biometrics.ui.viewmodel.CredentialViewModel;
import com.android.systemui.biometrics.ui.viewmodel.PromptViewModel;
import com.android.systemui.dagger.SysUISingleton;
@@ -134,8 +133,6 @@
private final CoroutineScope mApplicationCoroutineScope;
// TODO: these should be migrated out once ready
- @NonNull private final Provider<AuthBiometricFingerprintViewModel>
- mAuthBiometricFingerprintViewModelProvider;
@NonNull private final Provider<PromptCredentialInteractor> mPromptCredentialInteractor;
@NonNull private final Provider<PromptSelectorInteractor> mPromptSelectorInteractor;
@NonNull private final Provider<CredentialViewModel> mCredentialViewModelProvider;
@@ -765,8 +762,6 @@
@NonNull LockPatternUtils lockPatternUtils,
@NonNull UdfpsLogger udfpsLogger,
@NonNull LogContextInteractor logContextInteractor,
- @NonNull Provider<AuthBiometricFingerprintViewModel>
- authBiometricFingerprintViewModelProvider,
@NonNull Provider<PromptCredentialInteractor> promptCredentialInteractorProvider,
@NonNull Provider<PromptSelectorInteractor> promptSelectorInteractorProvider,
@NonNull Provider<CredentialViewModel> credentialViewModelProvider,
@@ -801,7 +796,6 @@
mVibratorHelper = vibratorHelper;
mLogContextInteractor = logContextInteractor;
- mAuthBiometricFingerprintViewModelProvider = authBiometricFingerprintViewModelProvider;
mPromptSelectorInteractor = promptSelectorInteractorProvider;
mPromptCredentialInteractor = promptCredentialInteractorProvider;
mPromptViewModelProvider = promptViewModelProvider;
@@ -1344,9 +1338,8 @@
config.mScaleProvider = this::getScaleFactor;
return new AuthContainerView(config, mFeatureFlags, mApplicationCoroutineScope, mFpProps, mFaceProps,
wakefulnessLifecycle, panelInteractionDetector, userManager, lockPatternUtils,
- mInteractionJankMonitor, mAuthBiometricFingerprintViewModelProvider,
- mPromptCredentialInteractor, mPromptSelectorInteractor, viewModel,
- mCredentialViewModelProvider, bgExecutor, mVibratorHelper);
+ mInteractionJankMonitor, mPromptCredentialInteractor, mPromptSelectorInteractor,
+ viewModel, mCredentialViewModelProvider, bgExecutor, mVibratorHelper);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintInteractiveToAuthProvider.java b/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintInteractiveToAuthProvider.java
index 902bb18..4bc07e8 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintInteractiveToAuthProvider.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/FingerprintInteractiveToAuthProvider.java
@@ -16,6 +16,8 @@
package com.android.systemui.biometrics;
+import android.hardware.biometrics.common.AuthenticateReason;
+
/** Provides the status of the interactive to auth feature. */
public interface FingerprintInteractiveToAuthProvider {
/**
@@ -24,4 +26,11 @@
* @return true if the InteractiveToAuthFeature is enabled, false if disabled.
*/
boolean isEnabled(int userId);
+
+ /**
+ *
+ * @param userId the user Id.
+ * @return Vendor extension if needed for authentication.
+ */
+ AuthenticateReason.Vendor getVendorExtension(int userId);
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/dagger/UdfpsModule.kt b/packages/SystemUI/src/com/android/systemui/biometrics/dagger/UdfpsModule.kt
index 20c3e40..f7f9103 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/dagger/UdfpsModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/dagger/UdfpsModule.kt
@@ -56,10 +56,10 @@
)
)
} else {
- BoundingBoxOverlapDetector()
+ BoundingBoxOverlapDetector(values[2])
}
} else {
- return BoundingBoxOverlapDetector()
+ return BoundingBoxOverlapDetector(1f)
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractor.kt b/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractor.kt
index bb87dca..5badcaf 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractor.kt
@@ -21,15 +21,18 @@
import com.android.systemui.biometrics.Utils
import com.android.systemui.biometrics.Utils.getCredentialType
import com.android.systemui.biometrics.Utils.isDeviceCredentialAllowed
+import com.android.systemui.biometrics.data.repository.FingerprintPropertyRepository
import com.android.systemui.biometrics.data.repository.PromptRepository
import com.android.systemui.biometrics.domain.model.BiometricModalities
import com.android.systemui.biometrics.domain.model.BiometricOperationInfo
import com.android.systemui.biometrics.domain.model.BiometricPromptRequest
import com.android.systemui.biometrics.shared.model.BiometricUserInfo
+import com.android.systemui.biometrics.shared.model.FingerprintSensorType
import com.android.systemui.biometrics.shared.model.PromptKind
import com.android.systemui.dagger.SysUISingleton
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.map
@@ -65,6 +68,9 @@
*/
val isConfirmationRequired: Flow<Boolean>
+ /** Fingerprint sensor type */
+ val sensorType: StateFlow<FingerprintSensorType>
+
/** Use biometrics for authentication. */
fun useBiometricsForAuthentication(
promptInfo: PromptInfo,
@@ -89,6 +95,7 @@
class PromptSelectorInteractorImpl
@Inject
constructor(
+ private val fingerprintPropertyRepository: FingerprintPropertyRepository,
private val promptRepository: PromptRepository,
lockPatternUtils: LockPatternUtils,
) : PromptSelectorInteractor {
@@ -140,6 +147,9 @@
}
}
+ override val sensorType: StateFlow<FingerprintSensorType> =
+ fingerprintPropertyRepository.sensorType
+
override fun useBiometricsForAuthentication(
promptInfo: PromptInfo,
userId: Int,
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/domain/model/BiometricPromptRequest.kt b/packages/SystemUI/src/com/android/systemui/biometrics/domain/model/BiometricPromptRequest.kt
index caebc30..a3ee220 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/domain/model/BiometricPromptRequest.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/domain/model/BiometricPromptRequest.kt
@@ -16,6 +16,7 @@
val description: String,
val userInfo: BiometricUserInfo,
val operationInfo: BiometricOperationInfo,
+ val showEmergencyCallButton: Boolean,
) {
/** Prompt using one or more biometrics. */
class Biometric(
@@ -29,7 +30,8 @@
subtitle = info.subtitle?.toString() ?: "",
description = info.description?.toString() ?: "",
userInfo = userInfo,
- operationInfo = operationInfo
+ operationInfo = operationInfo,
+ showEmergencyCallButton = info.isShowEmergencyCallButton
) {
val negativeButtonText: String = info.negativeButtonText?.toString() ?: ""
}
@@ -46,6 +48,7 @@
description = (info.deviceCredentialDescription ?: info.description)?.toString() ?: "",
userInfo = userInfo,
operationInfo = operationInfo,
+ showEmergencyCallButton = info.isShowEmergencyCallButton
) {
/** PIN prompt. */
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/udfps/BoundingBoxOverlapDetector.kt b/packages/SystemUI/src/com/android/systemui/biometrics/udfps/BoundingBoxOverlapDetector.kt
index cf6044f..9b946db 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/udfps/BoundingBoxOverlapDetector.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/udfps/BoundingBoxOverlapDetector.kt
@@ -17,16 +17,30 @@
package com.android.systemui.biometrics.udfps
import android.graphics.Rect
+import android.os.Build
+import android.util.Log
import com.android.systemui.dagger.SysUISingleton
/** Returns whether the touch coordinates are within the sensor's bounding box. */
@SysUISingleton
-class BoundingBoxOverlapDetector : OverlapDetector {
+class BoundingBoxOverlapDetector(private val targetSize: Float) : OverlapDetector {
+
+ private val TAG = "BoundingBoxOverlapDetector"
+
override fun isGoodOverlap(
touchData: NormalizedTouchData,
nativeSensorBounds: Rect,
nativeOverlayBounds: Rect,
- ): Boolean =
- touchData.isWithinBounds(nativeOverlayBounds) &&
- touchData.isWithinBounds(nativeSensorBounds)
+ ): Boolean {
+ val scaledRadius = (nativeSensorBounds.width() / 2) * targetSize
+ val scaledSensorBounds =
+ Rect(
+ (nativeSensorBounds.centerX() - scaledRadius).toInt(),
+ (nativeSensorBounds.centerY() - scaledRadius).toInt(),
+ (nativeSensorBounds.centerX() + scaledRadius).toInt(),
+ (nativeSensorBounds.centerY() + scaledRadius).toInt(),
+ )
+
+ return touchData.isWithinBounds(scaledSensorBounds)
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/CredentialPasswordView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/CredentialPasswordView.kt
index 709fe85..6c5cc48 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/CredentialPasswordView.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/CredentialPasswordView.kt
@@ -8,11 +8,8 @@
import android.view.WindowInsets
import android.view.WindowInsets.Type.ime
import android.view.accessibility.AccessibilityManager
-import android.widget.ImageView
-import android.widget.ImeAwareEditText
import android.widget.LinearLayout
import android.widget.TextView
-import androidx.core.view.isGone
import com.android.systemui.R
import com.android.systemui.biometrics.AuthPanelController
import com.android.systemui.biometrics.ui.binder.CredentialViewBinder
@@ -22,14 +19,6 @@
class CredentialPasswordView(context: Context, attrs: AttributeSet?) :
LinearLayout(context, attrs), CredentialView, View.OnApplyWindowInsetsListener {
- private lateinit var titleView: TextView
- private lateinit var subtitleView: TextView
- private lateinit var descriptionView: TextView
- private lateinit var iconView: ImageView
- private lateinit var passwordField: ImeAwareEditText
- private lateinit var credentialHeader: View
- private lateinit var credentialInput: View
-
private var bottomInset: Int = 0
private val accessibilityManager by lazy {
@@ -48,90 +37,32 @@
override fun onFinishInflate() {
super.onFinishInflate()
-
- titleView = requireViewById(R.id.title)
- subtitleView = requireViewById(R.id.subtitle)
- descriptionView = requireViewById(R.id.description)
- iconView = requireViewById(R.id.icon)
- passwordField = requireViewById(R.id.lockPassword)
- credentialHeader = requireViewById(R.id.auth_credential_header)
- credentialInput = requireViewById(R.id.auth_credential_input)
-
setOnApplyWindowInsetsListener(this)
}
- override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
- super.onLayout(changed, left, top, right, bottom)
-
- val inputLeftBound: Int
- var inputTopBound: Int
- var headerRightBound = right
- var headerTopBounds = top
- var headerBottomBounds = bottom
- val subTitleBottom: Int = if (subtitleView.isGone) titleView.bottom else subtitleView.bottom
- val descBottom = if (descriptionView.isGone) subTitleBottom else descriptionView.bottom
- if (resources.configuration.orientation == ORIENTATION_LANDSCAPE) {
- inputTopBound = (bottom - credentialInput.height) / 2
- inputLeftBound = (right - left) / 2
- headerRightBound = inputLeftBound
- if (descriptionView.bottom > headerBottomBounds) {
- headerTopBounds -= iconView.bottom.coerceAtMost(bottomInset)
- credentialHeader.layout(left, headerTopBounds, headerRightBound, bottom)
- }
- } else {
- inputTopBound = descBottom + (bottom - descBottom - credentialInput.height) / 2
- inputLeftBound = (right - left - credentialInput.width) / 2
-
- if (bottom - inputTopBound < credentialInput.height) {
- inputTopBound = bottom - credentialInput.height
- }
-
- if (descriptionView.bottom > inputTopBound) {
- credentialHeader.layout(left, headerTopBounds, headerRightBound, inputTopBound)
- }
- }
-
- credentialInput.layout(inputLeftBound, inputTopBound, right, bottom)
- }
-
- override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec)
-
- val newWidth = MeasureSpec.getSize(widthMeasureSpec)
- val newHeight = MeasureSpec.getSize(heightMeasureSpec) - bottomInset
-
- setMeasuredDimension(newWidth, newHeight)
-
- val halfWidthSpec = MeasureSpec.makeMeasureSpec(width / 2, MeasureSpec.AT_MOST)
- val fullHeightSpec = MeasureSpec.makeMeasureSpec(newHeight, MeasureSpec.UNSPECIFIED)
- if (resources.configuration.orientation == ORIENTATION_LANDSCAPE) {
- measureChildren(halfWidthSpec, fullHeightSpec)
- } else {
- measureChildren(widthMeasureSpec, fullHeightSpec)
- }
- }
-
override fun onApplyWindowInsets(v: View, insets: WindowInsets): WindowInsets {
- val bottomInsets = insets.getInsets(ime())
- if (bottomInset != bottomInsets.bottom) {
- bottomInset = bottomInsets.bottom
-
- if (bottomInset > 0 && resources.configuration.orientation == ORIENTATION_LANDSCAPE) {
- titleView.isSingleLine = true
- titleView.ellipsize = TextUtils.TruncateAt.MARQUEE
- titleView.marqueeRepeatLimit = -1
- // select to enable marquee unless a screen reader is enabled
- titleView.isSelected = accessibilityManager?.shouldMarquee() ?: false
- } else {
- titleView.isSingleLine = false
- titleView.ellipsize = null
- // select to enable marquee unless a screen reader is enabled
- titleView.isSelected = false
+ val imeBottomInset = insets.getInsets(ime()).bottom
+ if (bottomInset != imeBottomInset) {
+ val titleView: TextView? = findViewById(R.id.title)
+ if (titleView != null) {
+ if (
+ bottomInset > 0 && resources.configuration.orientation == ORIENTATION_LANDSCAPE
+ ) {
+ titleView.isSingleLine = true
+ titleView.ellipsize = TextUtils.TruncateAt.MARQUEE
+ titleView.marqueeRepeatLimit = -1
+ // select to enable marquee unless a screen reader is enabled
+ titleView.isSelected = accessibilityManager.shouldMarquee()
+ } else {
+ titleView.isSingleLine = false
+ titleView.ellipsize = null
+ // select to enable marquee unless a screen reader is enabled
+ titleView.isSelected = false
+ }
}
-
- requestLayout()
}
- return insets
+ setPadding(paddingLeft, paddingTop, paddingRight, imeBottomInset)
+ return insets.inset(0, 0, 0, imeBottomInset)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/IPinPad.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/IPinPad.kt
new file mode 100644
index 0000000..cf6865c
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/IPinPad.kt
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.biometrics.ui
+
+/**
+ * Interface for PinPad in auth_credential_pin_view. This is needed when a custom pin pad is
+ * preferred to the IME To use a PinPad, one needs to implement IPinPad interface and provide it in
+ * auth_credential_pin_view and specify the id as [pin_pad]
+ */
+interface IPinPad {
+ fun setPinPadClickListener(pinPadClickListener: PinPadClickListener)
+}
+
+/** The call back interface for onClick event in the view. */
+interface PinPadClickListener {
+ /**
+ * One of the digit key has been clicked.
+ *
+ * @param digit A String representing a digit between 0 and 9.
+ */
+ fun onDigitKeyClick(digit: String?)
+
+ /** The backspace key has been clicked. */
+ fun onBackspaceClick()
+
+ /** The enter key has been clicked. */
+ fun onEnterKeyClick()
+}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/AuthBiometricFingerprintViewBinder.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/AuthBiometricFingerprintViewBinder.kt
deleted file mode 100644
index 9c1bcec..0000000
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/AuthBiometricFingerprintViewBinder.kt
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package com.android.systemui.biometrics.ui.binder
-
-import com.android.systemui.biometrics.AuthBiometricFingerprintView
-import com.android.systemui.biometrics.ui.viewmodel.AuthBiometricFingerprintViewModel
-
-object AuthBiometricFingerprintViewBinder {
-
- /**
- * Binds a [AuthBiometricFingerprintView.mIconView] to a [AuthBiometricFingerprintViewModel].
- */
- @JvmStatic
- fun bind(view: AuthBiometricFingerprintView, viewModel: AuthBiometricFingerprintViewModel) {
- if (view.isSfps) {
- AuthBiometricFingerprintIconViewBinder.bind(view.getIconView(), viewModel)
- }
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewBinder.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewBinder.kt
index d054751..b1439fd 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewBinder.kt
@@ -108,6 +108,9 @@
val iconViewOverlay = view.requireViewById<LottieAnimationView>(R.id.biometric_icon_overlay)
val iconView = view.requireViewById<LottieAnimationView>(R.id.biometric_icon)
+
+ PromptFingerprintIconViewBinder.bind(iconView, viewModel.fingerprintIconViewModel)
+
val indicatorMessageView = view.requireViewById<TextView>(R.id.indicator)
// Negative-side (left) buttons
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/CredentialPasswordViewBinder.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/CredentialPasswordViewBinder.kt
index c27d7152..996b62e 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/CredentialPasswordViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/CredentialPasswordViewBinder.kt
@@ -15,6 +15,7 @@
import com.android.systemui.R
import com.android.systemui.biometrics.ui.CredentialPasswordView
import com.android.systemui.biometrics.ui.CredentialView
+import com.android.systemui.biometrics.ui.IPinPad
import com.android.systemui.biometrics.ui.viewmodel.CredentialViewModel
import com.android.systemui.lifecycle.repeatWhenAttached
import kotlinx.coroutines.awaitCancellation
@@ -53,13 +54,19 @@
}
)
passwordField.setOnKeyListener(OnBackButtonListener(onBackInvokedCallback))
-
+ val pinPadView = view.findViewById(R.id.pin_pad) as? IPinPad
+ if (pinPadView != null) {
+ PinPadViewBinder.bind(pinPadView, view)
+ }
repeatOnLifecycle(Lifecycle.State.STARTED) {
// dismiss on a valid credential check
launch {
viewModel.validatedAttestation.collect { attestation ->
if (attestation != null) {
- imeManager.hideSoftInputFromWindow(view.windowToken, 0 /* flags */)
+ imeManager.hideSoftInputFromWindow(
+ view.windowToken,
+ 0 // flag
+ )
host.onCredentialMatched(attestation)
} else {
passwordField.setText("")
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/CredentialViewBinder.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/CredentialViewBinder.kt
index 9292bd7..25fe619 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/CredentialViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/CredentialViewBinder.kt
@@ -2,6 +2,7 @@
import android.view.View
import android.view.ViewGroup
+import android.widget.Button
import android.widget.ImageView
import android.widget.TextView
import androidx.lifecycle.Lifecycle
@@ -46,6 +47,8 @@
val descriptionView: TextView = view.requireViewById(R.id.description)
val iconView: ImageView? = view.findViewById(R.id.icon)
val errorView: TextView = view.requireViewById(R.id.error)
+ val cancelButton: Button? = view.findViewById(R.id.cancel_button)
+ val emergencyButtonView: Button = view.requireViewById(R.id.emergencyCallButton)
var errorTimer: Job? = null
@@ -58,7 +61,7 @@
updateForContentDimensions(
containerWidth,
containerHeight,
- 0 /* animateDurationMs */
+ 0 // animateDurationMs
)
}
}
@@ -75,6 +78,13 @@
iconView?.setImageDrawable(header.icon)
+ if (header.showEmergencyCallButton) {
+ emergencyButtonView.visibility = View.VISIBLE
+ emergencyButtonView.setOnClickListener {
+ viewModel.doEmergencyCall(view.context)
+ }
+ }
+
// Only animate this if we're transitioning from a biometric view.
if (viewModel.animateContents.value) {
view.animateCredentialViewIn()
@@ -94,7 +104,18 @@
}
}
}
- .collect { errorView.textOrHide = it }
+ .collect { it ->
+ val hasError = !it.isNullOrBlank()
+ errorView.visibility =
+ if (hasError) {
+ View.VISIBLE
+ } else if (cancelButton != null) {
+ View.INVISIBLE
+ } else {
+ View.GONE
+ }
+ errorView.text = if (hasError) it else ""
+ }
}
// show an extra dialog if the remaining attempts becomes low
@@ -108,6 +129,8 @@
}
}
+ cancelButton?.setOnClickListener { host.onCredentialAborted() }
+
// bind the auth widget
when (view) {
is CredentialPasswordView ->
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/PinPadViewBinder.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/PinPadViewBinder.kt
new file mode 100644
index 0000000..906206c
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/PinPadViewBinder.kt
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package com.android.systemui.biometrics.ui.binder
+
+import android.view.KeyEvent
+import android.widget.ImeAwareEditText
+import com.android.internal.widget.LockscreenCredential
+import com.android.systemui.R
+import com.android.systemui.biometrics.ui.CredentialPasswordView
+import com.android.systemui.biometrics.ui.IPinPad
+import com.android.systemui.biometrics.ui.PinPadClickListener
+
+/** Binder for IPinPad */
+object PinPadViewBinder {
+ /** Implements a PinPadClickListener inside a pin pad */
+ @JvmStatic
+ fun bind(view: IPinPad, credentialPasswordView: CredentialPasswordView) {
+ val passwordField: ImeAwareEditText =
+ credentialPasswordView.requireViewById(R.id.lockPassword)
+ view.setPinPadClickListener(
+ object : PinPadClickListener {
+
+ override fun onDigitKeyClick(digit: String?) {
+ passwordField.append(digit)
+ }
+
+ override fun onBackspaceClick() {
+ val pin = LockscreenCredential.createPinOrNone(passwordField.text)
+ if (pin.size() > 0) {
+ passwordField.text.delete(
+ passwordField.selectionEnd - 1,
+ passwordField.selectionEnd
+ )
+ }
+ pin.zeroize()
+ }
+
+ override fun onEnterKeyClick() {
+ passwordField.dispatchKeyEvent(
+ KeyEvent(0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER, 0)
+ )
+ passwordField.dispatchKeyEvent(
+ KeyEvent(0, 0, KeyEvent.ACTION_UP, KeyEvent.KEYCODE_ENTER, 0)
+ )
+ }
+ }
+ )
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/AuthBiometricFingerprintIconViewBinder.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/PromptFingerprintIconViewBinder.kt
similarity index 68%
rename from packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/AuthBiometricFingerprintIconViewBinder.kt
rename to packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/PromptFingerprintIconViewBinder.kt
index bd0907e..188c82b 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/AuthBiometricFingerprintIconViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/PromptFingerprintIconViewBinder.kt
@@ -21,26 +21,29 @@
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.repeatOnLifecycle
import com.airbnb.lottie.LottieAnimationView
-import com.android.systemui.biometrics.AuthBiometricFingerprintView
-import com.android.systemui.biometrics.ui.viewmodel.AuthBiometricFingerprintViewModel
+import com.android.systemui.biometrics.ui.viewmodel.PromptFingerprintIconViewModel
import com.android.systemui.lifecycle.repeatWhenAttached
import kotlinx.coroutines.launch
-/** Sub-binder for [AuthBiometricFingerprintView.mIconView]. */
-object AuthBiometricFingerprintIconViewBinder {
+/** Sub-binder for [BiometricPromptLayout.iconView]. */
+object PromptFingerprintIconViewBinder {
- /**
- * Binds a [AuthBiometricFingerprintView.mIconView] to a [AuthBiometricFingerprintViewModel].
- */
+ /** Binds [BiometricPromptLayout.iconView] to [PromptFingerprintIconViewModel]. */
@JvmStatic
- fun bind(view: LottieAnimationView, viewModel: AuthBiometricFingerprintViewModel) {
+ fun bind(view: LottieAnimationView, viewModel: PromptFingerprintIconViewModel) {
view.repeatWhenAttached {
repeatOnLifecycle(Lifecycle.State.STARTED) {
val displayInfo = DisplayInfo()
view.context.display?.getDisplayInfo(displayInfo)
viewModel.setRotation(displayInfo.rotation)
viewModel.onConfigurationChanged(view.context.resources.configuration)
- launch { viewModel.iconAsset.collect { iconAsset -> view.setAnimation(iconAsset) } }
+ launch {
+ viewModel.iconAsset.collect { iconAsset ->
+ if (iconAsset != -1) {
+ view.setAnimation(iconAsset)
+ }
+ }
+ }
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/CredentialHeaderViewModel.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/CredentialHeaderViewModel.kt
index 3257f20..c6d9085 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/CredentialHeaderViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/CredentialHeaderViewModel.kt
@@ -10,4 +10,5 @@
val subtitle: String
val description: String
val icon: Drawable
+ val showEmergencyCallButton: Boolean
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModel.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModel.kt
index a3b23ca..6212ef0 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModel.kt
@@ -41,6 +41,7 @@
subtitle = request.subtitle,
description = request.description,
icon = applicationContext.asLockIcon(request.userInfo.deviceCredentialOwnerId),
+ showEmergencyCallButton = request.showEmergencyCallButton
)
}
@@ -136,6 +137,18 @@
}
}
}
+
+ fun doEmergencyCall(context: Context) {
+ val intent =
+ context
+ .getSystemService(android.telecom.TelecomManager::class.java)!!
+ .createLaunchEmergencyDialerIntent(null)
+ .setFlags(
+ android.content.Intent.FLAG_ACTIVITY_NEW_TASK or
+ android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP
+ )
+ context.startActivity(intent)
+ }
}
private fun Context.asBadCredentialErrorMessage(prompt: BiometricPromptRequest?): String =
@@ -174,6 +187,7 @@
override val subtitle: String,
override val description: String,
override val icon: Drawable,
+ override val showEmergencyCallButton: Boolean,
) : CredentialHeaderViewModel
private fun CredentialHeaderViewModel.asRequest(): BiometricPromptRequest.Credential =
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/AuthBiometricFingerprintViewModel.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptFingerprintIconViewModel.kt
similarity index 70%
rename from packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/AuthBiometricFingerprintViewModel.kt
rename to packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptFingerprintIconViewModel.kt
index 617d80c..9b30acb 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/AuthBiometricFingerprintViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptFingerprintIconViewModel.kt
@@ -22,23 +22,35 @@
import android.view.Surface
import com.android.systemui.R
import com.android.systemui.biometrics.domain.interactor.DisplayStateInteractor
+import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteractor
+import com.android.systemui.biometrics.shared.model.FingerprintSensorType
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
-/** Models UI of AuthBiometricFingerprintView to support rear display state changes. */
-class AuthBiometricFingerprintViewModel
+/** Models UI of [BiometricPromptLayout.iconView] */
+class PromptFingerprintIconViewModel
@Inject
-constructor(private val interactor: DisplayStateInteractor) {
+constructor(
+ private val displayStateInteractor: DisplayStateInteractor,
+ private val promptSelectorInteractor: PromptSelectorInteractor,
+) {
/** Current device rotation. */
private var rotation: Int = Surface.ROTATION_0
- /** Current AuthBiometricFingerprintView asset. */
+ /** Current BiometricPromptLayout.iconView asset. */
val iconAsset: Flow<Int> =
- combine(interactor.isFolded, interactor.isInRearDisplayMode) {
- isFolded: Boolean,
- isInRearDisplayMode: Boolean ->
- getSideFpsAnimationAsset(isFolded, isInRearDisplayMode)
+ combine(
+ displayStateInteractor.isFolded,
+ displayStateInteractor.isInRearDisplayMode,
+ promptSelectorInteractor.sensorType,
+ ) { isFolded: Boolean, isInRearDisplayMode: Boolean, sensorType: FingerprintSensorType ->
+ when (sensorType) {
+ FingerprintSensorType.POWER_BUTTON ->
+ getSideFpsAnimationAsset(isFolded, isInRearDisplayMode)
+ // Replace below when non-SFPS iconAsset logic is migrated to this ViewModel
+ else -> -1
+ }
}
@RawRes
@@ -75,7 +87,7 @@
/** Called on configuration changes */
fun onConfigurationChanged(newConfig: Configuration) {
- interactor.onConfigurationChanged(newConfig)
+ displayStateInteractor.onConfigurationChanged(newConfig)
}
fun setRotation(newRotation: Int) {
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt
index 89561a5..4dc7720 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt
@@ -20,6 +20,7 @@
import android.view.HapticFeedbackConstants
import android.view.MotionEvent
import com.android.systemui.biometrics.AuthBiometricView
+import com.android.systemui.biometrics.domain.interactor.DisplayStateInteractor
import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteractor
import com.android.systemui.biometrics.domain.model.BiometricModalities
import com.android.systemui.biometrics.shared.model.BiometricModality
@@ -45,16 +46,23 @@
class PromptViewModel
@Inject
constructor(
- private val interactor: PromptSelectorInteractor,
+ private val displayStateInteractor: DisplayStateInteractor,
+ private val promptSelectorInteractor: PromptSelectorInteractor,
private val vibrator: VibratorHelper,
private val featureFlags: FeatureFlags,
) {
+ /** Models UI of [BiometricPromptLayout.iconView] */
+ val fingerprintIconViewModel: PromptFingerprintIconViewModel =
+ PromptFingerprintIconViewModel(displayStateInteractor, promptSelectorInteractor)
+
/** The set of modalities available for this prompt */
val modalities: Flow<BiometricModalities> =
- interactor.prompt.map { it?.modalities ?: BiometricModalities() }.distinctUntilChanged()
+ promptSelectorInteractor.prompt
+ .map { it?.modalities ?: BiometricModalities() }
+ .distinctUntilChanged()
// TODO(b/251476085): remove after icon controllers are migrated - do not keep this state
- private var _legacyState = MutableStateFlow(AuthBiometricView.STATE_AUTHENTICATING_ANIMATING_IN)
+ private var _legacyState = MutableStateFlow(AuthBiometricView.STATE_IDLE)
val legacyState: StateFlow<Int> = _legacyState.asStateFlow()
private val _isAuthenticating: MutableStateFlow<Boolean> = MutableStateFlow(false)
@@ -75,17 +83,18 @@
* successful authentication.
*/
val isConfirmationRequired: Flow<Boolean> =
- combine(_isOverlayTouched, interactor.isConfirmationRequired) {
+ combine(_isOverlayTouched, promptSelectorInteractor.isConfirmationRequired) {
isOverlayTouched,
isConfirmationRequired ->
!isOverlayTouched && isConfirmationRequired
}
/** The kind of credential the user has. */
- val credentialKind: Flow<PromptKind> = interactor.credentialKind
+ val credentialKind: Flow<PromptKind> = promptSelectorInteractor.credentialKind
/** The label to use for the cancel button. */
- val negativeButtonText: Flow<String> = interactor.prompt.map { it?.negativeButtonText ?: "" }
+ val negativeButtonText: Flow<String> =
+ promptSelectorInteractor.prompt.map { it?.negativeButtonText ?: "" }
private val _message: MutableStateFlow<PromptMessage> = MutableStateFlow(PromptMessage.Empty)
@@ -113,7 +122,7 @@
_forceLargeSize,
_forceMediumSize,
modalities,
- interactor.isConfirmationRequired,
+ promptSelectorInteractor.isConfirmationRequired,
fingerprintStartMode,
) { forceLarge, forceMedium, modalities, confirmationRequired, fpStartMode ->
when {
@@ -129,14 +138,16 @@
.distinctUntilChanged()
/** Title for the prompt. */
- val title: Flow<String> = interactor.prompt.map { it?.title ?: "" }.distinctUntilChanged()
+ val title: Flow<String> =
+ promptSelectorInteractor.prompt.map { it?.title ?: "" }.distinctUntilChanged()
/** Subtitle for the prompt. */
- val subtitle: Flow<String> = interactor.prompt.map { it?.subtitle ?: "" }.distinctUntilChanged()
+ val subtitle: Flow<String> =
+ promptSelectorInteractor.prompt.map { it?.subtitle ?: "" }.distinctUntilChanged()
/** Description for the prompt. */
val description: Flow<String> =
- interactor.prompt.map { it?.description ?: "" }.distinctUntilChanged()
+ promptSelectorInteractor.prompt.map { it?.description ?: "" }.distinctUntilChanged()
/** If the indicator (help, error) message should be shown. */
val isIndicatorMessageVisible: Flow<Boolean> =
@@ -160,7 +171,9 @@
/** If the icon can be used as a confirmation button. */
val isIconConfirmButton: Flow<Boolean> =
- combine(size, interactor.isConfirmationRequired) { size, isConfirmationRequired ->
+ combine(size, promptSelectorInteractor.isConfirmationRequired) {
+ size,
+ isConfirmationRequired ->
size.isNotSmall && isConfirmationRequired
}
@@ -169,7 +182,7 @@
combine(
size,
isAuthenticated,
- interactor.isCredentialAllowed,
+ promptSelectorInteractor.isCredentialAllowed,
) { size, authState, credentialAllowed ->
size.isNotSmall && authState.isNotAuthenticated && !credentialAllowed
}
@@ -221,7 +234,7 @@
combine(
size,
isAuthenticated,
- interactor.isCredentialAllowed,
+ promptSelectorInteractor.isCredentialAllowed,
) { size, authState, credentialAllowed ->
size.isNotSmall && authState.isNotAuthenticated && credentialAllowed
}
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/data/factory/BouncerMessageFactory.kt b/packages/SystemUI/src/com/android/systemui/bouncer/data/factory/BouncerMessageFactory.kt
index 1817ea9..64bf688 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/data/factory/BouncerMessageFactory.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/data/factory/BouncerMessageFactory.kt
@@ -36,7 +36,6 @@
import com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TIMEOUT
import com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TRUSTAGENT_EXPIRED
import com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_USER_REQUEST
-import com.android.keyguard.KeyguardUpdateMonitor
import com.android.systemui.R.string.bouncer_face_not_recognized
import com.android.systemui.R.string.keyguard_enter_password
import com.android.systemui.R.string.keyguard_enter_pattern
@@ -80,13 +79,14 @@
import com.android.systemui.bouncer.shared.model.BouncerMessageModel
import com.android.systemui.bouncer.shared.model.Message
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.keyguard.data.repository.BiometricSettingsRepository
import javax.inject.Inject
@SysUISingleton
class BouncerMessageFactory
@Inject
constructor(
- private val updateMonitor: KeyguardUpdateMonitor,
+ private val biometricSettingsRepository: BiometricSettingsRepository,
private val securityModel: KeyguardSecurityModel,
) {
@@ -99,7 +99,7 @@
getBouncerMessage(
reason,
securityModel.getSecurityMode(userId),
- updateMonitor.isUnlockingWithFingerprintAllowed
+ biometricSettingsRepository.isFingerprintAuthCurrentlyAllowed.value
)
return pair?.let {
BouncerMessageModel(
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/data/repository/BouncerMessageRepository.kt b/packages/SystemUI/src/com/android/systemui/bouncer/data/repository/BouncerMessageRepository.kt
index 6fb0d4c..97c1bdb 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/data/repository/BouncerMessageRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/data/repository/BouncerMessageRepository.kt
@@ -123,20 +123,11 @@
fingerprintAuthRepository: DeviceEntryFingerprintAuthRepository,
) : BouncerMessageRepository {
- private val isFaceEnrolledAndEnabled =
- and(
- biometricSettingsRepository.isFaceAuthenticationEnabled,
- biometricSettingsRepository.isFaceEnrolled
- )
-
- private val isFingerprintEnrolledAndEnabled =
- and(
- biometricSettingsRepository.isFingerprintEnabledByDevicePolicy,
- biometricSettingsRepository.isFingerprintEnrolled
- )
-
private val isAnyBiometricsEnabledAndEnrolled =
- or(isFaceEnrolledAndEnabled, isFingerprintEnrolledAndEnabled)
+ or(
+ biometricSettingsRepository.isFaceAuthEnrolledAndEnabled,
+ biometricSettingsRepository.isFingerprintEnrolledAndEnabled,
+ )
private val wasRebootedForMainlineUpdate
get() = systemPropertiesHelper.get(SYS_BOOT_REASON_PROP) == REBOOT_MAINLINE_UPDATE
@@ -335,8 +326,5 @@
}
}
-private fun and(flow: Flow<Boolean>, anotherFlow: Flow<Boolean>) =
- flow.combine(anotherFlow) { a, b -> a && b }
-
private fun or(flow: Flow<Boolean>, anotherFlow: Flow<Boolean>) =
flow.combine(anotherFlow) { a, b -> a || b }
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/AlternateBouncerInteractor.kt b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/AlternateBouncerInteractor.kt
index 98ae54b..9a7fec1 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/AlternateBouncerInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/AlternateBouncerInteractor.kt
@@ -83,9 +83,7 @@
fun canShowAlternateBouncerForFingerprint(): Boolean {
return bouncerRepository.alternateBouncerUIAvailable.value &&
- biometricSettingsRepository.isFingerprintEnrolled.value &&
- biometricSettingsRepository.isStrongBiometricAllowed.value &&
- biometricSettingsRepository.isFingerprintEnabledByDevicePolicy.value &&
+ biometricSettingsRepository.isFingerprintAuthCurrentlyAllowed.value &&
!keyguardUpdateMonitor.isFingerprintLockedOut &&
!keyguardStateController.isUnlocked &&
!statusBarStateController.isDozing
diff --git a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/IntentCreator.java b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/IntentCreator.java
index 566a74a..d58fab4 100644
--- a/packages/SystemUI/src/com/android/systemui/clipboardoverlay/IntentCreator.java
+++ b/packages/SystemUI/src/com/android/systemui/clipboardoverlay/IntentCreator.java
@@ -27,7 +27,8 @@
import com.android.systemui.R;
class IntentCreator {
- private static final String EXTRA_EDIT_SOURCE_CLIPBOARD = "edit_source_clipboard";
+ private static final String EXTRA_EDIT_SOURCE = "edit_source";
+ private static final String EDIT_SOURCE_CLIPBOARD = "clipboard";
private static final String REMOTE_COPY_ACTION = "android.intent.action.REMOTE_COPY";
static Intent getTextEditorIntent(Context context) {
@@ -74,7 +75,7 @@
editIntent.setDataAndType(uri, "image/*");
editIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
editIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
- editIntent.putExtra(EXTRA_EDIT_SOURCE_CLIPBOARD, true);
+ editIntent.putExtra(EXTRA_EDIT_SOURCE, EDIT_SOURCE_CLIPBOARD);
return editIntent;
}
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinator.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinator.kt
index 8029ba8..534832c 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinator.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinator.kt
@@ -54,9 +54,10 @@
/**
* When a ToggleRange control is interacting with, a drag event is sent.
*
+ * @param cvh [ControlViewHolder] for the control
* @param isEdge did the drag event reach a control edge
*/
- fun drag(isEdge: Boolean)
+ fun drag(cvh: ControlViewHolder, isEdge: Boolean)
/**
* Send a request to update the value of a device using the [FloatAction].
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinatorImpl.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinatorImpl.kt
index a7e9efd8..00d95c0 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinatorImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlActionCoordinatorImpl.kt
@@ -37,6 +37,8 @@
import com.android.systemui.controls.settings.ControlsSettingsRepository
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
+import com.android.systemui.flags.FeatureFlags
+import com.android.systemui.flags.Flags.ONE_WAY_HAPTICS_API_MIGRATION
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.statusbar.policy.KeyguardStateController
@@ -57,6 +59,7 @@
private val controlsMetricsLogger: ControlsMetricsLogger,
private val vibrator: VibratorHelper,
private val controlsSettingsRepository: ControlsSettingsRepository,
+ private val featureFlags: FeatureFlags,
) : ControlActionCoordinator {
private var dialog: Dialog? = null
private var pendingAction: Action? = null
@@ -119,11 +122,17 @@
)
}
- override fun drag(isEdge: Boolean) {
- if (isEdge) {
- vibrate(Vibrations.rangeEdgeEffect)
+ override fun drag(cvh: ControlViewHolder, isEdge: Boolean) {
+ if (featureFlags.isEnabled(ONE_WAY_HAPTICS_API_MIGRATION)) {
+ val constant =
+ if (isEdge)
+ HapticFeedbackConstants.SEGMENT_TICK
+ else
+ HapticFeedbackConstants.SEGMENT_FREQUENT_TICK
+ vibrator.performHapticFeedback(cvh.layout, constant)
} else {
- vibrate(Vibrations.rangeMiddleEffect)
+ val effect = if (isEdge) Vibrations.rangeEdgeEffect else Vibrations.rangeMiddleEffect
+ vibrate(effect)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ToggleRangeBehavior.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ToggleRangeBehavior.kt
index b2c95a6..0d570d2 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/ToggleRangeBehavior.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ToggleRangeBehavior.kt
@@ -235,7 +235,7 @@
if (isDragging) {
val isEdge = newLevel == MIN_LEVEL || newLevel == MAX_LEVEL
if (clipLayer.level != newLevel) {
- cvh.controlActionCoordinator.drag(isEdge)
+ cvh.controlActionCoordinator.drag(cvh, isEdge)
clipLayer.level = newLevel
}
} else if (newLevel != clipLayer.level) {
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt b/packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt
index d9665c5b5..484be9c 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt
@@ -53,6 +53,7 @@
import com.android.systemui.statusbar.phone.KeyguardLiftController
import com.android.systemui.statusbar.phone.LockscreenWallpaper
import com.android.systemui.statusbar.phone.ScrimController
+import com.android.systemui.statusbar.phone.StatusBarHeadsUpChangeListener
import com.android.systemui.stylus.StylusUsiPowerStartable
import com.android.systemui.temporarydisplay.chipbar.ChipbarCoordinator
import com.android.systemui.theme.ThemeOverlayController
@@ -331,4 +332,11 @@
@IntoMap
@ClassKey(ScrimController::class)
abstract fun bindScrimController(impl: ScrimController): CoreStartable
+
+ @Binds
+ @IntoMap
+ @ClassKey(StatusBarHeadsUpChangeListener::class)
+ abstract fun bindStatusBarHeadsUpChangeListener(
+ impl: StatusBarHeadsUpChangeListener
+ ): CoreStartable
}
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
index 970d00b..3bf9cc8 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
@@ -107,6 +107,7 @@
import com.android.systemui.statusbar.notification.row.dagger.NotificationShelfComponent;
import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.LetterboxModule;
+import com.android.systemui.statusbar.phone.NotificationIconAreaControllerModule;
import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent;
import com.android.systemui.statusbar.pipeline.dagger.StatusBarPipelineModule;
import com.android.systemui.statusbar.policy.HeadsUpManager;
@@ -185,6 +186,7 @@
MediaProjectionModule.class,
MediaProjectionTaskSwitcherModule.class,
MotionToolModule.class,
+ NotificationIconAreaControllerModule.class,
PeopleHubModule.class,
PeopleModule.class,
PluginModule.class,
diff --git a/packages/SystemUI/src/com/android/systemui/dreams/conditions/AssistantAttentionCondition.java b/packages/SystemUI/src/com/android/systemui/dreams/conditions/AssistantAttentionCondition.java
index c889ac2..4dd97d5 100644
--- a/packages/SystemUI/src/com/android/systemui/dreams/conditions/AssistantAttentionCondition.java
+++ b/packages/SystemUI/src/com/android/systemui/dreams/conditions/AssistantAttentionCondition.java
@@ -16,10 +16,9 @@
package com.android.systemui.dreams.conditions;
-import com.android.internal.app.AssistUtils;
-import com.android.internal.app.IVisualQueryDetectionAttentionListener;
+import com.android.systemui.assist.AssistManager;
+import com.android.systemui.assist.AssistManager.VisualQueryAttentionListener;
import com.android.systemui.dagger.qualifiers.Application;
-import com.android.systemui.dreams.DreamOverlayStateController;
import com.android.systemui.shared.condition.Condition;
import javax.inject.Inject;
@@ -30,12 +29,10 @@
* {@link AssistantAttentionCondition} provides a signal when assistant has the user's attention.
*/
public class AssistantAttentionCondition extends Condition {
- private final DreamOverlayStateController mDreamOverlayStateController;
- private final AssistUtils mAssistUtils;
- private boolean mEnabled;
+ private final AssistManager mAssistManager;
- private final IVisualQueryDetectionAttentionListener mVisualQueryDetectionAttentionListener =
- new IVisualQueryDetectionAttentionListener.Stub() {
+ private final VisualQueryAttentionListener mVisualQueryAttentionListener =
+ new VisualQueryAttentionListener() {
@Override
public void onAttentionGained() {
updateCondition(true);
@@ -47,59 +44,26 @@
}
};
- private final DreamOverlayStateController.Callback mCallback =
- new DreamOverlayStateController.Callback() {
- @Override
- public void onStateChanged() {
- if (mDreamOverlayStateController.isDreamOverlayStatusBarVisible()) {
- enableVisualQueryDetection();
- } else {
- disableVisualQueryDetection();
- }
- }
- };
-
@Inject
public AssistantAttentionCondition(
@Application CoroutineScope scope,
- DreamOverlayStateController dreamOverlayStateController,
- AssistUtils assistUtils) {
+ AssistManager assistManager) {
super(scope);
- mDreamOverlayStateController = dreamOverlayStateController;
- mAssistUtils = assistUtils;
+ mAssistManager = assistManager;
}
@Override
protected void start() {
- mDreamOverlayStateController.addCallback(mCallback);
+ mAssistManager.addVisualQueryAttentionListener(mVisualQueryAttentionListener);
}
@Override
protected void stop() {
- disableVisualQueryDetection();
- mDreamOverlayStateController.removeCallback(mCallback);
+ mAssistManager.removeVisualQueryAttentionListener(mVisualQueryAttentionListener);
}
@Override
protected int getStartStrategy() {
return START_EAGERLY;
}
-
- private void enableVisualQueryDetection() {
- if (mEnabled) {
- return;
- }
- mEnabled = true;
- mAssistUtils.enableVisualQueryDetection(mVisualQueryDetectionAttentionListener);
- }
-
- private void disableVisualQueryDetection() {
- if (!mEnabled) {
- return;
- }
- mEnabled = false;
- mAssistUtils.disableVisualQueryDetection();
- // Make sure the condition is set to false as well.
- updateCondition(false);
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/flags/ConditionalRestarter.kt b/packages/SystemUI/src/com/android/systemui/flags/ConditionalRestarter.kt
index b20e33a..83c239f 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/ConditionalRestarter.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/ConditionalRestarter.kt
@@ -44,12 +44,12 @@
private var androidRestartRequested = false
override fun restartSystemUI(reason: String) {
- Log.d(FeatureFlagsDebug.TAG, "SystemUI Restart requested. Restarting when idle.")
+ Log.d(FeatureFlagsClassicDebug.TAG, "SystemUI Restart requested. Restarting when idle.")
scheduleRestart(reason)
}
override fun restartAndroid(reason: String) {
- Log.d(FeatureFlagsDebug.TAG, "Android Restart requested. Restarting when idle.")
+ Log.d(FeatureFlagsClassicDebug.TAG, "Android Restart requested. Restarting when idle.")
androidRestartRequested = true
scheduleRestart(reason)
}
diff --git a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlags.kt b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlags.kt
index 95e7ad96..d48eb29 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlags.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlags.kt
@@ -23,6 +23,21 @@
*
* See [Flags] for instructions on defining new flags.
*/
+interface FeatureFlagsClassic : FeatureFlags
+
+/**
+ * Class to manage simple DeviceConfig-based feature flags.
+ *
+ * See [Flags] for instructions on defining new flags.
+ */
+@Deprecated(
+ message = "Use FeatureFlagsClassic instead.",
+ replaceWith =
+ ReplaceWith(
+ "FeatureFlagsClassic",
+ "com.android.systemui.flags.FeatureFlagsClassic",
+ ),
+)
interface FeatureFlags : FlagListenable, Dumpable {
/** Returns a boolean value for the given flag. */
fun isEnabled(flag: UnreleasedFlag): Boolean
@@ -47,4 +62,4 @@
/** Returns an int value for a given flag/ */
fun getInt(flag: ResourceIntFlag): Int
-}
+}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsDebug.java b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsClassicDebug.java
similarity index 99%
rename from packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsDebug.java
rename to packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsClassicDebug.java
index 4c78e4c..126a1b5 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsDebug.java
+++ b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsClassicDebug.java
@@ -67,7 +67,7 @@
* To restore a flag back to its default, leave the `--ez value <0|1>` off of the command.
*/
@SysUISingleton
-public class FeatureFlagsDebug implements FeatureFlags {
+public class FeatureFlagsClassicDebug implements FeatureFlagsClassic {
static final String TAG = "SysUIFlags";
private final FlagManager mFlagManager;
@@ -116,7 +116,7 @@
};
@Inject
- public FeatureFlagsDebug(
+ public FeatureFlagsClassicDebug(
FlagManager flagManager,
Context context,
GlobalSettings globalSettings,
diff --git a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsRelease.java b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsClassicRelease.java
similarity index 98%
rename from packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsRelease.java
rename to packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsClassicRelease.java
index e03b438..79ebf9c 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsRelease.java
+++ b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsClassicRelease.java
@@ -43,7 +43,7 @@
* how to set flags.
*/
@SysUISingleton
-public class FeatureFlagsRelease implements FeatureFlags {
+public class FeatureFlagsClassicRelease implements FeatureFlagsClassic {
static final String TAG = "SysUIFlags";
private final Resources mResources;
@@ -89,7 +89,7 @@
};
@Inject
- public FeatureFlagsRelease(
+ public FeatureFlagsClassicRelease(
@Main Resources resources,
SystemPropertiesHelper systemProperties,
ServerFlagReader serverFlagReader,
diff --git a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsDebugStartable.kt b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsDebugStartable.kt
index 28c45b8..dd560b7 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsDebugStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsDebugStartable.kt
@@ -34,13 +34,13 @@
dumpManager: DumpManager,
private val commandRegistry: CommandRegistry,
private val flagCommand: FlagCommand,
- private val featureFlags: FeatureFlagsDebug,
+ private val featureFlags: FeatureFlagsClassicDebug,
private val broadcastSender: BroadcastSender,
private val initializationChecker: InitializationChecker,
) : CoreStartable {
init {
- dumpManager.registerCriticalDumpable(FeatureFlagsDebug.TAG) { pw, args ->
+ dumpManager.registerCriticalDumpable(FeatureFlagsClassicDebug.TAG) { pw, args ->
featureFlags.dump(pw, args)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsReleaseStartable.kt b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsReleaseStartable.kt
index f97112d..dfcc7ea 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsReleaseStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/FeatureFlagsReleaseStartable.kt
@@ -32,7 +32,7 @@
) : CoreStartable {
init {
- dumpManager.registerCriticalDumpable(FeatureFlagsRelease.TAG) { pw, args ->
+ dumpManager.registerCriticalDumpable(FeatureFlagsClassicRelease.TAG) { pw, args ->
featureFlags.dump(pw, args)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/flags/FlagCommand.java b/packages/SystemUI/src/com/android/systemui/flags/FlagCommand.java
index bd0ed48..e3cc2b0 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/FlagCommand.java
+++ b/packages/SystemUI/src/com/android/systemui/flags/FlagCommand.java
@@ -38,12 +38,12 @@
private final List<String> mOnCommands = List.of("true", "on", "1", "enabled");
private final List<String> mOffCommands = List.of("false", "off", "0", "disable");
private final List<String> mSetCommands = List.of("set", "put");
- private final FeatureFlagsDebug mFeatureFlags;
+ private final FeatureFlagsClassicDebug mFeatureFlags;
private final Map<String, Flag<?>> mAllFlags;
@Inject
FlagCommand(
- FeatureFlagsDebug featureFlags,
+ FeatureFlagsClassicDebug featureFlags,
@Named(ALL_FLAGS) Map<String, Flag<?>> allFlags
) {
mFeatureFlags = featureFlags;
diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
index 4a22a67..90e78c6 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
@@ -33,7 +33,7 @@
* On public release builds, flags will always return their default value. There is no way to change
* their value on release builds.
*
- * See [FeatureFlagsDebug] for instructions on flipping the flags via adb.
+ * See [FeatureFlagsClassicDebug] for instructions on flipping the flags via adb.
*/
object Flags {
@JvmField val TEAMFOOD = unreleasedFlag("teamfood")
@@ -115,7 +115,7 @@
// TODO(b/292213543): Tracking Bug
@JvmField
val NOTIFICATION_GROUP_EXPANSION_CHANGE =
- unreleasedFlag("notification_group_expansion_change", teamfood = false)
+ unreleasedFlag("notification_group_expansion_change", teamfood = true)
// 200 - keyguard/lockscreen
// ** Flag retired **
@@ -195,7 +195,7 @@
// TODO(b/294110497): Tracking Bug
@JvmField
val ENABLE_WALLET_CONTEXTUAL_LOYALTY_CARDS =
- unreleasedFlag("enable_wallet_contextual_loyalty_cards", teamfood = true)
+ releasedFlag("enable_wallet_contextual_loyalty_cards")
// TODO(b/242908637): Tracking Bug
@JvmField val WALLPAPER_FULLSCREEN_PREVIEW = releasedFlag("wallpaper_fullscreen_preview")
@@ -254,7 +254,7 @@
// TODO(b/290652751): Tracking bug.
@JvmField
val MIGRATE_SPLIT_KEYGUARD_BOTTOM_AREA =
- unreleasedFlag("migrate_split_keyguard_bottom_area")
+ unreleasedFlag("migrate_split_keyguard_bottom_area", teamfood = true)
/** Whether to listen for fingerprint authentication over keyguard occluding activities. */
// TODO(b/283260512): Tracking bug.
@@ -269,7 +269,7 @@
/** Migrate the lock icon view to the new keyguard root view. */
// TODO(b/286552209): Tracking bug.
- @JvmField val MIGRATE_LOCK_ICON = unreleasedFlag("migrate_lock_icon")
+ @JvmField val MIGRATE_LOCK_ICON = unreleasedFlag("migrate_lock_icon", teamfood = true)
// TODO(b/288276738): Tracking bug.
@JvmField val WIDGET_ON_KEYGUARD = unreleasedFlag("widget_on_keyguard")
@@ -355,7 +355,7 @@
// TODO(b/278068252): Tracking Bug
@JvmField
- val QS_PIPELINE_AUTO_ADD = unreleasedFlag("qs_pipeline_auto_add", teamfood = false)
+ val QS_PIPELINE_AUTO_ADD = unreleasedFlag("qs_pipeline_auto_add", teamfood = true)
// TODO(b/254512383): Tracking Bug
@JvmField
@@ -368,10 +368,6 @@
// TODO(b/244064524): Tracking Bug
@JvmField val QS_SECONDARY_DATA_SUB_INFO = releasedFlag("qs_secondary_data_sub_info")
- /** Enables Font Scaling Quick Settings tile */
- // TODO(b/269341316): Tracking Bug
- @JvmField val ENABLE_FONT_SCALING_TILE = releasedFlag("enable_font_scaling_tile")
-
/** Enables new QS Edit Mode visual refresh */
// TODO(b/269787742): Tracking Bug
@JvmField
@@ -386,8 +382,7 @@
@JvmField val NEW_BLUETOOTH_REPOSITORY = releasedFlag("new_bluetooth_repository")
// TODO(b/292533677): Tracking Bug
- val WIFI_TRACKER_LIB_FOR_WIFI_ICON =
- unreleasedFlag("wifi_tracker_lib_for_wifi_icon", teamfood = true)
+ val WIFI_TRACKER_LIB_FOR_WIFI_ICON = releasedFlag("wifi_tracker_lib_for_wifi_icon")
// TODO(b/293863612): Tracking Bug
@JvmField val INCOMPATIBLE_CHARGING_BATTERY_ICON =
@@ -399,6 +394,10 @@
// TODO(b/294588085): Tracking Bug
val WIFI_SECONDARY_NETWORKS = releasedFlag("wifi_secondary_networks")
+ // TODO(b/290676905): Tracking Bug
+ val NEW_SHADE_CARRIER_GROUP_MOBILE_ICONS =
+ unreleasedFlag("new_shade_carrier_group_mobile_icons")
+
// 700 - dialer/calls
// TODO(b/254512734): Tracking Bug
val ONGOING_CALL_STATUS_BAR_CHIP = releasedFlag("ongoing_call_status_bar_chip")
@@ -503,21 +502,6 @@
val WM_CAPTION_ON_SHELL =
sysPropBooleanFlag("persist.wm.debug.caption_on_shell", default = true)
- @Keep
- @JvmField
- val ENABLE_FLING_TO_DISMISS_BUBBLE =
- sysPropBooleanFlag("persist.wm.debug.fling_to_dismiss_bubble", default = true)
-
- @Keep
- @JvmField
- val ENABLE_FLING_TO_DISMISS_PIP =
- sysPropBooleanFlag("persist.wm.debug.fling_to_dismiss_pip", default = true)
-
- @Keep
- @JvmField
- val ENABLE_PIP_KEEP_CLEAR_ALGORITHM =
- sysPropBooleanFlag("persist.wm.debug.enable_pip_keep_clear_algorithm", default = true)
-
// TODO(b/256873975): Tracking Bug
@JvmField
@Keep
@@ -539,19 +523,6 @@
teamfood = false
)
- // TODO(b/198643358): Tracking bug
- @Keep
- @JvmField
- val ENABLE_PIP_SIZE_LARGE_SCREEN =
- sysPropBooleanFlag("persist.wm.debug.enable_pip_size_large_screen", default = true)
-
- // TODO(b/265998256): Tracking bug
- @Keep
- @JvmField
- val ENABLE_PIP_APP_ICON_OVERLAY =
- sysPropBooleanFlag("persist.wm.debug.enable_pip_app_icon_overlay", default = true)
-
-
// TODO(b/293252410) : Tracking Bug
@JvmField
val LOCKSCREEN_ENABLE_LANDSCAPE =
@@ -635,6 +606,10 @@
// TODO(b/251205791): Tracking Bug
@JvmField val SCREENSHOT_APP_CLIPS = releasedFlag("screenshot_app_clips")
+ /** TODO(b/295143676): Tracking bug. When enable, captures a screenshot for each display. */
+ @JvmField
+ val MULTI_DISPLAY_SCREENSHOT = unreleasedFlag("multi_display_screenshot")
+
// 1400 - columbus
// TODO(b/254512756): Tracking Bug
val QUICK_TAP_IN_PCC = releasedFlag("quick_tap_in_pcc")
@@ -776,6 +751,10 @@
@JvmField
val ONE_WAY_HAPTICS_API_MIGRATION = unreleasedFlag("oneway_haptics_api_migration")
+ /** TODO(b/296223317): Enables the new keyguard presentation containing a clock. */
+ @JvmField
+ val ENABLE_CLOCK_KEYGUARD_PRESENTATION = unreleasedFlag("enable_clock_keyguard_presentation")
+
/** Enable the Compose implementation of the PeopleSpaceActivity. */
@JvmField
val COMPOSE_PEOPLE_SPACE = unreleasedFlag("compose_people_space")
@@ -787,4 +766,8 @@
/** Enable the share wifi button in Quick Settings internet dialog. */
@JvmField
val SHARE_WIFI_QS_BUTTON = unreleasedFlag("share_wifi_qs_button")
+
+ /** Enable haptic slider component in the brightness slider */
+ @JvmField
+ val HAPTIC_BRIGHTNESS_SLIDER = unreleasedFlag("haptic_brightness_slider")
}
diff --git a/packages/SystemUI/src/com/android/systemui/flags/FlagsCommonModule.kt b/packages/SystemUI/src/com/android/systemui/flags/FlagsCommonModule.kt
index 3c50125..d13fa1e 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/FlagsCommonModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/FlagsCommonModule.kt
@@ -25,6 +25,8 @@
interface FlagsCommonModule {
@Binds fun bindsRestarter(impl: ConditionalRestarter): Restarter
+ @Binds fun bindsClassic(impl: FeatureFlagsClassic): FeatureFlags
+
companion object {
const val ALL_FLAGS = "all_flags"
diff --git a/packages/SystemUI/src/com/android/systemui/flags/SystemExitRestarter.kt b/packages/SystemUI/src/com/android/systemui/flags/SystemExitRestarter.kt
index 46e28a7..9f41b61 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/SystemExitRestarter.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/SystemExitRestarter.kt
@@ -26,12 +26,12 @@
private val barService: IStatusBarService,
) : Restarter {
override fun restartAndroid(reason: String) {
- Log.d(FeatureFlagsDebug.TAG, "Restarting Android: " + reason)
+ Log.d(FeatureFlagsClassicDebug.TAG, "Restarting Android: " + reason)
barService.restart()
}
override fun restartSystemUI(reason: String) {
- Log.d(FeatureFlagsDebug.TAG, "Restarting SystemUI: " + reason)
+ Log.d(FeatureFlagsClassicDebug.TAG, "Restarting SystemUI: " + reason)
System.exit(0)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
index 040ee79..3eb1740 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java
@@ -128,11 +128,11 @@
import com.android.systemui.shade.ShadeController;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.VibratorHelper;
-import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.LightBarController;
import com.android.systemui.statusbar.phone.SystemUIDialog;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
+import com.android.systemui.statusbar.window.StatusBarWindowController;
import com.android.systemui.telephony.TelephonyListenerManager;
import com.android.systemui.util.EmergencyDialerConstants;
import com.android.systemui.util.RingerModeTracker;
@@ -141,7 +141,6 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.Optional;
import java.util.concurrent.Executor;
import javax.inject.Inject;
@@ -244,6 +243,7 @@
private final IStatusBarService mStatusBarService;
protected final LightBarController mLightBarController;
protected final NotificationShadeWindowController mNotificationShadeWindowController;
+ private final StatusBarWindowController mStatusBarWindowController;
private final IWindowManager mIWindowManager;
private final Executor mBackgroundExecutor;
private final RingerModeTracker mRingerModeTracker;
@@ -251,7 +251,6 @@
protected Handler mMainHandler;
private int mSmallestScreenWidthDp;
private int mOrientation;
- private final Optional<CentralSurfaces> mCentralSurfacesOptional;
private final ShadeController mShadeController;
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
private final DialogLaunchAnimator mDialogLaunchAnimator;
@@ -356,13 +355,13 @@
IStatusBarService statusBarService,
LightBarController lightBarController,
NotificationShadeWindowController notificationShadeWindowController,
+ StatusBarWindowController statusBarWindowController,
IWindowManager iWindowManager,
@Background Executor backgroundExecutor,
UiEventLogger uiEventLogger,
RingerModeTracker ringerModeTracker,
@Main Handler handler,
PackageManager packageManager,
- Optional<CentralSurfaces> centralSurfacesOptional,
ShadeController shadeController,
KeyguardUpdateMonitor keyguardUpdateMonitor,
DialogLaunchAnimator dialogLaunchAnimator) {
@@ -390,13 +389,13 @@
mStatusBarService = statusBarService;
mLightBarController = lightBarController;
mNotificationShadeWindowController = notificationShadeWindowController;
+ mStatusBarWindowController = statusBarWindowController;
mIWindowManager = iWindowManager;
mBackgroundExecutor = backgroundExecutor;
mRingerModeTracker = ringerModeTracker;
mMainHandler = handler;
mSmallestScreenWidthDp = resources.getConfiguration().smallestScreenWidthDp;
mOrientation = resources.getConfiguration().orientation;
- mCentralSurfacesOptional = centralSurfacesOptional;
mShadeController = shadeController;
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mDialogLaunchAnimator = dialogLaunchAnimator;
@@ -449,10 +448,6 @@
return mUiEventLogger;
}
- protected Optional<CentralSurfaces> getCentralSurfaces() {
- return mCentralSurfacesOptional;
- }
-
protected KeyguardUpdateMonitor getKeyguardUpdateMonitor() {
return mKeyguardUpdateMonitor;
}
@@ -701,12 +696,21 @@
protected ActionsDialogLite createDialog() {
initDialogItems();
- ActionsDialogLite dialog = new ActionsDialogLite(mContext,
+ ActionsDialogLite dialog = new ActionsDialogLite(
+ mContext,
com.android.systemui.R.style.Theme_SystemUI_Dialog_GlobalActionsLite,
- mAdapter, mOverflowAdapter, mSysuiColorExtractor, mStatusBarService,
+ mAdapter,
+ mOverflowAdapter,
+ mSysuiColorExtractor,
+ mStatusBarService,
mLightBarController,
- mNotificationShadeWindowController, this::onRefresh, mKeyguardShowing,
- mPowerAdapter, mUiEventLogger, mCentralSurfacesOptional,
+ mKeyguardStateController,
+ mNotificationShadeWindowController,
+ mStatusBarWindowController,
+ this::onRefresh,
+ mKeyguardShowing,
+ mPowerAdapter,
+ mUiEventLogger,
mShadeController,
mKeyguardUpdateMonitor,
mLockPatternUtils);
@@ -2208,13 +2212,14 @@
private boolean mKeyguardShowing;
protected float mScrimAlpha;
protected final LightBarController mLightBarController;
+ private final KeyguardStateController mKeyguardStateController;
protected final NotificationShadeWindowController mNotificationShadeWindowController;
+ private final StatusBarWindowController mStatusBarWindowController;
private ListPopupWindow mOverflowPopup;
private Dialog mPowerOptionsDialog;
protected final Runnable mOnRefreshCallback;
private UiEventLogger mUiEventLogger;
private GestureDetector mGestureDetector;
- private Optional<CentralSurfaces> mCentralSurfacesOptional;
private final ShadeController mShadeController;
private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
private LockPatternUtils mLockPatternUtils;
@@ -2248,8 +2253,7 @@
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
float distanceY) {
if (distanceY < 0 && distanceY > distanceX
- && e1.getY() <= mCentralSurfacesOptional.map(
- CentralSurfaces::getStatusBarHeight).orElse(0)) {
+ && e1.getY() <= mStatusBarWindowController.getStatusBarHeight()) {
// Downwards scroll from top
openShadeAndDismiss();
return true;
@@ -2261,8 +2265,7 @@
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
if (velocityY > 0 && Math.abs(velocityY) > Math.abs(velocityX)
- && e1.getY() <= mCentralSurfacesOptional.map(
- CentralSurfaces::getStatusBarHeight).orElse(0)) {
+ && e1.getY() <= mStatusBarWindowController.getStatusBarHeight()) {
// Downwards fling from top
openShadeAndDismiss();
return true;
@@ -2281,14 +2284,20 @@
mOverriddenBackDispatcher = mockDispatcher;
}
- ActionsDialogLite(Context context, int themeRes, MyAdapter adapter,
+ ActionsDialogLite(Context context,
+ int themeRes,
+ MyAdapter adapter,
MyOverflowAdapter overflowAdapter,
- SysuiColorExtractor sysuiColorExtractor, IStatusBarService statusBarService,
+ SysuiColorExtractor sysuiColorExtractor,
+ IStatusBarService statusBarService,
LightBarController lightBarController,
+ KeyguardStateController keyguardStateController,
NotificationShadeWindowController notificationShadeWindowController,
- Runnable onRefreshCallback, boolean keyguardShowing,
- MyPowerOptionsAdapter powerAdapter, UiEventLogger uiEventLogger,
- Optional<CentralSurfaces> centralSurfacesOptional,
+ StatusBarWindowController statusBarWindowController,
+ Runnable onRefreshCallback,
+ boolean keyguardShowing,
+ MyPowerOptionsAdapter powerAdapter,
+ UiEventLogger uiEventLogger,
ShadeController shadeController,
KeyguardUpdateMonitor keyguardUpdateMonitor,
LockPatternUtils lockPatternUtils) {
@@ -2302,11 +2311,12 @@
mColorExtractor = sysuiColorExtractor;
mStatusBarService = statusBarService;
mLightBarController = lightBarController;
+ mKeyguardStateController = keyguardStateController;
mNotificationShadeWindowController = notificationShadeWindowController;
+ mStatusBarWindowController = statusBarWindowController;
mOnRefreshCallback = onRefreshCallback;
mKeyguardShowing = keyguardShowing;
mUiEventLogger = uiEventLogger;
- mCentralSurfacesOptional = centralSurfacesOptional;
mShadeController = shadeController;
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mLockPatternUtils = lockPatternUtils;
@@ -2355,7 +2365,7 @@
private void openShadeAndDismiss() {
mUiEventLogger.log(GlobalActionsEvent.GA_CLOSE_TAP_OUTSIDE);
- if (mCentralSurfacesOptional.map(CentralSurfaces::isKeyguardShowing).orElse(false)) {
+ if (mKeyguardStateController.isShowing()) {
// match existing lockscreen behavior to open QS when swiping from status bar
mShadeController.animateExpandQs();
} else {
diff --git a/packages/SystemUI/src/com/android/systemui/keyevent/domain/interactor/KeyEventInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyevent/domain/interactor/KeyEventInteractor.kt
new file mode 100644
index 0000000..3f2f67d
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/keyevent/domain/interactor/KeyEventInteractor.kt
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.keyevent.domain.interactor
+
+import android.view.KeyEvent
+import com.android.systemui.back.domain.interactor.BackActionInteractor
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.keyguard.domain.interactor.KeyguardKeyEventInteractor
+import javax.inject.Inject
+
+/**
+ * Sends key events to the appropriate interactors and then acts upon key events that haven't
+ * already been handled but should be handled by SystemUI.
+ */
+@SysUISingleton
+class KeyEventInteractor
+@Inject
+constructor(
+ private val backActionInteractor: BackActionInteractor,
+ private val keyguardKeyEventInteractor: KeyguardKeyEventInteractor,
+) {
+ fun dispatchKeyEvent(event: KeyEvent): Boolean {
+ if (keyguardKeyEventInteractor.dispatchKeyEvent(event)) {
+ return true
+ }
+
+ when (event.keyCode) {
+ KeyEvent.KEYCODE_BACK -> {
+ if (event.handleAction()) {
+ backActionInteractor.onBackRequested()
+ }
+ return true
+ }
+ }
+ return false
+ }
+
+ fun interceptMediaKey(event: KeyEvent): Boolean {
+ return keyguardKeyEventInteractor.interceptMediaKey(event)
+ }
+
+ fun dispatchKeyEventPreIme(event: KeyEvent): Boolean {
+ return keyguardKeyEventInteractor.dispatchKeyEventPreIme(event)
+ }
+
+ companion object {
+ // Most actions shouldn't be handled on the down event and instead handled on subsequent
+ // key events like ACTION_UP.
+ fun KeyEvent.handleAction(): Boolean {
+ return action != KeyEvent.ACTION_DOWN
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/BiometricSettingsRepository.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/BiometricSettingsRepository.kt
index ff3e77c..682e841 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/BiometricSettingsRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/BiometricSettingsRepository.kt
@@ -28,6 +28,9 @@
import com.android.systemui.Dumpable
import com.android.systemui.R
import com.android.systemui.biometrics.AuthController
+import com.android.systemui.biometrics.data.repository.FacePropertyRepository
+import com.android.systemui.biometrics.data.repository.FingerprintPropertyRepository
+import com.android.systemui.biometrics.shared.model.SensorStrength
import com.android.systemui.broadcast.BroadcastDispatcher
import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLogging
import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow
@@ -68,34 +71,32 @@
* upstream changes.
*/
interface BiometricSettingsRepository {
- /** Whether any fingerprints are enrolled for the current user. */
- val isFingerprintEnrolled: StateFlow<Boolean>
-
- /** Whether face authentication is enrolled for the current user. */
- val isFaceEnrolled: Flow<Boolean>
+ /**
+ * If the current user can enter the device using fingerprint. This is true if user has enrolled
+ * fingerprints and fingerprint auth is not disabled through settings/device policy
+ */
+ val isFingerprintEnrolledAndEnabled: StateFlow<Boolean>
/**
- * Whether face authentication is enabled/disabled based on system settings like device policy,
- * biometrics setting.
+ * If the current user can enter the device using fingerprint, right now.
+ *
+ * This returns true if there are no strong auth flags that restrict the user from using
+ * fingerprint and [isFingerprintEnrolledAndEnabled] is true
*/
- val isFaceAuthenticationEnabled: Flow<Boolean>
+ val isFingerprintAuthCurrentlyAllowed: StateFlow<Boolean>
/**
- * Whether the current user is allowed to use a strong biometric for device entry based on
- * Android Security policies. If false, the user may be able to use primary authentication for
- * device entry.
+ * If the current user can use face auth to enter the device. This is true when the user has
+ * face auth enrolled, and is enabled in settings/device policy.
*/
- val isStrongBiometricAllowed: StateFlow<Boolean>
+ val isFaceAuthEnrolledAndEnabled: Flow<Boolean>
/**
- * Whether the current user is allowed to use a convenience biometric for device entry based on
- * Android Security policies. If false, the user may be able to use strong biometric or primary
- * authentication for device entry.
+ * If the current user can use face auth to enter the device right now. This is true when
+ * [isFaceAuthEnrolledAndEnabled] is true and strong auth settings allow face auth to run and
+ * face auth is supported by the current device posture.
*/
- val isNonStrongBiometricAllowed: StateFlow<Boolean>
-
- /** Whether fingerprint feature is enabled for the current user by the DevicePolicy */
- val isFingerprintEnabledByDevicePolicy: StateFlow<Boolean>
+ val isFaceAuthCurrentlyAllowed: Flow<Boolean>
/**
* Whether face authentication is supported for the current device posture. Face auth can be
@@ -130,6 +131,8 @@
@Background backgroundDispatcher: CoroutineDispatcher,
biometricManager: BiometricManager?,
devicePostureRepository: DevicePostureRepository,
+ facePropertyRepository: FacePropertyRepository,
+ fingerprintPropertyRepository: FingerprintPropertyRepository,
dumpManager: DumpManager,
) : BiometricSettingsRepository, Dumpable {
@@ -165,7 +168,9 @@
}
override fun dump(pw: PrintWriter, args: Array<String?>) {
- pw.println("isFingerprintEnrolled=${isFingerprintEnrolled.value}")
+ pw.println("isFingerprintEnrolledAndEnabled=${isFingerprintEnrolledAndEnabled.value}")
+ pw.println("isFingerprintAuthCurrentlyAllowed=${isFingerprintAuthCurrentlyAllowed.value}")
+ pw.println("isNonStrongBiometricAllowed=${isNonStrongBiometricAllowed.value}")
pw.println("isStrongBiometricAllowed=${isStrongBiometricAllowed.value}")
pw.println("isFingerprintEnabledByDevicePolicy=${isFingerprintEnabledByDevicePolicy.value}")
}
@@ -180,7 +185,7 @@
user = UserHandle.ALL
)
- override val isFingerprintEnrolled: StateFlow<Boolean> =
+ private val isFingerprintEnrolled: Flow<Boolean> =
selectedUserId
.flatMapLatest { currentUserId ->
conflatedCallbackFlow {
@@ -211,7 +216,7 @@
authController.isFingerprintEnrolled(userRepository.getSelectedUserInfo().id)
)
- override val isFaceEnrolled: Flow<Boolean> =
+ private val isFaceEnrolled: Flow<Boolean> =
selectedUserId.flatMapLatest { selectedUserId: Int ->
conflatedCallbackFlow {
val callback =
@@ -245,14 +250,6 @@
isFaceEnabledByBiometricsManager.map { biometricsEnabledForUser[userInfo.id] ?: false }
}
- override val isFaceAuthenticationEnabled: Flow<Boolean>
- get() =
- combine(isFaceEnabledByBiometricsManagerForCurrentUser, isFaceEnabledByDevicePolicy) {
- biometricsManagerSetting,
- devicePolicySetting ->
- biometricsManagerSetting && devicePolicySetting
- }
-
private val isFaceEnabledByDevicePolicy: Flow<Boolean> =
combine(selectedUserId, devicePolicyChangedForAllUsers) { userId, _ ->
devicePolicyManager.isFaceDisabled(userId)
@@ -263,6 +260,13 @@
.flowOn(backgroundDispatcher)
.distinctUntilChanged()
+ private val isFaceAuthenticationEnabled: Flow<Boolean> =
+ combine(isFaceEnabledByBiometricsManagerForCurrentUser, isFaceEnabledByDevicePolicy) {
+ biometricsManagerSetting,
+ devicePolicySetting ->
+ biometricsManagerSetting && devicePolicySetting
+ }
+
private val isFaceEnabledByBiometricsManager: Flow<Pair<Int, Boolean>> =
conflatedCallbackFlow {
val callback =
@@ -283,7 +287,7 @@
// being registered.
.stateIn(scope, SharingStarted.Eagerly, Pair(0, false))
- override val isStrongBiometricAllowed: StateFlow<Boolean> =
+ private val isStrongBiometricAllowed: StateFlow<Boolean> =
strongAuthTracker.isStrongBiometricAllowed.stateIn(
scope,
SharingStarted.Eagerly,
@@ -293,7 +297,7 @@
)
)
- override val isNonStrongBiometricAllowed: StateFlow<Boolean> =
+ private val isNonStrongBiometricAllowed: StateFlow<Boolean> =
strongAuthTracker.isNonStrongBiometricAllowed.stateIn(
scope,
SharingStarted.Eagerly,
@@ -303,7 +307,19 @@
)
)
- override val isFingerprintEnabledByDevicePolicy: StateFlow<Boolean> =
+ private val isFingerprintBiometricAllowed: Flow<Boolean> =
+ fingerprintPropertyRepository.strength.flatMapLatest {
+ if (it == SensorStrength.STRONG) isStrongBiometricAllowed
+ else isNonStrongBiometricAllowed
+ }
+
+ private val isFaceBiometricsAllowed: Flow<Boolean> =
+ facePropertyRepository.sensorInfo.flatMapLatest {
+ if (it?.strength == SensorStrength.STRONG) isStrongBiometricAllowed
+ else isNonStrongBiometricAllowed
+ }
+
+ private val isFingerprintEnabledByDevicePolicy: StateFlow<Boolean> =
selectedUserId
.flatMapLatest { userId ->
devicePolicyChangedForAllUsers
@@ -319,6 +335,25 @@
userRepository.getSelectedUserInfo().id
)
)
+
+ override val isFingerprintEnrolledAndEnabled: StateFlow<Boolean> =
+ isFingerprintEnrolled
+ .and(isFingerprintEnabledByDevicePolicy)
+ .stateIn(scope, SharingStarted.Eagerly, false)
+
+ override val isFingerprintAuthCurrentlyAllowed: StateFlow<Boolean> =
+ isFingerprintEnrolledAndEnabled
+ .and(isFingerprintBiometricAllowed)
+ .stateIn(scope, SharingStarted.Eagerly, false)
+
+ override val isFaceAuthEnrolledAndEnabled: Flow<Boolean>
+ get() = isFaceAuthenticationEnabled.and(isFaceEnrolled)
+
+ override val isFaceAuthCurrentlyAllowed: Flow<Boolean>
+ get() =
+ isFaceAuthEnrolledAndEnabled
+ .and(isFaceBiometricsAllowed)
+ .and(isFaceAuthSupportedInCurrentPosture)
}
@OptIn(ExperimentalCoroutinesApi::class)
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepository.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepository.kt
index 6894147..93eb103 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepository.kt
@@ -26,8 +26,6 @@
import com.android.keyguard.FaceAuthUiEvent
import com.android.systemui.Dumpable
import com.android.systemui.R
-import com.android.systemui.biometrics.data.repository.FacePropertyRepository
-import com.android.systemui.biometrics.shared.model.SensorStrength
import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor
import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLogging
import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow
@@ -72,7 +70,6 @@
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.filterNotNull
-import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.map
@@ -162,7 +159,6 @@
@FaceAuthTableLog private val faceAuthLog: TableLogBuffer,
private val keyguardTransitionInteractor: KeyguardTransitionInteractor,
private val featureFlags: FeatureFlags,
- facePropertyRepository: FacePropertyRepository,
dumpManager: DumpManager,
) : DeviceEntryFaceAuthRepository, Dumpable {
private var authCancellationSignal: CancellationSignal? = null
@@ -182,13 +178,6 @@
override val detectionStatus: Flow<FaceDetectionStatus>
get() = _detectionStatus.filterNotNull()
- private val isFaceBiometricsAllowed: Flow<Boolean> =
- facePropertyRepository.sensorInfo.flatMapLatest {
- if (it?.strength == SensorStrength.STRONG)
- biometricSettingsRepository.isStrongBiometricAllowed
- else biometricSettingsRepository.isNonStrongBiometricAllowed
- }
-
private val _isLockedOut = MutableStateFlow(false)
override val isLockedOut: StateFlow<Boolean> = _isLockedOut
@@ -313,8 +302,10 @@
canFaceAuthOrDetectRun(faceDetectLog),
logAndObserve(isBypassEnabled, "isBypassEnabled", faceDetectLog),
logAndObserve(
- isFaceBiometricsAllowed.isFalse().or(trustRepository.isCurrentUserTrusted),
- "biometricIsNotAllowedOrCurrentUserIsTrusted",
+ biometricSettingsRepository.isFaceAuthCurrentlyAllowed
+ .isFalse()
+ .or(trustRepository.isCurrentUserTrusted),
+ "faceAuthIsNotCurrentlyAllowedOrCurrentUserIsTrusted",
faceDetectLog
),
// We don't want to run face detect if fingerprint can be used to unlock the device
@@ -346,13 +337,8 @@
private fun canFaceAuthOrDetectRun(tableLogBuffer: TableLogBuffer): Flow<Boolean> {
return listOf(
logAndObserve(
- biometricSettingsRepository.isFaceEnrolled,
- "isFaceEnrolled",
- tableLogBuffer
- ),
- logAndObserve(
- biometricSettingsRepository.isFaceAuthenticationEnabled,
- "isFaceAuthenticationEnabled",
+ biometricSettingsRepository.isFaceAuthEnrolledAndEnabled,
+ "isFaceAuthEnrolledAndEnabled",
tableLogBuffer
),
logAndObserve(faceAuthPaused.isFalse(), "faceAuthIsNotPaused", tableLogBuffer),
@@ -406,7 +392,11 @@
"currentUserIsNotTrusted",
faceAuthLog
),
- logAndObserve(isFaceBiometricsAllowed, "isFaceBiometricsAllowed", faceAuthLog),
+ logAndObserve(
+ biometricSettingsRepository.isFaceAuthCurrentlyAllowed,
+ "isFaceAuthCurrentlyAllowed",
+ faceAuthLog
+ ),
logAndObserve(isAuthenticated.isFalse(), "faceNotAuthenticated", faceAuthLog),
)
.reduce(::and)
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardBlueprintRepository.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardBlueprintRepository.kt
index 059f72b..7234757 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardBlueprintRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardBlueprintRepository.kt
@@ -17,7 +17,10 @@
package com.android.systemui.keyguard.data.repository
+import android.view.View
+import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.ConstraintSet
+import androidx.core.view.children
import com.android.systemui.common.ui.data.repository.ConfigurationRepository
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
@@ -96,8 +99,16 @@
/** Determines the constraints for the ConstraintSet in the lockscreen root view. */
interface KeyguardBlueprint {
val id: String
+ val shouldRemoveUnconstrainedViews: Boolean
+ get() = true
- fun apply(constraintSet: ConstraintSet)
+ fun apply(constraintLayout: ConstraintSet)
+ fun removeUnConstrainedViews(constraintLayout: ConstraintLayout, constraintSet: ConstraintSet) {
+ constraintLayout.children
+ .map { it.id }
+ .filterNot { constraintSet.knownIds.contains(it) }
+ .forEach { constraintSet.setVisibility(it, View.GONE) }
+ }
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractor.kt
index 271bc38..b050890 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAlternateBouncerTransitionInteractor.kt
@@ -50,6 +50,7 @@
listenForAlternateBouncerToGone()
listenForAlternateBouncerToLockscreenAodOrDozing()
listenForAlternateBouncerToPrimaryBouncer()
+ listenForTransitionToCamera(scope, keyguardInteractor)
}
private fun listenForAlternateBouncerToLockscreenAodOrDozing() {
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractor.kt
index 888f746..518ae2f 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromAodTransitionInteractor.kt
@@ -47,6 +47,7 @@
override fun start() {
listenForAodToLockscreenOrOccluded()
listenForAodToGone()
+ listenForTransitionToCamera(scope, keyguardInteractor)
}
private fun listenForAodToLockscreenOrOccluded() {
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDozingTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDozingTransitionInteractor.kt
index 76d9893..712215f 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDozingTransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDozingTransitionInteractor.kt
@@ -47,6 +47,7 @@
override fun start() {
listenForDozingToLockscreenOrOccluded()
listenForDozingToGone()
+ listenForTransitionToCamera(scope, keyguardInteractor)
}
private fun listenForDozingToLockscreenOrOccluded() {
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingTransitionInteractor.kt
index 954ff6f..75aa4b60f 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingTransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingTransitionInteractor.kt
@@ -51,6 +51,7 @@
listenForDreamingToOccluded()
listenForDreamingToGone()
listenForDreamingToDozing()
+ listenForTransitionToCamera(scope, keyguardInteractor)
}
fun startToLockscreenTransition() {
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromLockscreenTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromLockscreenTransitionInteractor.kt
index aa771fd..9c6a1b1 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromLockscreenTransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromLockscreenTransitionInteractor.kt
@@ -63,12 +63,12 @@
listenForLockscreenToGone()
listenForLockscreenToGoneDragging()
listenForLockscreenToOccluded()
- listenForLockscreenToCamera()
listenForLockscreenToAodOrDozing()
listenForLockscreenToPrimaryBouncer()
listenForLockscreenToDreaming()
listenForLockscreenToPrimaryBouncerDragging()
listenForLockscreenToAlternateBouncer()
+ listenForLockscreenTransitionToCamera()
}
/**
@@ -128,6 +128,10 @@
}
.distinctUntilChanged()
+ private fun listenForLockscreenTransitionToCamera() {
+ listenForTransitionToCamera(scope, keyguardInteractor)
+ }
+
private fun listenForLockscreenToDreaming() {
val invalidFromStates = setOf(KeyguardState.AOD, KeyguardState.DOZING)
scope.launch {
@@ -311,7 +315,7 @@
keyguardInteractor.isKeyguardOccluded
.sample(
combine(
- transitionInteractor.finishedKeyguardState,
+ transitionInteractor.startedKeyguardState,
keyguardInteractor.isDreaming,
::Pair
),
@@ -325,27 +329,6 @@
}
}
- /** This signal may come in before the occlusion signal, and can provide a custom transition */
- private fun listenForLockscreenToCamera() {
- scope.launch {
- keyguardInteractor.onCameraLaunchDetected
- .sample(transitionInteractor.startedKeyguardTransitionStep, ::Pair)
- .collect { (_, lastStartedStep) ->
- // DREAMING/AOD/OFF may trigger on the first power button push, so include this
- // state in order to cancel and correct the transition
- if (
- lastStartedStep.to == KeyguardState.LOCKSCREEN ||
- lastStartedStep.to == KeyguardState.DREAMING ||
- lastStartedStep.to == KeyguardState.DOZING ||
- lastStartedStep.to == KeyguardState.AOD ||
- lastStartedStep.to == KeyguardState.OFF
- ) {
- startTransitionTo(KeyguardState.OCCLUDED)
- }
- }
- }
- }
-
private fun listenForLockscreenToAodOrDozing() {
scope.launch {
keyguardInteractor.wakefulnessModel
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromPrimaryBouncerTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromPrimaryBouncerTransitionInteractor.kt
index c9f32da..143be1d 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromPrimaryBouncerTransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromPrimaryBouncerTransitionInteractor.kt
@@ -61,6 +61,7 @@
listenForPrimaryBouncerToAodOrDozing()
listenForPrimaryBouncerToLockscreenOrOccluded()
listenForPrimaryBouncerToDreamingLockscreenHosted()
+ listenForTransitionToCamera(scope, keyguardInteractor)
}
val surfaceBehindVisibility: Flow<Boolean?> =
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt
index 562c4db..ed84884 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt
@@ -40,10 +40,10 @@
import com.android.systemui.keyguard.shared.model.WakefulnessModel
import com.android.systemui.statusbar.CommandQueue
import com.android.systemui.util.kotlin.sample
+import javax.inject.Inject
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
-import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
@@ -53,7 +53,6 @@
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.merge
import kotlinx.coroutines.flow.onStart
-import javax.inject.Inject
/**
* Encapsulates business-logic related to the keyguard but not to a more specific part within it.
@@ -68,18 +67,6 @@
bouncerRepository: KeyguardBouncerRepository,
configurationRepository: ConfigurationRepository,
) {
-
- data class PreviewMode(
- val isInPreviewMode: Boolean = false,
- val shouldHighlightSelectedAffordance: Boolean = false,
- )
-
- /**
- * Whether this view-model instance is powering the preview experience that renders exclusively
- * in the wallpaper picker application. This should _always_ be `false` for the real lock screen
- * experience.
- */
- val previewMode = MutableStateFlow(PreviewMode())
/**
* The amount of doze the system is in, where `1.0` is fully dozing and `0.0` is not dozing at
* all.
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardKeyEventInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardKeyEventInteractor.kt
new file mode 100644
index 0000000..e501ece
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardKeyEventInteractor.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 com.android.systemui.keyguard.domain.interactor
+
+import android.content.Context
+import android.media.AudioManager
+import android.view.KeyEvent
+import com.android.systemui.back.domain.interactor.BackActionInteractor
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.keyevent.domain.interactor.KeyEventInteractor.Companion.handleAction
+import com.android.systemui.media.controls.util.MediaSessionLegacyHelperWrapper
+import com.android.systemui.plugins.statusbar.StatusBarStateController
+import com.android.systemui.shade.ShadeController
+import com.android.systemui.statusbar.StatusBarState
+import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager
+import javax.inject.Inject
+
+/** Handles key events arriving when the keyguard is showing or device is dozing. */
+@SysUISingleton
+class KeyguardKeyEventInteractor
+@Inject
+constructor(
+ private val context: Context,
+ private val statusBarStateController: StatusBarStateController,
+ private val keyguardInteractor: KeyguardInteractor,
+ private val statusBarKeyguardViewManager: StatusBarKeyguardViewManager,
+ private val shadeController: ShadeController,
+ private val mediaSessionLegacyHelperWrapper: MediaSessionLegacyHelperWrapper,
+ private val backActionInteractor: BackActionInteractor,
+) {
+
+ fun dispatchKeyEvent(event: KeyEvent): Boolean {
+ if (statusBarStateController.isDozing) {
+ when (event.keyCode) {
+ KeyEvent.KEYCODE_VOLUME_DOWN,
+ KeyEvent.KEYCODE_VOLUME_UP -> return dispatchVolumeKeyEvent(event)
+ }
+ }
+
+ if (event.handleAction()) {
+ when (event.keyCode) {
+ KeyEvent.KEYCODE_MENU -> return dispatchMenuKeyEvent()
+ KeyEvent.KEYCODE_SPACE,
+ KeyEvent.KEYCODE_ENTER ->
+ if (isDeviceInteractive()) {
+ return collapseShadeLockedOrShowPrimaryBouncer()
+ }
+ }
+ }
+ return false
+ }
+
+ /**
+ * While IME is active and a BACK event is detected, check with {@link
+ * StatusBarKeyguardViewManager#dispatchBackKeyEventPreIme()} to see if the event should be
+ * handled before routing to IME, in order to prevent the user from having to hit back twice to
+ * exit bouncer.
+ */
+ fun dispatchKeyEventPreIme(event: KeyEvent): Boolean {
+ when (event.keyCode) {
+ KeyEvent.KEYCODE_BACK ->
+ if (
+ statusBarStateController.state == StatusBarState.KEYGUARD &&
+ statusBarKeyguardViewManager.dispatchBackKeyEventPreIme()
+ ) {
+ return backActionInteractor.onBackRequested()
+ }
+ }
+ return false
+ }
+
+ fun interceptMediaKey(event: KeyEvent): Boolean {
+ return statusBarStateController.state == StatusBarState.KEYGUARD &&
+ statusBarKeyguardViewManager.interceptMediaKey(event)
+ }
+
+ private fun dispatchMenuKeyEvent(): Boolean {
+ val shouldUnlockOnMenuPressed =
+ isDeviceInteractive() &&
+ (statusBarStateController.state != StatusBarState.SHADE) &&
+ statusBarKeyguardViewManager.shouldDismissOnMenuPressed()
+ if (shouldUnlockOnMenuPressed) {
+ return collapseShadeLockedOrShowPrimaryBouncer()
+ }
+ return false
+ }
+
+ private fun collapseShadeLockedOrShowPrimaryBouncer(): Boolean {
+ when (statusBarStateController.state) {
+ StatusBarState.SHADE -> return false
+ StatusBarState.SHADE_LOCKED -> {
+ shadeController.animateCollapseShadeForced()
+ return true
+ }
+ StatusBarState.KEYGUARD -> {
+ statusBarKeyguardViewManager.showPrimaryBouncer(true)
+ return true
+ }
+ }
+ return false
+ }
+
+ private fun dispatchVolumeKeyEvent(event: KeyEvent): Boolean {
+ mediaSessionLegacyHelperWrapper
+ .getHelper(context)
+ .sendVolumeKeyEvent(event, AudioManager.USE_DEFAULT_STREAM_TYPE, true)
+ return true
+ }
+
+ private fun isDeviceInteractive(): Boolean {
+ return keyguardInteractor.wakefulnessModel.value.isDeviceInteractive()
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionAuditLogger.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionAuditLogger.kt
index 4f7abd4..0dc16e9 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionAuditLogger.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionAuditLogger.kt
@@ -95,5 +95,11 @@
logger.log(TAG, VERBOSE, "Doze transition", it)
}
}
+
+ scope.launch {
+ keyguardInteractor.onCameraLaunchDetected.collect {
+ logger.log(TAG, VERBOSE, "onCameraLaunchDetected", it)
+ }
+ }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/TransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/TransitionInteractor.kt
index 0dda625..54c6d5f 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/TransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/TransitionInteractor.kt
@@ -21,7 +21,10 @@
import com.android.systemui.keyguard.data.repository.KeyguardTransitionRepository
import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.keyguard.shared.model.TransitionInfo
+import com.android.systemui.util.kotlin.sample
import java.util.UUID
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.launch
/**
* Each TransitionInteractor is responsible for determining under which conditions to notify
@@ -46,7 +49,7 @@
fun startTransitionTo(
toState: KeyguardState,
animator: ValueAnimator? = getDefaultAnimatorForTransitionsToState(toState),
- resetIfCancelled: Boolean = false
+ resetIfCancelled: Boolean = false,
): UUID? {
if (
fromState != transitionInteractor.startedKeyguardState.value &&
@@ -75,6 +78,27 @@
)
}
+ /** This signal may come in before the occlusion signal, and can provide a custom transition */
+ fun listenForTransitionToCamera(
+ scope: CoroutineScope,
+ keyguardInteractor: KeyguardInteractor,
+ ) {
+ scope.launch {
+ keyguardInteractor.onCameraLaunchDetected
+ .sample(transitionInteractor.finishedKeyguardState)
+ .collect { finishedKeyguardState ->
+ // Other keyguard state transitions may trigger on the first power button push,
+ // so use the last finishedKeyguardState to determine the overriding FROM state
+ if (finishedKeyguardState == fromState) {
+ startTransitionTo(
+ KeyguardState.OCCLUDED,
+ resetIfCancelled = true,
+ )
+ }
+ }
+ }
+ }
+
/**
* Returns a ValueAnimator to be used for transitions to [toState], if one is not explicitly
* passed to [startTransitionTo].
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt
index 23b80b0..e40c279 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt
@@ -19,10 +19,10 @@
import android.os.Trace
import android.util.Log
+import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.ConstraintSet
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.repeatOnLifecycle
-import com.android.systemui.keyguard.ui.view.KeyguardRootView
import com.android.systemui.keyguard.ui.viewmodel.KeyguardBlueprintViewModel
import com.android.systemui.lifecycle.repeatWhenAttached
import kotlinx.coroutines.launch
@@ -31,19 +31,20 @@
companion object {
private const val TAG = "KeyguardBlueprintViewBinder"
- fun bind(keyguardRootView: KeyguardRootView, viewModel: KeyguardBlueprintViewModel) {
- keyguardRootView.repeatWhenAttached {
+ fun bind(constraintLayout: ConstraintLayout, viewModel: KeyguardBlueprintViewModel) {
+ constraintLayout.repeatWhenAttached {
repeatOnLifecycle(Lifecycle.State.CREATED) {
launch {
viewModel.blueprint.collect { blueprint ->
Trace.beginSection("KeyguardBlueprintController#applyBlueprint")
Log.d(TAG, "applying blueprint: $blueprint")
ConstraintSet().apply {
- clone(keyguardRootView)
+ clone(constraintLayout)
val emptyLayout = ConstraintSet.Layout()
knownIds.forEach { getConstraint(it).layout.copyFrom(emptyLayout) }
blueprint?.apply(this)
- applyTo(keyguardRootView)
+ blueprint?.removeUnConstrainedViews(constraintLayout, this)
+ applyTo(constraintLayout)
}
Trace.endSection()
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt
index dd3da97..41c1c96 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt
@@ -49,6 +49,7 @@
import com.android.systemui.keyguard.ui.binder.KeyguardPreviewClockViewBinder
import com.android.systemui.keyguard.ui.binder.KeyguardPreviewSmartspaceViewBinder
import com.android.systemui.keyguard.ui.binder.KeyguardQuickAffordanceViewBinder
+import com.android.systemui.keyguard.ui.binder.KeyguardRootViewBinder
import com.android.systemui.keyguard.ui.view.KeyguardRootView
import com.android.systemui.keyguard.ui.viewmodel.KeyguardBlueprintViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardBottomAreaViewModel
@@ -56,25 +57,31 @@
import com.android.systemui.keyguard.ui.viewmodel.KeyguardPreviewSmartspaceViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardQuickAffordancesCombinedViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardRootViewModel
+import com.android.systemui.keyguard.ui.viewmodel.OccludingAppDeviceEntryMessageViewModel
import com.android.systemui.monet.ColorScheme
import com.android.systemui.plugins.ClockController
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.shared.clocks.ClockRegistry
import com.android.systemui.shared.clocks.DefaultClockController
import com.android.systemui.shared.clocks.shared.model.ClockPreviewConstants
+import com.android.systemui.shared.keyguard.shared.model.KeyguardQuickAffordanceSlots
import com.android.systemui.shared.quickaffordance.shared.model.KeyguardPreviewConstants
import com.android.systemui.statusbar.KeyguardIndicationController
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.statusbar.lockscreen.LockscreenSmartspaceController
import com.android.systemui.statusbar.phone.KeyguardBottomAreaView
+import com.android.systemui.statusbar.policy.KeyguardStateController
+import com.android.systemui.temporarydisplay.chipbar.ChipbarCoordinator
import dagger.assisted.Assisted
import dagger.assisted.AssistedInject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.DisposableHandle
+import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.runBlocking
/** Renders the preview of the lock screen. */
class KeyguardPreviewRenderer
+@OptIn(ExperimentalCoroutinesApi::class)
@AssistedInject
constructor(
@Application private val context: Context,
@@ -99,6 +106,9 @@
@Assisted bundle: Bundle,
private val keyguardBlueprintViewModel: KeyguardBlueprintViewModel,
private val keyguardBlueprintInteractor: KeyguardBlueprintInteractor,
+ private val occludingAppDeviceEntryMessageViewModel: OccludingAppDeviceEntryMessageViewModel,
+ private val chipbarCoordinator: ChipbarCoordinator,
+ private val keyguardStateController: KeyguardStateController,
) {
val hostToken: IBinder? = bundle.getBinder(KEY_HOST_TOKEN)
@@ -130,19 +140,21 @@
init {
if (featureFlags.isEnabled(Flags.MIGRATE_SPLIT_KEYGUARD_BOTTOM_AREA)) {
- keyguardRootViewModel.enablePreviewMode(
+ keyguardRootViewModel.enablePreviewMode()
+ quickAffordancesCombinedViewModel.enablePreviewMode(
initiallySelectedSlotId =
- bundle.getString(
- KeyguardPreviewConstants.KEY_INITIALLY_SELECTED_SLOT_ID,
- ),
+ bundle.getString(
+ KeyguardPreviewConstants.KEY_INITIALLY_SELECTED_SLOT_ID,
+ )
+ ?: KeyguardQuickAffordanceSlots.SLOT_ID_BOTTOM_START,
shouldHighlightSelectedAffordance = shouldHighlightSelectedAffordance,
)
} else {
bottomAreaViewModel.enablePreviewMode(
initiallySelectedSlotId =
- bundle.getString(
- KeyguardPreviewConstants.KEY_INITIALLY_SELECTED_SLOT_ID,
- ),
+ bundle.getString(
+ KeyguardPreviewConstants.KEY_INITIALLY_SELECTED_SLOT_ID,
+ ),
shouldHighlightSelectedAffordance = shouldHighlightSelectedAffordance,
)
}
@@ -163,17 +175,8 @@
val rootView = FrameLayout(context)
if (featureFlags.isEnabled(Flags.MIGRATE_SPLIT_KEYGUARD_BOTTOM_AREA)) {
- val keyguardRootView = KeyguardRootView(context, null)
- rootView.addView(
- keyguardRootView,
- FrameLayout.LayoutParams(
- FrameLayout.LayoutParams.MATCH_PARENT,
- FrameLayout.LayoutParams.MATCH_PARENT,
- ),
- )
- setupShortcuts(keyguardRootView)
- KeyguardBlueprintViewBinder.bind(keyguardRootView, keyguardBlueprintViewModel)
- keyguardBlueprintInteractor.refreshBlueprint()
+ setupKeyguardRootView(rootView)
+ setupShortcuts(rootView)
} else {
setUpBottomArea(rootView)
}
@@ -314,7 +317,7 @@
false,
) as KeyguardBottomAreaView
bottomAreaView.init(
- viewModel = bottomAreaViewModel,
+ viewModel = bottomAreaViewModel,
)
parentView.addView(
bottomAreaView,
@@ -325,10 +328,34 @@
)
}
- private fun setupShortcuts(keyguardRootView: KeyguardRootView) {
+ @OptIn(ExperimentalCoroutinesApi::class)
+ private fun setupKeyguardRootView(rootView: FrameLayout) {
+ val keyguardRootView = KeyguardRootView(context, null)
+ disposables.add(
+ KeyguardRootViewBinder.bind(
+ keyguardRootView,
+ keyguardRootViewModel,
+ featureFlags,
+ occludingAppDeviceEntryMessageViewModel,
+ chipbarCoordinator,
+ keyguardStateController,
+ )
+ )
+ rootView.addView(
+ keyguardRootView,
+ FrameLayout.LayoutParams(
+ FrameLayout.LayoutParams.MATCH_PARENT,
+ FrameLayout.LayoutParams.MATCH_PARENT,
+ ),
+ )
+ KeyguardBlueprintViewBinder.bind(keyguardRootView, keyguardBlueprintViewModel)
+ keyguardBlueprintInteractor.refreshBlueprint()
+ }
+
+ private fun setupShortcuts(rootView: FrameLayout) {
shortcutsBindings.add(
KeyguardQuickAffordanceViewBinder.bind(
- keyguardRootView.requireViewById(R.id.start_button),
+ rootView.requireViewById(R.id.start_button),
quickAffordancesCombinedViewModel.startButton,
keyguardRootViewModel.alpha,
falsingManager,
@@ -340,7 +367,7 @@
shortcutsBindings.add(
KeyguardQuickAffordanceViewBinder.bind(
- keyguardRootView.requireViewById(R.id.end_button),
+ rootView.requireViewById(R.id.end_button),
quickAffordancesCombinedViewModel.endButton,
keyguardRootViewModel.alpha,
falsingManager,
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModel.kt
index 56a98455..02ea550 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModel.kt
@@ -18,22 +18,20 @@
package com.android.systemui.keyguard.ui.viewmodel
import androidx.annotation.VisibleForTesting
-import com.android.systemui.keyguard.domain.interactor.KeyguardBottomAreaInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardQuickAffordanceInteractor
import com.android.systemui.keyguard.domain.model.KeyguardQuickAffordanceModel
import com.android.systemui.keyguard.shared.quickaffordance.ActivationState
import com.android.systemui.keyguard.shared.quickaffordance.KeyguardQuickAffordancePosition
import com.android.systemui.shared.keyguard.shared.model.KeyguardQuickAffordanceSlots
+import javax.inject.Inject
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.flatMapLatest
-import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
-import javax.inject.Inject
@OptIn(ExperimentalCoroutinesApi::class)
class KeyguardQuickAffordancesCombinedViewModel
@@ -43,6 +41,18 @@
private val keyguardInteractor: KeyguardInteractor,
) {
+ data class PreviewMode(
+ val isInPreviewMode: Boolean = false,
+ val shouldHighlightSelectedAffordance: Boolean = false,
+ )
+
+ /**
+ * Whether this view-model instance is powering the preview experience that renders exclusively
+ * in the wallpaper picker application. This should _always_ be `false` for the real lock screen
+ * experience.
+ */
+ private val previewMode = MutableStateFlow(PreviewMode())
+
/**
* ID of the slot that's currently selected in the preview that renders exclusively in the
* wallpaper picker application. This is ignored for the actual, real lock screen experience.
@@ -85,39 +95,63 @@
selectedPreviewSlotId.value = slotId
}
+ /**
+ * Puts this view-model in "preview mode", which means it's being used for UI that is rendering
+ * the lock screen preview in wallpaper picker / settings and not the real experience on the
+ * lock screen.
+ *
+ * @param initiallySelectedSlotId The ID of the initial slot to render as the selected one.
+ * @param shouldHighlightSelectedAffordance Whether the selected quick affordance should be
+ * highlighted (while all others are dimmed to make the selected one stand out).
+ */
+ fun enablePreviewMode(
+ initiallySelectedSlotId: String?,
+ shouldHighlightSelectedAffordance: Boolean,
+ ) {
+ val newPreviewMode =
+ PreviewMode(
+ isInPreviewMode = true,
+ shouldHighlightSelectedAffordance = shouldHighlightSelectedAffordance,
+ )
+ onPreviewSlotSelected(
+ initiallySelectedSlotId ?: KeyguardQuickAffordanceSlots.SLOT_ID_BOTTOM_START
+ )
+ previewMode.value = newPreviewMode
+ }
+
private fun button(
position: KeyguardQuickAffordancePosition
): Flow<KeyguardQuickAffordanceViewModel> {
- return keyguardInteractor.previewMode.flatMapLatest { previewMode ->
+ return previewMode.flatMapLatest { previewMode ->
combine(
- if (previewMode.isInPreviewMode) {
- quickAffordanceInteractor.quickAffordanceAlwaysVisible(position = position)
- } else {
- quickAffordanceInteractor.quickAffordance(position = position)
- },
- keyguardInteractor.animateDozingTransitions.distinctUntilChanged(),
- areQuickAffordancesFullyOpaque,
- selectedPreviewSlotId,
- quickAffordanceInteractor.useLongPress(),
- ) { model, animateReveal, isFullyOpaque, selectedPreviewSlotId, useLongPress ->
- val slotId = position.toSlotId()
- val isSelected = selectedPreviewSlotId == slotId
- model.toViewModel(
- animateReveal = !previewMode.isInPreviewMode && animateReveal,
- isClickable = isFullyOpaque && !previewMode.isInPreviewMode,
- isSelected =
- previewMode.isInPreviewMode &&
- previewMode.shouldHighlightSelectedAffordance &&
- isSelected,
- isDimmed =
- previewMode.isInPreviewMode &&
- previewMode.shouldHighlightSelectedAffordance &&
- !isSelected,
- forceInactive = previewMode.isInPreviewMode,
- slotId = slotId,
- useLongPress = useLongPress,
- )
- }
+ if (previewMode.isInPreviewMode) {
+ quickAffordanceInteractor.quickAffordanceAlwaysVisible(position = position)
+ } else {
+ quickAffordanceInteractor.quickAffordance(position = position)
+ },
+ keyguardInteractor.animateDozingTransitions.distinctUntilChanged(),
+ areQuickAffordancesFullyOpaque,
+ selectedPreviewSlotId,
+ quickAffordanceInteractor.useLongPress(),
+ ) { model, animateReveal, isFullyOpaque, selectedPreviewSlotId, useLongPress ->
+ val slotId = position.toSlotId()
+ val isSelected = selectedPreviewSlotId == slotId
+ model.toViewModel(
+ animateReveal = !previewMode.isInPreviewMode && animateReveal,
+ isClickable = isFullyOpaque && !previewMode.isInPreviewMode,
+ isSelected =
+ previewMode.isInPreviewMode &&
+ previewMode.shouldHighlightSelectedAffordance &&
+ isSelected,
+ isDimmed =
+ previewMode.isInPreviewMode &&
+ previewMode.shouldHighlightSelectedAffordance &&
+ !isSelected,
+ forceInactive = previewMode.isInPreviewMode,
+ slotId = slotId,
+ useLongPress = useLongPress,
+ )
+ }
.distinctUntilChanged()
}
}
@@ -167,8 +201,6 @@
// time, we don't want the number to be too close to 1.0 such that there is a chance that we
// never treat the affordance UI as "fully opaque" as that would risk making it forever not
// clickable.
- @VisibleForTesting
- const val AFFORDANCE_FULLY_OPAQUE_ALPHA_THRESHOLD = 0.95f
+ @VisibleForTesting const val AFFORDANCE_FULLY_OPAQUE_ALPHA_THRESHOLD = 0.95f
}
-
-}
\ No newline at end of file
+}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt
index 316ca77..92b9ee4 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt
@@ -19,29 +19,37 @@
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.keyguard.shared.model.KeyguardRootViewVisibilityState
-import com.android.systemui.shared.keyguard.shared.model.KeyguardQuickAffordanceSlots
+import javax.inject.Inject
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flowOf
-import javax.inject.Inject
@OptIn(ExperimentalCoroutinesApi::class)
class KeyguardRootViewModel
@Inject
constructor(
private val keyguardInteractor: KeyguardInteractor,
- private val keyguardQuickAffordancesCombinedViewModel: KeyguardQuickAffordancesCombinedViewModel
-)
-{
+) {
+
+ data class PreviewMode(val isInPreviewMode: Boolean = false)
+
+ /**
+ * Whether this view-model instance is powering the preview experience that renders exclusively
+ * in the wallpaper picker application. This should _always_ be `false` for the real lock screen
+ * experience.
+ */
+ private val previewMode = MutableStateFlow(PreviewMode())
+
/** Represents the current state of the KeyguardRootView visibility */
val keyguardRootViewVisibilityState: Flow<KeyguardRootViewVisibilityState> =
keyguardInteractor.keyguardRootViewVisibilityState
/** An observable for the alpha level for the entire keyguard root view. */
val alpha: Flow<Float> =
- keyguardInteractor.previewMode.flatMapLatest {
+ previewMode.flatMapLatest {
if (it.isInPreviewMode) {
flowOf(1f)
} else {
@@ -53,23 +61,9 @@
* Puts this view-model in "preview mode", which means it's being used for UI that is rendering
* the lock screen preview in wallpaper picker / settings and not the real experience on the
* lock screen.
- *
- * @param initiallySelectedSlotId The ID of the initial slot to render as the selected one.
- * @param shouldHighlightSelectedAffordance Whether the selected quick affordance should be
- * highlighted (while all others are dimmed to make the selected one stand out).
*/
- fun enablePreviewMode(
- initiallySelectedSlotId: String?,
- shouldHighlightSelectedAffordance: Boolean,
- ) {
- keyguardInteractor.previewMode.value =
- KeyguardInteractor.PreviewMode(
- isInPreviewMode = true,
- shouldHighlightSelectedAffordance = shouldHighlightSelectedAffordance,
- )
- keyguardQuickAffordancesCombinedViewModel.onPreviewSlotSelected(
- initiallySelectedSlotId ?: KeyguardQuickAffordanceSlots.SLOT_ID_BOTTOM_START
- )
+ fun enablePreviewMode() {
+ val newPreviewMode = PreviewMode(true)
+ previewMode.value = newPreviewMode
}
-
-}
\ No newline at end of file
+}
diff --git a/packages/SystemUI/src/com/android/systemui/media/NotificationPlayer.java b/packages/SystemUI/src/com/android/systemui/media/NotificationPlayer.java
index f8f784f..3d4fca1 100644
--- a/packages/SystemUI/src/com/android/systemui/media/NotificationPlayer.java
+++ b/packages/SystemUI/src/com/android/systemui/media/NotificationPlayer.java
@@ -216,6 +216,58 @@
}
}
+ private void stopSound(Command cmd) {
+ final MediaPlayer mp;
+ synchronized (mPlayerLock) {
+ mp = mPlayer;
+ mPlayer = null;
+ }
+ if (mp == null) {
+ Log.w(mTag, "STOP command without a player");
+ return;
+ }
+
+ long delay = SystemClock.uptimeMillis() - cmd.requestTime;
+ if (delay > 1000) {
+ Log.w(mTag, "Notification stop delayed by " + delay + "msecs");
+ }
+ try {
+ mp.stop();
+ } catch (Exception e) {
+ Log.w(mTag, "Failed to stop MediaPlayer", e);
+ }
+ if (DEBUG) {
+ Log.i(mTag, "About to release MediaPlayer piid:"
+ + mp.getPlayerIId() + " due to notif cancelled");
+ }
+ try {
+ mp.release();
+ } catch (Exception e) {
+ Log.w(mTag, "Failed to release MediaPlayer", e);
+ }
+ synchronized (mQueueAudioFocusLock) {
+ if (mAudioManagerWithAudioFocus != null) {
+ if (DEBUG) {
+ Log.d(mTag, "in STOP: abandonning AudioFocus");
+ }
+ try {
+ mAudioManagerWithAudioFocus.abandonAudioFocus(null);
+ } catch (Exception e) {
+ Log.w(mTag, "Failed to abandon audio focus", e);
+ }
+ mAudioManagerWithAudioFocus = null;
+ }
+ }
+ synchronized (mCompletionHandlingLock) {
+ if ((mLooper != null) && (mLooper.getThread().getState() != Thread.State.TERMINATED)) {
+ if (DEBUG) {
+ Log.d(mTag, "in STOP: quitting looper " + mLooper);
+ }
+ mLooper.quit();
+ }
+ }
+ }
+
private final class CmdThread extends java.lang.Thread {
CmdThread() {
super("NotificationPlayer-" + mTag);
@@ -229,62 +281,28 @@
if (DEBUG) Log.d(mTag, "RemoveFirst");
cmd = mCmdQueue.removeFirst();
}
-
- switch (cmd.code) {
- case PLAY:
- if (DEBUG) Log.d(mTag, "PLAY");
- startSound(cmd);
- break;
- case STOP:
- if (DEBUG) Log.d(mTag, "STOP");
- final MediaPlayer mp;
- synchronized (mPlayerLock) {
- mp = mPlayer;
- mPlayer = null;
+ try {
+ switch (cmd.code) {
+ case PLAY:
+ if (DEBUG) Log.d(mTag, "PLAY");
+ startSound(cmd);
+ break;
+ case STOP:
+ if (DEBUG) Log.d(mTag, "STOP");
+ stopSound(cmd);
+ break;
}
- if (mp != null) {
- long delay = SystemClock.uptimeMillis() - cmd.requestTime;
- if (delay > 1000) {
- Log.w(mTag, "Notification stop delayed by " + delay + "msecs");
+ } finally {
+ synchronized (mCmdQueue) {
+ if (mCmdQueue.size() == 0) {
+ // nothing left to do, quit
+ // doing this check after we're done prevents the case where they
+ // added it during the operation from spawning two threads and
+ // trying to do them in parallel.
+ mThread = null;
+ releaseWakeLock();
+ return;
}
- try {
- mp.stop();
- } catch (Exception e) { }
- if (DEBUG) {
- Log.i(mTag, "About to release MediaPlayer piid:"
- + mp.getPlayerIId() + " due to notif cancelled");
- }
- mp.release();
- synchronized(mQueueAudioFocusLock) {
- if (mAudioManagerWithAudioFocus != null) {
- if (DEBUG) { Log.d(mTag, "in STOP: abandonning AudioFocus"); }
- mAudioManagerWithAudioFocus.abandonAudioFocus(null);
- mAudioManagerWithAudioFocus = null;
- }
- }
- synchronized (mCompletionHandlingLock) {
- if ((mLooper != null) &&
- (mLooper.getThread().getState() != Thread.State.TERMINATED))
- {
- if (DEBUG) { Log.d(mTag, "in STOP: quitting looper "+ mLooper); }
- mLooper.quit();
- }
- }
- } else {
- Log.w(mTag, "STOP command without a player");
- }
- break;
- }
-
- synchronized (mCmdQueue) {
- if (mCmdQueue.size() == 0) {
- // nothing left to do, quit
- // doing this check after we're done prevents the case where they
- // added it during the operation from spawning two threads and
- // trying to do them in parallel.
- mThread = null;
- releaseWakeLock();
- return;
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/util/MediaSessionLegacyHelperWrapper.kt b/packages/SystemUI/src/com/android/systemui/media/controls/util/MediaSessionLegacyHelperWrapper.kt
new file mode 100644
index 0000000..9924369
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/util/MediaSessionLegacyHelperWrapper.kt
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.media.controls.util
+
+import android.content.Context
+import android.media.session.MediaSessionLegacyHelper
+import com.android.systemui.dagger.SysUISingleton
+import javax.inject.Inject
+
+/** Injectable wrapper around `MediaSessionLegacyHelper` functions */
+@SysUISingleton
+class MediaSessionLegacyHelperWrapper @Inject constructor() {
+ fun getHelper(context: Context): MediaSessionLegacyHelper {
+ return MediaSessionLegacyHelper.getHelper(context)
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java
index a3d1d8c..d8824983 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java
@@ -515,11 +515,13 @@
mSeekBar.setOnTouchListener((v, event) -> false);
updateIconAreaClickListener((v) -> {
if (device.getCurrentVolume() == 0) {
+ mController.logInteractionUnmuteDevice(device);
mSeekBar.setVolume(UNMUTE_DEFAULT_VOLUME);
mController.adjustVolume(device, UNMUTE_DEFAULT_VOLUME);
updateUnmutedVolumeIcon();
mIconAreaLayout.setOnTouchListener(((iconV, event) -> false));
} else {
+ mController.logInteractionMuteDevice(device);
mSeekBar.resetVolume();
mController.adjustVolume(device, 0);
updateMutedVolumeIcon();
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
index d281f50..bb0e9d1 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
@@ -837,6 +837,14 @@
mMetricLogger.logInteractionAdjustVolume(device);
}
+ void logInteractionMuteDevice(MediaDevice device) {
+ mMetricLogger.logInteractionMute(device);
+ }
+
+ void logInteractionUnmuteDevice(MediaDevice device) {
+ mMetricLogger.logInteractionUnmute(device);
+ }
+
String getPackageName() {
return mPackageName;
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputMetricLogger.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputMetricLogger.java
index 412d1a3..ffd626a 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputMetricLogger.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputMetricLogger.java
@@ -154,6 +154,38 @@
}
/**
+ * Do the metric logging of muting device.
+ */
+ public void logInteractionMute(MediaDevice source) {
+ if (DEBUG) {
+ Log.d(TAG, "logInteraction - Mute");
+ }
+
+ SysUiStatsLog.write(
+ SysUiStatsLog.MEDIAOUTPUT_OP_INTERACTION_REPORT,
+ SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__INTERACTION_TYPE__MUTE,
+ getInteractionDeviceType(source),
+ getLoggingPackageName(),
+ source.isSuggestedDevice());
+ }
+
+ /**
+ * Do the metric logging of unmuting device.
+ */
+ public void logInteractionUnmute(MediaDevice source) {
+ if (DEBUG) {
+ Log.d(TAG, "logInteraction - Unmute");
+ }
+
+ SysUiStatsLog.write(
+ SysUiStatsLog.MEDIAOUTPUT_OP_INTERACTION_REPORT,
+ SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__INTERACTION_TYPE__UNMUTE,
+ getInteractionDeviceType(source),
+ getLoggingPackageName(),
+ source.isSuggestedDevice());
+ }
+
+ /**
* Do the metric logging of content switching failure.
*
* @param deviceItemList media item list for device count updating
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java
index e134f7c..ae0ab84 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java
@@ -25,6 +25,7 @@
import static android.app.StatusBarManager.WindowVisibleState;
import static android.app.StatusBarManager.windowStateToString;
import static android.app.WindowConfiguration.ROTATION_UNDEFINED;
+import static android.inputmethodservice.InputMethodService.ENABLE_HIDE_IME_CAPTION_BAR;
import static android.view.InsetsSource.FLAG_SUPPRESS_SCRIM;
import static android.view.WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE;
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
@@ -1714,10 +1715,12 @@
private InsetsFrameProvider[] getInsetsFrameProvider(int insetsHeight, Context userContext) {
final InsetsFrameProvider navBarProvider =
- new InsetsFrameProvider(mInsetsSourceOwner, 0, WindowInsets.Type.navigationBars())
- .setInsetsSizeOverrides(new InsetsFrameProvider.InsetsSizeOverride[] {
- new InsetsFrameProvider.InsetsSizeOverride(
- TYPE_INPUT_METHOD, null)});
+ new InsetsFrameProvider(mInsetsSourceOwner, 0, WindowInsets.Type.navigationBars());
+ if (!ENABLE_HIDE_IME_CAPTION_BAR) {
+ navBarProvider.setInsetsSizeOverrides(new InsetsFrameProvider.InsetsSizeOverride[] {
+ new InsetsFrameProvider.InsetsSizeOverride(TYPE_INPUT_METHOD, null)
+ });
+ }
if (insetsHeight != -1 && !mEdgeBackGestureHandler.isButtonForcedVisible()) {
navBarProvider.setInsetsSize(Insets.of(0, 0, 0, insetsHeight));
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSHostAdapter.kt b/packages/SystemUI/src/com/android/systemui/qs/QSHostAdapter.kt
index 67927a4..cb87e3c 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSHostAdapter.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSHostAdapter.kt
@@ -22,13 +22,12 @@
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dump.DumpManager
-import com.android.systemui.flags.FeatureFlags
-import com.android.systemui.flags.Flags
import com.android.systemui.plugins.qs.QSTile
import com.android.systemui.plugins.qs.QSTileView
import com.android.systemui.qs.external.TileServiceRequestController
import com.android.systemui.qs.pipeline.data.repository.TileSpecRepository.Companion.POSITION_AT_END
import com.android.systemui.qs.pipeline.domain.interactor.CurrentTilesInteractor
+import com.android.systemui.qs.pipeline.shared.QSPipelineFlagsRepository
import com.android.systemui.qs.pipeline.shared.TileSpec
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
@@ -37,10 +36,11 @@
/**
* Adapter to determine what real class to use for classes that depend on [QSHost].
- * * When [Flags.QS_PIPELINE_NEW_HOST] is off, all calls will be routed to [QSTileHost].
- * * When [Flags.QS_PIPELINE_NEW_HOST] is on, calls regarding the current set of tiles will be
- * routed to [CurrentTilesInteractor]. Other calls (like [createTileView]) will still be routed to
+ * * When [QSPipelineFlagsRepository.pipelineHostEnabled] is false, all calls will be routed to
* [QSTileHost].
+ * * When [QSPipelineFlagsRepository.pipelineHostEnabled] is true, calls regarding the current set
+ * of tiles will be routed to [CurrentTilesInteractor]. Other calls (like [createTileView]) will
+ * still be routed to [QSTileHost].
*
* This routing also includes dumps.
*/
@@ -53,7 +53,7 @@
private val context: Context,
private val tileServiceRequestControllerBuilder: TileServiceRequestController.Builder,
@Application private val scope: CoroutineScope,
- private val featureFlags: FeatureFlags,
+ flags: QSPipelineFlagsRepository,
dumpManager: DumpManager,
) : QSHost {
@@ -61,7 +61,7 @@
private const val TAG = "QSTileHost"
}
- private val useNewHost = featureFlags.isEnabled(Flags.QS_PIPELINE_NEW_HOST)
+ private val useNewHost = flags.pipelineHostEnabled
@GuardedBy("callbacksMap") private val callbacksMap = mutableMapOf<QSHost.Callback, Job>()
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java b/packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java
index 432147f..e57db56 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSTileHost.java
@@ -35,8 +35,6 @@
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dump.nano.SystemUIProtoDump;
-import com.android.systemui.flags.FeatureFlags;
-import com.android.systemui.flags.Flags;
import com.android.systemui.plugins.PluginListener;
import com.android.systemui.plugins.PluginManager;
import com.android.systemui.plugins.qs.QSFactory;
@@ -50,6 +48,7 @@
import com.android.systemui.qs.nano.QsTileState;
import com.android.systemui.qs.pipeline.data.repository.CustomTileAddedRepository;
import com.android.systemui.qs.pipeline.domain.interactor.PanelInteractor;
+import com.android.systemui.qs.pipeline.shared.QSPipelineFlagsRepository;
import com.android.systemui.settings.UserFileManager;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shade.ShadeController;
@@ -119,7 +118,7 @@
private TileLifecycleManager.Factory mTileLifeCycleManagerFactory;
- private final FeatureFlags mFeatureFlags;
+ private final QSPipelineFlagsRepository mFeatureFlags;
@Inject
public QSTileHost(Context context,
@@ -135,7 +134,7 @@
CustomTileStatePersister customTileStatePersister,
TileLifecycleManager.Factory tileLifecycleManagerFactory,
UserFileManager userFileManager,
- FeatureFlags featureFlags
+ QSPipelineFlagsRepository featureFlags
) {
mContext = context;
mUserContext = context;
@@ -162,7 +161,7 @@
// finishes before creating any tiles.
tunerService.addTunable(this, TILES_SETTING);
// AutoTileManager can modify mTiles so make sure mTiles has already been initialized.
- if (!mFeatureFlags.isEnabled(Flags.QS_PIPELINE_AUTO_ADD)) {
+ if (!mFeatureFlags.getPipelineAutoAddEnabled()) {
mAutoTiles = autoTiles.get();
}
});
@@ -283,7 +282,7 @@
}
}
// Do not process tiles if the flag is enabled.
- if (mFeatureFlags.isEnabled(Flags.QS_PIPELINE_NEW_HOST)) {
+ if (mFeatureFlags.getPipelineHostEnabled()) {
return;
}
if (newValue == null && UserManager.isDeviceInDemoMode(mContext)) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/dagger/QSHostModule.kt b/packages/SystemUI/src/com/android/systemui/qs/dagger/QSHostModule.kt
index 1f63f5d..b2111d7 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/dagger/QSHostModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/dagger/QSHostModule.kt
@@ -16,8 +16,6 @@
package com.android.systemui.qs.dagger
-import com.android.systemui.flags.FeatureFlags
-import com.android.systemui.flags.Flags
import com.android.systemui.qs.QSHost
import com.android.systemui.qs.QSHostAdapter
import com.android.systemui.qs.QSTileHost
@@ -27,6 +25,7 @@
import com.android.systemui.qs.pipeline.data.repository.CustomTileAddedSharedPrefsRepository
import com.android.systemui.qs.pipeline.domain.interactor.PanelInteractor
import com.android.systemui.qs.pipeline.domain.interactor.PanelInteractorImpl
+import com.android.systemui.qs.pipeline.shared.QSPipelineFlagsRepository
import dagger.Binds
import dagger.Module
import dagger.Provides
@@ -45,11 +44,11 @@
@Provides
@JvmStatic
fun providePanelInteractor(
- featureFlags: FeatureFlags,
+ featureFlags: QSPipelineFlagsRepository,
qsHost: QSTileHost,
panelInteractorImpl: PanelInteractorImpl
): PanelInteractor {
- return if (featureFlags.isEnabled(Flags.QS_PIPELINE_NEW_HOST)) {
+ return if (featureFlags.pipelineHostEnabled) {
panelInteractorImpl
} else {
qsHost
@@ -59,11 +58,11 @@
@Provides
@JvmStatic
fun provideCustomTileAddedRepository(
- featureFlags: FeatureFlags,
+ featureFlags: QSPipelineFlagsRepository,
qsHost: QSTileHost,
customTileAddedRepository: CustomTileAddedSharedPrefsRepository
): CustomTileAddedRepository {
- return if (featureFlags.isEnabled(Flags.QS_PIPELINE_NEW_HOST)) {
+ return if (featureFlags.pipelineHostEnabled) {
customTileAddedRepository
} else {
qsHost
diff --git a/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java b/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java
index 5d02830..34d6233 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java
@@ -36,7 +36,6 @@
import android.service.quicksettings.IQSTileService;
import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
-import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.IWindowManager;
@@ -190,13 +189,8 @@
if (updateIcon) {
mTile.setIcon(mDefaultIcon);
}
- // Update the label if there is no label or it is the default label.
- boolean updateLabel = mTile.getLabel() == null
- || TextUtils.equals(mTile.getLabel(), mDefaultLabel);
mDefaultLabel = info.loadLabel(pm);
- if (updateLabel) {
- mTile.setLabel(mDefaultLabel);
- }
+ mTile.setDefaultLabel(mDefaultLabel);
} catch (PackageManager.NameNotFoundException e) {
mDefaultIcon = null;
mDefaultLabel = null;
@@ -291,8 +285,8 @@
if (tile.getIcon() != null || overwriteNulls) {
mTile.setIcon(tile.getIcon());
}
- if (tile.getLabel() != null || overwriteNulls) {
- mTile.setLabel(tile.getLabel());
+ if (tile.getCustomLabel() != null || overwriteNulls) {
+ mTile.setLabel(tile.getCustomLabel());
}
if (tile.getSubtitle() != null || overwriteNulls) {
mTile.setSubtitle(tile.getSubtitle());
diff --git a/packages/SystemUI/src/com/android/systemui/qs/external/CustomTileStatePersister.kt b/packages/SystemUI/src/com/android/systemui/qs/external/CustomTileStatePersister.kt
index 021e632..a321eef 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/CustomTileStatePersister.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/CustomTileStatePersister.kt
@@ -113,7 +113,7 @@
return with(tile) {
JSONObject()
.put(STATE, state)
- .put(LABEL, label)
+ .put(LABEL, customLabel)
.put(SUBTITLE, subtitle)
.put(CONTENT_DESCRIPTION, contentDescription)
.put(STATE_DESCRIPTION, stateDescription)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/interactor/CurrentTilesInteractor.kt b/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/interactor/CurrentTilesInteractor.kt
index 966f370..5a5e47a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/interactor/CurrentTilesInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/interactor/CurrentTilesInteractor.kt
@@ -27,8 +27,6 @@
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dump.nano.SystemUIProtoDump
-import com.android.systemui.flags.FeatureFlags
-import com.android.systemui.flags.Flags
import com.android.systemui.plugins.qs.QSFactory
import com.android.systemui.plugins.qs.QSTile
import com.android.systemui.qs.external.CustomTile
@@ -39,6 +37,7 @@
import com.android.systemui.qs.pipeline.data.repository.InstalledTilesComponentRepository
import com.android.systemui.qs.pipeline.data.repository.TileSpecRepository
import com.android.systemui.qs.pipeline.domain.model.TileModel
+import com.android.systemui.qs.pipeline.shared.QSPipelineFlagsRepository
import com.android.systemui.qs.pipeline.shared.TileSpec
import com.android.systemui.qs.pipeline.shared.logging.QSPipelineLogger
import com.android.systemui.qs.toProto
@@ -139,7 +138,7 @@
@Background private val backgroundDispatcher: CoroutineDispatcher,
@Application private val scope: CoroutineScope,
private val logger: QSPipelineLogger,
- featureFlags: FeatureFlags,
+ featureFlags: QSPipelineFlagsRepository,
) : CurrentTilesInteractor {
private val _currentSpecsAndTiles: MutableStateFlow<List<TileModel>> =
@@ -171,7 +170,7 @@
}
init {
- if (featureFlags.isEnabled(Flags.QS_PIPELINE_NEW_HOST)) {
+ if (featureFlags.pipelineHostEnabled) {
startTileCollection()
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/startable/QSPipelineCoreStartable.kt b/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/startable/QSPipelineCoreStartable.kt
index 224fc1a..0743ba0 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/startable/QSPipelineCoreStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/pipeline/domain/startable/QSPipelineCoreStartable.kt
@@ -18,10 +18,9 @@
import com.android.systemui.CoreStartable
import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.flags.FeatureFlags
-import com.android.systemui.flags.Flags
import com.android.systemui.qs.pipeline.domain.interactor.AutoAddInteractor
import com.android.systemui.qs.pipeline.domain.interactor.CurrentTilesInteractor
+import com.android.systemui.qs.pipeline.shared.QSPipelineFlagsRepository
import javax.inject.Inject
@SysUISingleton
@@ -30,14 +29,11 @@
constructor(
private val currentTilesInteractor: CurrentTilesInteractor,
private val autoAddInteractor: AutoAddInteractor,
- private val featureFlags: FeatureFlags,
+ private val featureFlags: QSPipelineFlagsRepository,
) : CoreStartable {
override fun start() {
- if (
- featureFlags.isEnabled(Flags.QS_PIPELINE_NEW_HOST) &&
- featureFlags.isEnabled(Flags.QS_PIPELINE_AUTO_ADD)
- ) {
+ if (featureFlags.pipelineAutoAddEnabled) {
autoAddInteractor.init(currentTilesInteractor)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/pipeline/shared/QSPipelineFlagsRepository.kt b/packages/SystemUI/src/com/android/systemui/qs/pipeline/shared/QSPipelineFlagsRepository.kt
new file mode 100644
index 0000000..551b0f4
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/qs/pipeline/shared/QSPipelineFlagsRepository.kt
@@ -0,0 +1,23 @@
+package com.android.systemui.qs.pipeline.shared
+
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.flags.FeatureFlags
+import com.android.systemui.flags.Flags
+import javax.inject.Inject
+
+/** Encapsulate the different QS pipeline flags and their dependencies */
+@SysUISingleton
+class QSPipelineFlagsRepository
+@Inject
+constructor(
+ private val featureFlags: FeatureFlags,
+) {
+
+ /** @see Flags.QS_PIPELINE_NEW_HOST */
+ val pipelineHostEnabled: Boolean
+ get() = featureFlags.isEnabled(Flags.QS_PIPELINE_NEW_HOST)
+
+ /** @see Flags.QS_PIPELINE_AUTO_ADD */
+ val pipelineAutoAddEnabled: Boolean
+ get() = pipelineHostEnabled && featureFlags.isEnabled(Flags.QS_PIPELINE_AUTO_ADD)
+}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/FontScalingTile.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/FontScalingTile.kt
index 423fa80..1f9979a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/FontScalingTile.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/FontScalingTile.kt
@@ -28,8 +28,6 @@
import com.android.systemui.animation.DialogLaunchAnimator
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
-import com.android.systemui.flags.FeatureFlags
-import com.android.systemui.flags.Flags
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.plugins.qs.QSTile
@@ -64,7 +62,6 @@
private val systemSettings: SystemSettings,
private val secureSettings: SecureSettings,
private val systemClock: SystemClock,
- private val featureFlags: FeatureFlags,
private val userTracker: UserTracker,
@Background private val backgroundDelayableExecutor: DelayableExecutor
) :
@@ -81,10 +78,6 @@
) {
private val icon = ResourceIcon.get(R.drawable.ic_qs_font_scaling)
- override fun isAvailable(): Boolean {
- return featureFlags.isEnabled(Flags.ENABLE_FONT_SCALING_TILE)
- }
-
override fun newTileState(): QSTile.State {
return QSTile.State()
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialog.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialog.java
index 6e1ef91..c67078f 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialog.java
@@ -128,12 +128,15 @@
private TextView mMobileTitleText;
private TextView mMobileSummaryText;
private TextView mSecondaryMobileTitleText;
- private TextView mSecondaryMobileSummaryText;
+ private TextView mSecondaryMobileSummaryText;
private TextView mAirplaneModeSummaryText;
private Switch mMobileDataToggle;
private View mMobileToggleDivider;
private Switch mWiFiToggle;
private Button mDoneButton;
+
+ @VisibleForTesting
+ protected Button mShareWifiButton;
private Button mAirplaneModeButton;
private Drawable mBackgroundOn;
private KeyguardStateController mKeyguard;
@@ -142,7 +145,6 @@
private int mDefaultDataSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
private boolean mCanConfigMobileData;
private boolean mCanChangeWifiState;
-
// Wi-Fi entries
private int mWifiNetworkHeight;
@Nullable
@@ -236,6 +238,7 @@
mWifiRecyclerView = mDialogView.requireViewById(R.id.wifi_list_layout);
mSeeAllLayout = mDialogView.requireViewById(R.id.see_all_layout);
mDoneButton = mDialogView.requireViewById(R.id.done_button);
+ mShareWifiButton = mDialogView.requireViewById(R.id.share_wifi_button);
mAirplaneModeButton = mDialogView.requireViewById(R.id.apm_button);
mSignalIcon = mDialogView.requireViewById(R.id.signal_icon);
mMobileTitleText = mDialogView.requireViewById(R.id.mobile_title);
@@ -274,6 +277,7 @@
mConnectedWifListLayout.setVisibility(View.GONE);
mWifiRecyclerView.setVisibility(View.GONE);
mSeeAllLayout.setVisibility(View.GONE);
+ mShareWifiButton.setVisibility(View.GONE);
}
@Override
@@ -291,6 +295,7 @@
mSeeAllLayout.setOnClickListener(null);
mWiFiToggle.setOnCheckedChangeListener(null);
mDoneButton.setOnClickListener(null);
+ mShareWifiButton.setOnClickListener(null);
mAirplaneModeButton.setOnClickListener(null);
mInternetDialogController.onStop();
mInternetDialogFactory.destroyDialog();
@@ -309,7 +314,7 @@
* Update the internet dialog when receiving the callback.
*
* @param shouldUpdateMobileNetwork {@code true} for update the mobile network layout,
- * otherwise {@code false}.
+ * otherwise {@code false}.
*/
void updateDialog(boolean shouldUpdateMobileNetwork) {
if (DEBUG) {
@@ -366,6 +371,11 @@
mInternetDialogController.setWifiEnabled(isChecked);
});
mDoneButton.setOnClickListener(v -> dismiss());
+ mShareWifiButton.setOnClickListener(v -> {
+ if (mInternetDialogController.mayLaunchShareWifiSettings(mConnectedWifiEntry)) {
+ mUiEventLogger.log(InternetDialogEvent.SHARE_WIFI_QS_BUTTON_CLICKED);
+ }
+ });
mAirplaneModeButton.setOnClickListener(v -> {
mInternetDialogController.setAirplaneModeDisabled();
});
@@ -526,6 +536,7 @@
private void updateConnectedWifi(boolean isWifiEnabled, boolean isDeviceLocked) {
if (!isWifiEnabled || mConnectedWifiEntry == null || isDeviceLocked) {
mConnectedWifListLayout.setVisibility(View.GONE);
+ mShareWifiButton.setVisibility(View.GONE);
return;
}
mConnectedWifListLayout.setVisibility(View.VISIBLE);
@@ -535,6 +546,12 @@
mInternetDialogController.getInternetWifiDrawable(mConnectedWifiEntry));
mWifiSettingsIcon.setColorFilter(
mContext.getColor(R.color.connected_network_primary_color));
+ if (mInternetDialogController.getConfiguratorQrCodeGeneratorIntentOrNull(
+ mConnectedWifiEntry) != null) {
+ mShareWifiButton.setVisibility(View.VISIBLE);
+ } else {
+ mShareWifiButton.setVisibility(View.GONE);
+ }
if (mSecondaryMobileNetworkLayout != null) {
mSecondaryMobileNetworkLayout.setVisibility(View.GONE);
@@ -683,7 +700,8 @@
mAlertDialog = new Builder(mContext)
.setTitle(R.string.mobile_data_disable_title)
.setMessage(mContext.getString(R.string.mobile_data_disable_message, carrierName))
- .setNegativeButton(android.R.string.cancel, (d, w) -> {})
+ .setNegativeButton(android.R.string.cancel, (d, w) -> {
+ })
.setPositiveButton(
com.android.internal.R.string.alert_windows_notification_turn_off_action,
(d, w) -> {
@@ -709,7 +727,8 @@
.setTitle(mContext.getString(R.string.auto_data_switch_disable_title, carrierName))
.setMessage(R.string.auto_data_switch_disable_message)
.setNegativeButton(R.string.auto_data_switch_dialog_negative_button,
- (d, w) -> {})
+ (d, w) -> {
+ })
.setPositiveButton(R.string.auto_data_switch_dialog_positive_button,
(d, w) -> {
mInternetDialogController
@@ -815,7 +834,10 @@
public enum InternetDialogEvent implements UiEventLogger.UiEventEnum {
@UiEvent(doc = "The Internet dialog became visible on the screen.")
- INTERNET_DIALOG_SHOW(843);
+ INTERNET_DIALOG_SHOW(843),
+
+ @UiEvent(doc = "The share wifi button is clicked.")
+ SHARE_WIFI_QS_BUTTON_CLICKED(1462);
private final int mId;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java
index ec12580..3c0b87d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDialogController.java
@@ -73,6 +73,7 @@
import com.android.settingslib.mobile.TelephonyIcons;
import com.android.settingslib.net.SignalStrengthUtil;
import com.android.settingslib.wifi.WifiUtils;
+import com.android.settingslib.wifi.dpp.WifiDppIntentHelper;
import com.android.systemui.R;
import com.android.systemui.animation.ActivityLaunchAnimator;
import com.android.systemui.animation.DialogLaunchAnimator;
@@ -1318,6 +1319,18 @@
return mWifiIconInjector;
}
+ boolean mayLaunchShareWifiSettings(WifiEntry wifiEntry) {
+ Intent intent = getConfiguratorQrCodeGeneratorIntentOrNull(wifiEntry);
+ if (intent == null) {
+ return false;
+ }
+ if (mCallback != null) {
+ mCallback.dismissDialog();
+ }
+ mActivityStarter.startActivity(intent, false /* dismissShade */);
+ return true;
+ }
+
interface InternetDialogCallback {
void onRefreshCarrierInfo();
@@ -1403,4 +1416,17 @@
}
}, SHORT_DURATION_TIMEOUT);
}
+
+ Intent getConfiguratorQrCodeGeneratorIntentOrNull(WifiEntry wifiEntry) {
+ if (!mFeatureFlags.isEnabled(Flags.SHARE_WIFI_QS_BUTTON) || wifiEntry == null
+ || mWifiManager == null || !wifiEntry.canShare()) {
+ return null;
+ }
+ Intent intent = new Intent();
+ intent.setAction(WifiDppIntentHelper.ACTION_CONFIGURATOR_AUTH_QR_CODE_GENERATOR);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ WifiDppIntentHelper.setConfiguratorIntentExtra(intent, mWifiManager,
+ wifiEntry.getWifiConfiguration());
+ return intent;
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt b/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt
index 76d9b03..a7434c6 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt
@@ -21,16 +21,13 @@
import com.android.systemui.scene.data.repository.SceneContainerRepository
import com.android.systemui.scene.shared.logger.SceneLogger
import com.android.systemui.scene.shared.model.ObservableTransitionState
-import com.android.systemui.scene.shared.model.RemoteUserInput
import com.android.systemui.scene.shared.model.SceneKey
import com.android.systemui.scene.shared.model.SceneModel
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
-import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
-import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.stateIn
@@ -109,10 +106,6 @@
/** Whether the scene container is visible. */
val isVisible: StateFlow<Boolean> = repository.isVisible
- private val _remoteUserInput: MutableStateFlow<RemoteUserInput?> = MutableStateFlow(null)
- /** A flow of motion events originating from outside of the scene framework. */
- val remoteUserInput: StateFlow<RemoteUserInput?> = _remoteUserInput.asStateFlow()
-
/**
* Returns the keys of all scenes in the container.
*
@@ -160,11 +153,6 @@
repository.setTransitionState(transitionState)
}
- /** Handles a remote user input. */
- fun onRemoteUserInput(input: RemoteUserInput) {
- _remoteUserInput.value = input
- }
-
/**
* Notifies that the UI has transitioned sufficiently to the given scene.
*
diff --git a/packages/SystemUI/src/com/android/systemui/scene/shared/model/RemoteUserInput.kt b/packages/SystemUI/src/com/android/systemui/scene/shared/model/RemoteUserInput.kt
deleted file mode 100644
index 680de59..0000000
--- a/packages/SystemUI/src/com/android/systemui/scene/shared/model/RemoteUserInput.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.android.systemui.scene.shared.model
-
-import android.view.MotionEvent
-
-/** A representation of user input that is used by the scene framework. */
-data class RemoteUserInput(
- val x: Float,
- val y: Float,
- val action: RemoteUserInputAction,
-) {
- companion object {
- fun translateMotionEvent(event: MotionEvent): RemoteUserInput {
- return RemoteUserInput(
- x = event.x,
- y = event.y,
- action =
- when (event.actionMasked) {
- MotionEvent.ACTION_DOWN -> RemoteUserInputAction.DOWN
- MotionEvent.ACTION_MOVE -> RemoteUserInputAction.MOVE
- MotionEvent.ACTION_UP -> RemoteUserInputAction.UP
- MotionEvent.ACTION_CANCEL -> RemoteUserInputAction.CANCEL
- else -> RemoteUserInputAction.UNKNOWN
- }
- )
- }
- }
-}
-
-enum class RemoteUserInputAction {
- DOWN,
- MOVE,
- UP,
- CANCEL,
- UNKNOWN,
-}
diff --git a/packages/SystemUI/src/com/android/systemui/scene/ui/view/SceneWindowRootView.kt b/packages/SystemUI/src/com/android/systemui/scene/ui/view/SceneWindowRootView.kt
index 8601b3d..cdf50ba 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/ui/view/SceneWindowRootView.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/ui/view/SceneWindowRootView.kt
@@ -2,7 +2,6 @@
import android.content.Context
import android.util.AttributeSet
-import android.view.MotionEvent
import android.view.View
import com.android.systemui.scene.shared.model.Scene
import com.android.systemui.scene.shared.model.SceneContainerConfig
@@ -39,14 +38,6 @@
)
}
- override fun onTouchEvent(event: MotionEvent?): Boolean {
- return event?.let {
- viewModel.onRemoteUserInput(event)
- true
- }
- ?: false
- }
-
override fun setVisibility(visibility: Int) {
// Do nothing. We don't want external callers to invoke this. Instead, we drive our own
// visibility from our view-binder.
diff --git a/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModel.kt b/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModel.kt
index 3e9bbe4..5c16fb5 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModel.kt
@@ -16,11 +16,9 @@
package com.android.systemui.scene.ui.viewmodel
-import android.view.MotionEvent
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.scene.domain.interactor.SceneInteractor
import com.android.systemui.scene.shared.model.ObservableTransitionState
-import com.android.systemui.scene.shared.model.RemoteUserInput
import com.android.systemui.scene.shared.model.SceneKey
import com.android.systemui.scene.shared.model.SceneModel
import javax.inject.Inject
@@ -34,9 +32,6 @@
constructor(
private val interactor: SceneInteractor,
) {
- /** A flow of motion events originating from outside of the scene framework. */
- val remoteUserInput: StateFlow<RemoteUserInput?> = interactor.remoteUserInput
-
/**
* Keys of all scenes in the container.
*
@@ -68,11 +63,6 @@
interactor.setTransitionState(transitionState)
}
- /** Handles a [MotionEvent] representing remote user input. */
- fun onRemoteUserInput(event: MotionEvent) {
- interactor.onRemoteUserInput(RemoteUserInput.translateMotionEvent(event))
- }
-
companion object {
private const val SCENE_TRANSITION_LOGGING_REASON = "user input"
}
diff --git a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialog.kt b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialog.kt
index e8683fb..fb99775 100644
--- a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialog.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenRecordPermissionDialog.kt
@@ -63,6 +63,7 @@
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setDialogTitle(R.string.screenrecord_permission_dialog_title)
+ setTitle(R.string.screenrecord_title)
setStartButtonText(R.string.screenrecord_permission_dialog_continue)
setStartButtonOnClickListener { v: View? ->
onStartRecordingClicked?.run()
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ActionIntentCreator.kt b/packages/SystemUI/src/com/android/systemui/screenshot/ActionIntentCreator.kt
index 05a0416..ab2a8d9 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ActionIntentCreator.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ActionIntentCreator.kt
@@ -82,11 +82,15 @@
return editIntent
.setDataAndType(uri, "image/png")
+ .putExtra(EXTRA_EDIT_SOURCE, EDIT_SOURCE_SCREENSHOT)
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
}
+
+ private const val EXTRA_EDIT_SOURCE = "edit_source"
+ private const val EDIT_SOURCE_SCREENSHOT = "screenshot"
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/DraggableConstraintLayout.java b/packages/SystemUI/src/com/android/systemui/screenshot/DraggableConstraintLayout.java
index 0b4b7c6..bdbc470 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/DraggableConstraintLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/DraggableConstraintLayout.java
@@ -43,6 +43,7 @@
*/
public class DraggableConstraintLayout extends ConstraintLayout
implements ViewTreeObserver.OnComputeInternalInsetsListener {
+ public static final int SWIPE_PADDING_DP = 12; // extra padding around views to allow swipe
private static final float VELOCITY_DP_PER_MS = 1;
private static final int MAXIMUM_DISMISS_DISTANCE_DP = 400;
@@ -179,8 +180,13 @@
Region r = new Region();
Rect rect = new Rect();
for (int i = 0; i < getChildCount(); i++) {
- getChildAt(i).getGlobalVisibleRect(rect);
- r.op(rect, Region.Op.UNION);
+ View child = getChildAt(i);
+ if (child.getVisibility() == View.VISIBLE) {
+ child.getGlobalVisibleRect(rect);
+ rect.inset((int) FloatingWindowUtil.dpToPx(mDisplayMetrics, -SWIPE_PADDING_DP),
+ (int) FloatingWindowUtil.dpToPx(mDisplayMetrics, -SWIPE_PADDING_DP));
+ r.op(rect, Region.Op.UNION);
+ }
}
inoutInfo.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
inoutInfo.touchableRegion.set(r);
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java
index 3903bb2..03e1e15 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java
@@ -68,7 +68,6 @@
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.ScrollCaptureResponse;
-import android.view.TouchDelegate;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
@@ -123,7 +122,6 @@
public static final long SCREENSHOT_ACTIONS_EXPANSION_DURATION_MS = 400;
private static final long SCREENSHOT_ACTIONS_ALPHA_DURATION_MS = 100;
private static final float SCREENSHOT_ACTIONS_START_SCALE_X = .7f;
- private static final int SWIPE_PADDING_DP = 12; // extra padding around views to allow swipe
private final Resources mResources;
private final Interpolator mFastOutSlowIn;
@@ -284,17 +282,22 @@
Region swipeRegion = new Region();
final Rect tmpRect = new Rect();
+ int swipePadding = (int) FloatingWindowUtil.dpToPx(
+ mDisplayMetrics, DraggableConstraintLayout.SWIPE_PADDING_DP * -1);
mScreenshotPreview.getBoundsOnScreen(tmpRect);
- tmpRect.inset((int) FloatingWindowUtil.dpToPx(mDisplayMetrics, -SWIPE_PADDING_DP),
- (int) FloatingWindowUtil.dpToPx(mDisplayMetrics, -SWIPE_PADDING_DP));
+ tmpRect.inset(swipePadding, swipePadding);
swipeRegion.op(tmpRect, Region.Op.UNION);
mActionsContainerBackground.getBoundsOnScreen(tmpRect);
- tmpRect.inset((int) FloatingWindowUtil.dpToPx(mDisplayMetrics, -SWIPE_PADDING_DP),
- (int) FloatingWindowUtil.dpToPx(mDisplayMetrics, -SWIPE_PADDING_DP));
+ tmpRect.inset(swipePadding, swipePadding);
swipeRegion.op(tmpRect, Region.Op.UNION);
mDismissButton.getBoundsOnScreen(tmpRect);
swipeRegion.op(tmpRect, Region.Op.UNION);
+ View messageContainer = findViewById(R.id.screenshot_message_container);
+ if (messageContainer != null) {
+ messageContainer.getBoundsOnScreen(tmpRect);
+ swipeRegion.op(tmpRect, Region.Op.UNION);
+ }
View messageDismiss = findViewById(R.id.message_dismiss_button);
if (messageDismiss != null) {
messageDismiss.getBoundsOnScreen(tmpRect);
@@ -378,16 +381,6 @@
mEditChip = requireNonNull(mActionsContainer.findViewById(R.id.screenshot_edit_chip));
mScrollChip = requireNonNull(mActionsContainer.findViewById(R.id.screenshot_scroll_chip));
- int swipePaddingPx = (int) FloatingWindowUtil.dpToPx(mDisplayMetrics, SWIPE_PADDING_DP);
- TouchDelegate previewDelegate = new TouchDelegate(
- new Rect(swipePaddingPx, swipePaddingPx, swipePaddingPx, swipePaddingPx),
- mScreenshotPreview);
- mScreenshotPreview.setTouchDelegate(previewDelegate);
- TouchDelegate actionsDelegate = new TouchDelegate(
- new Rect(swipePaddingPx, swipePaddingPx, swipePaddingPx, swipePaddingPx),
- mActionsContainerBackground);
- mActionsContainerBackground.setTouchDelegate(actionsDelegate);
-
setFocusable(true);
mActionsContainer.setScrollX(0);
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
index 132cd61..014093d 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
@@ -985,6 +985,7 @@
// Make sure the clock is in the correct position after the unlock animation
// so that it's not in the wrong place when we show the keyguard again.
positionClockAndNotifications(true /* forceClockUpdate */);
+ mScrimController.onUnlockAnimationFinished();
}
private void unlockAnimationStarted(
@@ -1243,6 +1244,13 @@
mKeyguardStatusViewController.init();
}
mKeyguardStatusViewController.setSplitShadeEnabled(mSplitShadeEnabled);
+ mKeyguardStatusViewController.getView().addOnLayoutChangeListener(
+ (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
+ int oldHeight = oldBottom - oldTop;
+ if (v.getHeight() != oldHeight) {
+ mNotificationStackScrollLayoutController.animateNextTopPaddingChange();
+ }
+ });
updateClockAppearance();
@@ -3198,6 +3206,11 @@
}
}
+ @Override
+ public void performHapticFeedback(int constant) {
+ mVibratorHelper.performHapticFeedback(mView, constant);
+ }
+
private class ShadeHeadsUpTrackerImpl implements ShadeHeadsUpTracker {
@Override
public void addTrackingHeadsUpListener(Consumer<ExpandableNotificationRow> listener) {
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java
index 832a25b..798f2d5 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java
@@ -21,8 +21,6 @@
import static com.android.systemui.util.kotlin.JavaAdapterKt.collectFlow;
import android.app.StatusBarManager;
-import android.media.AudioManager;
-import android.media.session.MediaSessionLegacyHelper;
import android.os.PowerManager;
import android.util.Log;
import android.view.GestureDetector;
@@ -47,6 +45,7 @@
import com.android.systemui.dock.DockManager;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
+import com.android.systemui.keyevent.domain.interactor.KeyEventInteractor;
import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor;
import com.android.systemui.keyguard.shared.model.TransitionState;
@@ -101,13 +100,21 @@
private final NotificationInsetsController mNotificationInsetsController;
private final boolean mIsTrackpadCommonEnabled;
private final FeatureFlags mFeatureFlags;
+ private final KeyEventInteractor mKeyEventInteractor;
private GestureDetector mPulsingWakeupGestureHandler;
private GestureDetector mDreamingWakeupGestureHandler;
private View mBrightnessMirror;
private boolean mTouchActive;
private boolean mTouchCancelled;
private MotionEvent mDownEvent;
+ // TODO rename to mLaunchAnimationRunning
private boolean mExpandAnimationRunning;
+ /**
+ * When mExpandAnimationRunning is true and the touch dispatcher receives a down even after
+ * uptime exceeds this, the dispatcher will stop blocking touches for the launch animation,
+ * which has presumabely not completed due to an error.
+ */
+ private long mLaunchAnimationTimeout;
private NotificationStackScrollLayout mStackScrollLayout;
private PhoneStatusBarViewController mStatusBarViewController;
private final CentralSurfaces mService;
@@ -164,7 +171,8 @@
FeatureFlags featureFlags,
SystemClock clock,
BouncerMessageInteractor bouncerMessageInteractor,
- BouncerLogger bouncerLogger) {
+ BouncerLogger bouncerLogger,
+ KeyEventInteractor keyEventInteractor) {
mLockscreenShadeTransitionController = transitionController;
mFalsingCollector = falsingCollector;
mStatusBarStateController = statusBarStateController;
@@ -190,6 +198,7 @@
mNotificationInsetsController = notificationInsetsController;
mIsTrackpadCommonEnabled = featureFlags.isEnabled(TRACKPAD_GESTURE_COMMON);
mFeatureFlags = featureFlags;
+ mKeyEventInteractor = keyEventInteractor;
// This view is not part of the newly inflated expanded status bar.
mBrightnessMirror = mView.findViewById(R.id.brightness_mirror_container);
@@ -278,7 +287,12 @@
return logDownDispatch(ev, "touch cancelled", false);
}
if (mExpandAnimationRunning) {
- return logDownDispatch(ev, "expand animation running", false);
+ if (isDown && mClock.uptimeMillis() > mLaunchAnimationTimeout) {
+ mShadeLogger.d("NSWVC: launch animation timed out");
+ setExpandAnimationRunning(false);
+ } else {
+ return logDownDispatch(ev, "expand animation running", false);
+ }
}
if (mKeyguardUnlockAnimationController.isPlayingCannedUnlockAnimation()) {
@@ -457,44 +471,17 @@
@Override
public boolean interceptMediaKey(KeyEvent event) {
- return mService.interceptMediaKey(event);
+ return mKeyEventInteractor.interceptMediaKey(event);
}
@Override
public boolean dispatchKeyEventPreIme(KeyEvent event) {
- return mService.dispatchKeyEventPreIme(event);
+ return mKeyEventInteractor.dispatchKeyEventPreIme(event);
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
- boolean down = event.getAction() == KeyEvent.ACTION_DOWN;
- switch (event.getKeyCode()) {
- case KeyEvent.KEYCODE_BACK:
- if (!down) {
- mBackActionInteractor.onBackRequested();
- }
- return true;
- case KeyEvent.KEYCODE_MENU:
- if (!down) {
- return mService.onMenuPressed();
- }
- break;
- case KeyEvent.KEYCODE_SPACE:
- if (!down) {
- return mService.onSpacePressed();
- }
- break;
- case KeyEvent.KEYCODE_VOLUME_DOWN:
- case KeyEvent.KEYCODE_VOLUME_UP:
- if (mStatusBarStateController.isDozing()) {
- MediaSessionLegacyHelper.getHelper(mView.getContext())
- .sendVolumeKeyEvent(
- event, AudioManager.USE_DEFAULT_STREAM_TYPE, true);
- return true;
- }
- break;
- }
- return false;
+ return mKeyEventInteractor.dispatchKeyEvent(event);
}
});
@@ -555,8 +542,12 @@
pw.println(mTouchActive);
}
- private void setExpandAnimationRunning(boolean running) {
+ @VisibleForTesting
+ void setExpandAnimationRunning(boolean running) {
if (mExpandAnimationRunning != running) {
+ if (running) {
+ mLaunchAnimationTimeout = mClock.uptimeMillis() + 5000;
+ }
mExpandAnimationRunning = running;
mNotificationShadeWindowController.setLaunchingActivity(mExpandAnimationRunning);
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt
index bea12de..6564118 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt
@@ -263,9 +263,11 @@
resources.getDimensionPixelSize(
R.dimen.shade_header_system_icons_padding_start
),
- systemIcons.paddingTop,
+ resources.getDimensionPixelSize(R.dimen.shade_header_system_icons_padding_top),
resources.getDimensionPixelSize(R.dimen.shade_header_system_icons_padding_end),
- systemIcons.paddingBottom
+ resources.getDimensionPixelSize(
+ R.dimen.shade_header_system_icons_padding_bottom
+ )
)
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt
index d5b5c87..182a676 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt
@@ -248,6 +248,16 @@
/** Starts tracking a shade expansion gesture that originated from the status bar. */
fun startTrackingExpansionFromStatusBar()
+ /**
+ * Performs haptic feedback from a view with a haptic feedback constant.
+ *
+ * The implementation of this method should use the [android.view.View.performHapticFeedback]
+ * method with the provided constant.
+ *
+ * @param[constant] One of [android.view.HapticFeedbackConstants]
+ */
+ fun performHapticFeedback(constant: Int)
+
// ******* End Keyguard Section *********
/** Returns the ShadeHeadsUpTracker. */
diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewControllerEmptyImpl.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewControllerEmptyImpl.kt
index 287ac52..09b74b2 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewControllerEmptyImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewControllerEmptyImpl.kt
@@ -86,6 +86,8 @@
return false
}
override fun startTrackingExpansionFromStatusBar() {}
+ override fun performHapticFeedback(constant: Int) {}
+
override val shadeHeadsUpTracker = ShadeHeadsUpTrackerEmptyImpl()
override val shadeFoldAnimator = ShadeFoldAnimatorEmptyImpl()
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrier.java b/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrier.java
index 8586828..8612cdf 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrier.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrier.java
@@ -34,6 +34,7 @@
import com.android.settingslib.graph.SignalDrawable;
import com.android.systemui.FontSizeUtils;
import com.android.systemui.R;
+import com.android.systemui.statusbar.pipeline.mobile.ui.view.ModernShadeCarrierGroupMobileView;
import com.android.systemui.util.LargeScreenUtils;
import java.util.Objects;
@@ -44,6 +45,7 @@
private TextView mCarrierText;
private ImageView mMobileSignal;
private ImageView mMobileRoaming;
+ private ModernShadeCarrierGroupMobileView mModernMobileView;
private View mSpacer;
@Nullable
private CellSignalState mLastSignalState;
@@ -77,6 +79,23 @@
updateResources();
}
+ /** Removes a ModernStatusBarMobileView from the ViewGroup. */
+ public void removeModernMobileView() {
+ if (mModernMobileView != null) {
+ removeView(mModernMobileView);
+ mModernMobileView = null;
+ }
+ }
+
+ /** Adds a ModernStatusBarMobileView to the ViewGroup. */
+ public void addModernMobileView(ModernShadeCarrierGroupMobileView mobileView) {
+ mModernMobileView = mobileView;
+ mMobileGroup.setVisibility(View.GONE);
+ mSpacer.setVisibility(View.GONE);
+ mCarrierText.setVisibility(View.GONE);
+ addView(mobileView);
+ }
+
/**
* Update the state of this view
* @param state the current state of the signal for this view
diff --git a/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrierGroupController.java b/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrierGroupController.java
index ad49b26..98d8a53 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrierGroupController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/carrier/ShadeCarrierGroupController.java
@@ -16,6 +16,7 @@
package com.android.systemui.shade.carrier;
+import static android.telephony.SubscriptionManager.INVALID_SIM_SLOT_INDEX;
import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES;
import android.annotation.MainThread;
@@ -46,8 +47,17 @@
import com.android.systemui.statusbar.connectivity.MobileDataIndicators;
import com.android.systemui.statusbar.connectivity.NetworkController;
import com.android.systemui.statusbar.connectivity.SignalCallback;
+import com.android.systemui.statusbar.connectivity.ui.MobileContextProvider;
+import com.android.systemui.statusbar.phone.StatusBarLocation;
+import com.android.systemui.statusbar.pipeline.StatusBarPipelineFlags;
+import com.android.systemui.statusbar.pipeline.mobile.ui.MobileUiAdapter;
+import com.android.systemui.statusbar.pipeline.mobile.ui.binder.MobileIconsBinder;
+import com.android.systemui.statusbar.pipeline.mobile.ui.view.ModernShadeCarrierGroupMobileView;
+import com.android.systemui.statusbar.pipeline.mobile.ui.viewmodel.MobileIconsViewModel;
+import com.android.systemui.statusbar.pipeline.mobile.ui.viewmodel.ShadeCarrierGroupMobileIconViewModel;
import com.android.systemui.util.CarrierConfigTracker;
+import java.util.List;
import java.util.function.Consumer;
import javax.inject.Inject;
@@ -62,12 +72,16 @@
private final ActivityStarter mActivityStarter;
private final Handler mBgHandler;
+ private final Context mContext;
private final NetworkController mNetworkController;
private final CarrierTextManager mCarrierTextManager;
private final TextView mNoSimTextView;
// Non final for testing
private H mMainHandler;
private final Callback mCallback;
+ private final MobileIconsViewModel mMobileIconsViewModel;
+ private final MobileContextProvider mMobileContextProvider;
+ private final StatusBarPipelineFlags mStatusBarPipelineFlags;
private boolean mListening;
private final CellSignalState[] mInfos =
new CellSignalState[SIM_SLOTS];
@@ -91,7 +105,7 @@
Log.w(TAG, "setMobileDataIndicators - slot: " + slotIndex);
return;
}
- if (slotIndex == SubscriptionManager.INVALID_SIM_SLOT_INDEX) {
+ if (slotIndex == INVALID_SIM_SLOT_INDEX) {
Log.e(TAG, "Invalid SIM slot index for subscription: " + indicators.subId);
return;
}
@@ -129,15 +143,25 @@
}
}
- private ShadeCarrierGroupController(ShadeCarrierGroup view, ActivityStarter activityStarter,
- @Background Handler bgHandler, @Main Looper mainLooper,
+ private ShadeCarrierGroupController(
+ ShadeCarrierGroup view,
+ ActivityStarter activityStarter,
+ @Background Handler bgHandler,
+ @Main Looper mainLooper,
NetworkController networkController,
- CarrierTextManager.Builder carrierTextManagerBuilder, Context context,
- CarrierConfigTracker carrierConfigTracker, SlotIndexResolver slotIndexResolver) {
-
+ CarrierTextManager.Builder carrierTextManagerBuilder,
+ Context context,
+ CarrierConfigTracker carrierConfigTracker,
+ SlotIndexResolver slotIndexResolver,
+ MobileUiAdapter mobileUiAdapter,
+ MobileContextProvider mobileContextProvider,
+ StatusBarPipelineFlags statusBarPipelineFlags
+ ) {
+ mContext = context;
mActivityStarter = activityStarter;
mBgHandler = bgHandler;
mNetworkController = networkController;
+ mStatusBarPipelineFlags = statusBarPipelineFlags;
mCarrierTextManager = carrierTextManagerBuilder
.setShowAirplaneMode(false)
.setShowMissingSim(false)
@@ -162,6 +186,14 @@
mCarrierGroups[1] = view.getCarrier2View();
mCarrierGroups[2] = view.getCarrier3View();
+ mMobileContextProvider = mobileContextProvider;
+ mMobileIconsViewModel = mobileUiAdapter.getMobileIconsViewModel();
+
+ if (mStatusBarPipelineFlags.useNewShadeCarrierGroupMobileIcons()) {
+ mobileUiAdapter.setShadeCarrierGroupController(this);
+ MobileIconsBinder.bind(view, mMobileIconsViewModel);
+ }
+
mCarrierDividers[0] = view.getCarrierDivider1();
mCarrierDividers[1] = view.getCarrierDivider2();
@@ -193,6 +225,50 @@
});
}
+ /** Updates the number of visible mobile icons using the new pipeline. */
+ public void updateModernMobileIcons(List<Integer> subIds) {
+ if (!mStatusBarPipelineFlags.useNewShadeCarrierGroupMobileIcons()) {
+ Log.d(TAG, "ignoring new pipeline callback because new mobile icon is disabled");
+ return;
+ }
+
+ for (ShadeCarrier carrier : mCarrierGroups) {
+ carrier.removeModernMobileView();
+ }
+
+ List<IconData> iconDataList = processSubIdList(subIds);
+
+ for (IconData iconData : iconDataList) {
+ ShadeCarrier carrier = mCarrierGroups[iconData.slotIndex];
+
+ Context mobileContext =
+ mMobileContextProvider.getMobileContextForSub(iconData.subId, mContext);
+ ModernShadeCarrierGroupMobileView modernMobileView = ModernShadeCarrierGroupMobileView
+ .constructAndBind(
+ mobileContext,
+ mMobileIconsViewModel.getLogger(),
+ "mobile_carrier_shade_group",
+ (ShadeCarrierGroupMobileIconViewModel) mMobileIconsViewModel
+ .viewModelForSub(iconData.subId,
+ StatusBarLocation.SHADE_CARRIER_GROUP)
+ );
+ carrier.addModernMobileView(modernMobileView);
+ }
+ }
+
+ @VisibleForTesting
+ List<IconData> processSubIdList(List<Integer> subIds) {
+ return subIds
+ .stream()
+ .limit(SIM_SLOTS)
+ .map(subId -> new IconData(subId, getSlotIndex(subId)))
+ .filter(iconData ->
+ iconData.slotIndex < SIM_SLOTS
+ && iconData.slotIndex != INVALID_SIM_SLOT_INDEX
+ )
+ .toList();
+ }
+
@VisibleForTesting
protected int getSlotIndex(int subscriptionId) {
return mSlotIndexResolver.getSlotIndex(subscriptionId);
@@ -269,8 +345,12 @@
}
}
- for (int i = 0; i < SIM_SLOTS; i++) {
- mCarrierGroups[i].updateState(mInfos[i], singleCarrier);
+ if (mStatusBarPipelineFlags.useNewShadeCarrierGroupMobileIcons()) {
+ Log.d(TAG, "ignoring old pipeline callback because new mobile icon is enabled");
+ } else {
+ for (int i = 0; i < SIM_SLOTS; i++) {
+ mCarrierGroups[i].updateState(mInfos[i], singleCarrier);
+ }
}
mCarrierDividers[0].setVisibility(
@@ -306,7 +386,7 @@
Log.w(TAG, "updateInfoCarrier - slot: " + slot);
continue;
}
- if (slot == SubscriptionManager.INVALID_SIM_SLOT_INDEX) {
+ if (slot == INVALID_SIM_SLOT_INDEX) {
Log.e(TAG,
"Invalid SIM slot index for subscription: "
+ info.subscriptionIds[i]);
@@ -385,12 +465,24 @@
private final Context mContext;
private final CarrierConfigTracker mCarrierConfigTracker;
private final SlotIndexResolver mSlotIndexResolver;
+ private final MobileUiAdapter mMobileUiAdapter;
+ private final MobileContextProvider mMobileContextProvider;
+ private final StatusBarPipelineFlags mStatusBarPipelineFlags;
@Inject
- public Builder(ActivityStarter activityStarter, @Background Handler handler,
- @Main Looper looper, NetworkController networkController,
- CarrierTextManager.Builder carrierTextControllerBuilder, Context context,
- CarrierConfigTracker carrierConfigTracker, SlotIndexResolver slotIndexResolver) {
+ public Builder(
+ ActivityStarter activityStarter,
+ @Background Handler handler,
+ @Main Looper looper,
+ NetworkController networkController,
+ CarrierTextManager.Builder carrierTextControllerBuilder,
+ Context context,
+ CarrierConfigTracker carrierConfigTracker,
+ SlotIndexResolver slotIndexResolver,
+ MobileUiAdapter mobileUiAdapter,
+ MobileContextProvider mobileContextProvider,
+ StatusBarPipelineFlags statusBarPipelineFlags
+ ) {
mActivityStarter = activityStarter;
mHandler = handler;
mLooper = looper;
@@ -399,6 +491,9 @@
mContext = context;
mCarrierConfigTracker = carrierConfigTracker;
mSlotIndexResolver = slotIndexResolver;
+ mMobileUiAdapter = mobileUiAdapter;
+ mMobileContextProvider = mobileContextProvider;
+ mStatusBarPipelineFlags = statusBarPipelineFlags;
}
public Builder setShadeCarrierGroup(ShadeCarrierGroup view) {
@@ -407,9 +502,20 @@
}
public ShadeCarrierGroupController build() {
- return new ShadeCarrierGroupController(mView, mActivityStarter, mHandler, mLooper,
- mNetworkController, mCarrierTextControllerBuilder, mContext,
- mCarrierConfigTracker, mSlotIndexResolver);
+ return new ShadeCarrierGroupController(
+ mView,
+ mActivityStarter,
+ mHandler,
+ mLooper,
+ mNetworkController,
+ mCarrierTextControllerBuilder,
+ mContext,
+ mCarrierConfigTracker,
+ mSlotIndexResolver,
+ mMobileUiAdapter,
+ mMobileContextProvider,
+ mStatusBarPipelineFlags
+ );
}
}
@@ -448,4 +554,15 @@
return SubscriptionManager.getSlotIndex(subscriptionId);
}
}
+
+ @VisibleForTesting
+ static class IconData {
+ public final int subId;
+ public final int slotIndex;
+
+ IconData(int subId, int slotIndex) {
+ this.subId = subId;
+ this.slotIndex = slotIndex;
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ActionClickLogger.kt b/packages/SystemUI/src/com/android/systemui/statusbar/ActionClickLogger.kt
index d3c19b7..5042f1b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ActionClickLogger.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ActionClickLogger.kt
@@ -31,56 +31,68 @@
) {
fun logInitialClick(
entry: NotificationEntry?,
+ index: Integer?,
pendingIntent: PendingIntent
) {
buffer.log(TAG, LogLevel.DEBUG, {
str1 = entry?.key
str2 = entry?.ranking?.channel?.id
- str3 = pendingIntent.intent.toString()
+ str3 = pendingIntent.toString()
+ int1 = index?.toInt() ?: Int.MIN_VALUE
}, {
- "ACTION CLICK $str1 (channel=$str2) for pending intent $str3"
+ "ACTION CLICK $str1 (channel=$str2) for pending intent $str3 at index $int1"
})
}
fun logRemoteInputWasHandled(
- entry: NotificationEntry?
+ entry: NotificationEntry?,
+ index: Int?
) {
buffer.log(TAG, LogLevel.DEBUG, {
str1 = entry?.key
+ int1 = index ?: Int.MIN_VALUE
}, {
- " [Action click] Triggered remote input (for $str1))"
+ " [Action click] Triggered remote input (for $str1) at index $int1"
})
}
fun logStartingIntentWithDefaultHandler(
entry: NotificationEntry?,
- pendingIntent: PendingIntent
+ pendingIntent: PendingIntent,
+ index: Int?
) {
buffer.log(TAG, LogLevel.DEBUG, {
str1 = entry?.key
- str2 = pendingIntent.intent.toString()
+ str2 = pendingIntent.toString()
+ int1 = index ?: Int.MIN_VALUE
}, {
- " [Action click] Launching intent $str2 via default handler (for $str1)"
+ " [Action click] Launching intent $str2 via default handler (for $str1 at index $int1)"
})
}
fun logWaitingToCloseKeyguard(
- pendingIntent: PendingIntent
+ pendingIntent: PendingIntent,
+ index: Int?
) {
buffer.log(TAG, LogLevel.DEBUG, {
- str1 = pendingIntent.intent.toString()
+ str1 = pendingIntent.toString()
+ int1 = index ?: Int.MIN_VALUE
}, {
- " [Action click] Intent $str1 launches an activity, dismissing keyguard first..."
+ " [Action click] Intent $str1 at index $int1 launches an activity, dismissing " +
+ "keyguard first..."
})
}
fun logKeyguardGone(
- pendingIntent: PendingIntent
+ pendingIntent: PendingIntent,
+ index: Int?
) {
buffer.log(TAG, LogLevel.DEBUG, {
- str1 = pendingIntent.intent.toString()
+ str1 = pendingIntent.toString()
+ int1 = index ?: Int.MIN_VALUE
}, {
- " [Action click] Keyguard dismissed, calling default handler for intent $str1"
+ " [Action click] Keyguard dismissed, calling default handler for intent $str1 at " +
+ "index $int1"
})
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationClickNotifier.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationClickNotifier.kt
index abf81c5..692a997 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationClickNotifier.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationClickNotifier.kt
@@ -2,10 +2,12 @@
import android.app.Notification
import android.os.RemoteException
+import android.util.Log
import com.android.internal.statusbar.IStatusBarService
import com.android.internal.statusbar.NotificationVisibility
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
+import com.android.systemui.dagger.qualifiers.UiBackground
import com.android.systemui.util.Assert
import java.util.concurrent.Executor
import javax.inject.Inject
@@ -21,7 +23,8 @@
@SysUISingleton
public class NotificationClickNotifier @Inject constructor(
val barService: IStatusBarService,
- @Main val mainExecutor: Executor
+ @Main val mainExecutor: Executor,
+ @UiBackground val backgroundExecutor: Executor
) {
val listeners = mutableListOf<NotificationInteractionListener>()
@@ -48,13 +51,14 @@
visibility: NotificationVisibility,
generatedByAssistant: Boolean
) {
- try {
- barService.onNotificationActionClick(
- key, actionIndex, action, visibility, generatedByAssistant)
- } catch (e: RemoteException) {
- // nothing
+ backgroundExecutor.execute {
+ try {
+ barService.onNotificationActionClick(
+ key, actionIndex, action, visibility, generatedByAssistant)
+ } catch (e: RemoteException) {
+ // nothing
+ }
}
-
mainExecutor.execute {
notifyListenersAboutInteraction(key)
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
index da84afe..8089fd9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
@@ -119,11 +119,14 @@
mPowerInteractor.wakeUpIfDozing(
"NOTIFICATION_CLICK", PowerManager.WAKE_REASON_GESTURE);
+ Integer actionIndex = (Integer)
+ view.getTag(com.android.internal.R.id.notification_action_index_tag);
+
final NotificationEntry entry = getNotificationForParent(view.getParent());
- mLogger.logInitialClick(entry, pendingIntent);
+ mLogger.logInitialClick(entry, actionIndex, pendingIntent);
if (handleRemoteInput(view, pendingIntent)) {
- mLogger.logRemoteInputWasHandled(entry);
+ mLogger.logRemoteInputWasHandled(entry, actionIndex);
return true;
}
@@ -141,9 +144,9 @@
}
Notification.Action action = getActionFromView(view, entry, pendingIntent);
return mCallback.handleRemoteViewClick(view, pendingIntent,
- action == null ? false : action.isAuthenticationRequired(), () -> {
+ action == null ? false : action.isAuthenticationRequired(), actionIndex, () -> {
Pair<Intent, ActivityOptions> options = response.getLaunchOptions(view);
- mLogger.logStartingIntentWithDefaultHandler(entry, pendingIntent);
+ mLogger.logStartingIntentWithDefaultHandler(entry, pendingIntent, actionIndex);
boolean started = RemoteViews.startPendingIntent(view, pendingIntent, options);
if (started) releaseNotificationIfKeptForRemoteInputHistory(entry);
return started;
@@ -692,11 +695,13 @@
* @param view
* @param pendingIntent
* @param appRequestedAuth
+ * @param actionIndex
* @param defaultHandler
* @return true iff the click was handled
*/
boolean handleRemoteViewClick(View view, PendingIntent pendingIntent,
- boolean appRequestedAuth, ClickHandler defaultHandler);
+ boolean appRequestedAuth, @Nullable Integer actionIndex,
+ ClickHandler defaultHandler);
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java
index d6a14604..6dd24ea 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarStateControllerImpl.java
@@ -48,8 +48,10 @@
import com.android.internal.jank.InteractionJankMonitor;
import com.android.internal.jank.InteractionJankMonitor.Configuration;
import com.android.internal.logging.UiEventLogger;
+import com.android.keyguard.KeyguardClockSwitch;
import com.android.systemui.DejankUtils;
import com.android.systemui.Dumpable;
+import com.android.systemui.R;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
@@ -420,6 +422,25 @@
}
}
+ /** Returns the id of the currently rendering clock */
+ public String getClockId() {
+ if (mView == null) {
+ return KeyguardClockSwitch.MISSING_CLOCK_ID;
+ }
+
+ View clockSwitch = mView.findViewById(R.id.keyguard_clock_container);
+ if (clockSwitch == null) {
+ Log.e(TAG, "Clock container was missing");
+ return KeyguardClockSwitch.MISSING_CLOCK_ID;
+ }
+ if (!(clockSwitch instanceof KeyguardClockSwitch)) {
+ Log.e(TAG, "Clock container was incorrect type: " + clockSwitch);
+ return KeyguardClockSwitch.MISSING_CLOCK_ID;
+ }
+
+ return ((KeyguardClockSwitch) clockSwitch).getClockId();
+ }
+
private void beginInteractionJankMonitor() {
final boolean shouldPost =
(mIsDozing && mDozeAmount == 0) || (!mIsDozing && mDozeAmount == 1);
@@ -429,6 +450,7 @@
Choreographer.CALLBACK_ANIMATION, this::beginInteractionJankMonitor, null);
} else {
Configuration.Builder builder = Configuration.Builder.withView(getCujType(), mView)
+ .setTag(getClockId())
.setDeferMonitorForAnimationStart(false);
mInteractionJankMonitor.begin(builder);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt
index 6346111..d667b91 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt
@@ -388,7 +388,10 @@
})
ssView.setFalsingManager(falsingManager)
ssView.setKeyguardBypassEnabled(bypassController.bypassEnabled)
- return (ssView as View).apply { addOnAttachStateChangeListener(stateChangeListener) }
+ return (ssView as View).apply {
+ setTag(R.id.tag_smartspace_view, Any())
+ addOnAttachStateChangeListener(stateChangeListener)
+ }
}
private fun connectSession() {
@@ -451,12 +454,6 @@
session?.requestSmartspaceUpdate()
}
- fun removeViewsFromParent(viewGroup: ViewGroup) {
- smartspaceViews.toList().forEach {
- viewGroup.removeView(it as View)
- }
- }
-
/**
* Disconnects the smartspace view from the smartspace service and cleans up any resources.
*/
@@ -597,3 +594,4 @@
}
}
}
+
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/OWNERS b/packages/SystemUI/src/com/android/systemui/statusbar/notification/OWNERS
index ed80f33..5558ab1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/OWNERS
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/OWNERS
@@ -2,13 +2,17 @@
# Bug component: 78010
-aaliomer@google.com
+aioana@google.com
aroederer@google.com
+iyz@google.com
jeffdq@google.com
juliacr@google.com
juliatuttle@google.com
+kurucz@google.com
+liuyining@google.com
lynhan@google.com
-steell@google.com
+matiashe@google.com
+valiiftime@google.com
yurilin@google.com
per-file MediaNotificationProcessor.java = ethibodeau@google.com, asc@google.com
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinator.kt
index 5c2f9a8..62a0d13 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinator.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinator.kt
@@ -39,10 +39,7 @@
override fun attach(pipeline: NotifPipeline) {
pipeline.addOnAfterRenderListListener(::onAfterRenderList)
- // TODO(b/282865576): This has an issue where it makes changes to some groups without
- // notifying listeners. To be fixed in QPR, but for now let's comment it out to avoid the
- // group expansion bug.
- // groupExpansionManagerImpl.attach(pipeline)
+ groupExpansionManagerImpl.attach(pipeline)
}
fun onAfterRenderList(entries: List<ListEntry>, controller: NotifStackController) =
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/GroupExpansionManagerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/GroupExpansionManagerImpl.java
index 46af03a..5d33804 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/GroupExpansionManagerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/GroupExpansionManagerImpl.java
@@ -67,18 +67,29 @@
* Cleanup entries from mExpandedGroups that no longer exist in the pipeline.
*/
private final OnBeforeRenderListListener mNotifTracker = (entries) -> {
+ if (mExpandedGroups.isEmpty()) {
+ return; // nothing to do
+ }
+
final Set<NotificationEntry> renderingSummaries = new HashSet<>();
for (ListEntry entry : entries) {
if (entry instanceof GroupEntry) {
renderingSummaries.add(entry.getRepresentativeEntry());
}
}
- mExpandedGroups.removeIf(expandedGroup -> !renderingSummaries.contains(expandedGroup));
+
+ // Create a copy of mExpandedGroups so we can modify it in a thread-safe way.
+ final var currentExpandedGroups = new HashSet<>(mExpandedGroups);
+ for (NotificationEntry entry : currentExpandedGroups) {
+ setExpanded(entry, renderingSummaries.contains(entry));
+ }
};
public void attach(NotifPipeline pipeline) {
- mDumpManager.registerDumpable(this);
- pipeline.addOnBeforeRenderListListener(mNotifTracker);
+ if (mFeatureFlags.isEnabled(Flags.NOTIFICATION_GROUP_EXPANSION_CHANGE)) {
+ mDumpManager.registerDumpable(this);
+ pipeline.addOnBeforeRenderListListener(mNotifTracker);
+ }
}
@Override
@@ -94,11 +105,24 @@
@Override
public void setGroupExpanded(NotificationEntry entry, boolean expanded) {
final NotificationEntry groupSummary = mGroupMembershipManager.getGroupSummary(entry);
+ setExpanded(groupSummary, expanded);
+ }
+
+ /**
+ * Add or remove {@code entry} to/from {@code mExpandedGroups} and notify listeners if
+ * something changed. This assumes that {@code entry} is a group summary.
+ * <p>
+ * TODO(b/293434635): Currently, in spite of its docs,
+ * {@code mGroupMembershipManager.getGroupSummary(entry)} returns null if {@code entry} is
+ * already a summary. Instead of needing this helper method to bypass that, we probably want to
+ * move this code back to {@code setGroupExpanded} and use that everywhere.
+ */
+ private void setExpanded(NotificationEntry entry, boolean expanded) {
boolean changed;
if (expanded) {
- changed = mExpandedGroups.add(groupSummary);
+ changed = mExpandedGroups.add(entry);
} else {
- changed = mExpandedGroups.remove(groupSummary);
+ changed = mExpandedGroups.remove(entry);
}
// Only notify listeners if something changed.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconAreaControllerViewBinderWrapperImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconAreaControllerViewBinderWrapperImpl.kt
new file mode 100644
index 0000000..26dfe3e
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconAreaControllerViewBinderWrapperImpl.kt
@@ -0,0 +1,684 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.statusbar.notification.icon.ui.viewbinder
+
+import android.content.Context
+import android.graphics.Color
+import android.graphics.Rect
+import android.os.Bundle
+import android.os.Trace
+import android.view.LayoutInflater
+import android.view.View
+import android.widget.FrameLayout
+import androidx.annotation.ColorInt
+import androidx.annotation.VisibleForTesting
+import androidx.collection.ArrayMap
+import com.android.app.animation.Interpolators
+import com.android.internal.statusbar.StatusBarIcon
+import com.android.internal.util.ContrastColorUtil
+import com.android.settingslib.Utils
+import com.android.systemui.R
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.demomode.DemoMode
+import com.android.systemui.demomode.DemoModeController
+import com.android.systemui.flags.FeatureFlags
+import com.android.systemui.flags.Flags
+import com.android.systemui.flags.ViewRefactorFlag
+import com.android.systemui.plugins.DarkIconDispatcher
+import com.android.systemui.plugins.statusbar.StatusBarStateController
+import com.android.systemui.statusbar.CrossFadeHelper
+import com.android.systemui.statusbar.NotificationListener
+import com.android.systemui.statusbar.NotificationMediaManager
+import com.android.systemui.statusbar.NotificationShelfController
+import com.android.systemui.statusbar.StatusBarIconView
+import com.android.systemui.statusbar.StatusBarState
+import com.android.systemui.statusbar.notification.NotificationUtils
+import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator
+import com.android.systemui.statusbar.notification.collection.ListEntry
+import com.android.systemui.statusbar.notification.collection.NotificationEntry
+import com.android.systemui.statusbar.notification.collection.provider.SectionStyleProvider
+import com.android.systemui.statusbar.notification.icon.ui.viewmodel.NotificationIconContainerAlwaysOnDisplayViewModel
+import com.android.systemui.statusbar.notification.icon.ui.viewmodel.NotificationIconContainerShelfViewModel
+import com.android.systemui.statusbar.notification.icon.ui.viewmodel.NotificationIconContainerStatusBarViewModel
+import com.android.systemui.statusbar.notification.shelf.ui.viewbinder.NotificationShelfViewBinderWrapperControllerImpl
+import com.android.systemui.statusbar.phone.DozeParameters
+import com.android.systemui.statusbar.phone.KeyguardBypassController
+import com.android.systemui.statusbar.phone.NotificationIconAreaController
+import com.android.systemui.statusbar.phone.NotificationIconContainer
+import com.android.systemui.statusbar.phone.ScreenOffAnimationController
+import com.android.systemui.statusbar.window.StatusBarWindowController
+import com.android.wm.shell.bubbles.Bubbles
+import java.util.Optional
+import java.util.function.Function
+import javax.inject.Inject
+import kotlinx.coroutines.DisposableHandle
+
+/**
+ * Controller class for [NotificationIconContainer]. This implementation serves as a temporary
+ * wrapper around [NotificationIconContainerViewBinder], so that external code can continue to
+ * depend on the [NotificationIconAreaController] interface. Once
+ * [LegacyNotificationIconAreaControllerImpl] is removed, this class can go away and the ViewBinder
+ * can be used directly.
+ */
+@SysUISingleton
+class NotificationIconAreaControllerViewBinderWrapperImpl
+@Inject
+constructor(
+ private val context: Context,
+ private val statusBarStateController: StatusBarStateController,
+ private val wakeUpCoordinator: NotificationWakeUpCoordinator,
+ private val bypassController: KeyguardBypassController,
+ private val mediaManager: NotificationMediaManager,
+ notificationListener: NotificationListener,
+ private val dozeParameters: DozeParameters,
+ private val sectionStyleProvider: SectionStyleProvider,
+ private val bubblesOptional: Optional<Bubbles>,
+ demoModeController: DemoModeController,
+ darkIconDispatcher: DarkIconDispatcher,
+ featureFlags: FeatureFlags,
+ private val statusBarWindowController: StatusBarWindowController,
+ private val screenOffAnimationController: ScreenOffAnimationController,
+ private val shelfIconsViewModel: NotificationIconContainerShelfViewModel,
+ private val statusBarIconsViewModel: NotificationIconContainerStatusBarViewModel,
+ private val aodIconsViewModel: NotificationIconContainerAlwaysOnDisplayViewModel,
+) :
+ NotificationIconAreaController,
+ DarkIconDispatcher.DarkReceiver,
+ StatusBarStateController.StateListener,
+ NotificationWakeUpCoordinator.WakeUpListener,
+ DemoMode {
+
+ private val contrastColorUtil: ContrastColorUtil = ContrastColorUtil.getInstance(context)
+ private val updateStatusBarIcons = Runnable { updateStatusBarIcons() }
+ private val shelfRefactor = ViewRefactorFlag(featureFlags, Flags.NOTIFICATION_SHELF_REFACTOR)
+ private val tintAreas = ArrayList<Rect>()
+
+ private var iconSize = 0
+ private var iconHPadding = 0
+ private var iconTint = Color.WHITE
+ private var notificationEntries = listOf<ListEntry>()
+ private var notificationIconArea: View? = null
+ private var notificationIcons: NotificationIconContainer? = null
+ private var shelfIcons: NotificationIconContainer? = null
+ private var aodIcons: NotificationIconContainer? = null
+ private var aodBindJob: DisposableHandle? = null
+ private var aodIconAppearTranslation = 0
+ private var animationsEnabled = false
+ private var aodIconTint = 0
+ private var aodIconsVisible = false
+ private var showLowPriority = true
+
+ @VisibleForTesting
+ val settingsListener: NotificationListener.NotificationSettingsListener =
+ object : NotificationListener.NotificationSettingsListener {
+ override fun onStatusBarIconsBehaviorChanged(hideSilentStatusIcons: Boolean) {
+ showLowPriority = !hideSilentStatusIcons
+ updateStatusBarIcons()
+ }
+ }
+
+ init {
+ statusBarStateController.addCallback(this)
+ wakeUpCoordinator.addListener(this)
+ demoModeController.addCallback(this)
+ notificationListener.addNotificationSettingsListener(settingsListener)
+ initializeNotificationAreaViews(context)
+ reloadAodColor()
+ darkIconDispatcher.addDarkReceiver(this)
+ }
+
+ @VisibleForTesting
+ fun shouldShowLowPriorityIcons(): Boolean {
+ return showLowPriority
+ }
+
+ /** Called by the Keyguard*ViewController whose view contains the aod icons. */
+ override fun setupAodIcons(aodIcons: NotificationIconContainer) {
+ val changed = this.aodIcons != null && aodIcons !== this.aodIcons
+ if (changed) {
+ this.aodIcons!!.setAnimationsEnabled(false)
+ this.aodIcons!!.removeAllViews()
+ aodBindJob?.dispose()
+ }
+ this.aodIcons = aodIcons
+ this.aodIcons!!.setOnLockScreen(true)
+ aodBindJob = NotificationIconContainerViewBinder.bind(aodIcons, aodIconsViewModel)
+ updateAodIconsVisibility(animate = false, forceUpdate = changed)
+ updateAnimations()
+ if (changed) {
+ updateAodNotificationIcons()
+ }
+ updateIconLayoutParams(context)
+ }
+
+ override fun setupShelf(notificationShelfController: NotificationShelfController) =
+ NotificationShelfViewBinderWrapperControllerImpl.unsupported
+
+ override fun setShelfIcons(icons: NotificationIconContainer) {
+ if (shelfRefactor.expectEnabled()) {
+ NotificationIconContainerViewBinder.bind(icons, shelfIconsViewModel)
+ shelfIcons = icons
+ }
+ }
+
+ override fun onDensityOrFontScaleChanged(context: Context) {
+ updateIconLayoutParams(context)
+ }
+
+ /** Returns the view that represents the notification area. */
+ override fun getNotificationInnerAreaView(): View? {
+ return notificationIconArea
+ }
+
+ /**
+ * See [com.android.systemui.statusbar.policy.DarkIconDispatcher.setIconsDarkArea]. Sets the
+ * color that should be used to tint any icons in the notification area.
+ *
+ * @param tintAreas the areas in which to tint the icons, specified in screen coordinates
+ * @param darkIntensity
+ */
+ override fun onDarkChanged(tintAreas: ArrayList<Rect>, darkIntensity: Float, iconTint: Int) {
+ this.tintAreas.clear()
+ this.tintAreas.addAll(tintAreas)
+ if (DarkIconDispatcher.isInAreas(tintAreas, notificationIconArea)) {
+ this.iconTint = iconTint
+ }
+ applyNotificationIconsTint()
+ }
+
+ /** Updates the notifications with the given list of notifications to display. */
+ override fun updateNotificationIcons(entries: List<ListEntry>) {
+ notificationEntries = entries
+ updateNotificationIcons()
+ }
+
+ private fun updateStatusBarIcons() {
+ updateIconsForLayout(
+ { entry: NotificationEntry -> entry.icons.statusBarIcon },
+ notificationIcons,
+ showAmbient = false /* showAmbient */,
+ showLowPriority = showLowPriority,
+ hideDismissed = true /* hideDismissed */,
+ hideRepliedMessages = true /* hideRepliedMessages */,
+ hideCurrentMedia = false /* hideCurrentMedia */,
+ hidePulsing = false /* hidePulsing */
+ )
+ }
+
+ override fun updateAodNotificationIcons() {
+ if (aodIcons == null) {
+ return
+ }
+ updateIconsForLayout(
+ { entry: NotificationEntry -> entry.icons.aodIcon },
+ aodIcons,
+ showAmbient = false /* showAmbient */,
+ showLowPriority = true /* showLowPriority */,
+ hideDismissed = true /* hideDismissed */,
+ hideRepliedMessages = true /* hideRepliedMessages */,
+ hideCurrentMedia = true /* hideCurrentMedia */,
+ hidePulsing = bypassController.bypassEnabled /* hidePulsing */
+ )
+ }
+
+ override fun showIconIsolated(icon: StatusBarIconView?, animated: Boolean) {
+ notificationIcons!!.showIconIsolated(icon, animated)
+ }
+
+ override fun setIsolatedIconLocation(iconDrawingRect: Rect, requireStateUpdate: Boolean) {
+ notificationIcons!!.setIsolatedIconLocation(iconDrawingRect, requireStateUpdate)
+ }
+
+ override fun onDozingChanged(isDozing: Boolean) {
+ if (aodIcons == null) {
+ return
+ }
+ val animate = (dozeParameters.alwaysOn && !dozeParameters.displayNeedsBlanking)
+ aodIcons!!.setDozing(isDozing, animate, 0)
+ }
+
+ override fun setAnimationsEnabled(enabled: Boolean) {
+ animationsEnabled = enabled
+ updateAnimations()
+ }
+
+ override fun onStateChanged(newState: Int) {
+ updateAodIconsVisibility(animate = false, forceUpdate = false)
+ updateAnimations()
+ }
+
+ override fun onThemeChanged() {
+ reloadAodColor()
+ updateAodIconColors()
+ }
+
+ override fun getHeight(): Int {
+ return if (aodIcons == null) 0 else aodIcons!!.height
+ }
+
+ @VisibleForTesting
+ fun appearAodIcons() {
+ if (aodIcons == null) {
+ return
+ }
+ if (screenOffAnimationController.shouldAnimateAodIcons()) {
+ aodIcons!!.translationY = -aodIconAppearTranslation.toFloat()
+ aodIcons!!.alpha = 0f
+ animateInAodIconTranslation()
+ aodIcons!!
+ .animate()
+ .alpha(1f)
+ .setInterpolator(Interpolators.LINEAR)
+ .setDuration(AOD_ICONS_APPEAR_DURATION)
+ .start()
+ } else {
+ aodIcons!!.alpha = 1.0f
+ aodIcons!!.translationY = 0f
+ }
+ }
+
+ override fun onFullyHiddenChanged(isFullyHidden: Boolean) {
+ var animate = true
+ if (!bypassController.bypassEnabled) {
+ animate = dozeParameters.alwaysOn && !dozeParameters.displayNeedsBlanking
+ // We only want the appear animations to happen when the notifications get fully hidden,
+ // since otherwise the unhide animation overlaps
+ animate = animate and isFullyHidden
+ }
+ updateAodIconsVisibility(animate, false /* force */)
+ updateAodNotificationIcons()
+ updateAodIconColors()
+ }
+
+ override fun onPulseExpansionChanged(expandingChanged: Boolean) {
+ if (expandingChanged) {
+ updateAodIconsVisibility(animate = true, forceUpdate = false)
+ }
+ }
+
+ override fun demoCommands(): List<String> {
+ val commands = ArrayList<String>()
+ commands.add(DemoMode.COMMAND_NOTIFICATIONS)
+ return commands
+ }
+
+ override fun dispatchDemoCommand(command: String, args: Bundle) {
+ if (notificationIconArea != null) {
+ val visible = args.getString("visible")
+ val vis = if ("false" == visible) View.INVISIBLE else View.VISIBLE
+ notificationIconArea?.visibility = vis
+ }
+ }
+
+ override fun onDemoModeFinished() {
+ if (notificationIconArea != null) {
+ notificationIconArea?.visibility = View.VISIBLE
+ }
+ }
+
+ private fun inflateIconArea(inflater: LayoutInflater): View {
+ return inflater.inflate(R.layout.notification_icon_area, null)
+ }
+
+ /** Initializes the views that will represent the notification area. */
+ private fun initializeNotificationAreaViews(context: Context) {
+ reloadDimens(context)
+ val layoutInflater = LayoutInflater.from(context)
+ notificationIconArea = inflateIconArea(layoutInflater)
+ notificationIcons = notificationIconArea?.findViewById(R.id.notificationIcons)
+ NotificationIconContainerViewBinder.bind(notificationIcons!!, statusBarIconsViewModel)
+ }
+
+ private fun updateIconLayoutParams(context: Context) {
+ reloadDimens(context)
+ val params = generateIconLayoutParams()
+ for (i in 0 until notificationIcons!!.childCount) {
+ val child = notificationIcons!!.getChildAt(i)
+ child.layoutParams = params
+ }
+ if (shelfIcons != null) {
+ for (i in 0 until shelfIcons!!.childCount) {
+ val child = shelfIcons!!.getChildAt(i)
+ child.layoutParams = params
+ }
+ }
+ if (aodIcons != null) {
+ for (i in 0 until aodIcons!!.childCount) {
+ val child = aodIcons!!.getChildAt(i)
+ child.layoutParams = params
+ }
+ }
+ }
+
+ private fun generateIconLayoutParams(): FrameLayout.LayoutParams {
+ return FrameLayout.LayoutParams(
+ iconSize + 2 * iconHPadding,
+ statusBarWindowController.statusBarHeight
+ )
+ }
+
+ private fun reloadDimens(context: Context) {
+ val res = context.resources
+ iconSize = res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_icon_size_sp)
+ iconHPadding = res.getDimensionPixelSize(R.dimen.status_bar_icon_horizontal_margin)
+ aodIconAppearTranslation = res.getDimensionPixelSize(R.dimen.shelf_appear_translation)
+ }
+
+ private fun shouldShowNotificationIcon(
+ entry: NotificationEntry,
+ showAmbient: Boolean,
+ showLowPriority: Boolean,
+ hideDismissed: Boolean,
+ hideRepliedMessages: Boolean,
+ hideCurrentMedia: Boolean,
+ hidePulsing: Boolean
+ ): Boolean {
+ if (!showAmbient && sectionStyleProvider.isMinimized(entry)) {
+ return false
+ }
+ if (hideCurrentMedia && entry.key == mediaManager.mediaNotificationKey) {
+ return false
+ }
+ if (!showLowPriority && sectionStyleProvider.isSilent(entry)) {
+ return false
+ }
+ if (entry.isRowDismissed && hideDismissed) {
+ return false
+ }
+ if (hideRepliedMessages && entry.isLastMessageFromReply) {
+ return false
+ }
+ // showAmbient == show in shade but not shelf
+ if (!showAmbient && entry.shouldSuppressStatusBar()) {
+ return false
+ }
+ if (
+ hidePulsing &&
+ entry.showingPulsing() &&
+ (!wakeUpCoordinator.notificationsFullyHidden || !entry.isPulseSuppressed)
+ ) {
+ return false
+ }
+ return if (bubblesOptional.isPresent && bubblesOptional.get().isBubbleExpanded(entry.key)) {
+ false
+ } else true
+ }
+
+ private fun updateNotificationIcons() {
+ Trace.beginSection("NotificationIconAreaController.updateNotificationIcons")
+ updateStatusBarIcons()
+ updateShelfIcons()
+ updateAodNotificationIcons()
+ applyNotificationIconsTint()
+ Trace.endSection()
+ }
+
+ private fun updateShelfIcons() {
+ if (shelfIcons == null) {
+ return
+ }
+ updateIconsForLayout(
+ { entry: NotificationEntry -> entry.icons.shelfIcon },
+ shelfIcons,
+ showAmbient = true,
+ showLowPriority = true,
+ hideDismissed = false,
+ hideRepliedMessages = false,
+ hideCurrentMedia = false,
+ hidePulsing = false
+ )
+ }
+
+ /**
+ * Updates the notification icons for a host layout. This will ensure that the notification host
+ * layout will have the same icons like the ones in here.
+ *
+ * @param function A function to look up an icon view based on an entry
+ * @param hostLayout which layout should be updated
+ * @param showAmbient should ambient notification icons be shown
+ * @param showLowPriority should icons from silent notifications be shown
+ * @param hideDismissed should dismissed icons be hidden
+ * @param hideRepliedMessages should messages that have been replied to be hidden
+ * @param hidePulsing should pulsing notifications be hidden
+ */
+ private fun updateIconsForLayout(
+ function: Function<NotificationEntry, StatusBarIconView?>,
+ hostLayout: NotificationIconContainer?,
+ showAmbient: Boolean,
+ showLowPriority: Boolean,
+ hideDismissed: Boolean,
+ hideRepliedMessages: Boolean,
+ hideCurrentMedia: Boolean,
+ hidePulsing: Boolean,
+ ) {
+ val toShow = ArrayList<StatusBarIconView>(notificationEntries.size)
+ // Filter out ambient notifications and notification children.
+ for (i in notificationEntries.indices) {
+ val entry = notificationEntries[i].representativeEntry
+ if (entry != null && entry.row != null) {
+ if (
+ shouldShowNotificationIcon(
+ entry,
+ showAmbient,
+ showLowPriority,
+ hideDismissed,
+ hideRepliedMessages,
+ hideCurrentMedia,
+ hidePulsing
+ )
+ ) {
+ val iconView = function.apply(entry)
+ if (iconView != null) {
+ toShow.add(iconView)
+ }
+ }
+ }
+ }
+
+ // In case we are changing the suppression of a group, the replacement shouldn't flicker
+ // and it should just be replaced instead. We therefore look for notifications that were
+ // just replaced by the child or vice-versa to suppress this.
+ val replacingIcons = ArrayMap<String, ArrayList<StatusBarIcon>>()
+ val toRemove = ArrayList<View>()
+ for (i in 0 until hostLayout!!.childCount) {
+ val child = hostLayout.getChildAt(i) as? StatusBarIconView ?: continue
+ if (!toShow.contains(child)) {
+ var iconWasReplaced = false
+ val removedGroupKey = child.notification.groupKey
+ for (j in toShow.indices) {
+ val candidate = toShow[j]
+ if (
+ candidate.sourceIcon.sameAs(child.sourceIcon) &&
+ candidate.notification.groupKey == removedGroupKey
+ ) {
+ if (!iconWasReplaced) {
+ iconWasReplaced = true
+ } else {
+ iconWasReplaced = false
+ break
+ }
+ }
+ }
+ if (iconWasReplaced) {
+ var statusBarIcons = replacingIcons[removedGroupKey]
+ if (statusBarIcons == null) {
+ statusBarIcons = ArrayList()
+ replacingIcons[removedGroupKey] = statusBarIcons
+ }
+ statusBarIcons.add(child.statusBarIcon)
+ }
+ toRemove.add(child)
+ }
+ }
+ // removing all duplicates
+ val duplicates = ArrayList<String?>()
+ for (key in replacingIcons.keys) {
+ val statusBarIcons = replacingIcons[key]!!
+ if (statusBarIcons.size != 1) {
+ duplicates.add(key)
+ }
+ }
+ replacingIcons.removeAll(duplicates)
+ hostLayout.setReplacingIcons(replacingIcons)
+ val toRemoveCount = toRemove.size
+ for (i in 0 until toRemoveCount) {
+ hostLayout.removeView(toRemove[i])
+ }
+ val params = generateIconLayoutParams()
+ for (i in toShow.indices) {
+ val v = toShow[i]
+ // The view might still be transiently added if it was just removed and added again
+ hostLayout.removeTransientView(v)
+ if (v.parent == null) {
+ if (hideDismissed) {
+ v.setOnDismissListener(updateStatusBarIcons)
+ }
+ hostLayout.addView(v, i, params)
+ }
+ }
+ hostLayout.setChangingViewPositions(true)
+ // Re-sort notification icons
+ val childCount = hostLayout.childCount
+ for (i in 0 until childCount) {
+ val actual = hostLayout.getChildAt(i)
+ val expected = toShow[i]
+ if (actual === expected) {
+ continue
+ }
+ hostLayout.removeView(expected)
+ hostLayout.addView(expected, i)
+ }
+ hostLayout.setChangingViewPositions(false)
+ hostLayout.setReplacingIcons(null)
+ }
+
+ /** Applies [.mIconTint] to the notification icons. */
+ private fun applyNotificationIconsTint() {
+ for (i in 0 until notificationIcons!!.childCount) {
+ val iv = notificationIcons!!.getChildAt(i) as StatusBarIconView
+ if (iv.width != 0) {
+ updateTintForIcon(iv, iconTint)
+ } else {
+ iv.executeOnLayout { updateTintForIcon(iv, iconTint) }
+ }
+ }
+ updateAodIconColors()
+ }
+
+ private fun updateTintForIcon(v: StatusBarIconView, tint: Int) {
+ val isPreL = java.lang.Boolean.TRUE == v.getTag(R.id.icon_is_pre_L)
+ var color = StatusBarIconView.NO_COLOR
+ val colorize = !isPreL || NotificationUtils.isGrayscale(v, contrastColorUtil)
+ if (colorize) {
+ color = DarkIconDispatcher.getTint(tintAreas, v, tint)
+ }
+ v.staticDrawableColor = color
+ v.setDecorColor(tint)
+ }
+
+ private fun updateAnimations() {
+ val inShade = statusBarStateController.state == StatusBarState.SHADE
+ if (aodIcons != null) {
+ aodIcons!!.setAnimationsEnabled(animationsEnabled && !inShade)
+ }
+ notificationIcons!!.setAnimationsEnabled(animationsEnabled && inShade)
+ }
+
+ private fun animateInAodIconTranslation() {
+ aodIcons!!
+ .animate()
+ .setInterpolator(Interpolators.DECELERATE_QUINT)
+ .translationY(0f)
+ .setDuration(AOD_ICONS_APPEAR_DURATION)
+ .start()
+ }
+
+ private fun reloadAodColor() {
+ aodIconTint =
+ Utils.getColorAttrDefaultColor(
+ context,
+ R.attr.wallpaperTextColor,
+ DEFAULT_AOD_ICON_COLOR
+ )
+ }
+
+ private fun updateAodIconColors() {
+ if (aodIcons != null) {
+ for (i in 0 until aodIcons!!.childCount) {
+ val iv = aodIcons!!.getChildAt(i) as StatusBarIconView
+ if (iv.width != 0) {
+ updateTintForIcon(iv, aodIconTint)
+ } else {
+ iv.executeOnLayout { updateTintForIcon(iv, aodIconTint) }
+ }
+ }
+ }
+ }
+
+ private fun updateAodIconsVisibility(animate: Boolean, forceUpdate: Boolean) {
+ if (aodIcons == null) {
+ return
+ }
+ var visible = (bypassController.bypassEnabled || wakeUpCoordinator.notificationsFullyHidden)
+
+ // Hide the AOD icons if we're not in the KEYGUARD state unless the screen off animation is
+ // playing, in which case we want them to be visible since we're animating in the AOD UI and
+ // will be switching to KEYGUARD shortly.
+ if (
+ statusBarStateController.state != StatusBarState.KEYGUARD &&
+ !screenOffAnimationController.shouldShowAodIconsWhenShade()
+ ) {
+ visible = false
+ }
+ if (visible && wakeUpCoordinator.isPulseExpanding() && !bypassController.bypassEnabled) {
+ visible = false
+ }
+ if (aodIconsVisible != visible || forceUpdate) {
+ aodIconsVisible = visible
+ aodIcons!!.animate().cancel()
+ if (animate) {
+ val wasFullyInvisible = aodIcons!!.visibility != View.VISIBLE
+ if (aodIconsVisible) {
+ if (wasFullyInvisible) {
+ // No fading here, let's just appear the icons instead!
+ aodIcons!!.visibility = View.VISIBLE
+ aodIcons!!.alpha = 1.0f
+ appearAodIcons()
+ } else {
+ // Let's make sure the icon are translated to 0, since we cancelled it above
+ animateInAodIconTranslation()
+ // We were fading out, let's fade in instead
+ CrossFadeHelper.fadeIn(aodIcons)
+ }
+ } else {
+ // Let's make sure the icon are translated to 0, since we cancelled it above
+ animateInAodIconTranslation()
+ CrossFadeHelper.fadeOut(aodIcons)
+ }
+ } else {
+ aodIcons!!.alpha = 1.0f
+ aodIcons!!.translationY = 0f
+ aodIcons!!.visibility = if (visible) View.VISIBLE else View.INVISIBLE
+ }
+ }
+ }
+
+ companion object {
+ private const val AOD_ICONS_APPEAR_DURATION: Long = 200
+
+ @ColorInt private val DEFAULT_AOD_ICON_COLOR = -0x1
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconContainerViewBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconContainerViewBinder.kt
new file mode 100644
index 0000000..8293bb3
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconContainerViewBinder.kt
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.statusbar.notification.icon.ui.viewbinder
+
+import androidx.lifecycle.Lifecycle
+import androidx.lifecycle.repeatOnLifecycle
+import com.android.systemui.lifecycle.repeatWhenAttached
+import com.android.systemui.statusbar.notification.icon.ui.viewmodel.NotificationIconContainerViewModel
+import com.android.systemui.statusbar.phone.NotificationIconContainer
+import kotlinx.coroutines.DisposableHandle
+
+/** Binds a [NotificationIconContainer] to its [view model][NotificationIconContainerViewModel]. */
+object NotificationIconContainerViewBinder {
+ fun bind(
+ view: NotificationIconContainer,
+ viewModel: NotificationIconContainerViewModel,
+ ): DisposableHandle {
+ return view.repeatWhenAttached { repeatOnLifecycle(Lifecycle.State.CREATED) {} }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewmodel/NotificationIconContainerAlwaysOnDisplayViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewmodel/NotificationIconContainerAlwaysOnDisplayViewModel.kt
new file mode 100644
index 0000000..f68b0ef
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewmodel/NotificationIconContainerAlwaysOnDisplayViewModel.kt
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.statusbar.notification.icon.ui.viewmodel
+
+import javax.inject.Inject
+
+/** View-model for the row of notification icons displayed on the always-on display. */
+class NotificationIconContainerAlwaysOnDisplayViewModel @Inject constructor() :
+ NotificationIconContainerViewModel
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewmodel/NotificationIconContainerShelfViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewmodel/NotificationIconContainerShelfViewModel.kt
new file mode 100644
index 0000000..933c76f
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewmodel/NotificationIconContainerShelfViewModel.kt
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.statusbar.notification.icon.ui.viewmodel
+
+import javax.inject.Inject
+
+/** View-model for the overflow row of notification icons displayed in the notification shade. */
+class NotificationIconContainerShelfViewModel @Inject constructor() :
+ NotificationIconContainerViewModel
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewmodel/NotificationIconContainerStatusBarViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewmodel/NotificationIconContainerStatusBarViewModel.kt
new file mode 100644
index 0000000..2217646
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewmodel/NotificationIconContainerStatusBarViewModel.kt
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.statusbar.notification.icon.ui.viewmodel
+
+import javax.inject.Inject
+
+/** View-model for the row of notification icons displayed in the status bar, */
+class NotificationIconContainerStatusBarViewModel @Inject constructor() :
+ NotificationIconContainerViewModel
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewmodel/NotificationIconContainerViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewmodel/NotificationIconContainerViewModel.kt
new file mode 100644
index 0000000..892b2be
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewmodel/NotificationIconContainerViewModel.kt
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.statusbar.notification.icon.ui.viewmodel
+
+/**
+ * View-model for the row of notification icons displayed in the NotificationShelf, StatusBar, and
+ * AOD.
+ */
+interface NotificationIconContainerViewModel
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PrecomputedTextViewFactory.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PrecomputedTextViewFactory.kt
index b002330..c276827 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PrecomputedTextViewFactory.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/PrecomputedTextViewFactory.kt
@@ -20,7 +20,9 @@
import android.util.AttributeSet
import android.view.View
import android.widget.TextView
+import com.android.internal.widget.ConversationLayout
import com.android.internal.widget.ImageFloatingTextView
+import com.android.internal.widget.MessagingLayout
import javax.inject.Inject
class PrecomputedTextViewFactory @Inject constructor() : NotifRemoteViewsFactory {
@@ -35,6 +37,10 @@
TextView::class.java.simpleName -> PrecomputedTextView(context, attrs)
ImageFloatingTextView::class.java.name ->
PrecomputedImageFloatingTextView(context, attrs)
+ MessagingLayout::class.java.name ->
+ MessagingLayout(context, attrs).apply { setPrecomputedTextEnabled(true) }
+ ConversationLayout::class.java.name ->
+ ConversationLayout(context, attrs).apply { setPrecomputedTextEnabled(true) }
else -> null
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/shelf/ui/viewbinder/NotificationShelfViewBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/shelf/ui/viewbinder/NotificationShelfViewBinder.kt
index 22a87a7..b92c51f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/shelf/ui/viewbinder/NotificationShelfViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/shelf/ui/viewbinder/NotificationShelfViewBinder.kt
@@ -64,8 +64,10 @@
override fun setOnClickListener(listener: View.OnClickListener) = unsupported
- private val unsupported: Nothing
- get() = error("Code path not supported when NOTIFICATION_SHELF_REFACTOR is disabled")
+ companion object {
+ val unsupported: Nothing
+ get() = error("Code path not supported when NOTIFICATION_SHELF_REFACTOR is disabled")
+ }
}
/** Binds a [NotificationShelf] to its [view model][NotificationShelfViewModel]. */
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
index 4668aa4..6db8df9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
@@ -28,7 +28,6 @@
import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.ROWS_GENTLE;
import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.ROWS_HIGH_PRIORITY;
import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.SelectedRows;
-import static com.android.systemui.statusbar.phone.NotificationIconAreaController.HIGH_PRIORITY;
import static com.android.systemui.util.kotlin.JavaAdapterKt.collectFlow;
import android.content.res.Configuration;
@@ -150,6 +149,7 @@
public class NotificationStackScrollLayoutController {
private static final String TAG = "StackScrollerController";
private static final boolean DEBUG = Compile.IS_DEBUG && Log.isLoggable(TAG, Log.DEBUG);
+ private static final String HIGH_PRIORITY = "high_priority";
private final boolean mAllowLongPress;
private final NotificationGutsManager mNotificationGutsManager;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java
index 5c28be3..d0a093c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java
@@ -25,7 +25,6 @@
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.UserHandle;
-import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.RemoteAnimationAdapter;
import android.view.View;
@@ -197,8 +196,6 @@
/** Get the Keyguard Message Area that displays auth messages. */
AuthKeyguardMessageArea getKeyguardMessageArea();
- int getStatusBarHeight();
-
boolean isLaunchingActivityOverLockscreen();
void onKeyguardViewManagerStatesUpdated();
@@ -229,9 +226,6 @@
/** */
boolean getCommandQueuePanelsEnabled();
- /** */
- int getStatusBarWindowState();
-
BiometricUnlockController getBiometricUnlockController();
void showWirelessChargingAnimation(int batteryLevel);
@@ -276,19 +270,11 @@
void userActivity();
- boolean interceptMediaKey(KeyEvent event);
-
- boolean dispatchKeyEventPreIme(KeyEvent event);
-
- boolean onMenuPressed();
-
void endAffordanceLaunch();
/** Should the keyguard be hidden immediately in response to a back press/gesture. */
boolean shouldKeyguardHideImmediately();
- boolean onSpacePressed();
-
void showBouncerWithDimissAndCancelIfKeyguard(OnDismissAction performAction,
Runnable cancelAction);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java
index 6431ef9..2bc7b99 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacks.java
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar.phone;
+import static com.android.systemui.flags.Flags.ONE_WAY_HAPTICS_API_MIGRATION;
import static com.android.systemui.keyguard.WakefulnessLifecycle.WAKEFULNESS_AWAKE;
import static com.android.systemui.keyguard.WakefulnessLifecycle.WAKEFULNESS_WAKING;
@@ -33,12 +34,15 @@
import android.os.Vibrator;
import android.util.Log;
import android.util.Slog;
+import android.view.HapticFeedbackConstants;
import android.view.KeyEvent;
import android.view.WindowInsets;
import android.view.WindowInsets.Type.InsetsType;
import android.view.WindowInsetsController.Appearance;
import android.view.WindowInsetsController.Behavior;
+import androidx.annotation.VisibleForTesting;
+
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.statusbar.LetterboxDetails;
@@ -49,6 +53,7 @@
import com.android.systemui.camera.CameraIntents;
import com.android.systemui.dagger.qualifiers.DisplayId;
import com.android.systemui.dagger.qualifiers.Main;
+import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.keyguard.WakefulnessLifecycle;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.qs.QSHost;
@@ -107,6 +112,7 @@
private final Lazy<CameraLauncher> mCameraLauncherLazy;
private final QuickSettingsController mQsController;
private final QSHost mQSHost;
+ private final FeatureFlags mFeatureFlags;
private static final VibrationAttributes HARDWARE_FEEDBACK_VIBRATION_ATTRIBUTES =
VibrationAttributes.createForUsage(VibrationAttributes.USAGE_HARDWARE_FEEDBACK);
@@ -144,7 +150,8 @@
Lazy<CameraLauncher> cameraLauncherLazy,
UserTracker userTracker,
QSHost qsHost,
- ActivityStarter activityStarter) {
+ ActivityStarter activityStarter,
+ FeatureFlags featureFlags) {
mCentralSurfaces = centralSurfaces;
mQsController = quickSettingsController;
mContext = context;
@@ -171,6 +178,7 @@
mCameraLauncherLazy = cameraLauncherLazy;
mUserTracker = userTracker;
mQSHost = qsHost;
+ mFeatureFlags = featureFlags;
mVibrateOnOpening = resources.getBoolean(R.bool.config_vibrateOnIconAnimation);
mCameraLaunchGestureVibrationEffect = getCameraGestureVibrationEffect(
@@ -314,7 +322,7 @@
mMetricsLogger.action(MetricsEvent.ACTION_SYSTEM_NAVIGATION_KEY_DOWN);
if (mShadeViewController.isFullyCollapsed()) {
if (mVibrateOnOpening) {
- mVibratorHelper.vibrate(VibrationEffect.EFFECT_TICK);
+ vibrateOnNavigationKeyDown();
}
mShadeViewController.expand(true /* animate */);
mNotificationStackScrollLayoutController.setWillExpand(true);
@@ -587,4 +595,15 @@
}
return VibrationEffect.createWaveform(timings, /* repeat= */ -1);
}
+
+ @VisibleForTesting
+ void vibrateOnNavigationKeyDown() {
+ if (mFeatureFlags.isEnabled(ONE_WAY_HAPTICS_API_MIGRATION)) {
+ mShadeViewController.performHapticFeedback(
+ HapticFeedbackConstants.GESTURE_START
+ );
+ } else {
+ mVibratorHelper.vibrate(VibrationEffect.EFFECT_TICK);
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
index 127569d..a1776c6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
@@ -89,7 +89,6 @@
import android.view.Display;
import android.view.IRemoteAnimationRunner;
import android.view.IWindowManager;
-import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.ThreadedRenderer;
import android.view.View;
@@ -1612,8 +1611,6 @@
mBackActionInteractor.setup(mQsController, mShadeSurface);
mNotificationActivityStarter = mCentralSurfacesComponent.getNotificationActivityStarter();
- mHeadsUpManager.addListener(mCentralSurfacesComponent.getStatusBarHeadsUpChangeListener());
-
// Listen for demo mode changes
mDemoModeController.addCallback(mDemoModeCallback);
@@ -1691,11 +1688,6 @@
return getNotificationShadeWindowViewController().getKeyguardMessageArea();
}
- @Override
- public int getStatusBarHeight() {
- return mStatusBarWindowController.getStatusBarHeight();
- }
-
private void updateReportRejectedTouchVisibility() {
if (mReportRejectedTouch == null) {
return;
@@ -1821,11 +1813,6 @@
}
@Override
- public int getStatusBarWindowState() {
- return mStatusBarWindowState;
- }
-
- @Override
public BiometricUnlockController getBiometricUnlockController() {
return mBiometricUnlockController;
}
@@ -2638,44 +2625,6 @@
}
@Override
- public boolean interceptMediaKey(KeyEvent event) {
- return mState == StatusBarState.KEYGUARD
- && mStatusBarKeyguardViewManager.interceptMediaKey(event);
- }
-
- /**
- * While IME is active and a BACK event is detected, check with
- * {@link StatusBarKeyguardViewManager#dispatchBackKeyEventPreIme()} to see if the event
- * should be handled before routing to IME, in order to prevent the user having to hit back
- * twice to exit bouncer.
- */
- @Override
- public boolean dispatchKeyEventPreIme(KeyEvent event) {
- switch (event.getKeyCode()) {
- case KeyEvent.KEYCODE_BACK:
- if (mState == StatusBarState.KEYGUARD
- && mStatusBarKeyguardViewManager.dispatchBackKeyEventPreIme()) {
- return mBackActionInteractor.onBackRequested();
- }
- }
- return false;
- }
-
- protected boolean shouldUnlockOnMenuPressed() {
- return mDeviceInteractive && mState != StatusBarState.SHADE
- && mStatusBarKeyguardViewManager.shouldDismissOnMenuPressed();
- }
-
- @Override
- public boolean onMenuPressed() {
- if (shouldUnlockOnMenuPressed()) {
- mShadeController.animateCollapseShadeForced();
- return true;
- }
- return false;
- }
-
- @Override
public void endAffordanceLaunch() {
releaseGestureWakeLock();
mCameraLauncherLazy.get().setLaunchingAffordance(false);
@@ -2694,15 +2643,6 @@
return (isScrimmedBouncer || isBouncerOverDream);
}
- @Override
- public boolean onSpacePressed() {
- if (mDeviceInteractive && mState != StatusBarState.SHADE) {
- mShadeController.animateCollapseShadeForced();
- return true;
- }
- return false;
- }
-
private void showBouncerOrLockScreenIfKeyguard() {
// If the keyguard is animating away, we aren't really the keyguard anymore and should not
// show the bouncer/lockscreen.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImpl.java
similarity index 96%
rename from packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java
rename to packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImpl.java
index 0bf0f4b..d22ed38 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImpl.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.android.systemui.statusbar.phone;
import android.content.Context;
@@ -43,6 +58,8 @@
import com.android.systemui.statusbar.window.StatusBarWindowController;
import com.android.wm.shell.bubbles.Bubbles;
+import org.jetbrains.annotations.NotNull;
+
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@@ -55,13 +72,13 @@
* normally reserved for notifications.
*/
@SysUISingleton
-public class NotificationIconAreaController implements
+public class LegacyNotificationIconAreaControllerImpl implements
+ NotificationIconAreaController,
DarkReceiver,
StatusBarStateController.StateListener,
NotificationWakeUpCoordinator.WakeUpListener,
DemoMode {
- public static final String HIGH_PRIORITY = "high_priority";
private static final long AOD_ICONS_APPEAR_DURATION = 200;
@ColorInt
private static final int DEFAULT_AOD_ICON_COLOR = 0xffffffff;
@@ -110,7 +127,7 @@
};
@Inject
- public NotificationIconAreaController(
+ public LegacyNotificationIconAreaControllerImpl(
Context context,
StatusBarStateController statusBarStateController,
NotificationWakeUpCoordinator wakeUpCoordinator,
@@ -192,7 +209,7 @@
}
}
- public void onDensityOrFontScaleChanged(Context context) {
+ public void onDensityOrFontScaleChanged(@NotNull Context context) {
updateIconLayoutParams(context);
}
@@ -493,7 +510,7 @@
mNotificationIcons.showIconIsolated(icon, animated);
}
- public void setIsolatedIconLocation(Rect iconDrawingRect, boolean requireStateUpdate) {
+ public void setIsolatedIconLocation(@NotNull Rect iconDrawingRect, boolean requireStateUpdate) {
mNotificationIcons.setIsolatedIconLocation(iconDrawingRect, requireStateUpdate);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.kt
new file mode 100644
index 0000000..0079f7c
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.kt
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.statusbar.phone
+
+import android.content.Context
+import android.graphics.Rect
+import android.view.View
+import com.android.systemui.statusbar.NotificationShelfController
+import com.android.systemui.statusbar.StatusBarIconView
+import com.android.systemui.statusbar.notification.collection.ListEntry
+
+/**
+ * A controller for the space in the status bar to the left of the system icons. This area is
+ * normally reserved for notifications.
+ */
+interface NotificationIconAreaController {
+ /** Called by the Keyguard*ViewController whose view contains the aod icons. */
+ fun setupAodIcons(aodIcons: NotificationIconContainer)
+ fun setupShelf(notificationShelfController: NotificationShelfController)
+ fun setShelfIcons(icons: NotificationIconContainer)
+ fun onDensityOrFontScaleChanged(context: Context)
+
+ /** Returns the view that represents the notification area. */
+ fun getNotificationInnerAreaView(): View?
+
+ /** Updates the notifications with the given list of notifications to display. */
+ fun updateNotificationIcons(entries: List<@JvmSuppressWildcards ListEntry>)
+ fun updateAodNotificationIcons()
+ fun showIconIsolated(icon: StatusBarIconView?, animated: Boolean)
+ fun setIsolatedIconLocation(iconDrawingRect: Rect, requireStateUpdate: Boolean)
+ fun setAnimationsEnabled(enabled: Boolean)
+ fun onThemeChanged()
+ fun getHeight(): Int
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerModule.kt
new file mode 100644
index 0000000..d1ddd51
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerModule.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.statusbar.phone
+
+import com.android.systemui.flags.FeatureFlags
+import com.android.systemui.flags.Flags
+import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconAreaControllerViewBinderWrapperImpl
+import dagger.Module
+import dagger.Provides
+import javax.inject.Provider
+
+@Module
+object NotificationIconAreaControllerModule {
+ @Provides
+ fun provideNotificationIconAreaControllerImpl(
+ featureFlags: FeatureFlags,
+ legacyProvider: Provider<LegacyNotificationIconAreaControllerImpl>,
+ newProvider: Provider<NotificationIconAreaControllerViewBinderWrapperImpl>,
+ ): NotificationIconAreaController =
+ if (featureFlags.isEnabled(Flags.NOTIFICATION_ICON_CONTAINER_REFACTOR)) {
+ newProvider.get()
+ } else {
+ legacyProvider.get()
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt
index 931aedd..cc41bf8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewController.kt
@@ -15,7 +15,6 @@
*/
package com.android.systemui.statusbar.phone
-import android.app.StatusBarManager.WINDOW_STATE_SHOWING
import android.app.StatusBarManager.WINDOW_STATUS_BAR
import android.content.res.Configuration
import android.graphics.Point
@@ -28,13 +27,13 @@
import com.android.systemui.R
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
-import com.android.systemui.scene.domain.interactor.SceneInteractor
-import com.android.systemui.scene.shared.model.RemoteUserInput
+import com.android.systemui.scene.ui.view.WindowRootView
import com.android.systemui.shade.ShadeController
import com.android.systemui.shade.ShadeLogger
import com.android.systemui.shade.ShadeViewController
import com.android.systemui.shared.animation.UnfoldMoveFromCenterAnimator
import com.android.systemui.statusbar.policy.ConfigurationController
+import com.android.systemui.statusbar.window.StatusBarWindowStateController
import com.android.systemui.unfold.SysUIUnfoldComponent
import com.android.systemui.unfold.UNFOLD_STATUS_BAR
import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider
@@ -54,9 +53,10 @@
view: PhoneStatusBarView,
@Named(UNFOLD_STATUS_BAR) private val progressProvider: ScopedUnfoldTransitionProgressProvider?,
private val centralSurfaces: CentralSurfaces,
+ private val statusBarWindowStateController: StatusBarWindowStateController,
private val shadeController: ShadeController,
private val shadeViewController: ShadeViewController,
- private val sceneInteractor: Provider<SceneInteractor>,
+ private val windowRootView: Provider<WindowRootView>,
private val shadeLogger: ShadeLogger,
private val moveFromCenterAnimationController: StatusBarMoveFromCenterAnimationController?,
private val userChipViewModel: StatusBarUserChipViewModel,
@@ -80,7 +80,8 @@
statusOverlayHoverListenerFactory.createDarkAwareListener(statusContainer))
if (moveFromCenterAnimationController == null) return
- val statusBarLeftSide: View = mView.requireViewById(R.id.status_bar_start_side_except_heads_up)
+ val statusBarLeftSide: View =
+ mView.requireViewById(R.id.status_bar_start_side_except_heads_up)
val systemIconArea: ViewGroup = mView.requireViewById(R.id.status_bar_end_side_content)
val viewsToAnimate = arrayOf(
@@ -148,7 +149,7 @@
/** Called when a touch event occurred on {@link PhoneStatusBarView}. */
fun onTouch(event: MotionEvent) {
- if (centralSurfaces.statusBarWindowState == WINDOW_STATE_SHOWING) {
+ if (statusBarWindowStateController.windowIsShowing()) {
val upOrCancel =
event.action == MotionEvent.ACTION_UP ||
event.action == MotionEvent.ACTION_CANCEL
@@ -179,11 +180,8 @@
// If scene framework is enabled, route the touch to it and
// ignore the rest of the gesture.
if (featureFlags.isEnabled(Flags.SCENE_CONTAINER)) {
- sceneInteractor.get()
- .onRemoteUserInput(RemoteUserInput.translateMotionEvent(event))
- // TODO(b/291965119): remove once view is expanded to cover the status bar
- sceneInteractor.get().setVisible(true, "swipe down from status bar")
- return false
+ windowRootView.get().dispatchTouchEvent(event)
+ return true
}
if (event.action == MotionEvent.ACTION_DOWN) {
@@ -245,9 +243,10 @@
private val featureFlags: FeatureFlags,
private val userChipViewModel: StatusBarUserChipViewModel,
private val centralSurfaces: CentralSurfaces,
+ private val statusBarWindowStateController: StatusBarWindowStateController,
private val shadeController: ShadeController,
private val shadeViewController: ShadeViewController,
- private val sceneInteractor: Provider<SceneInteractor>,
+ private val windowRootView: Provider<WindowRootView>,
private val shadeLogger: ShadeLogger,
private val viewUtil: ViewUtil,
private val configurationController: ConfigurationController,
@@ -267,9 +266,10 @@
view,
progressProvider.getOrNull(),
centralSurfaces,
+ statusBarWindowStateController,
shadeController,
shadeViewController,
- sceneInteractor,
+ windowRootView,
shadeLogger,
statusBarMoveFromCenterAnimationController,
userChipViewModel,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index fc66138..62a8cfd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -709,6 +709,11 @@
}
}
+ public void onUnlockAnimationFinished() {
+ mAnimatingPanelExpansionOnUnlock = false;
+ applyAndDispatchState();
+ }
+
/**
* Set the amount of progress we are currently in if we're transitioning to the full shade.
* 0.0f means we're not transitioning yet, while 1 means we're all the way in the full
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeadsUpChangeListener.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeadsUpChangeListener.java
index 9a295e6..4b39854 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeadsUpChangeListener.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeadsUpChangeListener.java
@@ -16,23 +16,24 @@
package com.android.systemui.statusbar.phone;
+import com.android.systemui.CoreStartable;
+import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.shade.ShadeViewController;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController;
-import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent;
import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener;
import com.android.systemui.statusbar.window.StatusBarWindowController;
import javax.inject.Inject;
/**
- * Ties the {@link CentralSurfaces} to {@link com.android.systemui.statusbar.policy.HeadsUpManager}.
+ * Ties the status bar to {@link com.android.systemui.statusbar.policy.HeadsUpManager}.
*/
-@CentralSurfacesComponent.CentralSurfacesScope
-public class StatusBarHeadsUpChangeListener implements OnHeadsUpChangedListener {
+@SysUISingleton
+public class StatusBarHeadsUpChangeListener implements OnHeadsUpChangedListener, CoreStartable {
private final NotificationShadeWindowController mNotificationShadeWindowController;
private final StatusBarWindowController mStatusBarWindowController;
private final ShadeViewController mShadeViewController;
@@ -63,6 +64,11 @@
}
@Override
+ public void start() {
+ mHeadsUpManager.addListener(this);
+ }
+
+ @Override
public void onHeadsUpPinnedModeChanged(boolean inPinnedMode) {
if (inPinnedMode) {
mNotificationShadeWindowController.setHeadsUpShowing(true);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLocation.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLocation.kt
index 5ace226..32e5c35 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLocation.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarLocation.kt
@@ -24,4 +24,6 @@
KEYGUARD,
/** Quick settings (inside the shade). */
QS,
+ /** ShadeCarrierGroup (above QS status bar in expanded mode). */
+ SHADE_CARRIER_GROUP,
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java
index 7fe01825..a6284e3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java
@@ -32,6 +32,8 @@
import android.view.View;
import android.view.ViewParent;
+import androidx.annotation.Nullable;
+
import com.android.systemui.ActivityIntentHelper;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Main;
@@ -254,16 +256,16 @@
@Override
public boolean handleRemoteViewClick(View view, PendingIntent pendingIntent,
- boolean appRequestedAuth,
+ boolean appRequestedAuth, @Nullable Integer actionIndex,
NotificationRemoteInputManager.ClickHandler defaultHandler) {
final boolean isActivity = pendingIntent.isActivity();
if (isActivity || appRequestedAuth) {
- mActionClickLogger.logWaitingToCloseKeyguard(pendingIntent);
+ mActionClickLogger.logWaitingToCloseKeyguard(pendingIntent, actionIndex);
final boolean afterKeyguardGone = mActivityIntentHelper
.wouldPendingLaunchResolverActivity(pendingIntent,
mLockscreenUserManager.getCurrentUserId());
mActivityStarter.dismissKeyguardThenExecute(() -> {
- mActionClickLogger.logKeyguardGone(pendingIntent);
+ mActionClickLogger.logKeyguardGone(pendingIntent, actionIndex);
try {
ActivityManager.getService().resumeAppSwitches();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt
index 1bceb29..cd1afc7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt
@@ -223,10 +223,14 @@
}
.setCustomInterpolator(View.ALPHA, Interpolators.FAST_OUT_SLOW_IN),
true /* animate */)
- interactionJankMonitor.begin(
- notifShadeWindowControllerLazy.get().windowRootView,
- CUJ_SCREEN_OFF_SHOW_AOD
- )
+ val builder = InteractionJankMonitor.Configuration.Builder
+ .withView(
+ InteractionJankMonitor.CUJ_SCREEN_OFF_SHOW_AOD,
+ notifShadeWindowControllerLazy.get().windowRootView
+ )
+ .setTag(statusBarStateControllerImpl.getClockId())
+
+ interactionJankMonitor.begin(builder)
}
override fun onStartedWakingUp() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/CentralSurfacesComponent.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/CentralSurfacesComponent.java
index 3a3663d..bbbe16f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/CentralSurfacesComponent.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/dagger/CentralSurfacesComponent.java
@@ -25,7 +25,6 @@
import com.android.systemui.statusbar.notification.NotificationActivityStarter;
import com.android.systemui.statusbar.phone.CentralSurfacesCommandQueueCallbacks;
import com.android.systemui.statusbar.phone.CentralSurfacesImpl;
-import com.android.systemui.statusbar.phone.StatusBarHeadsUpChangeListener;
import com.android.systemui.statusbar.phone.StatusBarNotificationActivityStarterModule;
import com.android.systemui.statusbar.phone.fragment.CollapsedStatusBarFragment;
@@ -72,11 +71,6 @@
WindowRootView getWindowRootView();
/**
- * Creates a StatusBarHeadsUpChangeListener.
- */
- StatusBarHeadsUpChangeListener getStatusBarHeadsUpChangeListener();
-
- /**
* Creates a CentralSurfacesCommandQueueCallbacks.
*/
CentralSurfacesCommandQueueCallbacks getCentralSurfacesCommandQueueCallbacks();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/StatusBarPipelineFlags.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/StatusBarPipelineFlags.kt
index 6e51ed0..c695773 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/StatusBarPipelineFlags.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/StatusBarPipelineFlags.kt
@@ -18,6 +18,9 @@
import android.content.Context
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.flags.FeatureFlags
+import com.android.systemui.flags.Flags
+import com.android.systemui.shade.carrier.ShadeCarrierGroup
import javax.inject.Inject
/** All flagging methods related to the new status bar pipeline (see b/238425913). */
@@ -26,11 +29,19 @@
@Inject
constructor(
context: Context,
+ private val featureFlags: FeatureFlags,
) {
private val mobileSlot = context.getString(com.android.internal.R.string.status_bar_mobile)
private val wifiSlot = context.getString(com.android.internal.R.string.status_bar_wifi)
/**
+ * True if we should display the mobile icons in the [ShadeCarrierGroup] using the new status
+ * bar Data pipeline.
+ */
+ fun useNewShadeCarrierGroupMobileIcons(): Boolean =
+ featureFlags.isEnabled(Flags.NEW_SHADE_CARRIER_GROUP_MOBILE_ICONS)
+
+ /**
* For convenience in the StatusBarIconController, we want to gate some actions based on slot
* name and the flag together.
*
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/model/NetworkNameModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/model/NetworkNameModel.kt
index 78231e2..99ed2d9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/model/NetworkNameModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/model/NetworkNameModel.kt
@@ -60,6 +60,19 @@
}
}
+ /** This name has been derived from SubscriptionModel. see [SubscriptionModel] */
+ data class SubscriptionDerived(override val name: String) : NetworkNameModel {
+ override fun logDiffs(prevVal: NetworkNameModel, row: TableRowLogger) {
+ if (prevVal !is SubscriptionDerived || prevVal.name != name) {
+ row.logChange(COL_NETWORK_NAME, "SubscriptionDerived($name)")
+ }
+ }
+
+ override fun logFull(row: TableRowLogger) {
+ row.logChange(COL_NETWORK_NAME, "SubscriptionDerived($name)")
+ }
+ }
+
/**
* This name has been derived from the sim via
* [android.telephony.TelephonyManager.getSimOperatorName].
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/model/SubscriptionModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/model/SubscriptionModel.kt
index 16c4027..27f6df4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/model/SubscriptionModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/model/SubscriptionModel.kt
@@ -34,4 +34,7 @@
/** Subscriptions in the same group may be filtered or treated as a single subscription */
val groupUuid: ParcelUuid? = null,
+
+ /** Text representing the name for this connection */
+ val carrierName: String,
)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileConnectionRepository.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileConnectionRepository.kt
index c1af6df..a89b1b2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileConnectionRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileConnectionRepository.kt
@@ -115,10 +115,18 @@
*/
val cdmaRoaming: StateFlow<Boolean>
- /** The service provider name for this network connection, or the default name */
+ /** The service provider name for this network connection, or the default name. */
val networkName: StateFlow<NetworkNameModel>
/**
+ * The service provider name for this network connection, or the default name.
+ *
+ * TODO(b/296600321): De-duplicate this field with [networkName] after determining the data
+ * provided is identical
+ */
+ val carrierName: StateFlow<NetworkNameModel>
+
+ /**
* True if this type of connection is allowed while airplane mode is on, and false otherwise.
*/
val isAllowedDuringAirplaneMode: StateFlow<Boolean>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionRepository.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionRepository.kt
index 17d20c2..c576b82 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionRepository.kt
@@ -184,7 +184,10 @@
override val cdmaRoaming = MutableStateFlow(false)
- override val networkName = MutableStateFlow(NetworkNameModel.IntentDerived("demo network"))
+ override val networkName = MutableStateFlow(NetworkNameModel.IntentDerived(DEMO_CARRIER_NAME))
+
+ override val carrierName =
+ MutableStateFlow(NetworkNameModel.SubscriptionDerived(DEMO_CARRIER_NAME))
override val isAllowedDuringAirplaneMode = MutableStateFlow(false)
@@ -200,6 +203,7 @@
// This is always true here, because we split out disabled states at the data-source level
dataEnabled.value = true
networkName.value = NetworkNameModel.IntentDerived(event.name)
+ carrierName.value = NetworkNameModel.SubscriptionDerived("${event.name} ${event.subId}")
_carrierId.value = event.carrierId ?: INVALID_SUBSCRIPTION_ID
@@ -227,6 +231,7 @@
// This is always true here, because we split out disabled states at the data-source level
dataEnabled.value = true
networkName.value = NetworkNameModel.IntentDerived(CARRIER_MERGED_NAME)
+ carrierName.value = NetworkNameModel.SubscriptionDerived(CARRIER_MERGED_NAME)
// TODO(b/276943904): is carrierId a thing with carrier merged networks?
_carrierId.value = INVALID_SUBSCRIPTION_ID
numberOfLevels.value = event.numberOfLevels
@@ -248,6 +253,7 @@
}
companion object {
+ private const val DEMO_CARRIER_NAME = "Demo Carrier"
private const val CARRIER_MERGED_NAME = "Carrier Merged Network"
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionsRepository.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionsRepository.kt
index 0e4ceeb..ee13d93 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionsRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionsRepository.kt
@@ -92,9 +92,12 @@
private fun maybeCreateSubscription(subId: Int) {
if (!subscriptionInfoCache.containsKey(subId)) {
- SubscriptionModel(subscriptionId = subId, isOpportunistic = false).also {
- subscriptionInfoCache[subId] = it
- }
+ SubscriptionModel(
+ subscriptionId = subId,
+ isOpportunistic = false,
+ carrierName = DEFAULT_CARRIER_NAME,
+ )
+ .also { subscriptionInfoCache[subId] = it }
_subscriptions.value = subscriptionInfoCache.values.toList()
}
@@ -327,6 +330,7 @@
private const val TAG = "DemoMobileConnectionsRepo"
private const val DEFAULT_SUB_ID = 1
+ private const val DEFAULT_CARRIER_NAME = "demo carrier"
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepository.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepository.kt
index 65f4866..28be3be 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepository.kt
@@ -108,6 +108,8 @@
NetworkNameModel.SimDerived(telephonyManager.simOperatorName),
)
+ override val carrierName: StateFlow<NetworkNameModel> = networkName
+
override val numberOfLevels: StateFlow<Int> =
wifiRepository.wifiNetwork
.map {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepository.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepository.kt
index 8ba7d21..ee11c06 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepository.kt
@@ -22,6 +22,7 @@
import com.android.systemui.log.table.TableLogBufferFactory
import com.android.systemui.log.table.logDiffsForTable
import com.android.systemui.statusbar.pipeline.mobile.data.model.NetworkNameModel
+import com.android.systemui.statusbar.pipeline.mobile.data.model.SubscriptionModel
import com.android.systemui.statusbar.pipeline.mobile.data.repository.MobileConnectionRepository
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
@@ -47,6 +48,7 @@
override val subId: Int,
startingIsCarrierMerged: Boolean,
override val tableLogBuffer: TableLogBuffer,
+ subscriptionModel: StateFlow<SubscriptionModel?>,
private val defaultNetworkName: NetworkNameModel,
private val networkNameSeparator: String,
@Application scope: CoroutineScope,
@@ -80,6 +82,7 @@
mobileRepoFactory.build(
subId,
tableLogBuffer,
+ subscriptionModel,
defaultNetworkName,
networkNameSeparator,
)
@@ -287,6 +290,16 @@
)
.stateIn(scope, SharingStarted.WhileSubscribed(), activeRepo.value.networkName.value)
+ override val carrierName =
+ activeRepo
+ .flatMapLatest { it.carrierName }
+ .logDiffsForTable(
+ tableLogBuffer,
+ columnPrefix = "",
+ initialValue = activeRepo.value.carrierName.value,
+ )
+ .stateIn(scope, SharingStarted.WhileSubscribed(), activeRepo.value.carrierName.value)
+
override val isAllowedDuringAirplaneMode =
activeRepo
.flatMapLatest { it.isAllowedDuringAirplaneMode }
@@ -307,6 +320,7 @@
fun build(
subId: Int,
startingIsCarrierMerged: Boolean,
+ subscriptionModel: StateFlow<SubscriptionModel?>,
defaultNetworkName: NetworkNameModel,
networkNameSeparator: String,
): FullMobileConnectionRepository {
@@ -317,6 +331,7 @@
subId,
startingIsCarrierMerged,
mobileLogger,
+ subscriptionModel,
defaultNetworkName,
networkNameSeparator,
scope,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt
index aadc975..1f1ac92 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryImpl.kt
@@ -43,6 +43,7 @@
import com.android.systemui.statusbar.pipeline.mobile.data.model.ResolvedNetworkType.DefaultNetworkType
import com.android.systemui.statusbar.pipeline.mobile.data.model.ResolvedNetworkType.OverrideNetworkType
import com.android.systemui.statusbar.pipeline.mobile.data.model.ResolvedNetworkType.UnknownNetworkType
+import com.android.systemui.statusbar.pipeline.mobile.data.model.SubscriptionModel
import com.android.systemui.statusbar.pipeline.mobile.data.model.SystemUiCarrierConfig
import com.android.systemui.statusbar.pipeline.mobile.data.model.toDataConnectionType
import com.android.systemui.statusbar.pipeline.mobile.data.model.toNetworkNameModel
@@ -80,6 +81,7 @@
@OptIn(ExperimentalCoroutinesApi::class)
class MobileConnectionRepositoryImpl(
override val subId: Int,
+ subscriptionModel: StateFlow<SubscriptionModel?>,
defaultNetworkName: NetworkNameModel,
networkNameSeparator: String,
private val telephonyManager: TelephonyManager,
@@ -281,6 +283,14 @@
}
.stateIn(scope, SharingStarted.WhileSubscribed(), DEFAULT_NUM_LEVELS)
+ override val carrierName =
+ subscriptionModel
+ .map {
+ it?.let { model -> NetworkNameModel.SubscriptionDerived(model.carrierName) }
+ ?: defaultNetworkName
+ }
+ .stateIn(scope, SharingStarted.WhileSubscribed(), defaultNetworkName)
+
/**
* There are a few cases where we will need to poll [TelephonyManager] so we can update some
* internal state where callbacks aren't provided. Any of those events should be merged into
@@ -350,11 +360,13 @@
fun build(
subId: Int,
mobileLogger: TableLogBuffer,
+ subscriptionModel: StateFlow<SubscriptionModel?>,
defaultNetworkName: NetworkNameModel,
networkNameSeparator: String,
): MobileConnectionRepository {
return MobileConnectionRepositoryImpl(
subId,
+ subscriptionModel,
defaultNetworkName,
networkNameSeparator,
telephonyManager.createForSubscriptionId(subId),
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt
index 54948a4..67b04db 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryImpl.kt
@@ -319,10 +319,17 @@
@VisibleForTesting fun getSubIdRepoCache() = subIdRepositoryCache
+ private fun subscriptionModelForSubId(subId: Int): StateFlow<SubscriptionModel?> {
+ return subscriptions
+ .map { list -> list.firstOrNull { model -> model.subscriptionId == subId } }
+ .stateIn(scope, SharingStarted.WhileSubscribed(), null)
+ }
+
private fun createRepositoryForSubId(subId: Int): FullMobileConnectionRepository {
return fullMobileRepoFactory.build(
subId,
isCarrierMerged(subId),
+ subscriptionModelForSubId(subId),
defaultNetworkName,
networkNameSeparator,
)
@@ -373,6 +380,7 @@
subscriptionId = subscriptionId,
isOpportunistic = isOpportunistic,
groupUuid = groupUuid,
+ carrierName = carrierName.toString(),
)
companion object {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconInteractor.kt
index 1a13827..4cfde5b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconInteractor.kt
@@ -92,6 +92,22 @@
*/
val networkName: StateFlow<NetworkNameModel>
+ /**
+ * Provider name for this network connection. The name can be one of 3 values:
+ * 1. The default network name, if one is configured
+ * 2. A name provided by the [SubscriptionModel] of this network connection
+ * 3. Or, in the case where the repository sends us the default network name, we check for an
+ * override in [connectionInfo.operatorAlphaShort], a value that is derived from
+ * [ServiceState]
+ *
+ * TODO(b/296600321): De-duplicate this field with [networkName] after determining the data
+ * provided is identical
+ */
+ val carrierName: StateFlow<String>
+
+ /** True if there is only one active subscription. */
+ val isSingleCarrier: StateFlow<Boolean>
+
/** True if this line of service is emergency-only */
val isEmergencyOnly: StateFlow<Boolean>
@@ -126,6 +142,7 @@
defaultSubscriptionHasDataEnabled: StateFlow<Boolean>,
override val alwaysShowDataRatIcon: StateFlow<Boolean>,
override val alwaysUseCdmaLevel: StateFlow<Boolean>,
+ override val isSingleCarrier: StateFlow<Boolean>,
override val mobileIsDefault: StateFlow<Boolean>,
defaultMobileIconMapping: StateFlow<Map<String, MobileIconGroup>>,
defaultMobileIconGroup: StateFlow<MobileIconGroup>,
@@ -171,6 +188,22 @@
connectionRepository.networkName.value
)
+ override val carrierName =
+ combine(connectionRepository.operatorAlphaShort, connectionRepository.carrierName) {
+ operatorAlphaShort,
+ networkName ->
+ if (networkName is NetworkNameModel.Default && operatorAlphaShort != null) {
+ operatorAlphaShort
+ } else {
+ networkName.name
+ }
+ }
+ .stateIn(
+ scope,
+ SharingStarted.WhileSubscribed(),
+ connectionRepository.carrierName.value.name
+ )
+
/** What the mobile icon would be before carrierId overrides */
private val defaultNetworkType: StateFlow<MobileIconGroup> =
combine(
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractor.kt
index e90f40c7..d08808b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractor.kt
@@ -76,6 +76,9 @@
/** True if the CDMA level should be preferred over the primary level. */
val alwaysUseCdmaLevel: StateFlow<Boolean>
+ /** True if there is only one active subscription. */
+ val isSingleCarrier: StateFlow<Boolean>
+
/** The icon mapping from network type to [MobileIconGroup] for the default subscription */
val defaultMobileIconMapping: StateFlow<Map<String, MobileIconGroup>>
@@ -252,6 +255,17 @@
.mapLatest { it.alwaysShowCdmaRssi }
.stateIn(scope, SharingStarted.WhileSubscribed(), false)
+ override val isSingleCarrier: StateFlow<Boolean> =
+ mobileConnectionsRepo.subscriptions
+ .map { it.size == 1 }
+ .logDiffsForTable(
+ tableLogger,
+ columnPrefix = LOGGING_PREFIX,
+ columnName = "isSingleCarrier",
+ initialValue = false,
+ )
+ .stateIn(scope, SharingStarted.WhileSubscribed(), false)
+
/** If there is no mapping in [defaultMobileIconMapping], then use this default icon group */
override val defaultMobileIconGroup: StateFlow<MobileIconGroup> =
mobileConnectionsRepo.defaultMobileIconGroup.stateIn(
@@ -298,6 +312,7 @@
activeDataConnectionHasDataEnabled,
alwaysShowDataRatIcon,
alwaysUseCdmaLevel,
+ isSingleCarrier,
mobileIsDefault,
defaultMobileIconMapping,
defaultMobileIconGroup,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/MobileUiAdapter.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/MobileUiAdapter.kt
index d7fcf48..02e50a0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/MobileUiAdapter.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/MobileUiAdapter.kt
@@ -19,6 +19,7 @@
import com.android.systemui.CoreStartable
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.shade.carrier.ShadeCarrierGroupController
import com.android.systemui.statusbar.phone.StatusBarIconController
import com.android.systemui.statusbar.pipeline.mobile.domain.interactor.MobileIconsInteractor
import com.android.systemui.statusbar.pipeline.mobile.ui.viewmodel.MobileIconsViewModel
@@ -49,6 +50,8 @@
private var isCollecting: Boolean = false
private var lastValue: List<Int>? = null
+ private var shadeCarrierGroupController: ShadeCarrierGroupController? = null
+
override fun start() {
// Start notifying the icon controller of subscriptions
scope.launch {
@@ -57,10 +60,16 @@
logger.logUiAdapterSubIdsSentToIconController(it)
lastValue = it
iconController.setNewMobileIconSubIds(it)
+ shadeCarrierGroupController?.updateModernMobileIcons(it)
}
}
}
+ /** Set the [ShadeCarrierGroupController] to notify of subscription updates */
+ fun setShadeCarrierGroupController(controller: ShadeCarrierGroupController) {
+ shadeCarrierGroupController = controller
+ }
+
override fun dump(pw: PrintWriter, args: Array<out String>) {
pw.println("isCollecting=$isCollecting")
pw.println("Last values sent to icon controller: $lastValue")
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/MobileViewLogger.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/MobileViewLogger.kt
index cea6654..2af6795b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/MobileViewLogger.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/MobileViewLogger.kt
@@ -57,7 +57,7 @@
{
str1 = view.getIdForLogging()
str2 = viewModel.getIdForLogging()
- str3 = viewModel.locationName
+ str3 = viewModel.location.name
},
{ "New view binding. viewId=$str1, viewModelId=$str2, viewModelLocation=$str3" },
)
@@ -71,7 +71,7 @@
{
str1 = view.getIdForLogging()
str2 = viewModel.getIdForLogging()
- str3 = viewModel.locationName
+ str3 = viewModel.location.name
},
{ "Collection started. viewId=$str1, viewModelId=$str2, viewModelLocation=$str3" },
)
@@ -85,7 +85,7 @@
{
str1 = view.getIdForLogging()
str2 = viewModel.getIdForLogging()
- str3 = viewModel.locationName
+ str3 = viewModel.location.name
},
{ "Collection stopped. viewId=$str1, viewModelId=$str2, viewModelLocation=$str3" },
)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/binder/MobileIconBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/binder/MobileIconBinder.kt
index 55bc8d5..4b2fb43 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/binder/MobileIconBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/binder/MobileIconBinder.kt
@@ -50,6 +50,7 @@
fun bind(
view: ViewGroup,
viewModel: LocationBasedMobileViewModel,
+ @StatusBarIconView.VisibleState initialVisibilityState: Int = STATE_HIDDEN,
logger: MobileViewLogger,
): ModernStatusBarViewBinding {
val mobileGroupView = view.requireViewById<ViewGroup>(R.id.mobile_group)
@@ -68,12 +69,12 @@
// TODO(b/238425913): We should log this visibility state.
@StatusBarIconView.VisibleState
- val visibilityState: MutableStateFlow<Int> = MutableStateFlow(STATE_HIDDEN)
+ val visibilityState: MutableStateFlow<Int> = MutableStateFlow(initialVisibilityState)
val iconTint: MutableStateFlow<Int> = MutableStateFlow(viewModel.defaultColor)
val decorTint: MutableStateFlow<Int> = MutableStateFlow(viewModel.defaultColor)
- var isCollecting: Boolean = false
+ var isCollecting = false
view.repeatWhenAttached {
repeatOnLifecycle(Lifecycle.State.STARTED) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/binder/ShadeCarrierBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/binder/ShadeCarrierBinder.kt
new file mode 100644
index 0000000..081e101
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/binder/ShadeCarrierBinder.kt
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.pipeline.mobile.ui.binder
+
+import androidx.core.view.isVisible
+import androidx.lifecycle.Lifecycle
+import androidx.lifecycle.repeatOnLifecycle
+import com.android.systemui.lifecycle.repeatWhenAttached
+import com.android.systemui.statusbar.pipeline.mobile.ui.viewmodel.ShadeCarrierGroupMobileIconViewModel
+import com.android.systemui.util.AutoMarqueeTextView
+import kotlinx.coroutines.launch
+
+object ShadeCarrierBinder {
+ /** Binds the view to the view-model, continuing to update the former based on the latter */
+ @JvmStatic
+ fun bind(
+ carrierTextView: AutoMarqueeTextView,
+ viewModel: ShadeCarrierGroupMobileIconViewModel,
+ ) {
+ carrierTextView.isVisible = true
+
+ carrierTextView.repeatWhenAttached {
+ repeatOnLifecycle(Lifecycle.State.STARTED) {
+ launch { viewModel.carrierName.collect { carrierTextView.text = it } }
+ }
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/view/ModernShadeCarrierGroupMobileView.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/view/ModernShadeCarrierGroupMobileView.kt
new file mode 100644
index 0000000..f407127
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/view/ModernShadeCarrierGroupMobileView.kt
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.pipeline.mobile.ui.view
+
+import android.content.Context
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.widget.LinearLayout
+import com.android.systemui.R
+import com.android.systemui.statusbar.StatusBarIconView.STATE_ICON
+import com.android.systemui.statusbar.pipeline.mobile.ui.MobileViewLogger
+import com.android.systemui.statusbar.pipeline.mobile.ui.binder.MobileIconBinder
+import com.android.systemui.statusbar.pipeline.mobile.ui.binder.ShadeCarrierBinder
+import com.android.systemui.statusbar.pipeline.mobile.ui.viewmodel.ShadeCarrierGroupMobileIconViewModel
+import com.android.systemui.util.AutoMarqueeTextView
+
+/**
+ * ViewGroup containing a mobile carrier name and icon in the Shade Header. Can be multiple
+ * instances as children under [ShadeCarrierGroup]
+ */
+class ModernShadeCarrierGroupMobileView(
+ context: Context,
+ attrs: AttributeSet?,
+) : LinearLayout(context, attrs) {
+
+ var subId: Int = -1
+
+ override fun toString(): String {
+ return "ModernShadeCarrierGroupMobileView(" +
+ "subId=$subId, " +
+ "viewString=${super.toString()}"
+ }
+
+ companion object {
+
+ /**
+ * Inflates a new instance of [ModernShadeCarrierGroupMobileView], binds it to [viewModel],
+ * and returns it.
+ */
+ @JvmStatic
+ fun constructAndBind(
+ context: Context,
+ logger: MobileViewLogger,
+ slot: String,
+ viewModel: ShadeCarrierGroupMobileIconViewModel,
+ ): ModernShadeCarrierGroupMobileView {
+ return (LayoutInflater.from(context).inflate(R.layout.shade_carrier_new, null)
+ as ModernShadeCarrierGroupMobileView)
+ .also {
+ it.subId = viewModel.subscriptionId
+
+ val iconView = it.requireViewById<ModernStatusBarMobileView>(R.id.mobile_combo)
+ iconView.initView(slot) {
+ MobileIconBinder.bind(iconView, viewModel, STATE_ICON, logger)
+ }
+ logger.logNewViewBinding(it, viewModel)
+
+ val textView = it.requireViewById<AutoMarqueeTextView>(R.id.mobile_carrier_text)
+ ShadeCarrierBinder.bind(textView, viewModel)
+ }
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/view/ModernStatusBarMobileView.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/view/ModernStatusBarMobileView.kt
index 4144293d..68d02de 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/view/ModernStatusBarMobileView.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/view/ModernStatusBarMobileView.kt
@@ -60,7 +60,9 @@
as ModernStatusBarMobileView)
.also {
it.subId = viewModel.subscriptionId
- it.initView(slot) { MobileIconBinder.bind(it, viewModel, logger) }
+ it.initView(slot) {
+ MobileIconBinder.bind(view = it, viewModel = viewModel, logger = logger)
+ }
logger.logNewViewBinding(it, viewModel)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/LocationBasedMobileViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/LocationBasedMobileViewModel.kt
index a51982c..e7c311d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/LocationBasedMobileViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/LocationBasedMobileViewModel.kt
@@ -18,7 +18,13 @@
import android.graphics.Color
import com.android.systemui.statusbar.phone.StatusBarLocation
+import com.android.systemui.statusbar.pipeline.mobile.domain.interactor.MobileIconInteractor
import com.android.systemui.statusbar.pipeline.mobile.ui.VerboseMobileViewLogger
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.flow.SharingStarted
+import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.stateIn
/**
* A view model for an individual mobile icon that embeds the notion of a [StatusBarLocation]. This
@@ -26,12 +32,12 @@
*
* @param commonImpl for convenience, this class wraps a base interface that can provides all of the
* common implementations between locations. See [MobileIconViewModel]
- * @property locationName the name of the location of this VM, used for logging.
+ * @property location the [StatusBarLocation] of this VM.
* @property verboseLogger an optional logger to log extremely verbose view updates.
*/
abstract class LocationBasedMobileViewModel(
val commonImpl: MobileIconViewModelCommon,
- val locationName: String,
+ val location: StatusBarLocation,
val verboseLogger: VerboseMobileViewLogger?,
) : MobileIconViewModelCommon by commonImpl {
val defaultColor: Int = Color.WHITE
@@ -39,10 +45,12 @@
companion object {
fun viewModelForLocation(
commonImpl: MobileIconViewModelCommon,
+ interactor: MobileIconInteractor,
verboseMobileViewLogger: VerboseMobileViewLogger,
- loc: StatusBarLocation,
+ location: StatusBarLocation,
+ scope: CoroutineScope,
): LocationBasedMobileViewModel =
- when (loc) {
+ when (location) {
StatusBarLocation.HOME ->
HomeMobileIconViewModel(
commonImpl,
@@ -50,6 +58,12 @@
)
StatusBarLocation.KEYGUARD -> KeyguardMobileIconViewModel(commonImpl)
StatusBarLocation.QS -> QsMobileIconViewModel(commonImpl)
+ StatusBarLocation.SHADE_CARRIER_GROUP ->
+ ShadeCarrierGroupMobileIconViewModel(
+ commonImpl,
+ interactor,
+ scope,
+ )
}
}
}
@@ -61,7 +75,7 @@
MobileIconViewModelCommon,
LocationBasedMobileViewModel(
commonImpl,
- locationName = "Home",
+ location = StatusBarLocation.HOME,
verboseMobileViewLogger,
)
@@ -71,18 +85,40 @@
MobileIconViewModelCommon,
LocationBasedMobileViewModel(
commonImpl,
- locationName = "QS",
+ location = StatusBarLocation.QS,
// Only do verbose logging for the Home location.
verboseLogger = null,
)
+class ShadeCarrierGroupMobileIconViewModel(
+ commonImpl: MobileIconViewModelCommon,
+ interactor: MobileIconInteractor,
+ scope: CoroutineScope,
+) :
+ MobileIconViewModelCommon,
+ LocationBasedMobileViewModel(
+ commonImpl,
+ location = StatusBarLocation.SHADE_CARRIER_GROUP,
+ // Only do verbose logging for the Home location.
+ verboseLogger = null,
+ ) {
+ private val isSingleCarrier = interactor.isSingleCarrier
+ val carrierName = interactor.carrierName
+
+ override val isVisible: StateFlow<Boolean> =
+ combine(super.isVisible, isSingleCarrier) { isVisible, isSingleCarrier ->
+ if (isSingleCarrier) false else isVisible
+ }
+ .stateIn(scope, SharingStarted.WhileSubscribed(), super.isVisible.value)
+}
+
class KeyguardMobileIconViewModel(
commonImpl: MobileIconViewModelCommon,
) :
MobileIconViewModelCommon,
LocationBasedMobileViewModel(
commonImpl,
- locationName = "Keyguard",
+ location = StatusBarLocation.KEYGUARD,
// Only do verbose logging for the Home location.
verboseLogger = null,
)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconViewModel.kt
index fe24815..275cfc5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconViewModel.kt
@@ -221,36 +221,15 @@
override val activityInVisible: Flow<Boolean> =
activity
.map { it?.hasActivityIn ?: false }
- .distinctUntilChanged()
- .logDiffsForTable(
- iconInteractor.tableLogBuffer,
- columnPrefix = "",
- columnName = "activityInVisible",
- initialValue = false,
- )
.stateIn(scope, SharingStarted.WhileSubscribed(), false)
override val activityOutVisible: Flow<Boolean> =
activity
.map { it?.hasActivityOut ?: false }
- .distinctUntilChanged()
- .logDiffsForTable(
- iconInteractor.tableLogBuffer,
- columnPrefix = "",
- columnName = "activityOutVisible",
- initialValue = false,
- )
.stateIn(scope, SharingStarted.WhileSubscribed(), false)
override val activityContainerVisible: Flow<Boolean> =
activity
.map { it != null && (it.hasActivityIn || it.hasActivityOut) }
- .distinctUntilChanged()
- .logDiffsForTable(
- iconInteractor.tableLogBuffer,
- columnPrefix = "",
- columnName = "activityContainerVisible",
- initialValue = false,
- )
.stateIn(scope, SharingStarted.WhileSubscribed(), false)
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconsViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconsViewModel.kt
index 5cf887e..216afb9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconsViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconsViewModel.kt
@@ -22,6 +22,7 @@
import com.android.systemui.statusbar.phone.StatusBarLocation
import com.android.systemui.statusbar.pipeline.StatusBarPipelineFlags
import com.android.systemui.statusbar.pipeline.airplane.domain.interactor.AirplaneModeInteractor
+import com.android.systemui.statusbar.pipeline.mobile.domain.interactor.MobileIconInteractor
import com.android.systemui.statusbar.pipeline.mobile.domain.interactor.MobileIconsInteractor
import com.android.systemui.statusbar.pipeline.mobile.ui.MobileViewLogger
import com.android.systemui.statusbar.pipeline.mobile.ui.VerboseMobileViewLogger
@@ -58,6 +59,8 @@
private val statusBarPipelineFlags: StatusBarPipelineFlags,
) {
@VisibleForTesting val mobileIconSubIdCache = mutableMapOf<Int, MobileIconViewModel>()
+ @VisibleForTesting
+ val mobileIconInteractorSubIdCache = mutableMapOf<Int, MobileIconInteractor>()
val subscriptionIdsFlow: StateFlow<List<Int>> =
interactor.filteredSubscriptions
@@ -91,15 +94,17 @@
.stateIn(scope, SharingStarted.WhileSubscribed(), false)
init {
- scope.launch { subscriptionIdsFlow.collect { removeInvalidModelsFromCache(it) } }
+ scope.launch { subscriptionIdsFlow.collect { invalidateCaches(it) } }
}
fun viewModelForSub(subId: Int, location: StatusBarLocation): LocationBasedMobileViewModel {
val common = commonViewModelForSub(subId)
return LocationBasedMobileViewModel.viewModelForLocation(
common,
+ mobileIconInteractorForSub(subId),
verboseLogger,
location,
+ scope,
)
}
@@ -107,7 +112,7 @@
return mobileIconSubIdCache[subId]
?: MobileIconViewModel(
subId,
- interactor.createMobileConnectionInteractorForSubId(subId),
+ mobileIconInteractorForSub(subId),
airplaneModeInteractor,
constants,
scope,
@@ -115,8 +120,20 @@
.also { mobileIconSubIdCache[subId] = it }
}
- private fun removeInvalidModelsFromCache(subIds: List<Int>) {
+ @VisibleForTesting
+ fun mobileIconInteractorForSub(subId: Int): MobileIconInteractor {
+ return mobileIconInteractorSubIdCache[subId]
+ ?: interactor.createMobileConnectionInteractorForSubId(subId).also {
+ mobileIconInteractorSubIdCache[subId] = it
+ }
+ }
+
+ private fun invalidateCaches(subIds: List<Int>) {
val subIdsToRemove = mobileIconSubIdCache.keys.filter { !subIds.contains(it) }
subIdsToRemove.forEach { mobileIconSubIdCache.remove(it) }
+
+ mobileIconInteractorSubIdCache.keys
+ .filter { !subIds.contains(it) }
+ .forEach { subId -> mobileIconInteractorSubIdCache.remove(subId) }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/ui/viewmodel/LocationBasedWifiViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/ui/viewmodel/LocationBasedWifiViewModel.kt
index cd5b92c..00bd616 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/ui/viewmodel/LocationBasedWifiViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/wifi/ui/viewmodel/LocationBasedWifiViewModel.kt
@@ -18,6 +18,7 @@
import android.graphics.Color
import com.android.systemui.statusbar.phone.StatusBarLocation
+import java.lang.IllegalArgumentException
/**
* A view model for a wifi icon in a specific location. This allows us to control parameters that
@@ -43,6 +44,8 @@
StatusBarLocation.HOME -> HomeWifiViewModel(commonImpl)
StatusBarLocation.KEYGUARD -> KeyguardWifiViewModel(commonImpl)
StatusBarLocation.QS -> QsWifiViewModel(commonImpl)
+ StatusBarLocation.SHADE_CARRIER_GROUP ->
+ throw IllegalArgumentException("invalid location for WifiViewModel: $location")
}
}
}
@@ -64,3 +67,11 @@
class QsWifiViewModel(
commonImpl: WifiViewModelCommon,
) : WifiViewModelCommon, LocationBasedWifiViewModel(commonImpl)
+
+/**
+ * A view model for the wifi icon in the shade carrier group (visible when quick settings is fully
+ * expanded, and in large screen shade). Currently unused.
+ */
+class ShadeCarrierGroupWifiViewModel(
+ commonImpl: WifiViewModelCommon,
+) : WifiViewModelCommon, LocationBasedWifiViewModel(commonImpl)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/VariableDateViewController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/policy/VariableDateViewController.kt
index 4a31b86..eaae0f0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/VariableDateViewController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/VariableDateViewController.kt
@@ -33,6 +33,7 @@
import com.android.systemui.Dependency
import com.android.systemui.broadcast.BroadcastDispatcher
import com.android.systemui.shade.ShadeExpansionStateManager
+import com.android.systemui.shade.ShadeLogger
import com.android.systemui.util.ViewController
import com.android.systemui.util.time.SystemClock
import java.text.FieldPosition
@@ -83,6 +84,7 @@
private val systemClock: SystemClock,
private val broadcastDispatcher: BroadcastDispatcher,
private val shadeExpansionStateManager: ShadeExpansionStateManager,
+ private val shadeLogger: ShadeLogger,
private val timeTickHandler: Handler,
view: VariableDateView
) : ViewController<VariableDateView>(view) {
@@ -111,24 +113,29 @@
private val intentReceiver: BroadcastReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
+ val action = intent.action
+ if (
+ Intent.ACTION_LOCALE_CHANGED == action ||
+ Intent.ACTION_TIMEZONE_CHANGED == action
+ ) {
+ // need to get a fresh date format
+ dateFormat = null
+ shadeLogger.d("VariableDateViewController received intent to refresh date format")
+ }
+
+ val handler = mView.handler
+
// If the handler is null, it means we received a broadcast while the view has not
// finished being attached or in the process of being detached.
// In that case, do not post anything.
- val handler = mView.handler ?: return
- val action = intent.action
- if (
+ if (handler == null) {
+ shadeLogger.d("VariableDateViewController received intent but handler was null")
+ } else if (
Intent.ACTION_TIME_TICK == action ||
Intent.ACTION_TIME_CHANGED == action ||
Intent.ACTION_TIMEZONE_CHANGED == action ||
Intent.ACTION_LOCALE_CHANGED == action
) {
- if (
- Intent.ACTION_LOCALE_CHANGED == action ||
- Intent.ACTION_TIMEZONE_CHANGED == action
- ) {
- // need to get a fresh date format
- handler.post { dateFormat = null }
- }
handler.post(::updateClock)
}
}
@@ -231,6 +238,7 @@
private val systemClock: SystemClock,
private val broadcastDispatcher: BroadcastDispatcher,
private val shadeExpansionStateManager: ShadeExpansionStateManager,
+ private val shadeLogger: ShadeLogger,
@Named(Dependency.TIME_TICK_HANDLER_NAME) private val handler: Handler
) {
fun create(view: VariableDateView): VariableDateViewController {
@@ -238,6 +246,7 @@
systemClock,
broadcastDispatcher,
shadeExpansionStateManager,
+ shadeLogger,
handler,
view
)
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java
index 53f4837..9cc3cdb 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java
@@ -67,7 +67,6 @@
import com.android.systemui.R;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.dagger.SysUISingleton;
-import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.keyguard.WakefulnessLifecycle;
import com.android.systemui.plugins.VolumeDialogController;
@@ -84,6 +83,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicReference;
import javax.inject.Inject;
@@ -134,7 +134,7 @@
private final Receiver mReceiver = new Receiver();
private final RingerModeObservers mRingerModeObservers;
private final MediaSessions mMediaSessions;
- private CaptioningManager mCaptioningManager;
+ private final AtomicReference<CaptioningManager> mCaptioningManager = new AtomicReference<>();
private final KeyguardManager mKeyguardManager;
private final ActivityManager mActivityManager;
private final UserTracker mUserTracker;
@@ -158,16 +158,16 @@
private final WakefulnessLifecycle.Observer mWakefullnessLifecycleObserver =
new WakefulnessLifecycle.Observer() {
- @Override
- public void onStartedWakingUp() {
- mDeviceInteractive = true;
- }
+ @Override
+ public void onStartedWakingUp() {
+ mDeviceInteractive = true;
+ }
- @Override
- public void onFinishedGoingToSleep() {
- mDeviceInteractive = false;
- }
- };
+ @Override
+ public void onFinishedGoingToSleep() {
+ mDeviceInteractive = false;
+ }
+ };
@Inject
public VolumeDialogControllerImpl(
@@ -185,8 +185,7 @@
KeyguardManager keyguardManager,
ActivityManager activityManager,
UserTracker userTracker,
- DumpManager dumpManager,
- @Main Handler mainHandler
+ DumpManager dumpManager
) {
mContext = context.getApplicationContext();
mPackageManager = packageManager;
@@ -215,7 +214,7 @@
mKeyguardManager = keyguardManager;
mActivityManager = activityManager;
mUserTracker = userTracker;
- mUserTracker.addCallback(mUserChangedCallback, new HandlerExecutor(mainHandler));
+ mUserTracker.addCallback(mUserChangedCallback, new HandlerExecutor(mWorker));
createCaptioningManagerServiceByUserContext(mUserTracker.getUserContext());
dumpManager.registerDumpable("VolumeDialogControllerImpl", this);
@@ -223,8 +222,8 @@
boolean accessibilityVolumeStreamActive = accessibilityManager
.isAccessibilityVolumeStreamActive();
mVolumeController.setA11yMode(accessibilityVolumeStreamActive ?
- VolumePolicy.A11Y_MODE_INDEPENDENT_A11Y_VOLUME :
- VolumePolicy.A11Y_MODE_MEDIA_A11Y_VOLUME);
+ VolumePolicy.A11Y_MODE_INDEPENDENT_A11Y_VOLUME :
+ VolumePolicy.A11Y_MODE_MEDIA_A11Y_VOLUME);
mWakefulnessLifecycle.addObserver(mWakefullnessLifecycleObserver);
}
@@ -337,15 +336,15 @@
};
private void createCaptioningManagerServiceByUserContext(@NonNull Context userContext) {
- mCaptioningManager = userContext.getSystemService(CaptioningManager.class);
+ mCaptioningManager.set(userContext.getSystemService(CaptioningManager.class));
}
- public boolean areCaptionsEnabled() {
- return mCaptioningManager.isSystemAudioCaptioningEnabled();
+ public void getCaptionsEnabledState(boolean checkForSwitchState) {
+ mWorker.obtainMessage(W.GET_CAPTIONS_ENABLED_STATE, checkForSwitchState).sendToTarget();
}
- public void setCaptionsEnabled(boolean isEnabled) {
- mCaptioningManager.setSystemAudioCaptioningEnabled(isEnabled);
+ public void setCaptionsEnabledState(boolean enabled) {
+ mWorker.obtainMessage(W.SET_CAPTIONS_ENABLED_STATE, enabled).sendToTarget();
}
public void getCaptionsComponentState(boolean fromTooltip) {
@@ -386,8 +385,8 @@
}
public void setEnableDialogs(boolean volumeUi, boolean safetyWarning) {
- mShowVolumeDialog = volumeUi;
- mShowSafetyWarning = safetyWarning;
+ mShowVolumeDialog = volumeUi;
+ mShowSafetyWarning = safetyWarning;
}
@Override
@@ -438,12 +437,38 @@
}
private void onShowCsdWarningW(@AudioManager.CsdWarning int csdWarning, int durationMs) {
- mCallbacks.onShowCsdWarning(csdWarning, durationMs);
+ mCallbacks.onShowCsdWarning(csdWarning, durationMs);
}
private void onGetCaptionsComponentStateW(boolean fromTooltip) {
- mCallbacks.onCaptionComponentStateChanged(
- mCaptioningManager.isSystemAudioCaptioningUiEnabled(), fromTooltip);
+ CaptioningManager captioningManager = mCaptioningManager.get();
+ if (null != captioningManager) {
+ mCallbacks.onCaptionComponentStateChanged(
+ captioningManager.isSystemAudioCaptioningUiEnabled(), fromTooltip);
+ } else {
+ Log.e(TAG, "onGetCaptionsComponentStateW(), null captioningManager");
+ }
+ }
+
+ private void onGetCaptionsEnabledStateW(boolean checkForSwitchState) {
+ CaptioningManager captioningManager = mCaptioningManager.get();
+ if (null != captioningManager) {
+ mCallbacks.onCaptionEnabledStateChanged(
+ captioningManager.isSystemAudioCaptioningEnabled(), checkForSwitchState);
+ } else {
+ Log.e(TAG, "onGetCaptionsEnabledStateW(), null captioningManager");
+ }
+ }
+
+ private void onSetCaptionsEnabledStateW(boolean enabled) {
+ CaptioningManager captioningManager = mCaptioningManager.get();
+ if (null != captioningManager) {
+ captioningManager.setSystemAudioCaptioningEnabled(enabled);
+ mCallbacks.onCaptionEnabledStateChanged(
+ captioningManager.isSystemAudioCaptioningEnabled(), false);
+ } else {
+ Log.e(TAG, "onGetCaptionsEnabledStateW(), null captioningManager");
+ }
}
private void onAccessibilityModeChanged(Boolean showA11yStream) {
@@ -822,6 +847,8 @@
private static final int ACCESSIBILITY_MODE_CHANGED = 15;
private static final int GET_CAPTIONS_COMPONENT_STATE = 16;
private static final int SHOW_CSD_WARNING = 17;
+ private static final int GET_CAPTIONS_ENABLED_STATE = 18;
+ private static final int SET_CAPTIONS_ENABLED_STATE = 19;
W(Looper looper) {
super(looper);
@@ -849,6 +876,10 @@
case ACCESSIBILITY_MODE_CHANGED: onAccessibilityModeChanged((Boolean) msg.obj);
break;
case SHOW_CSD_WARNING: onShowCsdWarningW(msg.arg1, msg.arg2); break;
+ case GET_CAPTIONS_ENABLED_STATE:
+ onGetCaptionsEnabledStateW((Boolean) msg.obj); break;
+ case SET_CAPTIONS_ENABLED_STATE:
+ onSetCaptionsEnabledStateW((Boolean) msg.obj); break;
}
}
}
@@ -1017,6 +1048,17 @@
componentEnabled, fromTooltip));
}
}
+
+ @Override
+ public void onCaptionEnabledStateChanged(Boolean isEnabled, Boolean checkBeforeSwitch) {
+ boolean captionsEnabled = isEnabled != null && isEnabled;
+ for (final Map.Entry<Callbacks, Handler> entry : mCallbackMap.entrySet()) {
+ entry.getValue().post(
+ () -> entry.getKey().onCaptionEnabledStateChanged(
+ captionsEnabled, checkBeforeSwitch));
+ }
+ }
+
}
private final class RingerModeObservers {
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
index 0e97e21..dcc0525 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
@@ -1333,21 +1333,30 @@
if (!isServiceComponentEnabled) return;
- updateCaptionsIcon();
+ checkEnabledStateForCaptionsIconUpdate();
if (fromTooltip) showCaptionsTooltip();
}
- private void updateCaptionsIcon() {
- boolean captionsEnabled = mController.areCaptionsEnabled();
- if (mODICaptionsIcon.getCaptionsEnabled() != captionsEnabled) {
- mHandler.post(mODICaptionsIcon.setCaptionsEnabled(captionsEnabled));
+ private void updateCaptionsEnabledH(boolean isCaptionsEnabled, boolean checkForSwitchState) {
+ if (checkForSwitchState) {
+ mController.setCaptionsEnabledState(!isCaptionsEnabled);
+ } else {
+ updateCaptionsIcon(isCaptionsEnabled);
+ }
+ }
+
+ private void checkEnabledStateForCaptionsIconUpdate() {
+ mController.getCaptionsEnabledState(false);
+ }
+
+ private void updateCaptionsIcon(boolean isCaptionsEnabled) {
+ if (mODICaptionsIcon.getCaptionsEnabled() != isCaptionsEnabled) {
+ mHandler.post(mODICaptionsIcon.setCaptionsEnabled(isCaptionsEnabled));
}
}
private void onCaptionIconClicked() {
- boolean isEnabled = mController.areCaptionsEnabled();
- mController.setCaptionsEnabled(!isEnabled);
- updateCaptionsIcon();
+ mController.getCaptionsEnabledState(true);
}
private void incrementManualToggleCount() {
@@ -2365,7 +2374,6 @@
} else {
updateRowsH(activeRow);
}
-
}
@Override
@@ -2373,6 +2381,11 @@
Boolean isComponentEnabled, Boolean fromTooltip) {
updateODICaptionsH(isComponentEnabled, fromTooltip);
}
+
+ @Override
+ public void onCaptionEnabledStateChanged(Boolean isEnabled, Boolean checkForSwitchState) {
+ updateCaptionsEnabledH(isEnabled, checkForSwitchState);
+ }
};
@VisibleForTesting void onPostureChanged(int posture) {
diff --git a/packages/SystemUI/src/com/android/systemui/wallpapers/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/wallpapers/ImageWallpaper.java
index 316b54e..9dca013 100644
--- a/packages/SystemUI/src/com/android/systemui/wallpapers/ImageWallpaper.java
+++ b/packages/SystemUI/src/com/android/systemui/wallpapers/ImageWallpaper.java
@@ -133,6 +133,7 @@
setShowForAllUsers(true);
mWallpaperLocalColorExtractor = new WallpaperLocalColorExtractor(
mLongExecutor,
+ mLock,
new WallpaperLocalColorExtractor.WallpaperLocalColorExtractorCallback() {
@Override
public void onColorsProcessed(List<RectF> regions,
diff --git a/packages/SystemUI/src/com/android/systemui/wallpapers/WallpaperLocalColorExtractor.java b/packages/SystemUI/src/com/android/systemui/wallpapers/WallpaperLocalColorExtractor.java
index 1e8446f..e2ec8dc 100644
--- a/packages/SystemUI/src/com/android/systemui/wallpapers/WallpaperLocalColorExtractor.java
+++ b/packages/SystemUI/src/com/android/systemui/wallpapers/WallpaperLocalColorExtractor.java
@@ -61,7 +61,7 @@
private int mBitmapWidth = -1;
private int mBitmapHeight = -1;
- private final Object mLock = new Object();
+ private final Object mLock;
private final List<RectF> mPendingRegions = new ArrayList<>();
private final Set<RectF> mProcessedRegions = new ArraySet<>();
@@ -102,12 +102,15 @@
/**
* Creates a new color extractor.
* @param longExecutor the executor on which the color extraction will be performed
+ * @param lock the lock object to use for computing colors or processing the bitmap
* @param wallpaperLocalColorExtractorCallback an interface to handle the callbacks from
* the color extractor.
*/
public WallpaperLocalColorExtractor(@LongRunning Executor longExecutor,
+ Object lock,
WallpaperLocalColorExtractorCallback wallpaperLocalColorExtractorCallback) {
mLongExecutor = longExecutor;
+ mLock = lock;
mWallpaperLocalColorExtractorCallback = wallpaperLocalColorExtractorCallback;
}
@@ -149,6 +152,12 @@
private void onBitmapChangedSynchronized(@NonNull Bitmap bitmap) {
synchronized (mLock) {
+ if (bitmap.isRecycled()) {
+ // ImageWallpaper loaded a new bitmap before the extraction of the previous one
+ // In that case, ImageWallpaper also scheduled the extraction of the next bitmap
+ Log.i(TAG, "Wallpaper has changed; deferring color extraction");
+ return;
+ }
if (bitmap.getWidth() <= 0 || bitmap.getHeight() <= 0) {
Log.e(TAG, "Attempt to extract colors from an invalid bitmap");
return;
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java
index 677d3ff..c894d91 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardAbsKeyInputViewControllerTest.java
@@ -180,8 +180,9 @@
}
@Test
- public void testResume() {
- mKeyguardAbsKeyInputViewController.onResume(KeyguardSecurityView.VIEW_REVEALED);
+ public void testOnViewAttached() {
+ reset(mLockPatternUtils);
+ mKeyguardAbsKeyInputViewController.onViewAttached();
verify(mLockPatternUtils).getLockoutAttemptDeadline(anyInt());
}
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java
index 98d4d22..1be8746 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java
@@ -23,7 +23,6 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.atLeast;
-import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -136,6 +135,10 @@
public void setup() {
MockitoAnnotations.initMocks(this);
+ mFakeDateView.setTag(R.id.tag_smartspace_view, new Object());
+ mFakeWeatherView.setTag(R.id.tag_smartspace_view, new Object());
+ mFakeSmartspaceView.setTag(R.id.tag_smartspace_view, new Object());
+
when(mView.findViewById(R.id.left_aligned_notification_icon_container))
.thenReturn(mNotificationIcons);
when(mNotificationIcons.getLayoutParams()).thenReturn(
@@ -158,12 +161,6 @@
when(mSmartspaceController.buildAndConnectDateView(any())).thenReturn(mFakeDateView);
when(mSmartspaceController.buildAndConnectWeatherView(any())).thenReturn(mFakeWeatherView);
when(mSmartspaceController.buildAndConnectView(any())).thenReturn(mFakeSmartspaceView);
- doAnswer(invocation -> {
- removeView(mFakeDateView);
- removeView(mFakeWeatherView);
- removeView(mFakeSmartspaceView);
- return null;
- }).when(mSmartspaceController).removeViewsFromParent(any());
mExecutor = new FakeExecutor(new FakeSystemClock());
mFakeFeatureFlags = new FakeFeatureFlags();
mFakeFeatureFlags.set(FACE_AUTH_REFACTOR, false);
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardDisplayManagerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardDisplayManagerTest.java
index b349696..438f0f4 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardDisplayManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardDisplayManagerTest.java
@@ -18,6 +18,8 @@
import static android.view.DisplayAdjustments.DEFAULT_DISPLAY_ADJUSTMENTS;
+import static com.android.systemui.flags.Flags.ENABLE_CLOCK_KEYGUARD_PRESENTATION;
+
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
@@ -37,6 +39,7 @@
import com.android.keyguard.dagger.KeyguardStatusViewComponent;
import com.android.systemui.SysuiTestCase;
+import com.android.systemui.flags.FakeFeatureFlags;
import com.android.systemui.navigationbar.NavigationBarController;
import com.android.systemui.settings.FakeDisplayTracker;
import com.android.systemui.statusbar.policy.KeyguardStateController;
@@ -59,8 +62,13 @@
@Mock
private KeyguardStatusViewComponent.Factory mKeyguardStatusViewComponentFactory;
@Mock
+ private ConnectedDisplayKeyguardPresentation.Factory
+ mConnectedDisplayKeyguardPresentationFactory;
+ @Mock
private KeyguardDisplayManager.KeyguardPresentation mKeyguardPresentation;
@Mock
+ private ConnectedDisplayKeyguardPresentation mConnectedDisplayKeyguardPresentation;
+ @Mock
private KeyguardDisplayManager.DeviceStateHelper mDeviceStateHelper;
@Mock
private KeyguardStateController mKeyguardStateController;
@@ -69,7 +77,7 @@
private Executor mBackgroundExecutor = Runnable::run;
private KeyguardDisplayManager mManager;
private FakeDisplayTracker mDisplayTracker = new FakeDisplayTracker(mContext);
-
+ private FakeFeatureFlags mFakeFeatureFlags = new FakeFeatureFlags();
// The default and secondary displays are both in the default group
private Display mDefaultDisplay;
private Display mSecondaryDisplay;
@@ -80,10 +88,14 @@
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
+ mFakeFeatureFlags.set(ENABLE_CLOCK_KEYGUARD_PRESENTATION, false);
mManager = spy(new KeyguardDisplayManager(mContext, () -> mNavigationBarController,
mKeyguardStatusViewComponentFactory, mDisplayTracker, mMainExecutor,
- mBackgroundExecutor, mDeviceStateHelper, mKeyguardStateController));
+ mBackgroundExecutor, mDeviceStateHelper, mKeyguardStateController,
+ mConnectedDisplayKeyguardPresentationFactory, mFakeFeatureFlags));
doReturn(mKeyguardPresentation).when(mManager).createPresentation(any());
+ doReturn(mConnectedDisplayKeyguardPresentation).when(
+ mConnectedDisplayKeyguardPresentationFactory).create(any());
mDefaultDisplay = new Display(DisplayManagerGlobal.getInstance(), Display.DEFAULT_DISPLAY,
new DisplayInfo(), DEFAULT_DISPLAY_ADJUSTMENTS);
@@ -138,4 +150,15 @@
when(mKeyguardStateController.isOccluded()).thenReturn(true);
verify(mManager, never()).createPresentation(eq(mSecondaryDisplay));
}
+
+ @Test
+ public void testShow_withClockPresentationFlagEnabled_presentationCreated() {
+ when(mManager.createPresentation(any())).thenCallRealMethod();
+ mFakeFeatureFlags.set(ENABLE_CLOCK_KEYGUARD_PRESENTATION, true);
+ mDisplayTracker.setAllDisplays(new Display[]{mDefaultDisplay, mSecondaryDisplay});
+
+ mManager.show();
+
+ verify(mConnectedDisplayKeyguardPresentationFactory).create(eq(mSecondaryDisplay));
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt
index 1a9260c..3a94730 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPasswordViewControllerTest.kt
@@ -20,6 +20,7 @@
import android.testing.TestableLooper
import android.view.inputmethod.InputMethodManager
import android.widget.EditText
+import android.widget.ImageView
import androidx.test.filters.SmallTest
import com.android.internal.util.LatencyTracker
import com.android.internal.widget.LockPatternUtils
@@ -29,6 +30,7 @@
import com.android.systemui.flags.FakeFeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.util.concurrency.DelayableExecutor
+import com.android.systemui.util.mockito.whenever
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -36,6 +38,7 @@
import org.mockito.ArgumentMatchers.anyString
import org.mockito.Mock
import org.mockito.Mockito
+import org.mockito.Mockito.mock
import org.mockito.Mockito.never
import org.mockito.Mockito.verify
import org.mockito.Mockito.`when`
@@ -45,104 +48,109 @@
@RunWith(AndroidTestingRunner::class)
@TestableLooper.RunWithLooper
class KeyguardPasswordViewControllerTest : SysuiTestCase() {
- @Mock private lateinit var keyguardPasswordView: KeyguardPasswordView
- @Mock private lateinit var passwordEntry: EditText
- @Mock lateinit var keyguardUpdateMonitor: KeyguardUpdateMonitor
- @Mock lateinit var securityMode: KeyguardSecurityModel.SecurityMode
- @Mock lateinit var lockPatternUtils: LockPatternUtils
- @Mock lateinit var keyguardSecurityCallback: KeyguardSecurityCallback
- @Mock lateinit var messageAreaControllerFactory: KeyguardMessageAreaController.Factory
- @Mock lateinit var latencyTracker: LatencyTracker
- @Mock lateinit var inputMethodManager: InputMethodManager
- @Mock lateinit var emergencyButtonController: EmergencyButtonController
- @Mock lateinit var mainExecutor: DelayableExecutor
- @Mock lateinit var falsingCollector: FalsingCollector
- @Mock lateinit var keyguardViewController: KeyguardViewController
- @Mock private lateinit var mKeyguardMessageArea: BouncerKeyguardMessageArea
- @Mock
- private lateinit var mKeyguardMessageAreaController:
- KeyguardMessageAreaController<BouncerKeyguardMessageArea>
+ @Mock private lateinit var keyguardPasswordView: KeyguardPasswordView
+ @Mock private lateinit var passwordEntry: EditText
+ @Mock lateinit var keyguardUpdateMonitor: KeyguardUpdateMonitor
+ @Mock lateinit var securityMode: KeyguardSecurityModel.SecurityMode
+ @Mock lateinit var lockPatternUtils: LockPatternUtils
+ @Mock lateinit var keyguardSecurityCallback: KeyguardSecurityCallback
+ @Mock lateinit var messageAreaControllerFactory: KeyguardMessageAreaController.Factory
+ @Mock lateinit var latencyTracker: LatencyTracker
+ @Mock lateinit var inputMethodManager: InputMethodManager
+ @Mock lateinit var emergencyButtonController: EmergencyButtonController
+ @Mock lateinit var mainExecutor: DelayableExecutor
+ @Mock lateinit var falsingCollector: FalsingCollector
+ @Mock lateinit var keyguardViewController: KeyguardViewController
+ @Mock private lateinit var mKeyguardMessageArea: BouncerKeyguardMessageArea
+ @Mock
+ private lateinit var mKeyguardMessageAreaController:
+ KeyguardMessageAreaController<BouncerKeyguardMessageArea>
- private lateinit var keyguardPasswordViewController: KeyguardPasswordViewController
+ private lateinit var keyguardPasswordViewController: KeyguardPasswordViewController
- @Before
- fun setup() {
- MockitoAnnotations.initMocks(this)
- Mockito.`when`(
- keyguardPasswordView.requireViewById<BouncerKeyguardMessageArea>(
- R.id.bouncer_message_area))
- .thenReturn(mKeyguardMessageArea)
- Mockito.`when`(messageAreaControllerFactory.create(mKeyguardMessageArea))
- .thenReturn(mKeyguardMessageAreaController)
- Mockito.`when`(keyguardPasswordView.passwordTextViewId).thenReturn(R.id.passwordEntry)
- Mockito.`when`(keyguardPasswordView.findViewById<EditText>(R.id.passwordEntry))
- .thenReturn(passwordEntry)
- `when`(keyguardPasswordView.resources).thenReturn(context.resources)
- val fakeFeatureFlags = FakeFeatureFlags()
- fakeFeatureFlags.set(Flags.REVAMPED_BOUNCER_MESSAGES, true)
- keyguardPasswordViewController =
- KeyguardPasswordViewController(
- keyguardPasswordView,
- keyguardUpdateMonitor,
- securityMode,
- lockPatternUtils,
- keyguardSecurityCallback,
- messageAreaControllerFactory,
- latencyTracker,
- inputMethodManager,
- emergencyButtonController,
- mainExecutor,
- mContext.resources,
- falsingCollector,
- keyguardViewController,
- fakeFeatureFlags)
- }
-
- @Test
- fun testFocusWhenBouncerIsShown() {
- Mockito.`when`(keyguardViewController.isBouncerShowing).thenReturn(true)
- Mockito.`when`(keyguardPasswordView.isShown).thenReturn(true)
- keyguardPasswordViewController.onResume(KeyguardSecurityView.VIEW_REVEALED)
- keyguardPasswordView.post {
- verify(keyguardPasswordView).requestFocus()
- verify(keyguardPasswordView).showKeyboard()
+ @Before
+ fun setup() {
+ MockitoAnnotations.initMocks(this)
+ Mockito.`when`(
+ keyguardPasswordView.requireViewById<BouncerKeyguardMessageArea>(
+ R.id.bouncer_message_area
+ )
+ )
+ .thenReturn(mKeyguardMessageArea)
+ Mockito.`when`(messageAreaControllerFactory.create(mKeyguardMessageArea))
+ .thenReturn(mKeyguardMessageAreaController)
+ Mockito.`when`(keyguardPasswordView.passwordTextViewId).thenReturn(R.id.passwordEntry)
+ Mockito.`when`(keyguardPasswordView.findViewById<EditText>(R.id.passwordEntry))
+ .thenReturn(passwordEntry)
+ whenever(keyguardPasswordView.findViewById<ImageView>(R.id.switch_ime_button))
+ .thenReturn(mock(ImageView::class.java))
+ `when`(keyguardPasswordView.resources).thenReturn(context.resources)
+ val fakeFeatureFlags = FakeFeatureFlags()
+ fakeFeatureFlags.set(Flags.REVAMPED_BOUNCER_MESSAGES, true)
+ keyguardPasswordViewController =
+ KeyguardPasswordViewController(
+ keyguardPasswordView,
+ keyguardUpdateMonitor,
+ securityMode,
+ lockPatternUtils,
+ keyguardSecurityCallback,
+ messageAreaControllerFactory,
+ latencyTracker,
+ inputMethodManager,
+ emergencyButtonController,
+ mainExecutor,
+ mContext.resources,
+ falsingCollector,
+ keyguardViewController,
+ fakeFeatureFlags
+ )
}
- }
- @Test
- fun testDoNotFocusWhenBouncerIsHidden() {
- Mockito.`when`(keyguardViewController.isBouncerShowing).thenReturn(false)
- Mockito.`when`(keyguardPasswordView.isShown).thenReturn(true)
- keyguardPasswordViewController.onResume(KeyguardSecurityView.VIEW_REVEALED)
- verify(keyguardPasswordView, never()).requestFocus()
- }
-
- @Test
- fun testHideKeyboardWhenOnPause() {
- keyguardPasswordViewController.onPause()
- keyguardPasswordView.post {
- verify(keyguardPasswordView).clearFocus()
- verify(keyguardPasswordView).hideKeyboard()
+ @Test
+ fun testFocusWhenBouncerIsShown() {
+ Mockito.`when`(keyguardViewController.isBouncerShowing).thenReturn(true)
+ Mockito.`when`(keyguardPasswordView.isShown).thenReturn(true)
+ keyguardPasswordViewController.onResume(KeyguardSecurityView.VIEW_REVEALED)
+ keyguardPasswordView.post {
+ verify(keyguardPasswordView).requestFocus()
+ verify(keyguardPasswordView).showKeyboard()
+ }
}
- }
- @Test
- fun startAppearAnimation() {
- keyguardPasswordViewController.startAppearAnimation()
- verify(mKeyguardMessageAreaController)
- .setMessage(context.resources.getString(R.string.keyguard_enter_your_password), false)
- }
+ @Test
+ fun testDoNotFocusWhenBouncerIsHidden() {
+ Mockito.`when`(keyguardViewController.isBouncerShowing).thenReturn(false)
+ Mockito.`when`(keyguardPasswordView.isShown).thenReturn(true)
+ keyguardPasswordViewController.onResume(KeyguardSecurityView.VIEW_REVEALED)
+ verify(keyguardPasswordView, never()).requestFocus()
+ }
- @Test
- fun startAppearAnimation_withExistingMessage() {
- `when`(mKeyguardMessageAreaController.message).thenReturn("Unlock to continue.")
- keyguardPasswordViewController.startAppearAnimation()
- verify(mKeyguardMessageAreaController, never()).setMessage(anyString(), anyBoolean())
- }
+ @Test
+ fun testHideKeyboardWhenOnPause() {
+ keyguardPasswordViewController.onPause()
+ keyguardPasswordView.post {
+ verify(keyguardPasswordView).clearFocus()
+ verify(keyguardPasswordView).hideKeyboard()
+ }
+ }
- @Test
- fun testMessageIsSetWhenReset() {
- keyguardPasswordViewController.resetState()
- verify(mKeyguardMessageAreaController).setMessage(R.string.keyguard_enter_your_password)
- }
+ @Test
+ fun testOnViewAttached() {
+ keyguardPasswordViewController.onViewAttached()
+ verify(mKeyguardMessageAreaController)
+ .setMessage(context.resources.getString(R.string.keyguard_enter_your_password), false)
+ }
+
+ @Test
+ fun testOnViewAttached_withExistingMessage() {
+ `when`(mKeyguardMessageAreaController.message).thenReturn("Unlock to continue.")
+ keyguardPasswordViewController.onViewAttached()
+ verify(mKeyguardMessageAreaController, never()).setMessage(anyString(), anyBoolean())
+ }
+
+ @Test
+ fun testMessageIsSetWhenReset() {
+ keyguardPasswordViewController.resetState()
+ verify(mKeyguardMessageAreaController).setMessage(R.string.keyguard_enter_your_password)
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPatternViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPatternViewControllerTest.kt
index 9f7ab7b..1acd676 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPatternViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPatternViewControllerTest.kt
@@ -46,6 +46,7 @@
import org.mockito.Captor
import org.mockito.Mock
import org.mockito.Mockito.never
+import org.mockito.Mockito.reset
import org.mockito.Mockito.verify
import org.mockito.Mockito.`when`
import org.mockito.MockitoAnnotations
@@ -54,35 +55,35 @@
@RunWith(AndroidTestingRunner::class)
@TestableLooper.RunWithLooper
class KeyguardPatternViewControllerTest : SysuiTestCase() {
- private lateinit var mKeyguardPatternView: KeyguardPatternView
+ private lateinit var mKeyguardPatternView: KeyguardPatternView
- @Mock private lateinit var mKeyguardUpdateMonitor: KeyguardUpdateMonitor
+ @Mock private lateinit var mKeyguardUpdateMonitor: KeyguardUpdateMonitor
- @Mock private lateinit var mSecurityMode: KeyguardSecurityModel.SecurityMode
+ @Mock private lateinit var mSecurityMode: KeyguardSecurityModel.SecurityMode
- @Mock private lateinit var mLockPatternUtils: LockPatternUtils
+ @Mock private lateinit var mLockPatternUtils: LockPatternUtils
- @Mock private lateinit var mKeyguardSecurityCallback: KeyguardSecurityCallback
+ @Mock private lateinit var mKeyguardSecurityCallback: KeyguardSecurityCallback
- @Mock private lateinit var mLatencyTracker: LatencyTracker
- private var mFalsingCollector: FalsingCollector = FalsingCollectorFake()
+ @Mock private lateinit var mLatencyTracker: LatencyTracker
+ private var mFalsingCollector: FalsingCollector = FalsingCollectorFake()
- @Mock private lateinit var mEmergencyButtonController: EmergencyButtonController
+ @Mock private lateinit var mEmergencyButtonController: EmergencyButtonController
- @Mock
- private lateinit var mKeyguardMessageAreaControllerFactory: KeyguardMessageAreaController.Factory
+ @Mock
+ private lateinit var mKeyguardMessageAreaControllerFactory:
+ KeyguardMessageAreaController.Factory
- @Mock
- private lateinit var mKeyguardMessageAreaController:
- KeyguardMessageAreaController<BouncerKeyguardMessageArea>
+ @Mock
+ private lateinit var mKeyguardMessageAreaController:
+ KeyguardMessageAreaController<BouncerKeyguardMessageArea>
- @Mock private lateinit var mPostureController: DevicePostureController
+ @Mock private lateinit var mPostureController: DevicePostureController
- private lateinit var mKeyguardPatternViewController: KeyguardPatternViewController
- private lateinit var fakeFeatureFlags: FakeFeatureFlags
+ private lateinit var mKeyguardPatternViewController: KeyguardPatternViewController
+ private lateinit var fakeFeatureFlags: FakeFeatureFlags
- @Captor
- lateinit var postureCallbackCaptor: ArgumentCaptor<DevicePostureController.Callback>
+ @Captor lateinit var postureCallbackCaptor: ArgumentCaptor<DevicePostureController.Callback>
@Before
fun setup() {
@@ -91,9 +92,8 @@
.thenReturn(mKeyguardMessageAreaController)
fakeFeatureFlags = FakeFeatureFlags()
fakeFeatureFlags.set(Flags.REVAMPED_BOUNCER_MESSAGES, false)
- mKeyguardPatternView = View.inflate(mContext, R.layout.keyguard_pattern_view, null)
- as KeyguardPatternView
-
+ mKeyguardPatternView =
+ View.inflate(mContext, R.layout.keyguard_pattern_view, null) as KeyguardPatternView
mKeyguardPatternViewController =
KeyguardPatternViewController(
@@ -125,8 +125,7 @@
@Test
fun onDevicePostureChanged_deviceOpened_propagatedToPatternView() {
overrideResource(R.dimen.half_opened_bouncer_height_ratio, 0.5f)
- whenever(mPostureController.devicePosture)
- .thenReturn(DEVICE_POSTURE_HALF_OPENED)
+ whenever(mPostureController.devicePosture).thenReturn(DEVICE_POSTURE_HALF_OPENED)
mKeyguardPatternViewController.onViewAttached()
@@ -159,39 +158,37 @@
return mContext.resources.getFloat(R.dimen.half_opened_bouncer_height_ratio)
}
- @Test
- fun withFeatureFlagOn_oldMessage_isHidden() {
- fakeFeatureFlags.set(Flags.REVAMPED_BOUNCER_MESSAGES, true)
+ @Test
+ fun withFeatureFlagOn_oldMessage_isHidden() {
+ fakeFeatureFlags.set(Flags.REVAMPED_BOUNCER_MESSAGES, true)
- mKeyguardPatternViewController.onViewAttached()
+ mKeyguardPatternViewController.onViewAttached()
- verify<KeyguardMessageAreaController<*>>(mKeyguardMessageAreaController).disable()
- }
+ verify<KeyguardMessageAreaController<*>>(mKeyguardMessageAreaController).disable()
+ }
- @Test
- fun onPause_resetsText() {
- mKeyguardPatternViewController.init()
- mKeyguardPatternViewController.onPause()
- verify(mKeyguardMessageAreaController).setMessage(R.string.keyguard_enter_your_pattern)
- }
+ @Test
+ fun onPause_resetsText() {
+ mKeyguardPatternViewController.init()
+ mKeyguardPatternViewController.onPause()
+ verify(mKeyguardMessageAreaController).setMessage(R.string.keyguard_enter_your_pattern)
+ }
- @Test
- fun startAppearAnimation() {
- mKeyguardPatternViewController.startAppearAnimation()
- verify(mKeyguardMessageAreaController)
- .setMessage(context.resources.getString(R.string.keyguard_enter_your_pattern), false)
- }
+ @Test
+ fun testOnViewAttached() {
+ reset(mKeyguardMessageAreaController)
+ reset(mLockPatternUtils)
+ mKeyguardPatternViewController.onViewAttached()
+ verify(mKeyguardMessageAreaController)
+ .setMessage(context.resources.getString(R.string.keyguard_enter_your_pattern), false)
+ verify(mLockPatternUtils).getLockoutAttemptDeadline(anyInt())
+ }
- @Test
- fun startAppearAnimation_withExistingMessage() {
- `when`(mKeyguardMessageAreaController.message).thenReturn("Unlock to continue.")
- mKeyguardPatternViewController.startAppearAnimation()
- verify(mKeyguardMessageAreaController, never()).setMessage(anyString(), anyBoolean())
- }
-
- @Test
- fun resume() {
- mKeyguardPatternViewController.onResume(KeyguardSecurityView.VIEW_REVEALED)
- verify(mLockPatternUtils).getLockoutAttemptDeadline(anyInt())
- }
+ @Test
+ fun testOnViewAttached_withExistingMessage() {
+ reset(mKeyguardMessageAreaController)
+ `when`(mKeyguardMessageAreaController.message).thenReturn("Unlock to continue.")
+ mKeyguardPatternViewController.onViewAttached()
+ verify(mKeyguardMessageAreaController, never()).setMessage(anyString(), anyBoolean())
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinBasedInputViewControllerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinBasedInputViewControllerTest.java
index cf86c21..efe1955 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinBasedInputViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinBasedInputViewControllerTest.java
@@ -100,6 +100,8 @@
.thenReturn(mDeleteButton);
when(mPinBasedInputView.findViewById(R.id.key_enter))
.thenReturn(mOkButton);
+
+ when(mPinBasedInputView.getResources()).thenReturn(getContext().getResources());
FakeFeatureFlags featureFlags = new FakeFeatureFlags();
featureFlags.set(Flags.REVAMPED_BOUNCER_MESSAGES, true);
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinViewControllerTest.kt
index 309d9e0..80fd721 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardPinViewControllerTest.kt
@@ -185,27 +185,27 @@
}
@Test
- fun startAppearAnimation() {
+ fun testOnViewAttached() {
val pinViewController = constructPinViewController(mockKeyguardPinView)
- pinViewController.startAppearAnimation()
+ pinViewController.onViewAttached()
verify(keyguardMessageAreaController)
.setMessage(context.resources.getString(R.string.keyguard_enter_your_pin), false)
}
@Test
- fun startAppearAnimation_withExistingMessage() {
+ fun testOnViewAttached_withExistingMessage() {
val pinViewController = constructPinViewController(mockKeyguardPinView)
Mockito.`when`(keyguardMessageAreaController.message).thenReturn("Unlock to continue.")
- pinViewController.startAppearAnimation()
+ pinViewController.onViewAttached()
verify(keyguardMessageAreaController, Mockito.never()).setMessage(anyString(), anyBoolean())
}
@Test
- fun startAppearAnimation_withAutoPinConfirmationFailedPasswordAttemptsLessThan5() {
+ fun testOnViewAttached_withAutoPinConfirmationFailedPasswordAttemptsLessThan5() {
val pinViewController = constructPinViewController(mockKeyguardPinView)
`when`(featureFlags.isEnabled(Flags.AUTO_PIN_CONFIRMATION)).thenReturn(true)
`when`(lockPatternUtils.getPinLength(anyInt())).thenReturn(6)
@@ -213,7 +213,7 @@
`when`(lockPatternUtils.getCurrentFailedPasswordAttempts(anyInt())).thenReturn(3)
`when`(passwordTextView.text).thenReturn("")
- pinViewController.startAppearAnimation()
+ pinViewController.onViewAttached()
verify(deleteButton).visibility = View.INVISIBLE
verify(enterButton).visibility = View.INVISIBLE
@@ -222,7 +222,7 @@
}
@Test
- fun startAppearAnimation_withAutoPinConfirmationFailedPasswordAttemptsMoreThan5() {
+ fun testOnViewAttached_withAutoPinConfirmationFailedPasswordAttemptsMoreThan5() {
val pinViewController = constructPinViewController(mockKeyguardPinView)
`when`(featureFlags.isEnabled(Flags.AUTO_PIN_CONFIRMATION)).thenReturn(true)
`when`(lockPatternUtils.getPinLength(anyInt())).thenReturn(6)
@@ -230,7 +230,7 @@
`when`(lockPatternUtils.getCurrentFailedPasswordAttempts(anyInt())).thenReturn(6)
`when`(passwordTextView.text).thenReturn("")
- pinViewController.startAppearAnimation()
+ pinViewController.onViewAttached()
verify(deleteButton).visibility = View.VISIBLE
verify(enterButton).visibility = View.VISIBLE
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt
index 0192e78..dff058c 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.kt
@@ -58,12 +58,15 @@
import com.android.systemui.scene.shared.model.SceneKey
import com.android.systemui.scene.shared.model.SceneModel
import com.android.systemui.statusbar.policy.ConfigurationController
+import com.android.systemui.statusbar.policy.DeviceProvisionedController
import com.android.systemui.statusbar.policy.KeyguardStateController
import com.android.systemui.statusbar.policy.UserSwitcherController
import com.android.systemui.user.domain.interactor.UserInteractor
import com.android.systemui.util.kotlin.JavaAdapter
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.argThat
+import com.android.systemui.util.mockito.argumentCaptor
+import com.android.systemui.util.mockito.capture
import com.android.systemui.util.mockito.mock
import com.android.systemui.util.mockito.whenever
import com.android.systemui.util.settings.GlobalSettings
@@ -133,6 +136,7 @@
@Mock private lateinit var audioManager: AudioManager
@Mock private lateinit var userInteractor: UserInteractor
@Mock private lateinit var faceAuthAccessibilityDelegate: FaceAuthAccessibilityDelegate
+ @Mock private lateinit var deviceProvisionedController: DeviceProvisionedController
@Captor
private lateinit var swipeListenerArgumentCaptor:
@@ -182,6 +186,7 @@
whenever(keyguardPasswordView.windowInsetsController).thenReturn(windowInsetsController)
whenever(keyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(SecurityMode.PIN)
whenever(keyguardStateController.canDismissLockScreen()).thenReturn(true)
+ whenever(deviceProvisionedController.isUserSetup(anyInt())).thenReturn(true)
featureFlags = FakeFeatureFlags()
featureFlags.set(Flags.REVAMPED_BOUNCER_MESSAGES, true)
@@ -249,6 +254,7 @@
mock(),
{ JavaAdapter(sceneTestUtils.testScope.backgroundScope) },
userInteractor,
+ deviceProvisionedController,
faceAuthAccessibilityDelegate,
keyguardTransitionInteractor
) {
@@ -506,6 +512,30 @@
// THEN the next security method of None will dismiss keyguard.
verify(viewMediatorCallback, never()).keyguardDone(anyBoolean(), anyInt())
}
+ @Test
+ fun showNextSecurityScreenOrFinish_SimPin_Swipe_userNotSetup() {
+ // GIVEN the current security method is SimPin
+ whenever(keyguardUpdateMonitor.getUserHasTrust(anyInt())).thenReturn(false)
+ whenever(keyguardUpdateMonitor.getUserUnlockedWithBiometric(TARGET_USER_ID))
+ .thenReturn(false)
+ underTest.showSecurityScreen(SecurityMode.SimPin)
+
+ // WHEN a request is made from the SimPin screens to show the next security method
+ whenever(keyguardSecurityModel.getSecurityMode(TARGET_USER_ID))
+ .thenReturn(SecurityMode.None)
+ // WHEN security method is SWIPE
+ whenever(lockPatternUtils.isLockScreenDisabled(anyInt())).thenReturn(false)
+ whenever(deviceProvisionedController.isUserSetup(anyInt())).thenReturn(false)
+ underTest.showNextSecurityScreenOrFinish(
+ /* authenticated= */ true,
+ TARGET_USER_ID,
+ /* bypassSecondaryLockScreen= */ true,
+ SecurityMode.SimPin
+ )
+
+ // THEN the next security method of None will dismiss keyguard.
+ verify(viewMediatorCallback).keyguardDone(anyBoolean(), anyInt())
+ }
@Test
fun onSwipeUp_whenFaceDetectionIsNotRunning_initiatesFaceAuth() {
@@ -578,18 +608,7 @@
ArgumentCaptor.forClass(ConfigurationController.ConfigurationListener::class.java)
underTest.onViewAttached()
verify(configurationController).addCallback(configurationListenerArgumentCaptor.capture())
- clearInvocations(viewFlipperController)
configurationListenerArgumentCaptor.value.onThemeChanged()
- verify(viewFlipperController).clearViews()
- verify(viewFlipperController)
- .asynchronouslyInflateView(
- eq(SecurityMode.PIN),
- any(),
- onViewInflatedCallbackArgumentCaptor.capture()
- )
- onViewInflatedCallbackArgumentCaptor.value.onViewInflated(inputViewController)
- verify(view).reset()
- verify(viewFlipperController).reset()
verify(view).reloadColors()
}
@@ -599,8 +618,46 @@
ArgumentCaptor.forClass(ConfigurationController.ConfigurationListener::class.java)
underTest.onViewAttached()
verify(configurationController).addCallback(configurationListenerArgumentCaptor.capture())
- clearInvocations(viewFlipperController)
configurationListenerArgumentCaptor.value.onUiModeChanged()
+ verify(view).reloadColors()
+ }
+ @Test
+ fun onOrientationChanged_landscapeKeyguardFlagDisabled_blockReinflate() {
+ featureFlags.set(Flags.LOCKSCREEN_ENABLE_LANDSCAPE, false)
+
+ // Run onOrientationChanged
+ val configurationListenerArgumentCaptor =
+ ArgumentCaptor.forClass(ConfigurationController.ConfigurationListener::class.java)
+ underTest.onViewAttached()
+ verify(configurationController).addCallback(configurationListenerArgumentCaptor.capture())
+ clearInvocations(viewFlipperController)
+ configurationListenerArgumentCaptor.value.onOrientationChanged(
+ Configuration.ORIENTATION_LANDSCAPE
+ )
+ // Verify view is reinflated when flag is on
+ verify(viewFlipperController, never()).clearViews()
+ verify(viewFlipperController, never())
+ .asynchronouslyInflateView(
+ eq(SecurityMode.PIN),
+ any(),
+ onViewInflatedCallbackArgumentCaptor.capture()
+ )
+ }
+
+ @Test
+ fun onOrientationChanged_landscapeKeyguardFlagEnabled_doesReinflate() {
+ featureFlags.set(Flags.LOCKSCREEN_ENABLE_LANDSCAPE, true)
+
+ // Run onOrientationChanged
+ val configurationListenerArgumentCaptor =
+ ArgumentCaptor.forClass(ConfigurationController.ConfigurationListener::class.java)
+ underTest.onViewAttached()
+ verify(configurationController).addCallback(configurationListenerArgumentCaptor.capture())
+ clearInvocations(viewFlipperController)
+ configurationListenerArgumentCaptor.value.onOrientationChanged(
+ Configuration.ORIENTATION_LANDSCAPE
+ )
+ // Verify view is reinflated when flag is on
verify(viewFlipperController).clearViews()
verify(viewFlipperController)
.asynchronouslyInflateView(
@@ -608,8 +665,6 @@
any(),
onViewInflatedCallbackArgumentCaptor.capture()
)
- onViewInflatedCallbackArgumentCaptor.value.onViewInflated(inputViewController)
- verify(view).reloadColors()
}
@Test
@@ -847,6 +902,17 @@
verify(userSwitcher).setAlpha(0f)
}
+ @Test
+ fun testOnUserSwitched() {
+ val userSwitchCallbackArgumentCaptor =
+ argumentCaptor<UserSwitcherController.UserSwitchCallback>()
+ underTest.onViewAttached()
+ verify(userSwitcherController)
+ .addUserSwitchCallback(capture(userSwitchCallbackArgumentCaptor))
+ userSwitchCallbackArgumentCaptor.value.onUserSwitched()
+ verify(viewFlipperController).asynchronouslyInflateView(any(), any(), any())
+ }
+
private val registeredSwipeListener: KeyguardSecurityContainer.SwipeListener
get() {
underTest.onViewAttached()
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPinViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPinViewControllerTest.kt
index a3acc78..291dda25 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPinViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPinViewControllerTest.kt
@@ -97,6 +97,8 @@
@Test
fun onViewAttached() {
underTest.onViewAttached()
+ verify(keyguardMessageAreaController)
+ .setMessage(context.resources.getString(R.string.keyguard_enter_your_pin), false)
}
@Test
@@ -120,8 +122,6 @@
@Test
fun startAppearAnimation() {
underTest.startAppearAnimation()
- verify(keyguardMessageAreaController)
- .setMessage(context.resources.getString(R.string.keyguard_enter_your_pin), false)
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPukViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPukViewControllerTest.kt
index efcf4dd..626faa6 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPukViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardSimPukViewControllerTest.kt
@@ -98,6 +98,8 @@
underTest.onViewAttached()
Mockito.verify(keyguardUpdateMonitor)
.registerCallback(any(KeyguardUpdateMonitorCallback::class.java))
+ Mockito.verify(keyguardMessageAreaController)
+ .setMessage(context.resources.getString(R.string.keyguard_enter_your_pin), false)
}
@Test
@@ -120,8 +122,6 @@
@Test
fun startAppearAnimation() {
underTest.startAppearAnimation()
- Mockito.verify(keyguardMessageAreaController)
- .setMessage(context.resources.getString(R.string.keyguard_enter_your_pin), false)
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewControllerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewControllerTest.java
index 7d23c80..b8b0198 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewControllerTest.java
@@ -77,7 +77,7 @@
public void updatePosition_primaryClockAnimation() {
ClockController mockClock = mock(ClockController.class);
when(mKeyguardClockSwitchController.getClock()).thenReturn(mockClock);
- when(mockClock.getConfig()).thenReturn(new ClockConfig(false, true));
+ when(mockClock.getConfig()).thenReturn(new ClockConfig("MOCK", false, true));
mController.updatePosition(10, 15, 20f, true);
@@ -92,7 +92,7 @@
public void updatePosition_alternateClockAnimation() {
ClockController mockClock = mock(ClockController.class);
when(mKeyguardClockSwitchController.getClock()).thenReturn(mockClock);
- when(mockClock.getConfig()).thenReturn(new ClockConfig(true, true));
+ when(mockClock.getConfig()).thenReturn(new ClockConfig("MOCK", true, true));
mController.updatePosition(10, 15, 20f, true);
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
index 6f3322a..0cd82f0 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
@@ -1694,71 +1694,6 @@
}
@Test
- public void startsListeningForSfps_whenKeyguardIsVisible_ifRequireInteractiveToAuthEnabled()
- throws RemoteException {
- // SFPS supported and enrolled
- when(mAuthController.isSfpsSupported()).thenReturn(true);
- when(mAuthController.isSfpsEnrolled(anyInt())).thenReturn(true);
-
- // WHEN require interactive to auth is disabled, and keyguard is not awake
- when(mInteractiveToAuthProvider.isEnabled(anyInt())).thenReturn(false);
-
- // Preconditions for sfps auth to run
- keyguardNotGoingAway();
- currentUserIsSystem();
- currentUserDoesNotHaveTrust();
- biometricsNotDisabledThroughDevicePolicyManager();
- biometricsEnabledForCurrentUser();
- userNotCurrentlySwitching();
-
- statusBarShadeIsLocked();
- mTestableLooper.processAllMessages();
-
- // THEN we should listen for sfps when screen off, because require screen on is disabled
- assertThat(mKeyguardUpdateMonitor.shouldListenForFingerprint(false)).isTrue();
-
- // WHEN require interactive to auth is enabled, and keyguard is not awake
- when(mInteractiveToAuthProvider.isEnabled(anyInt())).thenReturn(true);
-
- // THEN we shouldn't listen for sfps when screen off, because require screen on is enabled
- assertThat(mKeyguardUpdateMonitor.shouldListenForFingerprint(false)).isFalse();
-
- // Device now awake & keyguard is now interactive
- deviceNotGoingToSleep();
- deviceIsInteractive();
- keyguardIsVisible();
-
- // THEN we should listen for sfps when screen on, and require screen on is enabled
- assertThat(mKeyguardUpdateMonitor.shouldListenForFingerprint(false)).isTrue();
- }
-
- @Test
- public void notListeningForSfps_whenGoingToSleep_ifRequireInteractiveToAuthEnabled()
- throws RemoteException {
- // GIVEN SFPS supported and enrolled
- when(mAuthController.isSfpsSupported()).thenReturn(true);
- when(mAuthController.isSfpsEnrolled(anyInt())).thenReturn(true);
-
- // GIVEN Preconditions for sfps auth to run
- keyguardNotGoingAway();
- currentUserIsSystem();
- currentUserDoesNotHaveTrust();
- biometricsNotDisabledThroughDevicePolicyManager();
- biometricsEnabledForCurrentUser();
- userNotCurrentlySwitching();
- statusBarShadeIsLocked();
-
- // WHEN require interactive to auth is enabled & keyguard is going to sleep
- when(mInteractiveToAuthProvider.isEnabled(anyInt())).thenReturn(true);
- deviceGoingToSleep();
-
- mTestableLooper.processAllMessages();
-
- // THEN we should NOT listen for sfps because device is going to sleep
- assertThat(mKeyguardUpdateMonitor.shouldListenForFingerprint(false)).isFalse();
- }
-
- @Test
public void listeningForSfps_whenGoingToSleep_ifRequireInteractiveToAuthDisabled()
throws RemoteException {
// GIVEN SFPS supported and enrolled
diff --git a/packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java
index b23f7f2d..b100336 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java
@@ -21,6 +21,8 @@
import static com.android.systemui.appops.AppOpsControllerImpl.OPS_MIC;
+import static com.google.common.truth.Truth.assertThat;
+
import static junit.framework.TestCase.assertFalse;
import static org.junit.Assert.assertEquals;
@@ -66,6 +68,7 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -543,69 +546,114 @@
@Test
public void testAudioFilteredWhenMicDisabled() {
- mController.addCallback(new int[]{AppOpsManager.OP_RECORD_AUDIO, AppOpsManager.OP_CAMERA},
- mCallback);
+ int micOp = AppOpsManager.OP_RECORD_AUDIO;
+ int nonMicOp = AppOpsManager.OP_CAMERA;
+
+ // Add callbacks for the micOp and nonMicOp, called for the micOp active state change,
+ // verify the micOp is the only active op returned.
+ mController.addCallback(new int[]{micOp, nonMicOp}, mCallback);
mTestableLooper.processAllMessages();
mController.onOpActiveChanged(
- AppOpsManager.OPSTR_RECORD_AUDIO, TEST_UID_OTHER, TEST_PACKAGE_NAME, true);
+ AppOpsManager.opToPublicName(micOp), TEST_UID_OTHER, TEST_PACKAGE_NAME, true);
mTestableLooper.processAllMessages();
- List<AppOpItem> list = mController.getActiveAppOps();
- assertEquals(1, list.size());
- assertEquals(AppOpsManager.OP_RECORD_AUDIO, list.get(0).getCode());
- assertFalse(list.get(0).isDisabled());
+ verifySingleActiveOps(micOp);
- // Add a camera op, and disable the microphone. The camera op should be the only op returned
+ // Add a non-mic op, and disable the microphone. The camera op should be the only active op
+ // returned.
mController.onSensorBlockedChanged(MICROPHONE, true);
- mController.onOpActiveChanged(
- AppOpsManager.OPSTR_CAMERA, TEST_UID_OTHER, TEST_PACKAGE_NAME, true);
+ mController.onOpActiveChanged(AppOpsManager.opToPublicName(nonMicOp), TEST_UID_OTHER,
+ TEST_PACKAGE_NAME, true);
mTestableLooper.processAllMessages();
- list = mController.getActiveAppOps();
- assertEquals(1, list.size());
- assertEquals(AppOpsManager.OP_CAMERA, list.get(0).getCode());
+ verifySingleActiveOps(nonMicOp);
-
- // Re enable the microphone, and verify the op returns
+ // Re-enable the microphone, and verify the active op returns.
mController.onSensorBlockedChanged(MICROPHONE, false);
mTestableLooper.processAllMessages();
-
- list = mController.getActiveAppOps();
- assertEquals(2, list.size());
- int micIdx = list.get(0).getCode() == AppOpsManager.OP_CAMERA ? 1 : 0;
- assertEquals(AppOpsManager.OP_RECORD_AUDIO, list.get(micIdx).getCode());
+ verifyActiveOps(micOp, nonMicOp);
}
@Test
public void testPhoneCallMicrophoneFilteredWhenMicDisabled() {
- mController.addCallback(
- new int[]{AppOpsManager.OP_PHONE_CALL_MICROPHONE, AppOpsManager.OP_CAMERA},
- mCallback);
+ int micOp = AppOpsManager.OP_PHONE_CALL_MICROPHONE;
+ int nonMicOp = AppOpsManager.OP_CAMERA;
+
+ // Add callbacks for the micOp and nonMicOp, called for the micOp active state change,
+ // verify the micOp is the only active op returned.
+ mController.addCallback(new int[]{micOp, nonMicOp}, mCallback);
mTestableLooper.processAllMessages();
mController.onOpActiveChanged(
- AppOpsManager.OPSTR_PHONE_CALL_MICROPHONE, TEST_UID_OTHER, TEST_PACKAGE_NAME, true);
+ AppOpsManager.opToPublicName(micOp), TEST_UID_OTHER, TEST_PACKAGE_NAME, true);
mTestableLooper.processAllMessages();
- List<AppOpItem> list = mController.getActiveAppOps();
- assertEquals(1, list.size());
- assertEquals(AppOpsManager.OP_PHONE_CALL_MICROPHONE, list.get(0).getCode());
- assertFalse(list.get(0).isDisabled());
+ verifySingleActiveOps(micOp);
- // Add a camera op, and disable the microphone. The camera op should be the only op returned
+ // Add a non-mic op, and disable the microphone. The camera op should be the only active op
+ // returned.
mController.onSensorBlockedChanged(MICROPHONE, true);
- mController.onOpActiveChanged(
- AppOpsManager.OPSTR_CAMERA, TEST_UID_OTHER, TEST_PACKAGE_NAME, true);
+ mController.onOpActiveChanged(AppOpsManager.opToPublicName(nonMicOp), TEST_UID_OTHER,
+ TEST_PACKAGE_NAME, true);
mTestableLooper.processAllMessages();
- list = mController.getActiveAppOps();
- assertEquals(1, list.size());
- assertEquals(AppOpsManager.OP_CAMERA, list.get(0).getCode());
+ verifySingleActiveOps(nonMicOp);
-
- // Re enable the microphone, and verify the op returns
+ // Re-enable the microphone, and verify the active op returns.
mController.onSensorBlockedChanged(MICROPHONE, false);
mTestableLooper.processAllMessages();
+ verifyActiveOps(micOp, nonMicOp);
+ }
- list = mController.getActiveAppOps();
- assertEquals(2, list.size());
- int micIdx = list.get(0).getCode() == AppOpsManager.OP_CAMERA ? 1 : 0;
- assertEquals(AppOpsManager.OP_PHONE_CALL_MICROPHONE, list.get(micIdx).getCode());
+ @Test
+ public void testAmbientTriggerMicrophoneFilteredWhenMicDisabled() {
+ int micOp = AppOpsManager.OP_RECEIVE_AMBIENT_TRIGGER_AUDIO;
+ int nonMicOp = AppOpsManager.OP_CAMERA;
+
+ // Add callbacks for the micOp and nonMicOp, called for the micOp active state change,
+ // verify the micOp is the only active op returned.
+ mController.addCallback(new int[]{micOp, nonMicOp}, mCallback);
+ mTestableLooper.processAllMessages();
+ mController.onOpActiveChanged(
+ AppOpsManager.opToPublicName(micOp), TEST_UID_OTHER, TEST_PACKAGE_NAME, true);
+ mTestableLooper.processAllMessages();
+ verifySingleActiveOps(micOp);
+
+ // Add a non-mic op, and disable the microphone. The camera op should be the only active op
+ // returned.
+ mController.onSensorBlockedChanged(MICROPHONE, true);
+ mController.onOpActiveChanged(AppOpsManager.opToPublicName(nonMicOp), TEST_UID_OTHER,
+ TEST_PACKAGE_NAME, true);
+ mTestableLooper.processAllMessages();
+ verifySingleActiveOps(nonMicOp);
+
+ // Re-enable the microphone, and verify the active op returns.
+ mController.onSensorBlockedChanged(MICROPHONE, false);
+ mTestableLooper.processAllMessages();
+ verifyActiveOps(micOp, nonMicOp);
+ }
+
+ @Test
+ public void testSandboxTriggerMicrophoneFilteredWhenMicDisabled() {
+ int micOp = AppOpsManager.OP_RECEIVE_SANDBOX_TRIGGER_AUDIO;
+ int nonMicOp = AppOpsManager.OP_CAMERA;
+
+ // Add callbacks for the micOp and nonMicOp, called for the micOp active state change,
+ // verify the micOp is the only active op returned.
+ mController.addCallback(new int[]{micOp, nonMicOp}, mCallback);
+ mTestableLooper.processAllMessages();
+ mController.onOpActiveChanged(
+ AppOpsManager.opToPublicName(micOp), TEST_UID_OTHER, TEST_PACKAGE_NAME, true);
+ mTestableLooper.processAllMessages();
+ verifySingleActiveOps(micOp);
+
+ // Add a non-mic op, and disable the microphone. The camera op should be the only active op
+ // returned.
+ mController.onSensorBlockedChanged(MICROPHONE, true);
+ mController.onOpActiveChanged(AppOpsManager.opToPublicName(nonMicOp), TEST_UID_OTHER,
+ TEST_PACKAGE_NAME, true);
+ mTestableLooper.processAllMessages();
+ verifySingleActiveOps(nonMicOp);
+
+ // Re-enable the microphone, and verify the active op returns.
+ mController.onSensorBlockedChanged(MICROPHONE, false);
+ mTestableLooper.processAllMessages();
+ verifyActiveOps(micOp, nonMicOp);
}
@Test
@@ -708,6 +756,22 @@
micOpCode, TEST_UID_OTHER, TEST_PACKAGE_NAME, false);
}
+ private void verifySingleActiveOps(int op) {
+ List<AppOpItem> list = mController.getActiveAppOps();
+ assertEquals(1, list.size());
+ assertEquals(op, list.get(0).getCode());
+ assertFalse(list.get(0).isDisabled());
+ }
+
+ private void verifyActiveOps(int micOp, int nonMicOp) {
+ List<AppOpItem> list = mController.getActiveAppOps();
+ assertEquals(2, list.size());
+ List<Integer> codes = Arrays.asList(list.get(0).getCode(), list.get(1).getCode());
+ assertThat(codes).containsExactly(micOp, nonMicOp);
+ assertFalse(list.get(0).isDisabled());
+ assertFalse(list.get(1).isDisabled());
+ }
+
private class TestHandler extends AppOpsControllerImpl.H {
TestHandler(Looper looper) {
mController.super(looper);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.kt
index 4e52e64..9584d88 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.kt
@@ -39,13 +39,13 @@
import com.android.internal.widget.LockPatternUtils
import com.android.systemui.R
import com.android.systemui.SysuiTestCase
+import com.android.systemui.biometrics.data.repository.FakeFingerprintPropertyRepository
import com.android.systemui.biometrics.data.repository.FakePromptRepository
import com.android.systemui.biometrics.data.repository.FakeRearDisplayStateRepository
import com.android.systemui.biometrics.domain.interactor.DisplayStateInteractorImpl
import com.android.systemui.biometrics.domain.interactor.FakeCredentialInteractor
import com.android.systemui.biometrics.domain.interactor.PromptCredentialInteractor
import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteractorImpl
-import com.android.systemui.biometrics.ui.viewmodel.AuthBiometricFingerprintViewModel
import com.android.systemui.biometrics.ui.viewmodel.CredentialViewModel
import com.android.systemui.biometrics.ui.viewmodel.PromptViewModel
import com.android.systemui.flags.FakeFeatureFlags
@@ -109,6 +109,7 @@
private val testScope = TestScope(StandardTestDispatcher())
private val fakeExecutor = FakeExecutor(FakeSystemClock())
private val biometricPromptRepository = FakePromptRepository()
+ private val fingerprintRepository = FakeFingerprintPropertyRepository()
private val rearDisplayStateRepository = FakeRearDisplayStateRepository()
private val credentialInteractor = FakeCredentialInteractor()
private val bpCredentialInteractor = PromptCredentialInteractor(
@@ -118,10 +119,12 @@
)
private val promptSelectorInteractor by lazy {
PromptSelectorInteractorImpl(
+ fingerprintRepository,
biometricPromptRepository,
lockPatternUtils,
)
}
+
private val displayStateInteractor = DisplayStateInteractorImpl(
testScope.backgroundScope,
mContext,
@@ -129,9 +132,7 @@
rearDisplayStateRepository
)
- private val authBiometricFingerprintViewModel = AuthBiometricFingerprintViewModel(
- displayStateInteractor
- )
+
private val credentialViewModel = CredentialViewModel(mContext, bpCredentialInteractor)
private var authContainer: TestAuthContainerView? = null
@@ -524,10 +525,14 @@
userManager,
lockPatternUtils,
interactionJankMonitor,
- { authBiometricFingerprintViewModel },
{ promptSelectorInteractor },
{ bpCredentialInteractor },
- PromptViewModel(promptSelectorInteractor, vibrator, featureFlags),
+ PromptViewModel(
+ displayStateInteractor,
+ promptSelectorInteractor,
+ vibrator,
+ featureFlags
+ ),
{ credentialViewModel },
Handler(TestableLooper.get(this).looper),
fakeExecutor,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java
index 48e5131..6d71dd5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java
@@ -92,7 +92,6 @@
import com.android.systemui.biometrics.domain.interactor.LogContextInteractor;
import com.android.systemui.biometrics.domain.interactor.PromptCredentialInteractor;
import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteractor;
-import com.android.systemui.biometrics.ui.viewmodel.AuthBiometricFingerprintViewModel;
import com.android.systemui.biometrics.ui.viewmodel.CredentialViewModel;
import com.android.systemui.biometrics.ui.viewmodel.PromptViewModel;
import com.android.systemui.flags.FakeFeatureFlags;
@@ -177,8 +176,6 @@
@Mock
private PromptSelectorInteractor mPromptSelectionInteractor;
@Mock
- private AuthBiometricFingerprintViewModel mAuthBiometricFingerprintViewModel;
- @Mock
private CredentialViewModel mCredentialViewModel;
@Mock
private PromptViewModel mPromptViewModel;
@@ -1095,11 +1092,10 @@
mFingerprintManager, mFaceManager, () -> mUdfpsController,
() -> mSideFpsController, mDisplayManager, mWakefulnessLifecycle,
mPanelInteractionDetector, mUserManager, mLockPatternUtils, mUdfpsLogger,
- mLogContextInteractor, () -> mAuthBiometricFingerprintViewModel,
- () -> mBiometricPromptCredentialInteractor, () -> mPromptSelectionInteractor,
- () -> mCredentialViewModel, () -> mPromptViewModel,
- mInteractionJankMonitor, mHandler,
- mBackgroundExecutor, mUdfpsUtils, mVibratorHelper);
+ mLogContextInteractor, () -> mBiometricPromptCredentialInteractor,
+ () -> mPromptSelectionInteractor, () -> mCredentialViewModel,
+ () -> mPromptViewModel, mInteractionJankMonitor, mHandler, mBackgroundExecutor,
+ mUdfpsUtils, mVibratorHelper);
}
@Override
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/BiometricNotificationDialogFactoryTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/BiometricNotificationDialogFactoryTest.java
index 362d26b0..cf4e2c319 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/BiometricNotificationDialogFactoryTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/BiometricNotificationDialogFactoryTest.java
@@ -18,6 +18,7 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assume.assumeTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.never;
@@ -28,6 +29,7 @@
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
+import android.content.pm.PackageManager;
import android.hardware.biometrics.BiometricSourceType;
import android.hardware.face.FaceManager;
import android.hardware.fingerprint.FingerprintManager;
@@ -86,6 +88,9 @@
@Test
public void testFingerprintReEnrollDialog_onRemovalSucceeded() {
+ assumeTrue(getContext().getPackageManager()
+ .hasSystemFeature(PackageManager.FEATURE_FINGERPRINT));
+
mDialogFactory.createReenrollDialog(mContextSpy, mDialog,
BiometricSourceType.FINGERPRINT);
@@ -109,6 +114,9 @@
@Test
public void testFingerprintReEnrollDialog_onRemovalError() {
+ assumeTrue(getContext().getPackageManager()
+ .hasSystemFeature(PackageManager.FEATURE_FINGERPRINT));
+
mDialogFactory.createReenrollDialog(mContextSpy, mDialog,
BiometricSourceType.FINGERPRINT);
@@ -130,6 +138,9 @@
@Test
public void testFaceReEnrollDialog_onRemovalSucceeded() {
+ assumeTrue(getContext().getPackageManager()
+ .hasSystemFeature(PackageManager.FEATURE_FACE));
+
mDialogFactory.createReenrollDialog(mContextSpy, mDialog,
BiometricSourceType.FACE);
@@ -153,6 +164,9 @@
@Test
public void testFaceReEnrollDialog_onRemovalError() {
+ assumeTrue(getContext().getPackageManager()
+ .hasSystemFeature(PackageManager.FEATURE_FACE));
+
mDialogFactory.createReenrollDialog(mContextSpy, mDialog,
BiometricSourceType.FACE);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractorImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractorImplTest.kt
index 81cbaea..4d5e1b7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractorImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractorImplTest.kt
@@ -23,6 +23,7 @@
import com.android.internal.widget.LockPatternUtils
import com.android.systemui.SysuiTestCase
import com.android.systemui.biometrics.Utils
+import com.android.systemui.biometrics.data.repository.FakeFingerprintPropertyRepository
import com.android.systemui.biometrics.data.repository.FakePromptRepository
import com.android.systemui.biometrics.domain.model.BiometricModalities
import com.android.systemui.biometrics.faceSensorPropertiesInternal
@@ -61,13 +62,15 @@
@Mock private lateinit var lockPatternUtils: LockPatternUtils
private val testScope = TestScope()
+ private val fingerprintRepository = FakeFingerprintPropertyRepository()
private val promptRepository = FakePromptRepository()
private lateinit var interactor: PromptSelectorInteractor
@Before
fun setup() {
- interactor = PromptSelectorInteractorImpl(promptRepository, lockPatternUtils)
+ interactor =
+ PromptSelectorInteractorImpl(fingerprintRepository, promptRepository, lockPatternUtils)
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/udfps/BoundingBoxOverlapDetectorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/udfps/BoundingBoxOverlapDetectorTest.kt
index da55d5a..95b72d5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/udfps/BoundingBoxOverlapDetectorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/udfps/BoundingBoxOverlapDetectorTest.kt
@@ -28,7 +28,7 @@
@SmallTest
@RunWith(Parameterized::class)
class BoundingBoxOverlapDetectorTest(val testCase: TestCase) : SysuiTestCase() {
- val underTest = BoundingBoxOverlapDetector()
+ val underTest = BoundingBoxOverlapDetector(1f)
@Test
fun isGoodOverlap() {
@@ -83,7 +83,7 @@
GESTURE_START
)
-private val SENSOR = Rect(100 /* left */, 200 /* top */, 300 /* right */, 500 /* bottom */)
+private val SENSOR = Rect(100 /* left */, 200 /* top */, 300 /* right */, 400 /* bottom */)
private val OVERLAY = Rect(0 /* left */, 100 /* top */, 400 /* right */, 600 /* bottom */)
private fun genTestCases(
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/AuthBiometricFingerprintViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/AuthBiometricFingerprintViewModelTest.kt
deleted file mode 100644
index 785f1be..0000000
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/AuthBiometricFingerprintViewModelTest.kt
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.android.systemui.biometrics.ui.viewmodel
-
-import android.content.res.Configuration
-import androidx.test.filters.SmallTest
-import com.android.systemui.SysuiTestCase
-import com.android.systemui.biometrics.data.repository.FakeRearDisplayStateRepository
-import com.android.systemui.biometrics.domain.interactor.DisplayStateInteractor
-import com.android.systemui.biometrics.domain.interactor.DisplayStateInteractorImpl
-import com.android.systemui.coroutines.collectLastValue
-import com.android.systemui.util.concurrency.FakeExecutor
-import com.android.systemui.util.time.FakeSystemClock
-import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.test.StandardTestDispatcher
-import kotlinx.coroutines.test.TestScope
-import kotlinx.coroutines.test.runCurrent
-import kotlinx.coroutines.test.runTest
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
-@OptIn(ExperimentalCoroutinesApi::class)
-@SmallTest
-@RunWith(JUnit4::class)
-class AuthBiometricFingerprintViewModelTest : SysuiTestCase() {
-
- private val rearDisplayStateRepository = FakeRearDisplayStateRepository()
- private val testScope = TestScope(StandardTestDispatcher())
- private val fakeExecutor = FakeExecutor(FakeSystemClock())
-
- private lateinit var interactor: DisplayStateInteractor
- private lateinit var viewModel: AuthBiometricFingerprintViewModel
-
- @Before
- fun setup() {
- interactor =
- DisplayStateInteractorImpl(
- testScope.backgroundScope,
- mContext,
- fakeExecutor,
- rearDisplayStateRepository
- )
- viewModel = AuthBiometricFingerprintViewModel(interactor)
- }
-
- @Test
- fun iconUpdates_onConfigurationChanged() {
- testScope.runTest {
- runCurrent()
-
- val testConfig = Configuration()
- val folded = INNER_SCREEN_SMALLEST_SCREEN_WIDTH_THRESHOLD_DP - 1
- val unfolded = INNER_SCREEN_SMALLEST_SCREEN_WIDTH_THRESHOLD_DP + 1
- val currentIcon = collectLastValue(viewModel.iconAsset)
-
- testConfig.smallestScreenWidthDp = folded
- viewModel.onConfigurationChanged(testConfig)
- val foldedIcon = currentIcon()
-
- testConfig.smallestScreenWidthDp = unfolded
- viewModel.onConfigurationChanged(testConfig)
- val unfoldedIcon = currentIcon()
-
- assertThat(foldedIcon).isNotEqualTo(unfoldedIcon)
- }
- }
-}
-
-internal const val INNER_SCREEN_SMALLEST_SCREEN_WIDTH_THRESHOLD_DP = 600
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptFingerprintIconViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptFingerprintIconViewModelTest.kt
new file mode 100644
index 0000000..7697c09
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptFingerprintIconViewModelTest.kt
@@ -0,0 +1,94 @@
+package com.android.systemui.biometrics.ui.viewmodel
+
+import android.content.res.Configuration
+import androidx.test.filters.SmallTest
+import com.android.internal.widget.LockPatternUtils
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.biometrics.data.repository.FakeFingerprintPropertyRepository
+import com.android.systemui.biometrics.data.repository.FakePromptRepository
+import com.android.systemui.biometrics.data.repository.FakeRearDisplayStateRepository
+import com.android.systemui.biometrics.domain.interactor.DisplayStateInteractor
+import com.android.systemui.biometrics.domain.interactor.DisplayStateInteractorImpl
+import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteractor
+import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteractorImpl
+import com.android.systemui.biometrics.shared.model.FingerprintSensorType
+import com.android.systemui.biometrics.shared.model.SensorStrength
+import com.android.systemui.coroutines.collectLastValue
+import com.android.systemui.util.concurrency.FakeExecutor
+import com.android.systemui.util.time.FakeSystemClock
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.StandardTestDispatcher
+import kotlinx.coroutines.test.TestScope
+import kotlinx.coroutines.test.runCurrent
+import kotlinx.coroutines.test.runTest
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+import org.mockito.Mock
+import org.mockito.junit.MockitoJUnit
+
+@OptIn(ExperimentalCoroutinesApi::class)
+@SmallTest
+@RunWith(JUnit4::class)
+class PromptFingerprintIconViewModelTest : SysuiTestCase() {
+
+ @JvmField @Rule var mockitoRule = MockitoJUnit.rule()
+
+ @Mock private lateinit var lockPatternUtils: LockPatternUtils
+
+ private val fingerprintRepository = FakeFingerprintPropertyRepository()
+ private val promptRepository = FakePromptRepository()
+ private val rearDisplayStateRepository = FakeRearDisplayStateRepository()
+
+ private val testScope = TestScope(StandardTestDispatcher())
+ private val fakeExecutor = FakeExecutor(FakeSystemClock())
+
+ private lateinit var promptSelectorInteractor: PromptSelectorInteractor
+ private lateinit var displayStateInteractor: DisplayStateInteractor
+ private lateinit var viewModel: PromptFingerprintIconViewModel
+
+ @Before
+ fun setup() {
+ promptSelectorInteractor =
+ PromptSelectorInteractorImpl(fingerprintRepository, promptRepository, lockPatternUtils)
+ displayStateInteractor =
+ DisplayStateInteractorImpl(
+ testScope.backgroundScope,
+ mContext,
+ fakeExecutor,
+ rearDisplayStateRepository
+ )
+ viewModel = PromptFingerprintIconViewModel(displayStateInteractor, promptSelectorInteractor)
+ }
+
+ @Test
+ fun sfpsIconUpdates_onConfigurationChanged() {
+ testScope.runTest {
+ runCurrent()
+ configureFingerprintPropertyRepository(FingerprintSensorType.POWER_BUTTON)
+ val testConfig = Configuration()
+ val folded = INNER_SCREEN_SMALLEST_SCREEN_WIDTH_THRESHOLD_DP - 1
+ val unfolded = INNER_SCREEN_SMALLEST_SCREEN_WIDTH_THRESHOLD_DP + 1
+ val currentIcon = collectLastValue(viewModel.iconAsset)
+
+ testConfig.smallestScreenWidthDp = folded
+ viewModel.onConfigurationChanged(testConfig)
+ val foldedIcon = currentIcon()
+
+ testConfig.smallestScreenWidthDp = unfolded
+ viewModel.onConfigurationChanged(testConfig)
+ val unfoldedIcon = currentIcon()
+
+ assertThat(foldedIcon).isNotEqualTo(unfoldedIcon)
+ }
+ }
+
+ private fun configureFingerprintPropertyRepository(sensorType: FingerprintSensorType) {
+ fingerprintRepository.setProperties(0, SensorStrength.STRONG, sensorType, mapOf())
+ }
+}
+
+internal const val INNER_SCREEN_SMALLEST_SCREEN_WIDTH_THRESHOLD_DP = 600
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt
index 4d19543..11b0b07 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt
@@ -24,7 +24,10 @@
import com.android.internal.widget.LockPatternUtils
import com.android.systemui.SysuiTestCase
import com.android.systemui.biometrics.AuthBiometricView
+import com.android.systemui.biometrics.data.repository.FakeFingerprintPropertyRepository
import com.android.systemui.biometrics.data.repository.FakePromptRepository
+import com.android.systemui.biometrics.data.repository.FakeRearDisplayStateRepository
+import com.android.systemui.biometrics.domain.interactor.DisplayStateInteractorImpl
import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteractor
import com.android.systemui.biometrics.domain.interactor.PromptSelectorInteractorImpl
import com.android.systemui.biometrics.domain.model.BiometricModalities
@@ -37,7 +40,9 @@
import com.android.systemui.flags.FakeFeatureFlags
import com.android.systemui.flags.Flags.ONE_WAY_HAPTICS_API_MIGRATION
import com.android.systemui.statusbar.VibratorHelper
+import com.android.systemui.util.concurrency.FakeExecutor
import com.android.systemui.util.mockito.any
+import com.android.systemui.util.time.FakeSystemClock
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.first
@@ -69,8 +74,19 @@
@Mock private lateinit var lockPatternUtils: LockPatternUtils
@Mock private lateinit var vibrator: VibratorHelper
+ private val fakeExecutor = FakeExecutor(FakeSystemClock())
private val testScope = TestScope()
+ private val fingerprintRepository = FakeFingerprintPropertyRepository()
private val promptRepository = FakePromptRepository()
+ private val rearDisplayStateRepository = FakeRearDisplayStateRepository()
+
+ private val displayStateInteractor =
+ DisplayStateInteractorImpl(
+ testScope.backgroundScope,
+ mContext,
+ fakeExecutor,
+ rearDisplayStateRepository
+ )
private lateinit var selector: PromptSelectorInteractor
private lateinit var viewModel: PromptViewModel
@@ -78,10 +94,11 @@
@Before
fun setup() {
- selector = PromptSelectorInteractorImpl(promptRepository, lockPatternUtils)
+ selector =
+ PromptSelectorInteractorImpl(fingerprintRepository, promptRepository, lockPatternUtils)
selector.resetPrompt()
- viewModel = PromptViewModel(selector, vibrator, featureFlags)
+ viewModel = PromptViewModel(displayStateInteractor, selector, vibrator, featureFlags)
featureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, false)
}
@@ -105,7 +122,7 @@
}
assertThat(message).isEqualTo(PromptMessage.Empty)
assertThat(size).isEqualTo(expectedSize)
- assertThat(legacyState).isEqualTo(AuthBiometricView.STATE_AUTHENTICATING_ANIMATING_IN)
+ assertThat(legacyState).isEqualTo(AuthBiometricView.STATE_IDLE)
val startMessage = "here we go"
viewModel.showAuthenticating(startMessage, isRetry = false)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/bouncer/data/factory/BouncerMessageFactoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/bouncer/data/factory/BouncerMessageFactoryTest.kt
index efae3fe..8eb274a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/bouncer/data/factory/BouncerMessageFactoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/bouncer/data/factory/BouncerMessageFactoryTest.kt
@@ -24,13 +24,12 @@
import com.android.keyguard.KeyguardSecurityModel.SecurityMode.Pattern
import com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_DEFAULT
import com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_INCORRECT_PRIMARY_AUTH_INPUT
-import com.android.keyguard.KeyguardUpdateMonitor
import com.android.systemui.SysuiTestCase
import com.android.systemui.bouncer.shared.model.BouncerMessageModel
+import com.android.systemui.keyguard.data.repository.FakeBiometricSettingsRepository
import com.android.systemui.util.mockito.whenever
import com.google.common.truth.StringSubject
import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.runTest
import org.junit.Before
@@ -39,13 +38,12 @@
import org.mockito.Mock
import org.mockito.MockitoAnnotations
-@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
@RunWith(AndroidJUnit4::class)
class BouncerMessageFactoryTest : SysuiTestCase() {
private lateinit var underTest: BouncerMessageFactory
- @Mock private lateinit var updateMonitor: KeyguardUpdateMonitor
+ @Mock private lateinit var biometricSettingsRepository: FakeBiometricSettingsRepository
@Mock private lateinit var securityModel: KeyguardSecurityModel
@@ -55,7 +53,8 @@
fun setUp() {
MockitoAnnotations.initMocks(this)
testScope = TestScope()
- underTest = BouncerMessageFactory(updateMonitor, securityModel)
+ biometricSettingsRepository = FakeBiometricSettingsRepository()
+ underTest = BouncerMessageFactory(biometricSettingsRepository, securityModel)
}
@Test
@@ -167,7 +166,7 @@
secondaryMessageOverride: String? = null,
): BouncerMessageModel? {
whenever(securityModel.getSecurityMode(0)).thenReturn(mode)
- whenever(updateMonitor.isUnlockingWithFingerprintAllowed).thenReturn(fpAuthAllowed)
+ biometricSettingsRepository.setIsFingerprintAuthCurrentlyAllowed(fpAuthAllowed)
return underTest.createFromPromptReason(
reason,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/bouncer/data/repo/BouncerMessageRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/bouncer/data/repo/BouncerMessageRepositoryTest.kt
index 2be7d8a..562a8ef 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/bouncer/data/repo/BouncerMessageRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/bouncer/data/repo/BouncerMessageRepositoryTest.kt
@@ -101,14 +101,15 @@
fingerprintRepository = FakeDeviceEntryFingerprintAuthRepository()
testScope = TestScope()
- whenever(updateMonitor.isUnlockingWithFingerprintAllowed).thenReturn(false)
+ biometricSettingsRepository.setIsFingerprintAuthCurrentlyAllowed(false)
whenever(securityModel.getSecurityMode(PRIMARY_USER_ID)).thenReturn(PIN)
underTest =
BouncerMessageRepositoryImpl(
trustRepository = trustRepository,
biometricSettingsRepository = biometricSettingsRepository,
updateMonitor = updateMonitor,
- bouncerMessageFactory = BouncerMessageFactory(updateMonitor, securityModel),
+ bouncerMessageFactory =
+ BouncerMessageFactory(biometricSettingsRepository, securityModel),
userRepository = userRepository,
fingerprintAuthRepository = fingerprintRepository,
systemPropertiesHelper = systemPropertiesHelper
@@ -222,8 +223,7 @@
whenever(systemPropertiesHelper.get("sys.boot.reason.last"))
.thenReturn("reboot,mainline_update")
userRepository.setSelectedUserInfo(PRIMARY_USER)
- biometricSettingsRepository.setFaceEnrolled(true)
- biometricSettingsRepository.setIsFaceAuthEnabled(true)
+ biometricSettingsRepository.setIsFaceAuthEnrolledAndEnabled(true)
verifyMessagesForAuthFlag(
STRONG_AUTH_REQUIRED_AFTER_BOOT to
@@ -236,8 +236,8 @@
testScope.runTest {
userRepository.setSelectedUserInfo(PRIMARY_USER)
trustRepository.setCurrentUserTrustManaged(false)
- biometricSettingsRepository.setFaceEnrolled(false)
- biometricSettingsRepository.setFingerprintEnrolled(false)
+ biometricSettingsRepository.setIsFaceAuthEnrolledAndEnabled(false)
+ biometricSettingsRepository.setIsFingerprintAuthEnrolledAndEnabled(false)
verifyMessagesForAuthFlag(
STRONG_AUTH_NOT_REQUIRED to null,
@@ -258,8 +258,8 @@
fun authFlagsChanges_withTrustManaged_providesDifferentMessages() =
testScope.runTest {
userRepository.setSelectedUserInfo(PRIMARY_USER)
- biometricSettingsRepository.setFaceEnrolled(false)
- biometricSettingsRepository.setFingerprintEnrolled(false)
+ biometricSettingsRepository.setIsFaceAuthEnrolledAndEnabled(false)
+ biometricSettingsRepository.setIsFingerprintAuthEnrolledAndEnabled(false)
trustRepository.setCurrentUserTrustManaged(true)
@@ -290,10 +290,9 @@
testScope.runTest {
userRepository.setSelectedUserInfo(PRIMARY_USER)
trustRepository.setCurrentUserTrustManaged(false)
- biometricSettingsRepository.setFingerprintEnrolled(false)
+ biometricSettingsRepository.setIsFingerprintAuthEnrolledAndEnabled(false)
- biometricSettingsRepository.setIsFaceAuthEnabled(true)
- biometricSettingsRepository.setFaceEnrolled(true)
+ biometricSettingsRepository.setIsFaceAuthEnrolledAndEnabled(true)
verifyMessagesForAuthFlag(
STRONG_AUTH_NOT_REQUIRED to null,
@@ -320,11 +319,9 @@
testScope.runTest {
userRepository.setSelectedUserInfo(PRIMARY_USER)
trustRepository.setCurrentUserTrustManaged(false)
- biometricSettingsRepository.setIsFaceAuthEnabled(false)
- biometricSettingsRepository.setFaceEnrolled(false)
+ biometricSettingsRepository.setIsFaceAuthEnrolledAndEnabled(false)
- biometricSettingsRepository.setFingerprintEnrolled(true)
- biometricSettingsRepository.setFingerprintEnabledByDevicePolicy(true)
+ biometricSettingsRepository.setIsFingerprintAuthEnrolledAndEnabled(true)
verifyMessagesForAuthFlag(
STRONG_AUTH_NOT_REQUIRED to null,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/AlternateBouncerInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/AlternateBouncerInteractorTest.kt
index 38e5728..0d17270 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/AlternateBouncerInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/AlternateBouncerInteractorTest.kt
@@ -94,9 +94,9 @@
}
@Test
- fun canShowAlternateBouncerForFingerprint_noFingerprintsEnrolled() {
+ fun canShowAlternateBouncerForFingerprint_ifFingerprintIsNotUsuallyAllowed() {
givenCanShowAlternateBouncer()
- biometricSettingsRepository.setFingerprintEnrolled(false)
+ biometricSettingsRepository.setIsFingerprintAuthEnrolledAndEnabled(false)
assertFalse(underTest.canShowAlternateBouncerForFingerprint())
}
@@ -104,15 +104,7 @@
@Test
fun canShowAlternateBouncerForFingerprint_strongBiometricNotAllowed() {
givenCanShowAlternateBouncer()
- biometricSettingsRepository.setStrongBiometricAllowed(false)
-
- assertFalse(underTest.canShowAlternateBouncerForFingerprint())
- }
-
- @Test
- fun canShowAlternateBouncerForFingerprint_devicePolicyDoesNotAllowFingerprint() {
- givenCanShowAlternateBouncer()
- biometricSettingsRepository.setFingerprintEnabledByDevicePolicy(false)
+ biometricSettingsRepository.setIsFingerprintAuthCurrentlyAllowed(false)
assertFalse(underTest.canShowAlternateBouncerForFingerprint())
}
@@ -189,14 +181,13 @@
private fun givenCanShowAlternateBouncer() {
bouncerRepository.setAlternateBouncerUIAvailable(true)
- biometricSettingsRepository.setFingerprintEnrolled(true)
- biometricSettingsRepository.setStrongBiometricAllowed(true)
- biometricSettingsRepository.setFingerprintEnabledByDevicePolicy(true)
+ biometricSettingsRepository.setIsFingerprintAuthEnrolledAndEnabled(true)
+ biometricSettingsRepository.setIsFingerprintAuthCurrentlyAllowed(true)
whenever(keyguardUpdateMonitor.isFingerprintLockedOut).thenReturn(false)
whenever(keyguardStateController.isUnlocked).thenReturn(false)
}
private fun givenCannotShowAlternateBouncer() {
- biometricSettingsRepository.setFingerprintEnrolled(false)
+ biometricSettingsRepository.setIsFingerprintAuthEnrolledAndEnabled(false)
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/BouncerMessageInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/BouncerMessageInteractorTest.kt
index 3ca94aa..4089abe 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/BouncerMessageInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/BouncerMessageInteractorTest.kt
@@ -22,9 +22,8 @@
import androidx.test.filters.SmallTest
import com.android.keyguard.KeyguardSecurityModel
import com.android.keyguard.KeyguardSecurityModel.SecurityMode.PIN
-import com.android.keyguard.KeyguardUpdateMonitor
-import com.android.systemui.R.string.keyguard_enter_pin
import com.android.systemui.R.string.kg_too_many_failed_attempts_countdown
+import com.android.systemui.R.string.kg_unlock_with_pin_or_fp
import com.android.systemui.SysuiTestCase
import com.android.systemui.bouncer.data.factory.BouncerMessageFactory
import com.android.systemui.bouncer.data.repository.FakeBouncerMessageRepository
@@ -34,11 +33,11 @@
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.flags.FakeFeatureFlags
import com.android.systemui.flags.Flags
+import com.android.systemui.keyguard.data.repository.FakeBiometricSettingsRepository
import com.android.systemui.user.data.repository.FakeUserRepository
import com.android.systemui.util.mockito.KotlinArgumentCaptor
import com.android.systemui.util.mockito.whenever
import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.runTest
import org.junit.Before
@@ -49,14 +48,13 @@
import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations
-@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
@TestableLooper.RunWithLooper(setAsMainLooper = true)
@RunWith(AndroidJUnit4::class)
class BouncerMessageInteractorTest : SysuiTestCase() {
@Mock private lateinit var securityModel: KeyguardSecurityModel
- @Mock private lateinit var updateMonitor: KeyguardUpdateMonitor
+ @Mock private lateinit var biometricSettingsRepository: FakeBiometricSettingsRepository
@Mock private lateinit var countDownTimerUtil: CountDownTimerUtil
private lateinit var countDownTimerCallback: KotlinArgumentCaptor<CountDownTimerCallback>
private lateinit var underTest: BouncerMessageInteractor
@@ -73,10 +71,11 @@
userRepository.setUserInfos(listOf(PRIMARY_USER))
testScope = TestScope()
countDownTimerCallback = KotlinArgumentCaptor(CountDownTimerCallback::class.java)
+ biometricSettingsRepository = FakeBiometricSettingsRepository()
allowTestableLooperAsMainThread()
whenever(securityModel.getSecurityMode(PRIMARY_USER_ID)).thenReturn(PIN)
- whenever(updateMonitor.isUnlockingWithFingerprintAllowed).thenReturn(false)
+ biometricSettingsRepository.setIsFingerprintAuthCurrentlyAllowed(true)
}
suspend fun TestScope.init() {
@@ -86,7 +85,7 @@
underTest =
BouncerMessageInteractor(
repository = repository,
- factory = BouncerMessageFactory(updateMonitor, securityModel),
+ factory = BouncerMessageFactory(biometricSettingsRepository, securityModel),
userRepository = userRepository,
countDownTimerUtil = countDownTimerUtil,
featureFlags = featureFlags
@@ -151,7 +150,8 @@
underTest.setCustomMessage("not empty")
val customMessage = repository.customMessage
- assertThat(customMessage.value!!.message!!.messageResId).isEqualTo(keyguard_enter_pin)
+ assertThat(customMessage.value!!.message!!.messageResId)
+ .isEqualTo(kg_unlock_with_pin_or_fp)
assertThat(customMessage.value!!.secondaryMessage!!.message).isEqualTo("not empty")
underTest.setCustomMessage(null)
@@ -168,7 +168,7 @@
val faceAcquisitionMessage = repository.faceAcquisitionMessage
assertThat(faceAcquisitionMessage.value!!.message!!.messageResId)
- .isEqualTo(keyguard_enter_pin)
+ .isEqualTo(kg_unlock_with_pin_or_fp)
assertThat(faceAcquisitionMessage.value!!.secondaryMessage!!.message)
.isEqualTo("not empty")
@@ -186,7 +186,7 @@
val fingerprintAcquisitionMessage = repository.fingerprintAcquisitionMessage
assertThat(fingerprintAcquisitionMessage.value!!.message!!.messageResId)
- .isEqualTo(keyguard_enter_pin)
+ .isEqualTo(kg_unlock_with_pin_or_fp)
assertThat(fingerprintAcquisitionMessage.value!!.secondaryMessage!!.message)
.isEqualTo("not empty")
@@ -275,7 +275,8 @@
repository.setBiometricLockedOutMessage(null)
// sets the default message if everything else is null
- assertThat(bouncerMessage()!!.message!!.messageResId).isEqualTo(keyguard_enter_pin)
+ assertThat(bouncerMessage()!!.message!!.messageResId)
+ .isEqualTo(kg_unlock_with_pin_or_fp)
}
private fun message(value: String): BouncerMessageModel {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/clipboardoverlay/IntentCreatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/clipboardoverlay/IntentCreatorTest.java
index 7628be4..662c89c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/clipboardoverlay/IntentCreatorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/clipboardoverlay/IntentCreatorTest.java
@@ -80,6 +80,7 @@
assertEquals(Intent.ACTION_EDIT, intent.getAction());
assertEquals("image/*", intent.getType());
assertEquals(null, intent.getComponent());
+ assertEquals("clipboard", intent.getStringExtra("edit_source"));
assertFlags(intent, EXTERNAL_INTENT_FLAGS);
// try again with an editor component
diff --git a/packages/SystemUI/tests/src/com/android/systemui/controls/controller/ControlActionCoordinatorImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/controls/controller/ControlActionCoordinatorImplTest.kt
index 692d794..8416c46 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/controls/controller/ControlActionCoordinatorImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/controls/controller/ControlActionCoordinatorImplTest.kt
@@ -18,12 +18,14 @@
import android.test.suitebuilder.annotation.SmallTest
import android.testing.AndroidTestingRunner
+import android.view.HapticFeedbackConstants
import com.android.systemui.SysuiTestCase
import com.android.systemui.broadcast.BroadcastSender
import com.android.systemui.controls.ControlsMetricsLogger
import com.android.systemui.controls.settings.ControlsSettingsDialogManager
import com.android.systemui.controls.settings.FakeControlsSettingsRepository
-import com.android.systemui.flags.FeatureFlags
+import com.android.systemui.flags.FakeFeatureFlags
+import com.android.systemui.flags.Flags.ONE_WAY_HAPTICS_API_MIGRATION
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.statusbar.policy.KeyguardStateController
@@ -33,6 +35,7 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Answers
+import org.mockito.ArgumentMatchers.eq
import org.mockito.Mock
import org.mockito.Mockito
import org.mockito.Mockito.anyBoolean
@@ -68,8 +71,6 @@
@Mock
private lateinit var metricsLogger: ControlsMetricsLogger
@Mock
- private lateinit var featureFlags: FeatureFlags
- @Mock
private lateinit var controlsSettingsDialogManager: ControlsSettingsDialogManager
companion object {
@@ -82,6 +83,8 @@
private lateinit var action: ControlActionCoordinatorImpl.Action
private lateinit var controlsSettingsRepository: FakeControlsSettingsRepository
+ private val featureFlags = FakeFeatureFlags()
+
@Before
fun setUp() {
MockitoAnnotations.initMocks(this)
@@ -101,6 +104,7 @@
metricsLogger,
vibratorHelper,
controlsSettingsRepository,
+ featureFlags
))
coordinator.activityContext = mContext
@@ -194,4 +198,50 @@
verify(coordinator).bouncerOrRun(action)
verify(action, never()).invoke()
}
+
+ @Test
+ fun drag_isEdge_oneWayHapticsDisabled_usesVibrate() {
+ featureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, false)
+
+ coordinator.drag(cvh, true)
+
+ verify(vibratorHelper).vibrate(
+ Vibrations.rangeEdgeEffect
+ )
+ }
+
+ @Test
+ fun drag_isNotEdge_oneWayHapticsDisabled_usesVibrate() {
+ featureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, false)
+
+ coordinator.drag(cvh, false)
+
+ verify(vibratorHelper).vibrate(
+ Vibrations.rangeMiddleEffect
+ )
+ }
+
+ @Test
+ fun drag_isEdge_oneWayHapticsEnabled_usesPerformHapticFeedback() {
+ featureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, true)
+
+ coordinator.drag(cvh, true)
+
+ verify(vibratorHelper).performHapticFeedback(
+ any(),
+ eq(HapticFeedbackConstants.SEGMENT_TICK)
+ )
+ }
+
+ @Test
+ fun drag_isNotEdge_oneWayHapticsEnabled_usesPerformHapticFeedback() {
+ featureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, true)
+
+ coordinator.drag(cvh, false)
+
+ verify(vibratorHelper).performHapticFeedback(
+ any(),
+ eq(HapticFeedbackConstants.SEGMENT_FREQUENT_TICK)
+ )
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/dreams/conditions/AssistantAttentionConditionTest.java b/packages/SystemUI/tests/src/com/android/systemui/dreams/conditions/AssistantAttentionConditionTest.java
index 07cb5d8..6a17889 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/dreams/conditions/AssistantAttentionConditionTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/dreams/conditions/AssistantAttentionConditionTest.java
@@ -22,17 +22,14 @@
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-import android.os.RemoteException;
import android.testing.AndroidTestingRunner;
import androidx.test.filters.SmallTest;
-import com.android.internal.app.AssistUtils;
-import com.android.internal.app.IVisualQueryDetectionAttentionListener;
import com.android.systemui.SysuiTestCase;
-import com.android.systemui.dreams.DreamOverlayStateController;
+import com.android.systemui.assist.AssistManager;
+import com.android.systemui.assist.AssistManager.VisualQueryAttentionListener;
import com.android.systemui.shared.condition.Condition;
import org.junit.Before;
@@ -50,9 +47,7 @@
@Mock
Condition.Callback mCallback;
@Mock
- AssistUtils mAssistUtils;
- @Mock
- DreamOverlayStateController mDreamOverlayStateController;
+ AssistManager mAssistManager;
@Mock
CoroutineScope mScope;
@@ -62,55 +57,34 @@
public void setup() {
MockitoAnnotations.initMocks(this);
- mAssistantAttentionCondition =
- new AssistantAttentionCondition(mScope, mDreamOverlayStateController, mAssistUtils);
+ mAssistantAttentionCondition = new AssistantAttentionCondition(mScope, mAssistManager);
// Adding a callback also starts the condition.
mAssistantAttentionCondition.addCallback(mCallback);
}
@Test
public void testEnableVisualQueryDetection() {
- final ArgumentCaptor<DreamOverlayStateController.Callback> argumentCaptor =
- ArgumentCaptor.forClass(DreamOverlayStateController.Callback.class);
- verify(mDreamOverlayStateController).addCallback(argumentCaptor.capture());
-
- when(mDreamOverlayStateController.isDreamOverlayStatusBarVisible()).thenReturn(true);
- argumentCaptor.getValue().onStateChanged();
-
- verify(mAssistUtils).enableVisualQueryDetection(any());
+ verify(mAssistManager).addVisualQueryAttentionListener(
+ any(VisualQueryAttentionListener.class));
}
@Test
public void testDisableVisualQueryDetection() {
- final ArgumentCaptor<DreamOverlayStateController.Callback> argumentCaptor =
- ArgumentCaptor.forClass(DreamOverlayStateController.Callback.class);
- verify(mDreamOverlayStateController).addCallback(argumentCaptor.capture());
-
- when(mDreamOverlayStateController.isDreamOverlayStatusBarVisible()).thenReturn(true);
- argumentCaptor.getValue().onStateChanged();
- when(mDreamOverlayStateController.isDreamOverlayStatusBarVisible()).thenReturn(false);
- argumentCaptor.getValue().onStateChanged();
-
- verify(mAssistUtils).disableVisualQueryDetection();
+ mAssistantAttentionCondition.stop();
+ verify(mAssistManager).removeVisualQueryAttentionListener(
+ any(VisualQueryAttentionListener.class));
}
@Test
- public void testAttentionChangedTriggersCondition() throws RemoteException {
- final ArgumentCaptor<DreamOverlayStateController.Callback> callbackCaptor =
- ArgumentCaptor.forClass(DreamOverlayStateController.Callback.class);
- verify(mDreamOverlayStateController).addCallback(callbackCaptor.capture());
+ public void testAttentionChangedTriggersCondition() {
+ final ArgumentCaptor<VisualQueryAttentionListener> argumentCaptor =
+ ArgumentCaptor.forClass(VisualQueryAttentionListener.class);
+ verify(mAssistManager).addVisualQueryAttentionListener(argumentCaptor.capture());
- when(mDreamOverlayStateController.isDreamOverlayStatusBarVisible()).thenReturn(true);
- callbackCaptor.getValue().onStateChanged();
-
- final ArgumentCaptor<IVisualQueryDetectionAttentionListener> listenerCaptor =
- ArgumentCaptor.forClass(IVisualQueryDetectionAttentionListener.class);
- verify(mAssistUtils).enableVisualQueryDetection(listenerCaptor.capture());
-
- listenerCaptor.getValue().onAttentionGained();
+ argumentCaptor.getValue().onAttentionGained();
assertThat(mAssistantAttentionCondition.isConditionMet()).isTrue();
- listenerCaptor.getValue().onAttentionLost();
+ argumentCaptor.getValue().onAttentionLost();
assertThat(mAssistantAttentionCondition.isConditionMet()).isFalse();
verify(mCallback, times(2)).onConditionChanged(eq(mAssistantAttentionCondition));
diff --git a/packages/SystemUI/tests/src/com/android/systemui/flags/FeatureFlagsDebugTest.kt b/packages/SystemUI/tests/src/com/android/systemui/flags/FeatureFlagsClassicDebugTest.kt
similarity index 65%
rename from packages/SystemUI/tests/src/com/android/systemui/flags/FeatureFlagsDebugTest.kt
rename to packages/SystemUI/tests/src/com/android/systemui/flags/FeatureFlagsClassicDebugTest.kt
index ff15cb3..14c5ec0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/flags/FeatureFlagsDebugTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/flags/FeatureFlagsClassicDebugTest.kt
@@ -29,6 +29,10 @@
import com.android.systemui.util.mockito.withArgCaptor
import com.android.systemui.util.settings.GlobalSettings
import com.google.common.truth.Truth.assertThat
+import java.io.PrintWriter
+import java.io.Serializable
+import java.io.StringWriter
+import java.util.function.Consumer
import org.junit.Assert
import org.junit.Before
import org.junit.Test
@@ -41,44 +45,30 @@
import org.mockito.Mockito.times
import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
-import org.mockito.MockitoAnnotations
-import java.io.PrintWriter
-import java.io.Serializable
-import java.io.StringWriter
-import java.util.function.Consumer
import org.mockito.Mockito.`when` as whenever
+import org.mockito.MockitoAnnotations
/**
* NOTE: This test is for the version of FeatureFlagManager in src-debug, which allows overriding
* the default.
*/
@SmallTest
-class FeatureFlagsDebugTest : SysuiTestCase() {
- private lateinit var featureFlagsDebug: FeatureFlagsDebug
+class FeatureFlagsClassicDebugTest : SysuiTestCase() {
+ private lateinit var mFeatureFlagsClassicDebug: FeatureFlagsClassicDebug
- @Mock
- private lateinit var flagManager: FlagManager
- @Mock
- private lateinit var mockContext: Context
- @Mock
- private lateinit var globalSettings: GlobalSettings
- @Mock
- private lateinit var systemProperties: SystemPropertiesHelper
- @Mock
- private lateinit var resources: Resources
- @Mock
- private lateinit var restarter: Restarter
+ @Mock private lateinit var flagManager: FlagManager
+ @Mock private lateinit var mockContext: Context
+ @Mock private lateinit var globalSettings: GlobalSettings
+ @Mock private lateinit var systemProperties: SystemPropertiesHelper
+ @Mock private lateinit var resources: Resources
+ @Mock private lateinit var restarter: Restarter
private val flagMap = mutableMapOf<String, Flag<*>>()
private lateinit var broadcastReceiver: BroadcastReceiver
private lateinit var clearCacheAction: Consumer<String>
private val serverFlagReader = ServerFlagReaderFake()
- private val teamfoodableFlagA = UnreleasedFlag(
- name = "a", namespace = "test", teamfood = true
- )
- private val teamfoodableFlagB = ReleasedFlag(
- name = "b", namespace = "test", teamfood = true
- )
+ private val teamfoodableFlagA = UnreleasedFlag(name = "a", namespace = "test", teamfood = true)
+ private val teamfoodableFlagB = ReleasedFlag(name = "b", namespace = "test", teamfood = true)
@Before
fun setup() {
@@ -86,27 +76,23 @@
flagMap.put(Flags.TEAMFOOD.name, Flags.TEAMFOOD)
flagMap.put(teamfoodableFlagA.name, teamfoodableFlagA)
flagMap.put(teamfoodableFlagB.name, teamfoodableFlagB)
- featureFlagsDebug = FeatureFlagsDebug(
- flagManager,
- mockContext,
- globalSettings,
- systemProperties,
- resources,
- serverFlagReader,
- flagMap,
- restarter
- )
- featureFlagsDebug.init()
+ mFeatureFlagsClassicDebug =
+ FeatureFlagsClassicDebug(
+ flagManager,
+ mockContext,
+ globalSettings,
+ systemProperties,
+ resources,
+ serverFlagReader,
+ flagMap,
+ restarter
+ )
+ mFeatureFlagsClassicDebug.init()
verify(flagManager).onSettingsChangedAction = any()
broadcastReceiver = withArgCaptor {
- verify(mockContext).registerReceiver(
- capture(), any(), nullable(), nullable(),
- any()
- )
+ verify(mockContext).registerReceiver(capture(), any(), nullable(), nullable(), any())
}
- clearCacheAction = withArgCaptor {
- verify(flagManager).clearCacheAction = capture()
- }
+ clearCacheAction = withArgCaptor { verify(flagManager).clearCacheAction = capture() }
whenever(flagManager.nameToSettingsKey(any())).thenAnswer { "key-${it.arguments[0]}" }
}
@@ -117,45 +103,29 @@
whenever(flagManager.readFlagValue<Boolean>(eq("4"), any())).thenReturn(false)
assertThat(
- featureFlagsDebug.isEnabled(
- ReleasedFlag(
- name = "2",
- namespace = "test"
- )
+ mFeatureFlagsClassicDebug.isEnabled(ReleasedFlag(name = "2", namespace = "test"))
)
- ).isTrue()
+ .isTrue()
assertThat(
- featureFlagsDebug.isEnabled(
- UnreleasedFlag(
- name = "3",
- namespace = "test"
- )
+ mFeatureFlagsClassicDebug.isEnabled(UnreleasedFlag(name = "3", namespace = "test"))
)
- ).isTrue()
+ .isTrue()
assertThat(
- featureFlagsDebug.isEnabled(
- ReleasedFlag(
- name = "4",
- namespace = "test"
- )
+ mFeatureFlagsClassicDebug.isEnabled(ReleasedFlag(name = "4", namespace = "test"))
)
- ).isFalse()
+ .isFalse()
assertThat(
- featureFlagsDebug.isEnabled(
- UnreleasedFlag(
- name = "5",
- namespace = "test"
- )
+ mFeatureFlagsClassicDebug.isEnabled(UnreleasedFlag(name = "5", namespace = "test"))
)
- ).isFalse()
+ .isFalse()
}
@Test
fun teamFoodFlag_False() {
- whenever(flagManager.readFlagValue<Boolean>(
- eq(Flags.TEAMFOOD.name), any())).thenReturn(false)
- assertThat(featureFlagsDebug.isEnabled(teamfoodableFlagA)).isFalse()
- assertThat(featureFlagsDebug.isEnabled(teamfoodableFlagB)).isTrue()
+ whenever(flagManager.readFlagValue<Boolean>(eq(Flags.TEAMFOOD.name), any()))
+ .thenReturn(false)
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(teamfoodableFlagA)).isFalse()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(teamfoodableFlagB)).isTrue()
// Regular boolean flags should still test the same.
// Only our teamfoodableFlag should change.
@@ -164,10 +134,10 @@
@Test
fun teamFoodFlag_True() {
- whenever(flagManager.readFlagValue<Boolean>(
- eq(Flags.TEAMFOOD.name), any())).thenReturn(true)
- assertThat(featureFlagsDebug.isEnabled(teamfoodableFlagA)).isTrue()
- assertThat(featureFlagsDebug.isEnabled(teamfoodableFlagB)).isTrue()
+ whenever(flagManager.readFlagValue<Boolean>(eq(Flags.TEAMFOOD.name), any()))
+ .thenReturn(true)
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(teamfoodableFlagA)).isTrue()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(teamfoodableFlagB)).isTrue()
// Regular boolean flags should still test the same.
// Only our teamfoodableFlag should change.
@@ -180,10 +150,10 @@
.thenReturn(true)
whenever(flagManager.readFlagValue<Boolean>(eq(teamfoodableFlagB.name), any()))
.thenReturn(false)
- whenever(flagManager.readFlagValue<Boolean>(
- eq(Flags.TEAMFOOD.name), any())).thenReturn(true)
- assertThat(featureFlagsDebug.isEnabled(teamfoodableFlagA)).isTrue()
- assertThat(featureFlagsDebug.isEnabled(teamfoodableFlagB)).isFalse()
+ whenever(flagManager.readFlagValue<Boolean>(eq(Flags.TEAMFOOD.name), any()))
+ .thenReturn(true)
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(teamfoodableFlagA)).isTrue()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(teamfoodableFlagB)).isFalse()
// Regular boolean flags should still test the same.
// Only our teamfoodableFlag should change.
@@ -201,25 +171,20 @@
whenever(flagManager.readFlagValue<Boolean>(eq("3"), any())).thenReturn(true)
whenever(flagManager.readFlagValue<Boolean>(eq("5"), any())).thenReturn(false)
- assertThat(
- featureFlagsDebug.isEnabled(
- ResourceBooleanFlag(
- "1",
- "test",
- 1001
- )
- )
- ).isFalse()
- assertThat(featureFlagsDebug.isEnabled(ResourceBooleanFlag("2", "test", 1002))).isTrue()
- assertThat(featureFlagsDebug.isEnabled(ResourceBooleanFlag("3", "test", 1003))).isTrue()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(ResourceBooleanFlag("1", "test", 1001)))
+ .isFalse()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(ResourceBooleanFlag("2", "test", 1002)))
+ .isTrue()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(ResourceBooleanFlag("3", "test", 1003)))
+ .isTrue()
Assert.assertThrows(NameNotFoundException::class.java) {
- featureFlagsDebug.isEnabled(ResourceBooleanFlag("4", "test", 1004))
+ mFeatureFlagsClassicDebug.isEnabled(ResourceBooleanFlag("4", "test", 1004))
}
// Test that resource is loaded (and validated) even when the setting is set.
// This prevents developers from not noticing when they reference an invalid resource.
Assert.assertThrows(NameNotFoundException::class.java) {
- featureFlagsDebug.isEnabled(ResourceBooleanFlag("5", "test", 1005))
+ mFeatureFlagsClassicDebug.isEnabled(ResourceBooleanFlag("5", "test", 1005))
}
}
@@ -232,29 +197,27 @@
return@thenAnswer it.getArgument(1)
}
- assertThat(featureFlagsDebug.isEnabled(SysPropBooleanFlag("a", "test"))).isFalse()
- assertThat(featureFlagsDebug.isEnabled(SysPropBooleanFlag("b", "test"))).isTrue()
- assertThat(featureFlagsDebug.isEnabled(SysPropBooleanFlag("c", "test", true))).isTrue()
- assertThat(
- featureFlagsDebug.isEnabled(
- SysPropBooleanFlag(
- "d",
- "test",
- false
- )
- )
- ).isFalse()
- assertThat(featureFlagsDebug.isEnabled(SysPropBooleanFlag("e", "test"))).isFalse()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(SysPropBooleanFlag("a", "test"))).isFalse()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(SysPropBooleanFlag("b", "test"))).isTrue()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(SysPropBooleanFlag("c", "test", true)))
+ .isTrue()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(SysPropBooleanFlag("d", "test", false)))
+ .isFalse()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(SysPropBooleanFlag("e", "test"))).isFalse()
}
@Test
fun readStringFlag() {
whenever(flagManager.readFlagValue<String>(eq("3"), any())).thenReturn("foo")
whenever(flagManager.readFlagValue<String>(eq("4"), any())).thenReturn("bar")
- assertThat(featureFlagsDebug.getString(StringFlag("1", "test", "biz"))).isEqualTo("biz")
- assertThat(featureFlagsDebug.getString(StringFlag("2", "test", "baz"))).isEqualTo("baz")
- assertThat(featureFlagsDebug.getString(StringFlag("3", "test", "buz"))).isEqualTo("foo")
- assertThat(featureFlagsDebug.getString(StringFlag("4", "test", "buz"))).isEqualTo("bar")
+ assertThat(mFeatureFlagsClassicDebug.getString(StringFlag("1", "test", "biz")))
+ .isEqualTo("biz")
+ assertThat(mFeatureFlagsClassicDebug.getString(StringFlag("2", "test", "baz")))
+ .isEqualTo("baz")
+ assertThat(mFeatureFlagsClassicDebug.getString(StringFlag("3", "test", "buz")))
+ .isEqualTo("foo")
+ assertThat(mFeatureFlagsClassicDebug.getString(StringFlag("4", "test", "buz")))
+ .isEqualTo("bar")
}
@Test
@@ -270,44 +233,23 @@
whenever(flagManager.readFlagValue<String>(eq("4"), any())).thenReturn("override4")
whenever(flagManager.readFlagValue<String>(eq("6"), any())).thenReturn("override6")
- assertThat(
- featureFlagsDebug.getString(
- ResourceStringFlag(
- "1",
- "test",
- 1001
- )
- )
- ).isEqualTo("")
- assertThat(
- featureFlagsDebug.getString(
- ResourceStringFlag(
- "2",
- "test",
- 1002
- )
- )
- ).isEqualTo("resource2")
- assertThat(
- featureFlagsDebug.getString(
- ResourceStringFlag(
- "3",
- "test",
- 1003
- )
- )
- ).isEqualTo("override3")
+ assertThat(mFeatureFlagsClassicDebug.getString(ResourceStringFlag("1", "test", 1001)))
+ .isEqualTo("")
+ assertThat(mFeatureFlagsClassicDebug.getString(ResourceStringFlag("2", "test", 1002)))
+ .isEqualTo("resource2")
+ assertThat(mFeatureFlagsClassicDebug.getString(ResourceStringFlag("3", "test", 1003)))
+ .isEqualTo("override3")
Assert.assertThrows(NullPointerException::class.java) {
- featureFlagsDebug.getString(ResourceStringFlag("4", "test", 1004))
+ mFeatureFlagsClassicDebug.getString(ResourceStringFlag("4", "test", 1004))
}
Assert.assertThrows(NameNotFoundException::class.java) {
- featureFlagsDebug.getString(ResourceStringFlag("5", "test", 1005))
+ mFeatureFlagsClassicDebug.getString(ResourceStringFlag("5", "test", 1005))
}
// Test that resource is loaded (and validated) even when the setting is set.
// This prevents developers from not noticing when they reference an invalid resource.
Assert.assertThrows(NameNotFoundException::class.java) {
- featureFlagsDebug.getString(ResourceStringFlag("6", "test", 1005))
+ mFeatureFlagsClassicDebug.getString(ResourceStringFlag("6", "test", 1005))
}
}
@@ -315,10 +257,10 @@
fun readIntFlag() {
whenever(flagManager.readFlagValue<Int>(eq("3"), any())).thenReturn(22)
whenever(flagManager.readFlagValue<Int>(eq("4"), any())).thenReturn(48)
- assertThat(featureFlagsDebug.getInt(IntFlag("1", "test", 12))).isEqualTo(12)
- assertThat(featureFlagsDebug.getInt(IntFlag("2", "test", 93))).isEqualTo(93)
- assertThat(featureFlagsDebug.getInt(IntFlag("3", "test", 8))).isEqualTo(22)
- assertThat(featureFlagsDebug.getInt(IntFlag("4", "test", 234))).isEqualTo(48)
+ assertThat(mFeatureFlagsClassicDebug.getInt(IntFlag("1", "test", 12))).isEqualTo(12)
+ assertThat(mFeatureFlagsClassicDebug.getInt(IntFlag("2", "test", 93))).isEqualTo(93)
+ assertThat(mFeatureFlagsClassicDebug.getInt(IntFlag("3", "test", 8))).isEqualTo(22)
+ assertThat(mFeatureFlagsClassicDebug.getInt(IntFlag("4", "test", 234))).isEqualTo(48)
}
@Test
@@ -334,17 +276,20 @@
whenever(flagManager.readFlagValue<Int>(eq("4"), any())).thenReturn(500)
whenever(flagManager.readFlagValue<Int>(eq("5"), any())).thenReturn(9519)
- assertThat(featureFlagsDebug.getInt(ResourceIntFlag("1", "test", 1001))).isEqualTo(88)
- assertThat(featureFlagsDebug.getInt(ResourceIntFlag("2", "test", 1002))).isEqualTo(61)
- assertThat(featureFlagsDebug.getInt(ResourceIntFlag("3", "test", 1003))).isEqualTo(20)
+ assertThat(mFeatureFlagsClassicDebug.getInt(ResourceIntFlag("1", "test", 1001)))
+ .isEqualTo(88)
+ assertThat(mFeatureFlagsClassicDebug.getInt(ResourceIntFlag("2", "test", 1002)))
+ .isEqualTo(61)
+ assertThat(mFeatureFlagsClassicDebug.getInt(ResourceIntFlag("3", "test", 1003)))
+ .isEqualTo(20)
Assert.assertThrows(NotFoundException::class.java) {
- featureFlagsDebug.getInt(ResourceIntFlag("4", "test", 1004))
+ mFeatureFlagsClassicDebug.getInt(ResourceIntFlag("4", "test", 1004))
}
// Test that resource is loaded (and validated) even when the setting is set.
// This prevents developers from not noticing when they reference an invalid resource.
Assert.assertThrows(NotFoundException::class.java) {
- featureFlagsDebug.getInt(ResourceIntFlag("5", "test", 1005))
+ mFeatureFlagsClassicDebug.getInt(ResourceIntFlag("5", "test", 1005))
}
}
@@ -424,11 +369,11 @@
whenever(flagManager.readFlagValue<String>(eq("1"), any())).thenReturn("original")
// gets the flag & cache it
- assertThat(featureFlagsDebug.getString(flag1)).isEqualTo("original")
+ assertThat(mFeatureFlagsClassicDebug.getString(flag1)).isEqualTo("original")
verify(flagManager, times(1)).readFlagValue(eq("1"), eq(StringFlagSerializer))
// hit the cache
- assertThat(featureFlagsDebug.getString(flag1)).isEqualTo("original")
+ assertThat(mFeatureFlagsClassicDebug.getString(flag1)).isEqualTo("original")
verifyNoMoreInteractions(flagManager)
// set the flag
@@ -436,7 +381,7 @@
verifyPutData("1", "{\"type\":\"string\",\"value\":\"new\"}", numReads = 2)
whenever(flagManager.readFlagValue<String>(eq("1"), any())).thenReturn("new")
- assertThat(featureFlagsDebug.getString(flag1)).isEqualTo("new")
+ assertThat(mFeatureFlagsClassicDebug.getString(flag1)).isEqualTo("new")
verify(flagManager, times(3)).readFlagValue(eq("1"), eq(StringFlagSerializer))
}
@@ -446,7 +391,7 @@
serverFlagReader.setFlagValue(flag.namespace, flag.name, false)
- assertThat(featureFlagsDebug.isEnabled(flag)).isFalse()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(flag)).isFalse()
}
@Test
@@ -454,32 +399,41 @@
val flag = UnreleasedFlag(name = "100", namespace = "test")
serverFlagReader.setFlagValue(flag.namespace, flag.name, true)
- assertThat(featureFlagsDebug.isEnabled(flag)).isTrue()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(flag)).isTrue()
}
@Test
fun serverSide_OverrideUncached_NoRestart() {
// No one has read the flag, so it's not in the cache.
serverFlagReader.setFlagValue(
- teamfoodableFlagA.namespace, teamfoodableFlagA.name, !teamfoodableFlagA.default)
+ teamfoodableFlagA.namespace,
+ teamfoodableFlagA.name,
+ !teamfoodableFlagA.default
+ )
verify(restarter, never()).restartSystemUI(anyString())
}
@Test
fun serverSide_Override_Restarts() {
// Read it to put it in the cache.
- featureFlagsDebug.isEnabled(teamfoodableFlagA)
+ mFeatureFlagsClassicDebug.isEnabled(teamfoodableFlagA)
serverFlagReader.setFlagValue(
- teamfoodableFlagA.namespace, teamfoodableFlagA.name, !teamfoodableFlagA.default)
+ teamfoodableFlagA.namespace,
+ teamfoodableFlagA.name,
+ !teamfoodableFlagA.default
+ )
verify(restarter).restartSystemUI(anyString())
}
@Test
fun serverSide_RedundantOverride_NoRestart() {
// Read it to put it in the cache.
- featureFlagsDebug.isEnabled(teamfoodableFlagA)
+ mFeatureFlagsClassicDebug.isEnabled(teamfoodableFlagA)
serverFlagReader.setFlagValue(
- teamfoodableFlagA.namespace, teamfoodableFlagA.name, teamfoodableFlagA.default)
+ teamfoodableFlagA.namespace,
+ teamfoodableFlagA.name,
+ teamfoodableFlagA.default
+ )
verify(restarter, never()).restartSystemUI(anyString())
}
@@ -500,13 +454,13 @@
.thenReturn("override7")
// WHEN the flags have been accessed
- assertThat(featureFlagsDebug.isEnabled(flag1)).isTrue()
- assertThat(featureFlagsDebug.isEnabled(flag2)).isTrue()
- assertThat(featureFlagsDebug.isEnabled(flag3)).isFalse()
- assertThat(featureFlagsDebug.getString(flag4)).isEmpty()
- assertThat(featureFlagsDebug.getString(flag5)).isEqualTo("flag5default")
- assertThat(featureFlagsDebug.getString(flag6)).isEqualTo("resource1006")
- assertThat(featureFlagsDebug.getString(flag7)).isEqualTo("override7")
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(flag1)).isTrue()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(flag2)).isTrue()
+ assertThat(mFeatureFlagsClassicDebug.isEnabled(flag3)).isFalse()
+ assertThat(mFeatureFlagsClassicDebug.getString(flag4)).isEmpty()
+ assertThat(mFeatureFlagsClassicDebug.getString(flag5)).isEqualTo("flag5default")
+ assertThat(mFeatureFlagsClassicDebug.getString(flag6)).isEqualTo("resource1006")
+ assertThat(mFeatureFlagsClassicDebug.getString(flag7)).isEqualTo("override7")
// THEN the dump contains the flags and the default values
val dump = dumpToString()
@@ -520,12 +474,15 @@
}
private fun verifyPutData(name: String, data: String, numReads: Int = 1) {
- inOrder(flagManager, globalSettings).apply {
- verify(flagManager, times(numReads)).readFlagValue(eq(name), any<FlagSerializer<*>>())
- verify(flagManager).nameToSettingsKey(eq(name))
- verify(globalSettings).putStringForUser(eq("key-$name"), eq(data), anyInt())
- verify(flagManager).dispatchListenersAndMaybeRestart(eq(name), any())
- }.verifyNoMoreInteractions()
+ inOrder(flagManager, globalSettings)
+ .apply {
+ verify(flagManager, times(numReads))
+ .readFlagValue(eq(name), any<FlagSerializer<*>>())
+ verify(flagManager).nameToSettingsKey(eq(name))
+ verify(globalSettings).putStringForUser(eq("key-$name"), eq(data), anyInt())
+ verify(flagManager).dispatchListenersAndMaybeRestart(eq(name), any())
+ }
+ .verifyNoMoreInteractions()
verifyNoMoreInteractions(flagManager, globalSettings)
}
@@ -545,7 +502,7 @@
private fun dumpToString(): String {
val sw = StringWriter()
val pw = PrintWriter(sw)
- featureFlagsDebug.dump(pw, emptyArray<String>())
+ mFeatureFlagsClassicDebug.dump(pw, emptyArray<String>())
pw.flush()
return sw.toString()
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/flags/FeatureFlagsReleaseTest.kt b/packages/SystemUI/tests/src/com/android/systemui/flags/FeatureFlagsClassicReleaseTest.kt
similarity index 72%
rename from packages/SystemUI/tests/src/com/android/systemui/flags/FeatureFlagsReleaseTest.kt
rename to packages/SystemUI/tests/src/com/android/systemui/flags/FeatureFlagsClassicReleaseTest.kt
index 16b4595..70d6dd9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/flags/FeatureFlagsReleaseTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/flags/FeatureFlagsClassicReleaseTest.kt
@@ -26,16 +26,16 @@
import org.mockito.Mock
import org.mockito.Mockito
import org.mockito.Mockito.never
-import org.mockito.MockitoAnnotations
import org.mockito.Mockito.`when` as whenever
+import org.mockito.MockitoAnnotations
/**
* NOTE: This test is for the version of FeatureFlagManager in src-release, which should not allow
* overriding, and should never return any value other than the one provided as the default.
*/
@SmallTest
-class FeatureFlagsReleaseTest : SysuiTestCase() {
- private lateinit var featureFlagsRelease: FeatureFlagsRelease
+class FeatureFlagsClassicReleaseTest : SysuiTestCase() {
+ private lateinit var mFeatureFlagsClassicRelease: FeatureFlagsClassicRelease
@Mock private lateinit var mResources: Resources
@Mock private lateinit var mSystemProperties: SystemPropertiesHelper
@@ -43,21 +43,22 @@
private val flagMap = mutableMapOf<String, Flag<*>>()
private val serverFlagReader = ServerFlagReaderFake()
-
private val flagA = ReleasedFlag(name = "a", namespace = "test")
@Before
fun setup() {
MockitoAnnotations.initMocks(this)
flagMap.put(flagA.name, flagA)
- featureFlagsRelease = FeatureFlagsRelease(
- mResources,
- mSystemProperties,
- serverFlagReader,
- flagMap,
- restarter)
+ mFeatureFlagsClassicRelease =
+ FeatureFlagsClassicRelease(
+ mResources,
+ mSystemProperties,
+ serverFlagReader,
+ flagMap,
+ restarter
+ )
- featureFlagsRelease.init()
+ mFeatureFlagsClassicRelease.init()
}
@Test
@@ -67,7 +68,7 @@
val flagNamespace = "test"
val flag = ResourceBooleanFlag(flagName, flagNamespace, flagResourceId)
whenever(mResources.getBoolean(flagResourceId)).thenReturn(true)
- assertThat(featureFlagsRelease.isEnabled(flag)).isTrue()
+ assertThat(mFeatureFlagsClassicRelease.isEnabled(flag)).isTrue()
}
@Test
@@ -77,16 +78,16 @@
whenever(mResources.getString(1003)).thenReturn(null)
whenever(mResources.getString(1004)).thenAnswer { throw NameNotFoundException() }
- assertThat(featureFlagsRelease.getString(
- ResourceStringFlag("1", "test", 1001))).isEqualTo("")
- assertThat(featureFlagsRelease.getString(
- ResourceStringFlag("2", "test", 1002))).isEqualTo("res2")
+ assertThat(mFeatureFlagsClassicRelease.getString(ResourceStringFlag("1", "test", 1001)))
+ .isEqualTo("")
+ assertThat(mFeatureFlagsClassicRelease.getString(ResourceStringFlag("2", "test", 1002)))
+ .isEqualTo("res2")
assertThrows(NullPointerException::class.java) {
- featureFlagsRelease.getString(ResourceStringFlag("3", "test", 1003))
+ mFeatureFlagsClassicRelease.getString(ResourceStringFlag("3", "test", 1003))
}
assertThrows(NameNotFoundException::class.java) {
- featureFlagsRelease.getString(ResourceStringFlag("4", "test", 1004))
+ mFeatureFlagsClassicRelease.getString(ResourceStringFlag("4", "test", 1004))
}
}
@@ -98,7 +99,7 @@
val flag = SysPropBooleanFlag(flagName, flagNamespace, flagDefault)
whenever(mSystemProperties.getBoolean(flagName, flagDefault)).thenReturn(flagDefault)
- assertThat(featureFlagsRelease.isEnabled(flag)).isEqualTo(flagDefault)
+ assertThat(mFeatureFlagsClassicRelease.isEnabled(flag)).isEqualTo(flagDefault)
}
@Test
@@ -107,7 +108,7 @@
serverFlagReader.setFlagValue(flag.namespace, flag.name, false)
- assertThat(featureFlagsRelease.isEnabled(flag)).isFalse()
+ assertThat(mFeatureFlagsClassicRelease.isEnabled(flag)).isFalse()
}
@Test
@@ -116,32 +117,29 @@
serverFlagReader.setFlagValue(flag.namespace, flag.name, true)
- assertThat(featureFlagsRelease.isEnabled(flag)).isFalse()
+ assertThat(mFeatureFlagsClassicRelease.isEnabled(flag)).isFalse()
}
@Test
fun serverSide_OverrideUncached_NoRestart() {
// No one has read the flag, so it's not in the cache.
- serverFlagReader.setFlagValue(
- flagA.namespace, flagA.name, !flagA.default)
+ serverFlagReader.setFlagValue(flagA.namespace, flagA.name, !flagA.default)
Mockito.verify(restarter, never()).restartSystemUI(Mockito.anyString())
}
@Test
fun serverSide_Override_Restarts() {
// Read it to put it in the cache.
- featureFlagsRelease.isEnabled(flagA)
- serverFlagReader.setFlagValue(
- flagA.namespace, flagA.name, !flagA.default)
+ mFeatureFlagsClassicRelease.isEnabled(flagA)
+ serverFlagReader.setFlagValue(flagA.namespace, flagA.name, !flagA.default)
Mockito.verify(restarter).restartSystemUI(Mockito.anyString())
}
@Test
fun serverSide_RedundantOverride_NoRestart() {
// Read it to put it in the cache.
- featureFlagsRelease.isEnabled(flagA)
- serverFlagReader.setFlagValue(
- flagA.namespace, flagA.name, flagA.default)
+ mFeatureFlagsClassicRelease.isEnabled(flagA)
+ serverFlagReader.setFlagValue(flagA.namespace, flagA.name, flagA.default)
Mockito.verify(restarter, never()).restartSystemUI(Mockito.anyString())
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/flags/FlagCommandTest.kt b/packages/SystemUI/tests/src/com/android/systemui/flags/FlagCommandTest.kt
index b02baa7..7c1325e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/flags/FlagCommandTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/flags/FlagCommandTest.kt
@@ -30,7 +30,7 @@
@SmallTest
class FlagCommandTest : SysuiTestCase() {
- @Mock private lateinit var featureFlags: FeatureFlagsDebug
+ @Mock private lateinit var featureFlags: FeatureFlagsClassicDebug
@Mock private lateinit var pw: PrintWriter
private val flagMap = mutableMapOf<String, Flag<*>>()
private val flagA = UnreleasedFlag("500", "test")
diff --git a/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java b/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java
index 6aa5a00..b1cf051 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/globalactions/GlobalActionsDialogLiteTest.java
@@ -24,6 +24,7 @@
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -70,10 +71,10 @@
import com.android.systemui.shade.ShadeController;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.VibratorHelper;
-import com.android.systemui.statusbar.phone.CentralSurfaces;
import com.android.systemui.statusbar.phone.LightBarController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
+import com.android.systemui.statusbar.window.StatusBarWindowController;
import com.android.systemui.telephony.TelephonyListenerManager;
import com.android.systemui.util.RingerModeLiveData;
import com.android.systemui.util.RingerModeTracker;
@@ -89,7 +90,6 @@
import org.mockito.MockitoAnnotations;
import java.util.List;
-import java.util.Optional;
import java.util.concurrent.Executor;
@SmallTest
@@ -119,6 +119,7 @@
@Mock private IStatusBarService mStatusBarService;
@Mock private LightBarController mLightBarController;
@Mock private NotificationShadeWindowController mNotificationShadeWindowController;
+ @Mock private StatusBarWindowController mStatusBarWindowController;
@Mock private IWindowManager mWindowManager;
@Mock private Executor mBackgroundExecutor;
@Mock private UiEventLogger mUiEventLogger;
@@ -128,7 +129,6 @@
@Mock private Handler mHandler;
@Mock private UserContextProvider mUserContextProvider;
@Mock private VibratorHelper mVibratorHelper;
- @Mock private CentralSurfaces mCentralSurfaces;
@Mock private ShadeController mShadeController;
@Mock private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
@Mock private DialogLaunchAnimator mDialogLaunchAnimator;
@@ -172,13 +172,13 @@
mStatusBarService,
mLightBarController,
mNotificationShadeWindowController,
+ mStatusBarWindowController,
mWindowManager,
mBackgroundExecutor,
mUiEventLogger,
mRingerModeTracker,
mHandler,
mPackageManager,
- Optional.of(mCentralSurfaces),
mShadeController,
mKeyguardUpdateMonitor,
mDialogLaunchAnimator);
@@ -305,7 +305,7 @@
doReturn(4).when(mGlobalActionsDialogLite).getMaxShownPowerItems();
doReturn(true).when(mGlobalActionsDialogLite).shouldDisplayLockdown(any());
doReturn(true).when(mGlobalActionsDialogLite).shouldShowAction(any());
- doReturn(true).when(mCentralSurfaces).isKeyguardShowing();
+ doReturn(true).when(mKeyguardStateController).isShowing();
String[] actions = {
GlobalActionsDialogLite.GLOBAL_ACTION_KEY_EMERGENCY,
GlobalActionsDialogLite.GLOBAL_ACTION_KEY_LOCKDOWN,
@@ -329,7 +329,7 @@
doReturn(4).when(mGlobalActionsDialogLite).getMaxShownPowerItems();
doReturn(true).when(mGlobalActionsDialogLite).shouldDisplayLockdown(any());
doReturn(true).when(mGlobalActionsDialogLite).shouldShowAction(any());
- doReturn(false).when(mCentralSurfaces).isKeyguardShowing();
+ doReturn(false).when(mKeyguardStateController).isShowing();
String[] actions = {
GlobalActionsDialogLite.GLOBAL_ACTION_KEY_EMERGENCY,
GlobalActionsDialogLite.GLOBAL_ACTION_KEY_LOCKDOWN,
@@ -348,6 +348,34 @@
}
@Test
+ public void testSwipeDown_pastStatusBarHeight_shadeNotOpened() {
+ mGlobalActionsDialogLite = spy(mGlobalActionsDialogLite);
+ doReturn(4).when(mGlobalActionsDialogLite).getMaxShownPowerItems();
+ doReturn(true).when(mGlobalActionsDialogLite).shouldDisplayLockdown(any());
+ doReturn(true).when(mGlobalActionsDialogLite).shouldShowAction(any());
+ doReturn(false).when(mKeyguardStateController).isShowing();
+ String[] actions = {
+ GlobalActionsDialogLite.GLOBAL_ACTION_KEY_EMERGENCY,
+ GlobalActionsDialogLite.GLOBAL_ACTION_KEY_LOCKDOWN,
+ GlobalActionsDialogLite.GLOBAL_ACTION_KEY_POWER,
+ GlobalActionsDialogLite.GLOBAL_ACTION_KEY_RESTART,
+ };
+ doReturn(actions).when(mGlobalActionsDialogLite).getDefaultActions();
+ GlobalActionsDialogLite.ActionsDialogLite dialog = mGlobalActionsDialogLite.createDialog();
+
+ doReturn(100).when(mStatusBarWindowController).getStatusBarHeight();
+
+ GestureDetector.SimpleOnGestureListener gestureListener = spy(dialog.mGestureListener);
+ // WHEN the start y is larger than the status bar height
+ MotionEvent start = MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, 0, 200, 0);
+ MotionEvent end = MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, 0, 500, 0);
+ gestureListener.onFling(start, end, 0, 1000);
+
+ // THEN the shade isn't opened
+ verify(mShadeController, never()).animateExpandShade();
+ }
+
+ @Test
public void testShouldLogBugreportPress() throws InterruptedException {
GlobalActionsDialogLite.BugReportAction bugReportAction =
mGlobalActionsDialogLite.makeBugReportActionForTesting();
@@ -539,7 +567,7 @@
doReturn(4).when(mGlobalActionsDialogLite).getMaxShownPowerItems();
doReturn(true).when(mGlobalActionsDialogLite).shouldDisplayLockdown(any());
doReturn(true).when(mGlobalActionsDialogLite).shouldShowAction(any());
- doReturn(false).when(mCentralSurfaces).isKeyguardShowing();
+ doReturn(false).when(mKeyguardStateController).isShowing();
String[] actions = {
GlobalActionsDialogLite.GLOBAL_ACTION_KEY_EMERGENCY,
GlobalActionsDialogLite.GLOBAL_ACTION_KEY_LOCKDOWN,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyevent/domain/interactor/KeyEventInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyevent/domain/interactor/KeyEventInteractorTest.kt
new file mode 100644
index 0000000..632d149
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyevent/domain/interactor/KeyEventInteractorTest.kt
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.keyevent.domain.interactor
+
+import android.view.KeyEvent
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.back.domain.interactor.BackActionInteractor
+import com.android.systemui.keyguard.domain.interactor.KeyguardInteractorFactory
+import com.android.systemui.keyguard.domain.interactor.KeyguardKeyEventInteractor
+import com.android.systemui.util.mockito.eq
+import com.android.systemui.util.mockito.whenever
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.Mockito.never
+import org.mockito.Mockito.verify
+import org.mockito.junit.MockitoJUnit
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class KeyEventInteractorTest : SysuiTestCase() {
+ @JvmField @Rule var mockitoRule = MockitoJUnit.rule()
+
+ private lateinit var keyguardInteractorWithDependencies:
+ KeyguardInteractorFactory.WithDependencies
+ @Mock private lateinit var keyguardKeyEventInteractor: KeyguardKeyEventInteractor
+ @Mock private lateinit var backActionInteractor: BackActionInteractor
+
+ private lateinit var underTest: KeyEventInteractor
+
+ @Before
+ fun setup() {
+ keyguardInteractorWithDependencies = KeyguardInteractorFactory.create()
+ underTest =
+ KeyEventInteractor(
+ backActionInteractor,
+ keyguardKeyEventInteractor,
+ )
+ }
+
+ @Test
+ fun dispatchBackKey_notHandledByKeyguardKeyEventInteractor_handledByBackActionInteractor() {
+ val backKeyEventActionDown = KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK)
+ val backKeyEventActionUp = KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK)
+
+ // GIVEN back key ACTION_DOWN and ACTION_UP aren't handled by the keyguardKeyEventInteractor
+ whenever(keyguardKeyEventInteractor.dispatchKeyEvent(backKeyEventActionDown))
+ .thenReturn(false)
+ whenever(keyguardKeyEventInteractor.dispatchKeyEvent(backKeyEventActionUp))
+ .thenReturn(false)
+
+ // WHEN back key event ACTION_DOWN, the event is handled even though back isn't requested
+ assertThat(underTest.dispatchKeyEvent(backKeyEventActionDown)).isTrue()
+ // THEN back event isn't handled on ACTION_DOWN
+ verify(backActionInteractor, never()).onBackRequested()
+
+ // WHEN back key event ACTION_UP
+ assertThat(underTest.dispatchKeyEvent(backKeyEventActionUp)).isTrue()
+ // THEN back event is handled on ACTION_UP
+ verify(backActionInteractor).onBackRequested()
+ }
+
+ @Test
+ fun dispatchKeyEvent_isNotHandledByKeyguardKeyEventInteractor() {
+ val keyEvent =
+ KeyEvent(
+ KeyEvent.ACTION_UP,
+ KeyEvent.KEYCODE_SPACE,
+ )
+ whenever(keyguardKeyEventInteractor.dispatchKeyEvent(eq(keyEvent))).thenReturn(false)
+ assertThat(underTest.dispatchKeyEvent(keyEvent)).isFalse()
+ }
+
+ @Test
+ fun dispatchKeyEvent_handledByKeyguardKeyEventInteractor() {
+ val keyEvent =
+ KeyEvent(
+ KeyEvent.ACTION_UP,
+ KeyEvent.KEYCODE_SPACE,
+ )
+ whenever(keyguardKeyEventInteractor.dispatchKeyEvent(eq(keyEvent))).thenReturn(true)
+ assertThat(underTest.dispatchKeyEvent(keyEvent)).isTrue()
+ }
+
+ @Test
+ fun interceptMediaKey_isNotHandledByKeyguardKeyEventInteractor() {
+ val keyEvent =
+ KeyEvent(
+ KeyEvent.ACTION_UP,
+ KeyEvent.KEYCODE_SPACE,
+ )
+ whenever(keyguardKeyEventInteractor.interceptMediaKey(eq(keyEvent))).thenReturn(false)
+ assertThat(underTest.interceptMediaKey(keyEvent)).isFalse()
+ }
+
+ @Test
+ fun interceptMediaKey_handledByKeyguardKeyEventInteractor() {
+ val keyEvent =
+ KeyEvent(
+ KeyEvent.ACTION_UP,
+ KeyEvent.KEYCODE_SPACE,
+ )
+ whenever(keyguardKeyEventInteractor.interceptMediaKey(eq(keyEvent))).thenReturn(true)
+ assertThat(underTest.interceptMediaKey(keyEvent)).isTrue()
+ }
+
+ @Test
+ fun dispatchKeyEventPreIme_isNotHandledByKeyguardKeyEventInteractor() {
+ val keyEvent =
+ KeyEvent(
+ KeyEvent.ACTION_UP,
+ KeyEvent.KEYCODE_SPACE,
+ )
+ whenever(keyguardKeyEventInteractor.dispatchKeyEventPreIme(eq(keyEvent))).thenReturn(false)
+ assertThat(underTest.dispatchKeyEventPreIme(keyEvent)).isFalse()
+ }
+
+ @Test
+ fun dispatchKeyEventPreIme_handledByKeyguardKeyEventInteractor() {
+ val keyEvent =
+ KeyEvent(
+ KeyEvent.ACTION_UP,
+ KeyEvent.KEYCODE_SPACE,
+ )
+ whenever(keyguardKeyEventInteractor.dispatchKeyEventPreIme(eq(keyEvent))).thenReturn(true)
+ assertThat(underTest.dispatchKeyEventPreIme(keyEvent)).isTrue()
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/BiometricSettingsRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/BiometricSettingsRepositoryTest.kt
index c6a2fa5..a6930d5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/BiometricSettingsRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/BiometricSettingsRepositoryTest.kt
@@ -36,6 +36,11 @@
import com.android.systemui.RoboPilotTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.biometrics.AuthController
+import com.android.systemui.biometrics.data.repository.FaceSensorInfo
+import com.android.systemui.biometrics.data.repository.FakeFacePropertyRepository
+import com.android.systemui.biometrics.data.repository.FakeFingerprintPropertyRepository
+import com.android.systemui.biometrics.shared.model.FingerprintSensorType
+import com.android.systemui.biometrics.shared.model.SensorStrength
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.dump.DumpManager
import com.android.systemui.keyguard.data.repository.BiometricType.FACE
@@ -63,6 +68,7 @@
import org.mockito.ArgumentMatchers.isNull
import org.mockito.Captor
import org.mockito.Mock
+import org.mockito.Mockito.atLeastOnce
import org.mockito.Mockito.clearInvocations
import org.mockito.Mockito.times
import org.mockito.Mockito.verify
@@ -89,6 +95,8 @@
ArgumentCaptor<IBiometricEnabledOnKeyguardCallback.Stub>
private lateinit var userRepository: FakeUserRepository
private lateinit var devicePostureRepository: FakeDevicePostureRepository
+ private lateinit var facePropertyRepository: FakeFacePropertyRepository
+ private lateinit var fingerprintPropertyRepository: FakeFingerprintPropertyRepository
private lateinit var testDispatcher: TestDispatcher
private lateinit var testScope: TestScope
@@ -102,6 +110,8 @@
testScope = TestScope(testDispatcher)
userRepository = FakeUserRepository()
devicePostureRepository = FakeDevicePostureRepository()
+ facePropertyRepository = FakeFacePropertyRepository()
+ fingerprintPropertyRepository = FakeFingerprintPropertyRepository()
}
private suspend fun createBiometricSettingsRepository() {
@@ -120,74 +130,110 @@
biometricManager = biometricManager,
devicePostureRepository = devicePostureRepository,
dumpManager = dumpManager,
+ facePropertyRepository = facePropertyRepository,
+ fingerprintPropertyRepository = fingerprintPropertyRepository,
)
testScope.runCurrent()
+ fingerprintPropertyRepository.setProperties(
+ 1,
+ SensorStrength.STRONG,
+ FingerprintSensorType.UDFPS_OPTICAL,
+ emptyMap()
+ )
verify(lockPatternUtils).registerStrongAuthTracker(strongAuthTracker.capture())
+ verify(authController, atLeastOnce()).addCallback(authControllerCallback.capture())
}
@Test
fun fingerprintEnrollmentChange() =
testScope.runTest {
createBiometricSettingsRepository()
- val fingerprintEnrolled = collectLastValue(underTest.isFingerprintEnrolled)
+ val fingerprintAllowed = collectLastValue(underTest.isFingerprintEnrolledAndEnabled)
runCurrent()
- verify(authController).addCallback(authControllerCallback.capture())
whenever(authController.isFingerprintEnrolled(anyInt())).thenReturn(true)
enrollmentChange(UNDER_DISPLAY_FINGERPRINT, PRIMARY_USER_ID, true)
- assertThat(fingerprintEnrolled()).isTrue()
+ assertThat(fingerprintAllowed()).isTrue()
whenever(authController.isFingerprintEnrolled(anyInt())).thenReturn(false)
enrollmentChange(UNDER_DISPLAY_FINGERPRINT, ANOTHER_USER_ID, false)
- assertThat(fingerprintEnrolled()).isTrue()
+ assertThat(fingerprintAllowed()).isTrue()
enrollmentChange(UNDER_DISPLAY_FINGERPRINT, PRIMARY_USER_ID, false)
- assertThat(fingerprintEnrolled()).isFalse()
+ assertThat(fingerprintAllowed()).isFalse()
}
@Test
fun strongBiometricAllowedChange() =
testScope.runTest {
+ fingerprintIsEnrolled()
+ doNotDisableKeyguardAuthFeatures()
createBiometricSettingsRepository()
- val strongBiometricAllowed = collectLastValue(underTest.isStrongBiometricAllowed)
+
+ val strongBiometricAllowed by
+ collectLastValue(underTest.isFingerprintAuthCurrentlyAllowed)
runCurrent()
onStrongAuthChanged(STRONG_AUTH_NOT_REQUIRED, PRIMARY_USER_ID)
- assertThat(strongBiometricAllowed()).isTrue()
+ assertThat(strongBiometricAllowed).isTrue()
onStrongAuthChanged(STRONG_AUTH_REQUIRED_AFTER_BOOT, PRIMARY_USER_ID)
- assertThat(strongBiometricAllowed()).isFalse()
+ assertThat(strongBiometricAllowed).isFalse()
}
@Test
fun convenienceBiometricAllowedChange() =
testScope.runTest {
overrideResource(com.android.internal.R.bool.config_strongAuthRequiredOnBoot, false)
+ deviceIsInPostureThatSupportsFaceAuth()
+ faceAuthIsEnrolled()
+ faceAuthIsNonStrongBiometric()
createBiometricSettingsRepository()
- val convenienceBiometricAllowed =
- collectLastValue(underTest.isNonStrongBiometricAllowed)
- runCurrent()
+ val convenienceFaceAuthAllowed by collectLastValue(underTest.isFaceAuthCurrentlyAllowed)
+ doNotDisableKeyguardAuthFeatures()
+ faceAuthIsEnabledByBiometricManager()
+
+ onStrongAuthChanged(STRONG_AUTH_NOT_REQUIRED, PRIMARY_USER_ID)
onNonStrongAuthChanged(true, PRIMARY_USER_ID)
- assertThat(convenienceBiometricAllowed()).isTrue()
+ runCurrent()
+ assertThat(convenienceFaceAuthAllowed).isTrue()
onNonStrongAuthChanged(false, ANOTHER_USER_ID)
- assertThat(convenienceBiometricAllowed()).isTrue()
+ assertThat(convenienceFaceAuthAllowed).isTrue()
onNonStrongAuthChanged(false, PRIMARY_USER_ID)
- assertThat(convenienceBiometricAllowed()).isFalse()
+ assertThat(convenienceFaceAuthAllowed).isFalse()
mContext.orCreateTestableResources.removeOverride(
com.android.internal.R.bool.config_strongAuthRequiredOnBoot
)
}
+ private fun faceAuthIsNonStrongBiometric() {
+ facePropertyRepository.setSensorInfo(FaceSensorInfo(1, SensorStrength.CONVENIENCE))
+ }
+
+ private fun faceAuthIsStrongBiometric() {
+ facePropertyRepository.setSensorInfo(FaceSensorInfo(1, SensorStrength.STRONG))
+ }
+
+ private fun deviceIsInPostureThatSupportsFaceAuth() {
+ overrideResource(
+ R.integer.config_face_auth_supported_posture,
+ DevicePostureController.DEVICE_POSTURE_FLIPPED
+ )
+ devicePostureRepository.setCurrentPosture(DevicePosture.FLIPPED)
+ }
+
@Test
fun whenStrongAuthRequiredAfterBoot_nonStrongBiometricNotAllowed() =
testScope.runTest {
overrideResource(com.android.internal.R.bool.config_strongAuthRequiredOnBoot, true)
createBiometricSettingsRepository()
+ faceAuthIsNonStrongBiometric()
+ faceAuthIsEnrolled()
+ doNotDisableKeyguardAuthFeatures()
- val convenienceBiometricAllowed =
- collectLastValue(underTest.isNonStrongBiometricAllowed)
+ val convenienceBiometricAllowed = collectLastValue(underTest.isFaceAuthCurrentlyAllowed)
runCurrent()
onNonStrongAuthChanged(true, PRIMARY_USER_ID)
@@ -201,16 +247,24 @@
fun whenStrongBiometricAuthIsNotAllowed_nonStrongBiometrics_alsoNotAllowed() =
testScope.runTest {
overrideResource(com.android.internal.R.bool.config_strongAuthRequiredOnBoot, false)
+ faceAuthIsNonStrongBiometric()
+ deviceIsInPostureThatSupportsFaceAuth()
+ faceAuthIsEnrolled()
createBiometricSettingsRepository()
-
- val convenienceBiometricAllowed =
- collectLastValue(underTest.isNonStrongBiometricAllowed)
+ doNotDisableKeyguardAuthFeatures()
+ faceAuthIsEnabledByBiometricManager()
runCurrent()
+
+ val convenienceBiometricAllowed by
+ collectLastValue(underTest.isFaceAuthCurrentlyAllowed)
+
+ onStrongAuthChanged(STRONG_AUTH_NOT_REQUIRED, PRIMARY_USER_ID)
onNonStrongAuthChanged(true, PRIMARY_USER_ID)
- assertThat(convenienceBiometricAllowed()).isTrue()
+ runCurrent()
+ assertThat(convenienceBiometricAllowed).isTrue()
onStrongAuthChanged(STRONG_AUTH_REQUIRED_AFTER_TIMEOUT, PRIMARY_USER_ID)
- assertThat(convenienceBiometricAllowed()).isFalse()
+ assertThat(convenienceBiometricAllowed).isFalse()
mContext.orCreateTestableResources.removeOverride(
com.android.internal.R.bool.config_strongAuthRequiredOnBoot
)
@@ -229,9 +283,11 @@
@Test
fun fingerprintDisabledByDpmChange() =
testScope.runTest {
+ fingerprintIsEnrolled(PRIMARY_USER_ID)
createBiometricSettingsRepository()
+
val fingerprintEnabledByDevicePolicy =
- collectLastValue(underTest.isFingerprintEnabledByDevicePolicy)
+ collectLastValue(underTest.isFingerprintEnrolledAndEnabled)
runCurrent()
whenever(devicePolicyManager.getKeyguardDisabledFeatures(any(), anyInt()))
@@ -244,43 +300,57 @@
assertThat(fingerprintEnabledByDevicePolicy()).isTrue()
}
+ private fun fingerprintIsEnrolled(userId: Int = PRIMARY_USER_ID) {
+ whenever(authController.isFingerprintEnrolled(userId)).thenReturn(true)
+ }
+
@Test
fun faceEnrollmentChangeIsPropagatedForTheCurrentUser() =
testScope.runTest {
createBiometricSettingsRepository()
+ faceAuthIsEnabledByBiometricManager()
+
+ doNotDisableKeyguardAuthFeatures(PRIMARY_USER_ID)
+
runCurrent()
clearInvocations(authController)
whenever(authController.isFaceAuthEnrolled(PRIMARY_USER_ID)).thenReturn(false)
- val faceEnrolled = collectLastValue(underTest.isFaceEnrolled)
+ val faceAuthAllowed = collectLastValue(underTest.isFaceAuthEnrolledAndEnabled)
- assertThat(faceEnrolled()).isFalse()
+ assertThat(faceAuthAllowed()).isFalse()
verify(authController).addCallback(authControllerCallback.capture())
enrollmentChange(REAR_FINGERPRINT, PRIMARY_USER_ID, true)
- assertThat(faceEnrolled()).isFalse()
+ assertThat(faceAuthAllowed()).isFalse()
enrollmentChange(SIDE_FINGERPRINT, PRIMARY_USER_ID, true)
- assertThat(faceEnrolled()).isFalse()
+ assertThat(faceAuthAllowed()).isFalse()
enrollmentChange(UNDER_DISPLAY_FINGERPRINT, PRIMARY_USER_ID, true)
- assertThat(faceEnrolled()).isFalse()
+ assertThat(faceAuthAllowed()).isFalse()
whenever(authController.isFaceAuthEnrolled(ANOTHER_USER_ID)).thenReturn(true)
enrollmentChange(FACE, ANOTHER_USER_ID, true)
- assertThat(faceEnrolled()).isFalse()
+ assertThat(faceAuthAllowed()).isFalse()
- whenever(authController.isFaceAuthEnrolled(PRIMARY_USER_ID)).thenReturn(true)
+ faceAuthIsEnrolled()
enrollmentChange(FACE, PRIMARY_USER_ID, true)
- assertThat(faceEnrolled()).isTrue()
+ assertThat(faceAuthAllowed()).isTrue()
}
+ private fun faceAuthIsEnabledByBiometricManager(userId: Int = PRIMARY_USER_ID) {
+ verify(biometricManager, atLeastOnce())
+ .registerEnabledOnKeyguardCallback(biometricManagerCallback.capture())
+ biometricManagerCallback.value.onChanged(true, userId)
+ }
+
@Test
fun faceEnrollmentStatusOfNewUserUponUserSwitch() =
testScope.runTest {
@@ -290,21 +360,26 @@
whenever(authController.isFaceAuthEnrolled(PRIMARY_USER_ID)).thenReturn(false)
whenever(authController.isFaceAuthEnrolled(ANOTHER_USER_ID)).thenReturn(true)
- val faceEnrolled = collectLastValue(underTest.isFaceEnrolled)
+ val faceAuthAllowed = collectLastValue(underTest.isFaceAuthEnrolledAndEnabled)
- assertThat(faceEnrolled()).isFalse()
+ assertThat(faceAuthAllowed()).isFalse()
}
@Test
fun faceEnrollmentChangesArePropagatedAfterUserSwitch() =
testScope.runTest {
createBiometricSettingsRepository()
+ verify(biometricManager)
+ .registerEnabledOnKeyguardCallback(biometricManagerCallback.capture())
userRepository.setSelectedUserInfo(ANOTHER_USER)
+ doNotDisableKeyguardAuthFeatures(ANOTHER_USER_ID)
+ biometricManagerCallback.value.onChanged(true, ANOTHER_USER_ID)
+
runCurrent()
clearInvocations(authController)
- val faceEnrolled = collectLastValue(underTest.isFaceEnrolled)
+ val faceAuthAllowed = collectLastValue(underTest.isFaceAuthEnrolledAndEnabled)
runCurrent()
verify(authController).addCallback(authControllerCallback.capture())
@@ -312,12 +387,14 @@
whenever(authController.isFaceAuthEnrolled(ANOTHER_USER_ID)).thenReturn(true)
enrollmentChange(FACE, ANOTHER_USER_ID, true)
- assertThat(faceEnrolled()).isTrue()
+ assertThat(faceAuthAllowed()).isTrue()
}
@Test
fun devicePolicyControlsFaceAuthenticationEnabledState() =
testScope.runTest {
+ faceAuthIsEnrolled()
+
createBiometricSettingsRepository()
verify(biometricManager)
.registerEnabledOnKeyguardCallback(biometricManagerCallback.capture())
@@ -325,62 +402,70 @@
whenever(devicePolicyManager.getKeyguardDisabledFeatures(isNull(), eq(PRIMARY_USER_ID)))
.thenReturn(KEYGUARD_DISABLE_FINGERPRINT or KEYGUARD_DISABLE_FACE)
- val isFaceAuthEnabled = collectLastValue(underTest.isFaceAuthenticationEnabled)
+ val isFaceAuthAllowed = collectLastValue(underTest.isFaceAuthEnrolledAndEnabled)
runCurrent()
broadcastDPMStateChange()
- assertThat(isFaceAuthEnabled()).isFalse()
+ assertThat(isFaceAuthAllowed()).isFalse()
biometricManagerCallback.value.onChanged(true, PRIMARY_USER_ID)
runCurrent()
- assertThat(isFaceAuthEnabled()).isFalse()
+ assertThat(isFaceAuthAllowed()).isFalse()
whenever(devicePolicyManager.getKeyguardDisabledFeatures(isNull(), eq(PRIMARY_USER_ID)))
.thenReturn(KEYGUARD_DISABLE_FINGERPRINT)
broadcastDPMStateChange()
- assertThat(isFaceAuthEnabled()).isTrue()
+ assertThat(isFaceAuthAllowed()).isTrue()
}
@Test
fun biometricManagerControlsFaceAuthenticationEnabledStatus() =
testScope.runTest {
+ faceAuthIsEnrolled()
+
createBiometricSettingsRepository()
verify(biometricManager)
.registerEnabledOnKeyguardCallback(biometricManagerCallback.capture())
whenever(devicePolicyManager.getKeyguardDisabledFeatures(isNull(), eq(PRIMARY_USER_ID)))
.thenReturn(0)
broadcastDPMStateChange()
- val isFaceAuthEnabled = collectLastValue(underTest.isFaceAuthenticationEnabled)
+ val isFaceAuthAllowed = collectLastValue(underTest.isFaceAuthEnrolledAndEnabled)
- assertThat(isFaceAuthEnabled()).isFalse()
+ assertThat(isFaceAuthAllowed()).isFalse()
// Value changes for another user
biometricManagerCallback.value.onChanged(true, ANOTHER_USER_ID)
- assertThat(isFaceAuthEnabled()).isFalse()
+ assertThat(isFaceAuthAllowed()).isFalse()
// Value changes for current user.
biometricManagerCallback.value.onChanged(true, PRIMARY_USER_ID)
- assertThat(isFaceAuthEnabled()).isTrue()
+ assertThat(isFaceAuthAllowed()).isTrue()
}
+ private fun faceAuthIsEnrolled(userId: Int = PRIMARY_USER_ID) {
+ whenever(authController.isFaceAuthEnrolled(userId)).thenReturn(true)
+ }
+
@Test
fun userChange_biometricEnabledChange_handlesRaceCondition() =
testScope.runTest {
createBiometricSettingsRepository()
+ whenever(authController.isFaceAuthEnrolled(ANOTHER_USER_ID)).thenReturn(true)
+
verify(biometricManager)
.registerEnabledOnKeyguardCallback(biometricManagerCallback.capture())
- val isFaceAuthEnabled = collectLastValue(underTest.isFaceAuthenticationEnabled)
+ val isFaceAuthAllowed = collectLastValue(underTest.isFaceAuthEnrolledAndEnabled)
biometricManagerCallback.value.onChanged(true, ANOTHER_USER_ID)
runCurrent()
userRepository.setSelectedUserInfo(ANOTHER_USER)
runCurrent()
- assertThat(isFaceAuthEnabled()).isTrue()
+ assertThat(isFaceAuthAllowed()).isTrue()
}
@Test
@@ -388,9 +473,9 @@
testScope.runTest {
createBiometricSettingsRepository()
- collectLastValue(underTest.isFaceAuthenticationEnabled)()
- collectLastValue(underTest.isFaceAuthenticationEnabled)()
- collectLastValue(underTest.isFaceAuthenticationEnabled)()
+ collectLastValue(underTest.isFaceAuthEnrolledAndEnabled)()
+ collectLastValue(underTest.isFaceAuthEnrolledAndEnabled)()
+ collectLastValue(underTest.isFaceAuthEnrolledAndEnabled)()
verify(biometricManager, times(1)).registerEnabledOnKeyguardCallback(any())
}
@@ -495,10 +580,138 @@
assertThat(authFlags()!!.flag).isEqualTo(STRONG_AUTH_REQUIRED_AFTER_TIMEOUT)
}
+ @Test
+ fun faceAuthCurrentlyAllowed_dependsOnStrongAuthBiometricSetting_ifFaceIsClass3() =
+ testScope.runTest {
+ createBiometricSettingsRepository()
+ val isFaceAuthCurrentlyAllowed by collectLastValue(underTest.isFaceAuthCurrentlyAllowed)
+
+ faceAuthIsEnrolled()
+ deviceIsInPostureThatSupportsFaceAuth()
+ doNotDisableKeyguardAuthFeatures()
+ faceAuthIsStrongBiometric()
+ faceAuthIsEnabledByBiometricManager()
+
+ onStrongAuthChanged(STRONG_AUTH_NOT_REQUIRED, PRIMARY_USER_ID)
+ onNonStrongAuthChanged(false, PRIMARY_USER_ID)
+
+ assertThat(isFaceAuthCurrentlyAllowed).isTrue()
+
+ onStrongAuthChanged(STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN, PRIMARY_USER_ID)
+ onNonStrongAuthChanged(true, PRIMARY_USER_ID)
+
+ assertThat(isFaceAuthCurrentlyAllowed).isFalse()
+ }
+
+ @Test
+ fun faceAuthCurrentlyAllowed_dependsOnNonStrongAuthBiometricSetting_ifFaceIsNotStrong() =
+ testScope.runTest {
+ createBiometricSettingsRepository()
+ val isFaceAuthCurrentlyAllowed by collectLastValue(underTest.isFaceAuthCurrentlyAllowed)
+
+ faceAuthIsEnrolled()
+ deviceIsInPostureThatSupportsFaceAuth()
+ doNotDisableKeyguardAuthFeatures()
+ faceAuthIsNonStrongBiometric()
+ faceAuthIsEnabledByBiometricManager()
+
+ onStrongAuthChanged(STRONG_AUTH_NOT_REQUIRED, PRIMARY_USER_ID)
+ onNonStrongAuthChanged(false, PRIMARY_USER_ID)
+
+ assertThat(isFaceAuthCurrentlyAllowed).isFalse()
+
+ onStrongAuthChanged(STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN, PRIMARY_USER_ID)
+ onNonStrongAuthChanged(true, PRIMARY_USER_ID)
+
+ assertThat(isFaceAuthCurrentlyAllowed).isFalse()
+
+ onStrongAuthChanged(STRONG_AUTH_NOT_REQUIRED, PRIMARY_USER_ID)
+ onNonStrongAuthChanged(true, PRIMARY_USER_ID)
+
+ assertThat(isFaceAuthCurrentlyAllowed).isTrue()
+ }
+
+ @Test
+ fun fpAuthCurrentlyAllowed_dependsOnNonStrongAuthBiometricSetting_ifFpIsNotStrong() =
+ testScope.runTest {
+ createBiometricSettingsRepository()
+ val isFingerprintCurrentlyAllowed by
+ collectLastValue(underTest.isFingerprintAuthCurrentlyAllowed)
+
+ fingerprintIsEnrolled(PRIMARY_USER_ID)
+ enrollmentChange(UNDER_DISPLAY_FINGERPRINT, PRIMARY_USER_ID, true)
+ doNotDisableKeyguardAuthFeatures(PRIMARY_USER_ID)
+ runCurrent()
+
+ fingerprintPropertyRepository.setProperties(
+ 1,
+ SensorStrength.STRONG,
+ FingerprintSensorType.UDFPS_OPTICAL,
+ emptyMap()
+ )
+ // Non strong auth is not allowed now, FP is marked strong
+ onStrongAuthChanged(STRONG_AUTH_NOT_REQUIRED, PRIMARY_USER_ID)
+ onNonStrongAuthChanged(false, PRIMARY_USER_ID)
+
+ assertThat(isFingerprintCurrentlyAllowed).isTrue()
+
+ fingerprintPropertyRepository.setProperties(
+ 1,
+ SensorStrength.CONVENIENCE,
+ FingerprintSensorType.UDFPS_OPTICAL,
+ emptyMap()
+ )
+ assertThat(isFingerprintCurrentlyAllowed).isFalse()
+
+ fingerprintPropertyRepository.setProperties(
+ 1,
+ SensorStrength.WEAK,
+ FingerprintSensorType.UDFPS_OPTICAL,
+ emptyMap()
+ )
+ assertThat(isFingerprintCurrentlyAllowed).isFalse()
+ }
+
+ @Test
+ fun fpAuthCurrentlyAllowed_dependsOnStrongAuthBiometricSetting_ifFpIsStrong() =
+ testScope.runTest {
+ createBiometricSettingsRepository()
+ val isFingerprintCurrentlyAllowed by
+ collectLastValue(underTest.isFingerprintAuthCurrentlyAllowed)
+
+ fingerprintIsEnrolled(PRIMARY_USER_ID)
+ enrollmentChange(UNDER_DISPLAY_FINGERPRINT, PRIMARY_USER_ID, true)
+ doNotDisableKeyguardAuthFeatures(PRIMARY_USER_ID)
+ runCurrent()
+
+ fingerprintPropertyRepository.setProperties(
+ 1,
+ SensorStrength.STRONG,
+ FingerprintSensorType.UDFPS_OPTICAL,
+ emptyMap()
+ )
+ // Non strong auth is not allowed now, FP is marked strong
+ onStrongAuthChanged(STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN, PRIMARY_USER_ID)
+ onNonStrongAuthChanged(true, PRIMARY_USER_ID)
+
+ assertThat(isFingerprintCurrentlyAllowed).isFalse()
+
+ onStrongAuthChanged(STRONG_AUTH_NOT_REQUIRED, PRIMARY_USER_ID)
+ onNonStrongAuthChanged(false, PRIMARY_USER_ID)
+
+ assertThat(isFingerprintCurrentlyAllowed).isTrue()
+ }
+
private fun enrollmentChange(biometricType: BiometricType, userId: Int, enabled: Boolean) {
authControllerCallback.value.onEnrollmentsChanged(biometricType, userId, enabled)
}
+ private fun doNotDisableKeyguardAuthFeatures(userId: Int = PRIMARY_USER_ID) {
+ whenever(devicePolicyManager.getKeyguardDisabledFeatures(isNull(), eq(userId)))
+ .thenReturn(0)
+ broadcastDPMStateChange()
+ }
+
private fun broadcastDPMStateChange() {
fakeBroadcastDispatcher.sendIntentToMatchingReceiversOnly(
context,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepositoryTest.kt
index fe5b812..64b9470 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/DeviceEntryFaceAuthRepositoryTest.kt
@@ -40,9 +40,7 @@
import com.android.systemui.R
import com.android.systemui.RoboPilotTest
import com.android.systemui.SysuiTestCase
-import com.android.systemui.biometrics.data.repository.FaceSensorInfo
import com.android.systemui.biometrics.data.repository.FakeFacePropertyRepository
-import com.android.systemui.biometrics.shared.model.SensorStrength
import com.android.systemui.bouncer.data.repository.FakeKeyguardBouncerRepository
import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor
import com.android.systemui.coroutines.FlowValue
@@ -255,7 +253,6 @@
faceAuthBuffer,
keyguardTransitionInteractor,
featureFlags,
- fakeFacePropertyRepository,
dumpManager,
)
}
@@ -525,15 +522,11 @@
}
@Test
- fun authenticateDoesNotRunIfFaceIsNotEnrolled() =
+ fun authenticateDoesNotRunIfFaceIsNotUsuallyAllowed() =
testScope.runTest {
- testGatingCheckForFaceAuth { biometricSettingsRepository.setFaceEnrolled(false) }
- }
-
- @Test
- fun authenticateDoesNotRunIfFaceIsNotEnabled() =
- testScope.runTest {
- testGatingCheckForFaceAuth { biometricSettingsRepository.setIsFaceAuthEnabled(false) }
+ testGatingCheckForFaceAuth {
+ biometricSettingsRepository.setIsFaceAuthEnrolledAndEnabled(false)
+ }
}
@Test
@@ -589,21 +582,10 @@
}
@Test
- fun authenticateDoesNotRunWhenNonStrongBiometricIsNotAllowed() =
+ fun authenticateDoesNotRunWhenFaceAuthIsNotCurrentlyAllowedToRun() =
testScope.runTest {
testGatingCheckForFaceAuth {
- biometricSettingsRepository.setIsNonStrongBiometricAllowed(false)
- }
- }
-
- @Test
- fun authenticateDoesNotRunWhenStrongBiometricIsNotAllowedAndFaceSensorIsStrong() =
- testScope.runTest {
- fakeFacePropertyRepository.setSensorInfo(FaceSensorInfo(1, SensorStrength.STRONG))
- runCurrent()
-
- testGatingCheckForFaceAuth(isFaceStrong = true) {
- biometricSettingsRepository.setIsStrongBiometricAllowed(false)
+ biometricSettingsRepository.setIsFaceAuthCurrentlyAllowed(false)
}
}
@@ -662,7 +644,7 @@
allPreconditionsToRunFaceAuthAreTrue()
// Flip one precondition to false.
- biometricSettingsRepository.setIsNonStrongBiometricAllowed(false)
+ biometricSettingsRepository.setIsFaceAuthCurrentlyAllowed(false)
assertThat(canFaceAuthRun()).isFalse()
underTest.authenticate(
FACE_AUTH_TRIGGERED_SWIPE_UP_ON_BOUNCER,
@@ -827,15 +809,11 @@
}
@Test
- fun detectDoesNotRunWhenFaceIsNotEnrolled() =
+ fun detectDoesNotRunWhenFaceIsNotUsuallyAllowed() =
testScope.runTest {
- testGatingCheckForDetect { biometricSettingsRepository.setFaceEnrolled(false) }
- }
-
- @Test
- fun detectDoesNotRunWhenFaceIsNotEnabled() =
- testScope.runTest {
- testGatingCheckForDetect { biometricSettingsRepository.setIsFaceAuthEnabled(false) }
+ testGatingCheckForDetect {
+ biometricSettingsRepository.setIsFaceAuthEnrolledAndEnabled(false)
+ }
}
@Test
@@ -932,23 +910,10 @@
}
@Test
- fun detectDoesNotRunWhenNonStrongBiometricIsAllowed() =
+ fun detectDoesNotRunWhenFaceAuthIsCurrentlyAllowedToRun() =
testScope.runTest {
testGatingCheckForDetect {
- biometricSettingsRepository.setIsNonStrongBiometricAllowed(true)
- }
- }
-
- @Test
- fun detectDoesNotRunWhenStrongBiometricIsAllowedAndFaceAuthSensorStrengthIsStrong() =
- testScope.runTest {
- fakeFacePropertyRepository.setSensorInfo(FaceSensorInfo(1, SensorStrength.STRONG))
- runCurrent()
-
- testGatingCheckForDetect(isFaceStrong = true) {
- biometricSettingsRepository.setIsStrongBiometricAllowed(true)
- // this shouldn't matter as face is set as a strong sensor
- biometricSettingsRepository.setIsNonStrongBiometricAllowed(false)
+ biometricSettingsRepository.setIsFaceAuthCurrentlyAllowed(true)
}
}
@@ -1043,12 +1008,9 @@
faceAuthenticateIsCalled()
}
- private suspend fun TestScope.testGatingCheckForFaceAuth(
- isFaceStrong: Boolean = false,
- gatingCheckModifier: () -> Unit
- ) {
+ private suspend fun TestScope.testGatingCheckForFaceAuth(gatingCheckModifier: () -> Unit) {
initCollectors()
- allPreconditionsToRunFaceAuthAreTrue(isFaceStrong)
+ allPreconditionsToRunFaceAuthAreTrue()
gatingCheckModifier()
runCurrent()
@@ -1057,7 +1019,7 @@
assertThat(underTest.canRunFaceAuth.value).isFalse()
// flip the gating check back on.
- allPreconditionsToRunFaceAuthAreTrue(isFaceStrong)
+ allPreconditionsToRunFaceAuthAreTrue()
triggerFaceAuth(false)
@@ -1076,19 +1038,12 @@
faceAuthenticateIsNotCalled()
}
- private suspend fun TestScope.testGatingCheckForDetect(
- isFaceStrong: Boolean = false,
- gatingCheckModifier: () -> Unit
- ) {
+ private suspend fun TestScope.testGatingCheckForDetect(gatingCheckModifier: () -> Unit) {
initCollectors()
allPreconditionsToRunFaceAuthAreTrue()
- if (isFaceStrong) {
- biometricSettingsRepository.setStrongBiometricAllowed(false)
- } else {
- // This will stop face auth from running but is required to be false for detect.
- biometricSettingsRepository.setIsNonStrongBiometricAllowed(false)
- }
+ // This will stop face auth from running but is required to be false for detect.
+ biometricSettingsRepository.setIsFaceAuthCurrentlyAllowed(false)
runCurrent()
assertThat(canFaceAuthRun()).isFalse()
@@ -1123,13 +1078,9 @@
cancellationSignal.value.setOnCancelListener { wasAuthCancelled = true }
}
- private suspend fun TestScope.allPreconditionsToRunFaceAuthAreTrue(
- isFaceStrong: Boolean = false
- ) {
+ private suspend fun TestScope.allPreconditionsToRunFaceAuthAreTrue() {
verify(faceManager, atLeastOnce())
.addLockoutResetCallback(faceLockoutResetCallback.capture())
- biometricSettingsRepository.setFaceEnrolled(true)
- biometricSettingsRepository.setIsFaceAuthEnabled(true)
underTest.resumeFaceAuth()
trustRepository.setCurrentUserTrusted(false)
keyguardRepository.setKeyguardGoingAway(false)
@@ -1140,14 +1091,11 @@
WakeSleepReason.OTHER
)
)
- if (isFaceStrong) {
- biometricSettingsRepository.setStrongBiometricAllowed(true)
- } else {
- biometricSettingsRepository.setIsNonStrongBiometricAllowed(true)
- }
+ biometricSettingsRepository.setIsFaceAuthEnrolledAndEnabled(true)
+ biometricSettingsRepository.setIsFaceAuthSupportedInCurrentPosture(true)
+ biometricSettingsRepository.setIsFaceAuthCurrentlyAllowed(true)
biometricSettingsRepository.setIsUserInLockdown(false)
fakeUserRepository.setSelectedUserInfo(primaryUser)
- biometricSettingsRepository.setIsFaceAuthSupportedInCurrentPosture(true)
faceLockoutResetCallback.value.onLockoutReset(0)
bouncerRepository.setAlternateVisible(true)
keyguardRepository.setKeyguardShowing(true)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/LightRevealScrimRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/LightRevealScrimRepositoryTest.kt
index dcaafe8..6fcf54c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/LightRevealScrimRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/LightRevealScrimRepositoryTest.kt
@@ -17,8 +17,8 @@
package com.android.systemui.keyguard.data.repository
import android.graphics.Point
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.RoboPilotTest
import com.android.systemui.SysuiTestCase
@@ -47,7 +47,7 @@
@SmallTest
@RoboPilotTest
@OptIn(ExperimentalCoroutinesApi::class)
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class LightRevealScrimRepositoryTest : SysuiTestCase() {
private lateinit var fakeKeyguardRepository: FakeKeyguardRepository
private lateinit var underTest: LightRevealScrimRepositoryImpl
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardKeyEventInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardKeyEventInteractorTest.kt
new file mode 100644
index 0000000..e0ae0c3
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardKeyEventInteractorTest.kt
@@ -0,0 +1,297 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.keyguard.domain.interactor
+
+import android.media.AudioManager
+import android.media.session.MediaSessionLegacyHelper
+import android.view.KeyEvent
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.back.domain.interactor.BackActionInteractor
+import com.android.systemui.keyguard.shared.model.WakeSleepReason
+import com.android.systemui.keyguard.shared.model.WakefulnessModel
+import com.android.systemui.keyguard.shared.model.WakefulnessState
+import com.android.systemui.media.controls.util.MediaSessionLegacyHelperWrapper
+import com.android.systemui.plugins.statusbar.StatusBarStateController
+import com.android.systemui.shade.ShadeController
+import com.android.systemui.statusbar.StatusBarState
+import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager
+import com.android.systemui.util.mockito.any
+import com.android.systemui.util.mockito.whenever
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentMatchers.eq
+import org.mockito.Mock
+import org.mockito.Mockito.clearInvocations
+import org.mockito.Mockito.never
+import org.mockito.Mockito.verify
+import org.mockito.junit.MockitoJUnit
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class KeyguardKeyEventInteractorTest : SysuiTestCase() {
+ @JvmField @Rule var mockitoRule = MockitoJUnit.rule()
+
+ private val actionDownVolumeDownKeyEvent =
+ KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_VOLUME_DOWN)
+ private val actionDownVolumeUpKeyEvent =
+ KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_VOLUME_UP)
+ private val backKeyEvent = KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK)
+ private val awakeWakefulnessMode =
+ WakefulnessModel(WakefulnessState.AWAKE, WakeSleepReason.OTHER, WakeSleepReason.OTHER)
+ private val asleepWakefulnessMode =
+ WakefulnessModel(WakefulnessState.ASLEEP, WakeSleepReason.OTHER, WakeSleepReason.OTHER)
+
+ private lateinit var keyguardInteractorWithDependencies:
+ KeyguardInteractorFactory.WithDependencies
+ @Mock private lateinit var statusBarStateController: StatusBarStateController
+ @Mock private lateinit var statusBarKeyguardViewManager: StatusBarKeyguardViewManager
+ @Mock private lateinit var shadeController: ShadeController
+ @Mock private lateinit var mediaSessionLegacyHelperWrapper: MediaSessionLegacyHelperWrapper
+ @Mock private lateinit var mediaSessionLegacyHelper: MediaSessionLegacyHelper
+ @Mock private lateinit var backActionInteractor: BackActionInteractor
+
+ private lateinit var underTest: KeyguardKeyEventInteractor
+
+ @Before
+ fun setup() {
+ whenever(mediaSessionLegacyHelperWrapper.getHelper(any()))
+ .thenReturn(mediaSessionLegacyHelper)
+ keyguardInteractorWithDependencies = KeyguardInteractorFactory.create()
+ underTest =
+ KeyguardKeyEventInteractor(
+ context,
+ statusBarStateController,
+ keyguardInteractorWithDependencies.keyguardInteractor,
+ statusBarKeyguardViewManager,
+ shadeController,
+ mediaSessionLegacyHelperWrapper,
+ backActionInteractor,
+ )
+ }
+
+ @Test
+ fun dispatchKeyEvent_volumeKey_dozing_handlesEvents() {
+ whenever(statusBarStateController.isDozing).thenReturn(true)
+
+ assertThat(underTest.dispatchKeyEvent(actionDownVolumeDownKeyEvent)).isTrue()
+ verify(mediaSessionLegacyHelper)
+ .sendVolumeKeyEvent(
+ eq(actionDownVolumeDownKeyEvent),
+ eq(AudioManager.USE_DEFAULT_STREAM_TYPE),
+ eq(true)
+ )
+
+ assertThat(underTest.dispatchKeyEvent(actionDownVolumeUpKeyEvent)).isTrue()
+ verify(mediaSessionLegacyHelper)
+ .sendVolumeKeyEvent(
+ eq(actionDownVolumeUpKeyEvent),
+ eq(AudioManager.USE_DEFAULT_STREAM_TYPE),
+ eq(true)
+ )
+ }
+
+ @Test
+ fun dispatchKeyEvent_volumeKey_notDozing_doesNotHandleEvents() {
+ whenever(statusBarStateController.isDozing).thenReturn(false)
+
+ assertThat(underTest.dispatchKeyEvent(actionDownVolumeDownKeyEvent)).isFalse()
+ verify(mediaSessionLegacyHelper, never())
+ .sendVolumeKeyEvent(
+ eq(actionDownVolumeDownKeyEvent),
+ eq(AudioManager.USE_DEFAULT_STREAM_TYPE),
+ eq(true)
+ )
+
+ assertThat(underTest.dispatchKeyEvent(actionDownVolumeUpKeyEvent)).isFalse()
+ verify(mediaSessionLegacyHelper, never())
+ .sendVolumeKeyEvent(
+ eq(actionDownVolumeUpKeyEvent),
+ eq(AudioManager.USE_DEFAULT_STREAM_TYPE),
+ eq(true)
+ )
+ }
+
+ @Test
+ fun dispatchKeyEvent_menuActionUp_interactiveKeyguard_showsPrimaryBouncer() {
+ keyguardInteractorWithDependencies.repository.setWakefulnessModel(awakeWakefulnessMode)
+ whenever(statusBarStateController.state).thenReturn(StatusBarState.KEYGUARD)
+ whenever(statusBarKeyguardViewManager.shouldDismissOnMenuPressed()).thenReturn(true)
+
+ verifyActionUpShowsPrimaryBouncer(KeyEvent.KEYCODE_MENU)
+ }
+
+ @Test
+ fun dispatchKeyEvent_menuActionUp_interactiveShadeLocked_collapsesShade() {
+ keyguardInteractorWithDependencies.repository.setWakefulnessModel(awakeWakefulnessMode)
+ whenever(statusBarStateController.state).thenReturn(StatusBarState.SHADE_LOCKED)
+ whenever(statusBarKeyguardViewManager.shouldDismissOnMenuPressed()).thenReturn(true)
+
+ verifyActionUpCollapsesTheShade(KeyEvent.KEYCODE_MENU)
+ }
+
+ @Test
+ fun dispatchKeyEvent_menuActionUp_nonInteractiveKeyguard_doNothing() {
+ keyguardInteractorWithDependencies.repository.setWakefulnessModel(asleepWakefulnessMode)
+ whenever(statusBarStateController.state).thenReturn(StatusBarState.KEYGUARD)
+ whenever(statusBarKeyguardViewManager.shouldDismissOnMenuPressed()).thenReturn(true)
+
+ verifyActionsDoNothing(KeyEvent.KEYCODE_MENU)
+ }
+
+ @Test
+ fun dispatchKeyEvent_spaceActionUp_interactiveKeyguard_showsPrimaryBouncer() {
+ keyguardInteractorWithDependencies.repository.setWakefulnessModel(awakeWakefulnessMode)
+ whenever(statusBarStateController.state).thenReturn(StatusBarState.KEYGUARD)
+
+ verifyActionUpShowsPrimaryBouncer(KeyEvent.KEYCODE_SPACE)
+ }
+
+ @Test
+ fun dispatchKeyEvent_spaceActionUp_shadeLocked_collapsesShade() {
+ keyguardInteractorWithDependencies.repository.setWakefulnessModel(awakeWakefulnessMode)
+ whenever(statusBarStateController.state).thenReturn(StatusBarState.SHADE_LOCKED)
+
+ verifyActionUpCollapsesTheShade(KeyEvent.KEYCODE_SPACE)
+ }
+
+ @Test
+ fun dispatchKeyEvent_enterActionUp_interactiveKeyguard_showsPrimaryBouncer() {
+ keyguardInteractorWithDependencies.repository.setWakefulnessModel(awakeWakefulnessMode)
+ whenever(statusBarStateController.state).thenReturn(StatusBarState.KEYGUARD)
+
+ verifyActionUpShowsPrimaryBouncer(KeyEvent.KEYCODE_ENTER)
+ }
+
+ @Test
+ fun dispatchKeyEvent_enterActionUp_shadeLocked_collapsesShade() {
+ keyguardInteractorWithDependencies.repository.setWakefulnessModel(awakeWakefulnessMode)
+ whenever(statusBarStateController.state).thenReturn(StatusBarState.SHADE_LOCKED)
+
+ verifyActionUpCollapsesTheShade(KeyEvent.KEYCODE_ENTER)
+ }
+
+ @Test
+ fun dispatchKeyEventPreIme_back_keyguard_onBackRequested() {
+ whenever(statusBarStateController.state).thenReturn(StatusBarState.KEYGUARD)
+ whenever(statusBarKeyguardViewManager.dispatchBackKeyEventPreIme()).thenReturn(true)
+
+ whenever(backActionInteractor.onBackRequested()).thenReturn(false)
+ assertThat(underTest.dispatchKeyEventPreIme(backKeyEvent)).isFalse()
+ verify(backActionInteractor).onBackRequested()
+ clearInvocations(backActionInteractor)
+
+ whenever(backActionInteractor.onBackRequested()).thenReturn(true)
+ assertThat(underTest.dispatchKeyEventPreIme(backKeyEvent)).isTrue()
+ verify(backActionInteractor).onBackRequested()
+ }
+
+ @Test
+ fun dispatchKeyEventPreIme_back_keyguard_SBKVMdoesNotHandle_neverOnBackRequested() {
+ whenever(statusBarStateController.state).thenReturn(StatusBarState.KEYGUARD)
+ whenever(statusBarKeyguardViewManager.dispatchBackKeyEventPreIme()).thenReturn(false)
+ whenever(backActionInteractor.onBackRequested()).thenReturn(true)
+
+ assertThat(underTest.dispatchKeyEventPreIme(backKeyEvent)).isFalse()
+ verify(backActionInteractor, never()).onBackRequested()
+ }
+
+ @Test
+ fun dispatchKeyEventPreIme_back_shade_neverOnBackRequested() {
+ whenever(statusBarStateController.state).thenReturn(StatusBarState.SHADE)
+ whenever(statusBarKeyguardViewManager.dispatchBackKeyEventPreIme()).thenReturn(true)
+ whenever(backActionInteractor.onBackRequested()).thenReturn(true)
+
+ assertThat(underTest.dispatchKeyEventPreIme(backKeyEvent)).isFalse()
+ verify(backActionInteractor, never()).onBackRequested()
+ }
+
+ @Test
+ fun interceptMediaKey_keyguard_SBKVMdoesNotHandle_doesNotHandleMediaKey() {
+ val keyEvent = KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_VOLUME_UP)
+ whenever(statusBarStateController.state).thenReturn(StatusBarState.KEYGUARD)
+ whenever(statusBarKeyguardViewManager.interceptMediaKey(eq(keyEvent))).thenReturn(false)
+
+ assertThat(underTest.interceptMediaKey(keyEvent)).isFalse()
+ verify(statusBarKeyguardViewManager).interceptMediaKey(eq(keyEvent))
+ }
+
+ @Test
+ fun interceptMediaKey_keyguard_handleMediaKey() {
+ val keyEvent = KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_VOLUME_UP)
+ whenever(statusBarStateController.state).thenReturn(StatusBarState.KEYGUARD)
+ whenever(statusBarKeyguardViewManager.interceptMediaKey(eq(keyEvent))).thenReturn(true)
+
+ assertThat(underTest.interceptMediaKey(keyEvent)).isTrue()
+ verify(statusBarKeyguardViewManager).interceptMediaKey(eq(keyEvent))
+ }
+
+ @Test
+ fun interceptMediaKey_shade_doesNotHandleMediaKey() {
+ whenever(statusBarStateController.state).thenReturn(StatusBarState.SHADE)
+
+ assertThat(
+ underTest.interceptMediaKey(
+ KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_VOLUME_UP)
+ )
+ )
+ .isFalse()
+ verify(statusBarKeyguardViewManager, never()).interceptMediaKey(any())
+ }
+
+ private fun verifyActionUpCollapsesTheShade(keycode: Int) {
+ // action down: does NOT collapse the shade
+ val actionDownMenuKeyEvent = KeyEvent(KeyEvent.ACTION_DOWN, keycode)
+ assertThat(underTest.dispatchKeyEvent(actionDownMenuKeyEvent)).isFalse()
+ verify(shadeController, never()).animateCollapseShadeForced()
+
+ // action up: collapses the shade
+ val actionUpMenuKeyEvent = KeyEvent(KeyEvent.ACTION_UP, keycode)
+ assertThat(underTest.dispatchKeyEvent(actionUpMenuKeyEvent)).isTrue()
+ verify(shadeController).animateCollapseShadeForced()
+ }
+
+ private fun verifyActionUpShowsPrimaryBouncer(keycode: Int) {
+ // action down: does NOT collapse the shade
+ val actionDownMenuKeyEvent = KeyEvent(KeyEvent.ACTION_DOWN, keycode)
+ assertThat(underTest.dispatchKeyEvent(actionDownMenuKeyEvent)).isFalse()
+ verify(statusBarKeyguardViewManager, never()).showPrimaryBouncer(any())
+
+ // action up: collapses the shade
+ val actionUpMenuKeyEvent = KeyEvent(KeyEvent.ACTION_UP, keycode)
+ assertThat(underTest.dispatchKeyEvent(actionUpMenuKeyEvent)).isTrue()
+ verify(statusBarKeyguardViewManager).showPrimaryBouncer(eq(true))
+ }
+
+ private fun verifyActionsDoNothing(keycode: Int) {
+ // action down: does nothing
+ val actionDownMenuKeyEvent = KeyEvent(KeyEvent.ACTION_DOWN, keycode)
+ assertThat(underTest.dispatchKeyEvent(actionDownMenuKeyEvent)).isFalse()
+ verify(shadeController, never()).animateCollapseShadeForced()
+ verify(statusBarKeyguardViewManager, never()).showPrimaryBouncer(any())
+
+ // action up: doesNothing
+ val actionUpMenuKeyEvent = KeyEvent(KeyEvent.ACTION_UP, keycode)
+ assertThat(underTest.dispatchKeyEvent(actionUpMenuKeyEvent)).isFalse()
+ verify(shadeController, never()).animateCollapseShadeForced()
+ verify(statusBarKeyguardViewManager, never()).showPrimaryBouncer(any())
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt
index 4b221a0..ca93246 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt
@@ -16,6 +16,7 @@
package com.android.systemui.keyguard.domain.interactor
+import android.app.StatusBarManager
import androidx.test.filters.SmallTest
import com.android.keyguard.KeyguardSecurityModel
import com.android.keyguard.KeyguardSecurityModel.SecurityMode.PIN
@@ -24,6 +25,7 @@
import com.android.systemui.bouncer.data.repository.FakeKeyguardBouncerRepository
import com.android.systemui.flags.FakeFeatureFlags
import com.android.systemui.flags.Flags
+import com.android.systemui.keyguard.data.repository.FakeCommandQueue
import com.android.systemui.keyguard.data.repository.FakeKeyguardRepository
import com.android.systemui.keyguard.data.repository.FakeKeyguardTransitionRepository
import com.android.systemui.keyguard.shared.model.BiometricUnlockModel
@@ -71,6 +73,7 @@
private lateinit var keyguardRepository: FakeKeyguardRepository
private lateinit var bouncerRepository: FakeKeyguardBouncerRepository
+ private lateinit var commandQueue: FakeCommandQueue
private lateinit var shadeRepository: ShadeRepository
private lateinit var transitionRepository: FakeKeyguardTransitionRepository
private lateinit var transitionInteractor: KeyguardTransitionInteractor
@@ -99,6 +102,7 @@
keyguardRepository = FakeKeyguardRepository()
bouncerRepository = FakeKeyguardBouncerRepository()
+ commandQueue = FakeCommandQueue()
shadeRepository = FakeShadeRepository()
transitionRepository = spy(FakeKeyguardTransitionRepository())
@@ -1152,6 +1156,39 @@
coroutineContext.cancelChildren()
}
+ @Test
+ fun lockscreenToOccluded_fromCameraGesture() =
+ testScope.runTest {
+ // GIVEN a prior transition has run to LOCKSCREEN
+ runTransition(KeyguardState.AOD, KeyguardState.LOCKSCREEN)
+ runCurrent()
+
+ // WHEN the device begins to sleep (first power button press)...
+ keyguardRepository.setWakefulnessModel(startingToSleep())
+ runCurrent()
+ reset(transitionRepository)
+
+ // ...AND WHEN the camera gesture is detected quickly afterwards
+ commandQueue.doForEachCallback {
+ it.onCameraLaunchGestureDetected(
+ StatusBarManager.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP
+ )
+ }
+ runCurrent()
+
+ // THEN a transition from LOCKSCREEN => OCCLUDED should occur
+ val info =
+ withArgCaptor<TransitionInfo> {
+ verify(transitionRepository).startTransition(capture(), anyBoolean())
+ }
+ assertThat(info.ownerName).isEqualTo("FromLockscreenTransitionInteractor")
+ assertThat(info.from).isEqualTo(KeyguardState.LOCKSCREEN)
+ assertThat(info.to).isEqualTo(KeyguardState.OCCLUDED)
+ assertThat(info.animator).isNotNull()
+
+ coroutineContext.cancelChildren()
+ }
+
private fun startingToWake() =
WakefulnessModel(
WakefulnessState.STARTING_TO_WAKE,
@@ -1170,6 +1207,7 @@
return KeyguardInteractorFactory.create(
featureFlags = featureFlags,
repository = keyguardRepository,
+ commandQueue = commandQueue,
bouncerRepository = bouncerRepository,
)
.keyguardInteractor
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModelTest.kt
index ef38d54..3576ec9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModelTest.kt
@@ -281,11 +281,7 @@
underTest.onPreviewSlotSelected(
KeyguardQuickAffordanceSlots.SLOT_ID_BOTTOM_START
)
- keyguardInteractor.previewMode.value =
- KeyguardInteractor.PreviewMode(
- isInPreviewMode = true,
- shouldHighlightSelectedAffordance = true,
- )
+ underTest.enablePreviewMode(KeyguardQuickAffordanceSlots.SLOT_ID_BOTTOM_START, true)
repository.setKeyguardShowing(false)
val latest = collectLastValue(underTest.startButton)
@@ -330,11 +326,7 @@
underTest.onPreviewSlotSelected(
KeyguardQuickAffordanceSlots.SLOT_ID_BOTTOM_START
)
- keyguardInteractor.previewMode.value =
- KeyguardInteractor.PreviewMode(
- isInPreviewMode = true,
- shouldHighlightSelectedAffordance = true,
- )
+ underTest.enablePreviewMode(KeyguardQuickAffordanceSlots.SLOT_ID_BOTTOM_START, true)
repository.setKeyguardShowing(false)
val endButton = collectLastValue(underTest.endButton)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModelTest.kt
index 05e933b..a14a1c5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModelTest.kt
@@ -45,7 +45,6 @@
private lateinit var testScope: TestScope
private lateinit var repository: FakeKeyguardRepository
private lateinit var keyguardInteractor: KeyguardInteractor
- @Mock private lateinit var keyguardQuickAffordancesCombinedViewModel: KeyguardQuickAffordancesCombinedViewModel
@Before
fun setUp() {
@@ -63,10 +62,7 @@
keyguardInteractor = withDeps.keyguardInteractor
repository = withDeps.repository
- underTest = KeyguardRootViewModel(
- keyguardInteractor,
- keyguardQuickAffordancesCombinedViewModel,
- )
+ underTest = KeyguardRootViewModel(keyguardInteractor)
}
@Test
@@ -89,10 +85,7 @@
fun alpha_inPreviewMode_doesNotChange() =
testScope.runTest {
val value = collectLastValue(underTest.alpha)
- underTest.enablePreviewMode(
- initiallySelectedSlotId = null,
- shouldHighlightSelectedAffordance = false,
- )
+ underTest.enablePreviewMode()
Truth.assertThat(value()).isEqualTo(1f)
repository.setKeyguardAlpha(0.1f)
@@ -104,4 +97,4 @@
repository.setKeyguardAlpha(0f)
Truth.assertThat(value()).isEqualTo(1f)
}
-}
\ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSTileHostTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSTileHostTest.java
index 9781baa..64d3b82 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSTileHostTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSTileHostTest.java
@@ -53,7 +53,6 @@
import com.android.systemui.classifier.FalsingManagerFake;
import com.android.systemui.dump.nano.SystemUIProtoDump;
import com.android.systemui.flags.FakeFeatureFlags;
-import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.plugins.PluginManager;
@@ -65,6 +64,7 @@
import com.android.systemui.qs.external.TileLifecycleManager;
import com.android.systemui.qs.external.TileServiceKey;
import com.android.systemui.qs.logging.QSLogger;
+import com.android.systemui.qs.pipeline.shared.QSPipelineFlagsRepository;
import com.android.systemui.qs.tileimpl.QSTileImpl;
import com.android.systemui.settings.UserFileManager;
import com.android.systemui.settings.UserTracker;
@@ -131,6 +131,8 @@
private FakeFeatureFlags mFeatureFlags;
+ private QSPipelineFlagsRepository mQSPipelineFlagsRepository;
+
private FakeExecutor mMainExecutor;
private QSTileHost mQSTileHost;
@@ -142,6 +144,7 @@
mFeatureFlags.set(Flags.QS_PIPELINE_NEW_HOST, false);
mFeatureFlags.set(Flags.QS_PIPELINE_AUTO_ADD, false);
+ mQSPipelineFlagsRepository = new QSPipelineFlagsRepository(mFeatureFlags);
mMainExecutor = new FakeExecutor(new FakeSystemClock());
@@ -164,7 +167,7 @@
mQSTileHost = new TestQSTileHost(mContext, mDefaultFactory, mMainExecutor,
mPluginManager, mTunerService, () -> mAutoTiles, mShadeController,
mQSLogger, mUserTracker, mSecureSettings, mCustomTileStatePersister,
- mTileLifecycleManagerFactory, mUserFileManager, mFeatureFlags);
+ mTileLifecycleManagerFactory, mUserFileManager, mQSPipelineFlagsRepository);
mMainExecutor.runAllReady();
mSecureSettings.registerContentObserverForUser(SETTING, new ContentObserver(null) {
@@ -708,7 +711,7 @@
UserTracker userTracker, SecureSettings secureSettings,
CustomTileStatePersister customTileStatePersister,
TileLifecycleManager.Factory tileLifecycleManagerFactory,
- UserFileManager userFileManager, FeatureFlags featureFlags) {
+ UserFileManager userFileManager, QSPipelineFlagsRepository featureFlags) {
super(context, defaultFactory, mainExecutor, pluginManager,
tunerService, autoTiles, shadeController, qsLogger,
userTracker, secureSettings, customTileStatePersister,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/external/CustomTileStatePersisterTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/external/CustomTileStatePersisterTest.kt
index 6c96576..a9f8ea0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/external/CustomTileStatePersisterTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/external/CustomTileStatePersisterTest.kt
@@ -36,8 +36,8 @@
import org.mockito.ArgumentMatchers.anyString
import org.mockito.Captor
import org.mockito.Mock
-import org.mockito.Mockito.`when`
import org.mockito.Mockito.verify
+import org.mockito.Mockito.`when`
import org.mockito.MockitoAnnotations
@SmallTest
@@ -54,6 +54,7 @@
private const val TEST_SUBTITLE = "test_subtitle"
private const val TEST_CONTENT_DESCRIPTION = "test_content_description"
private const val TEST_STATE_DESCRIPTION = "test_state_description"
+ private const val TEST_DEFAULT_LABEL = "default_label"
private fun Tile.isEqualTo(other: Tile): Boolean {
return state == other.state &&
@@ -156,4 +157,14 @@
verify(editor).remove(KEY.toString())
}
+
+ @Test
+ fun testWithDefaultLabel_notStored() {
+ tile.setDefaultLabel(TEST_DEFAULT_LABEL)
+
+ `when`(sharedPreferences.getString(eq(KEY.toString()), any()))
+ .thenReturn(writeToString(tile))
+
+ assertThat(customTileStatePersister.readState(KEY)!!.label).isNull()
+ }
}
\ No newline at end of file
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/external/CustomTileTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/external/CustomTileTest.kt
index 41240e5..244f627 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/external/CustomTileTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/external/CustomTileTest.kt
@@ -25,6 +25,7 @@
import android.graphics.drawable.Drawable
import android.graphics.drawable.Icon
import android.os.Handler
+import android.os.Parcel
import android.service.quicksettings.IQSTileService
import android.service.quicksettings.Tile
import android.test.suitebuilder.annotation.SmallTest
@@ -33,6 +34,7 @@
import android.view.IWindowManager
import android.view.View
import com.android.internal.logging.MetricsLogger
+import com.android.systemui.R
import com.android.systemui.SysuiTestCase
import com.android.systemui.animation.ActivityLaunchAnimator
import com.android.systemui.animation.view.LaunchableFrameLayout
@@ -47,6 +49,7 @@
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.eq
import com.android.systemui.util.mockito.nullable
+import com.google.common.truth.Truth.assertThat
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertThrows
@@ -395,4 +398,45 @@
verify(tileServiceManager, never()).setBindRequested(true)
verify(tileService, never()).onStartListening()
}
+
+ @Test
+ fun testAlwaysUseDefaultLabelIfNoLabelIsSet() {
+ // Give it an icon to prevent issues
+ serviceInfo.icon = R.drawable.android
+
+ val label1 = "Label 1"
+ val label2 = "Label 2"
+
+ `when`(serviceInfo.loadLabel(any())).thenReturn(label1)
+ customTile.handleSetListening(true)
+ testableLooper.processAllMessages()
+ customTile.handleSetListening(false)
+ testableLooper.processAllMessages()
+
+ assertThat(customTile.state.label).isEqualTo(label1)
+
+ // Retrieve the tile as if bound (a separate copy)
+ val tile = copyTileUsingParcel(customTile.qsTile)
+
+ // Change the language
+ `when`(serviceInfo.loadLabel(any())).thenReturn(label2)
+
+ // Set the tile to listening and apply the tile (unmodified)
+ customTile.handleSetListening(true)
+ testableLooper.processAllMessages()
+ customTile.updateTileState(tile)
+ customTile.refreshState()
+ testableLooper.processAllMessages()
+
+ assertThat(customTile.state.label).isEqualTo(label2)
+ }
+
+ private fun copyTileUsingParcel(t: Tile): Tile {
+ val parcel = Parcel.obtain()
+ parcel.setDataPosition(0)
+ t.writeToParcel(parcel, 0)
+ parcel.setDataPosition(0)
+
+ return Tile.CREATOR.createFromParcel(parcel)
+ }
}
\ No newline at end of file
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/pipeline/domain/interactor/CurrentTilesInteractorImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/pipeline/domain/interactor/CurrentTilesInteractorImplTest.kt
index 6689514..54a9360 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/pipeline/domain/interactor/CurrentTilesInteractorImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/pipeline/domain/interactor/CurrentTilesInteractorImplTest.kt
@@ -42,6 +42,7 @@
import com.android.systemui.qs.pipeline.data.repository.FakeTileSpecRepository
import com.android.systemui.qs.pipeline.data.repository.TileSpecRepository
import com.android.systemui.qs.pipeline.domain.model.TileModel
+import com.android.systemui.qs.pipeline.shared.QSPipelineFlagsRepository
import com.android.systemui.qs.pipeline.shared.TileSpec
import com.android.systemui.qs.pipeline.shared.logging.QSPipelineLogger
import com.android.systemui.qs.toProto
@@ -79,6 +80,7 @@
private val customTileAddedRepository: CustomTileAddedRepository =
FakeCustomTileAddedRepository()
private val featureFlags = FakeFeatureFlags()
+ private val pipelineFlags = QSPipelineFlagsRepository(featureFlags)
private val tileLifecycleManagerFactory = TLMFactory()
@Mock private lateinit var customTileStatePersister: CustomTileStatePersister
@@ -120,7 +122,7 @@
backgroundDispatcher = testDispatcher,
scope = testScope.backgroundScope,
logger = logger,
- featureFlags = featureFlags,
+ featureFlags = pipelineFlags,
)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/pipeline/shared/QSPipelineFlagsRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/pipeline/shared/QSPipelineFlagsRepositoryTest.kt
new file mode 100644
index 0000000..489221e
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/pipeline/shared/QSPipelineFlagsRepositoryTest.kt
@@ -0,0 +1,61 @@
+package com.android.systemui.qs.pipeline.shared
+
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.flags.FakeFeatureFlags
+import com.android.systemui.flags.Flags
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+import org.junit.runners.Parameterized.Parameter
+import org.junit.runners.Parameterized.Parameters
+
+@SmallTest
+@RunWith(Parameterized::class)
+class QSPipelineFlagsRepositoryTest : SysuiTestCase() {
+ companion object {
+ @Parameters(
+ name =
+ """
+WHEN: qs_pipeline_new_host = {0}, qs_pipeline_auto_add = {1}
+THEN: pipelineNewHost = {2}, pipelineAutoAdd = {3}
+ """
+ )
+ @JvmStatic
+ fun data(): List<Array<Boolean>> =
+ (0 until 4).map { combination ->
+ val qs_pipeline_new_host = combination and 0b10 != 0
+ val qs_pipeline_auto_add = combination and 0b01 != 0
+ arrayOf(
+ qs_pipeline_new_host,
+ qs_pipeline_auto_add,
+ /* pipelineNewHost = */ qs_pipeline_new_host,
+ /* pipelineAutoAdd = */ qs_pipeline_new_host && qs_pipeline_auto_add,
+ )
+ }
+ }
+
+ @JvmField @Parameter(0) var qsPipelineNewHostFlag: Boolean = false
+ @JvmField @Parameter(1) var qsPipelineAutoAddFlag: Boolean = false
+ @JvmField @Parameter(2) var pipelineNewHostExpected: Boolean = false
+ @JvmField @Parameter(3) var pipelineAutoAddExpected: Boolean = false
+
+ private val featureFlags = FakeFeatureFlags()
+ private val pipelineFlags = QSPipelineFlagsRepository(featureFlags)
+
+ @Before
+ fun setUp() {
+ featureFlags.apply {
+ set(Flags.QS_PIPELINE_NEW_HOST, qsPipelineNewHostFlag)
+ set(Flags.QS_PIPELINE_AUTO_ADD, qsPipelineAutoAddFlag)
+ }
+ }
+
+ @Test
+ fun flagLogic() {
+ assertThat(pipelineFlags.pipelineHostEnabled).isEqualTo(pipelineNewHostExpected)
+ assertThat(pipelineFlags.pipelineAutoAddEnabled).isEqualTo(pipelineAutoAddExpected)
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/FontScalingTileTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/FontScalingTileTest.kt
index cbc3553..d1d3c17 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/FontScalingTileTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/FontScalingTileTest.kt
@@ -26,8 +26,6 @@
import com.android.systemui.SysuiTestCase
import com.android.systemui.animation.DialogLaunchAnimator
import com.android.systemui.classifier.FalsingManagerFake
-import com.android.systemui.flags.FakeFeatureFlags
-import com.android.systemui.flags.Flags
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.qs.QSHost
@@ -74,8 +72,6 @@
private lateinit var backgroundDelayableExecutor: FakeExecutor
private lateinit var fontScalingTile: FontScalingTile
- val featureFlags = FakeFeatureFlags()
-
@Captor private lateinit var argumentCaptor: ArgumentCaptor<Runnable>
@Before
@@ -102,7 +98,6 @@
FakeSettings(),
FakeSettings(),
FakeSystemClock(),
- featureFlags,
userTracker,
backgroundDelayableExecutor,
)
@@ -117,18 +112,7 @@
}
@Test
- fun isAvailable_whenFlagIsFalse_returnsFalse() {
- featureFlags.set(Flags.ENABLE_FONT_SCALING_TILE, false)
-
- val isAvailable = fontScalingTile.isAvailable()
-
- assertThat(isAvailable).isFalse()
- }
-
- @Test
- fun isAvailable_whenFlagIsTrue_returnsTrue() {
- featureFlags.set(Flags.ENABLE_FONT_SCALING_TILE, true)
-
+ fun isAvailable_alwaysReturnsTrue() {
val isAvailable = fontScalingTile.isAvailable()
assertThat(isAvailable).isTrue()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogControllerTest.java
index 3e20511..6098809 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogControllerTest.java
@@ -60,6 +60,7 @@
import com.android.internal.logging.UiEventLogger;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.settingslib.wifi.WifiUtils;
+import com.android.settingslib.wifi.dpp.WifiDppIntentHelper;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.animation.DialogLaunchAnimator;
@@ -190,6 +191,7 @@
public void setUp() {
mStaticMockSession = mockitoSession()
.mockStatic(SubscriptionManager.class)
+ .mockStatic(WifiDppIntentHelper.class)
.strictness(Strictness.LENIENT)
.startMocking();
MockitoAnnotations.initMocks(this);
@@ -230,6 +232,7 @@
mInternetDialogController.mActivityStarter = mActivityStarter;
mInternetDialogController.mWifiIconInjector = mWifiIconInjector;
mFlags.set(Flags.QS_SECONDARY_DATA_SUB_INFO, false);
+ mFlags.set(Flags.SHARE_WIFI_QS_BUTTON, false);
mConfig = new Configuration(mContext.getResources().getConfiguration());
Configuration c2 = new Configuration(mConfig);
@@ -973,6 +976,29 @@
}
@Test
+ public void getConfiguratorQrCodeGeneratorIntentOrNull_wifiNotShareable_returnNull() {
+ mFlags.set(Flags.SHARE_WIFI_QS_BUTTON, true);
+ when(mConnectedEntry.canShare()).thenReturn(false);
+ assertThat(mInternetDialogController.getConfiguratorQrCodeGeneratorIntentOrNull(
+ mConnectedEntry)).isNull();
+ }
+ @Test
+ public void getConfiguratorQrCodeGeneratorIntentOrNull_flagOff_returnNull() {
+ mFlags.set(Flags.SHARE_WIFI_QS_BUTTON, false);
+ when(mConnectedEntry.canShare()).thenReturn(true);
+ assertThat(mInternetDialogController.getConfiguratorQrCodeGeneratorIntentOrNull(
+ mConnectedEntry)).isNull();
+ }
+
+ @Test
+ public void getConfiguratorQrCodeGeneratorIntentOrNull_wifiShareable() {
+ mFlags.set(Flags.SHARE_WIFI_QS_BUTTON, true);
+ when(mConnectedEntry.canShare()).thenReturn(true);
+ assertThat(mInternetDialogController.getConfiguratorQrCodeGeneratorIntentOrNull(
+ mConnectedEntry)).isNotNull();
+ }
+
+ @Test
public void onStop_cleanUp() {
doReturn(SUB_ID).when(mTelephonyManager).getSubscriptionId();
assertThat(mInternetDialogController.mSubIdTelephonyManagerMap.get(SUB_ID)).isEqualTo(
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogTest.java
index b59005a..2c74d4f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/dialog/InternetDialogTest.java
@@ -17,6 +17,7 @@
import android.app.AlertDialog;
import android.content.DialogInterface;
+import android.content.Intent;
import android.os.Handler;
import android.telephony.TelephonyManager;
import android.testing.AndroidTestingRunner;
@@ -718,6 +719,26 @@
assertThat(mInternetDialog.getWifiListMaxCount()).isEqualTo(MAX_WIFI_ENTRY_COUNT - 2);
}
+ @Test
+ public void updateDialog_shareWifiIntentNull_hideButton() {
+ when(mInternetDialogController.getConfiguratorQrCodeGeneratorIntentOrNull(any()))
+ .thenReturn(null);
+
+ mInternetDialog.updateDialog(false);
+
+ assertThat(mInternetDialog.mShareWifiButton.getVisibility()).isEqualTo(View.GONE);
+ }
+
+ @Test
+ public void updateDialog_shareWifiShareable_showButton() {
+ when(mInternetDialogController.getConfiguratorQrCodeGeneratorIntentOrNull(any()))
+ .thenReturn(new Intent());
+
+ mInternetDialog.updateDialog(false);
+
+ assertThat(mInternetDialog.mShareWifiButton.getVisibility()).isEqualTo(View.VISIBLE);
+ }
+
private void setNetworkVisible(boolean ethernetVisible, boolean mobileDataVisible,
boolean connectedWifiVisible) {
mEthernet.setVisibility(ethernetVisible ? View.VISIBLE : View.GONE);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/scene/domain/interactor/SceneInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/scene/domain/interactor/SceneInteractorTest.kt
index 16cc924..713c602 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/scene/domain/interactor/SceneInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/scene/domain/interactor/SceneInteractorTest.kt
@@ -147,16 +147,4 @@
underTest.setVisible(true, "reason")
assertThat(isVisible).isTrue()
}
-
- @Test
- fun remoteUserInput() =
- testScope.runTest {
- val remoteUserInput by collectLastValue(underTest.remoteUserInput)
- assertThat(remoteUserInput).isNull()
-
- for (input in SceneTestUtils.REMOTE_INPUT_DOWN_GESTURE) {
- underTest.onRemoteUserInput(input)
- assertThat(remoteUserInput).isEqualTo(input)
- }
- }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModelTest.kt
index da6c4269..88abb642 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/scene/ui/viewmodel/SceneContainerViewModelTest.kt
@@ -18,19 +18,14 @@
package com.android.systemui.scene.ui.viewmodel
-import android.view.MotionEvent
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.scene.SceneTestUtils
-import com.android.systemui.scene.shared.model.RemoteUserInput
-import com.android.systemui.scene.shared.model.RemoteUserInputAction
import com.android.systemui.scene.shared.model.SceneKey
import com.android.systemui.scene.shared.model.SceneModel
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.test.TestScope
-import kotlinx.coroutines.test.currentTime
import kotlinx.coroutines.test.runTest
import org.junit.Test
import org.junit.runner.RunWith
@@ -73,35 +68,4 @@
assertThat(currentScene).isEqualTo(SceneModel(SceneKey.Shade))
}
-
- @Test
- fun onRemoteUserInput() = runTest {
- val remoteUserInput by collectLastValue(underTest.remoteUserInput)
- assertThat(remoteUserInput).isNull()
-
- val inputs =
- SceneTestUtils.REMOTE_INPUT_DOWN_GESTURE.map { remoteUserInputToMotionEvent(it) }
-
- inputs.forEachIndexed { index, input ->
- underTest.onRemoteUserInput(input)
- assertThat(remoteUserInput).isEqualTo(SceneTestUtils.REMOTE_INPUT_DOWN_GESTURE[index])
- }
- }
-
- private fun TestScope.remoteUserInputToMotionEvent(input: RemoteUserInput): MotionEvent {
- return MotionEvent.obtain(
- currentTime,
- currentTime,
- when (input.action) {
- RemoteUserInputAction.DOWN -> MotionEvent.ACTION_DOWN
- RemoteUserInputAction.MOVE -> MotionEvent.ACTION_MOVE
- RemoteUserInputAction.UP -> MotionEvent.ACTION_UP
- RemoteUserInputAction.CANCEL -> MotionEvent.ACTION_CANCEL
- RemoteUserInputAction.UNKNOWN -> MotionEvent.ACTION_OUTSIDE
- },
- input.x,
- input.y,
- 0
- )
- }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenshot/ActionIntentCreatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/screenshot/ActionIntentCreatorTest.kt
index 2d3ee0e..ca4486b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/screenshot/ActionIntentCreatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/screenshot/ActionIntentCreatorTest.kt
@@ -20,12 +20,13 @@
import android.content.Context
import android.content.Intent
import android.net.Uri
-import androidx.test.ext.truth.content.IntentSubject.assertThat
+import androidx.test.ext.truth.content.IntentSubject.assertThat as assertThatIntent
import androidx.test.filters.SmallTest
import com.android.systemui.R
import com.android.systemui.SysuiTestCase
import com.android.systemui.util.mockito.eq
import com.android.systemui.util.mockito.mock
+import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
import org.junit.Test
import org.mockito.Mockito.`when` as whenever
@@ -39,23 +40,23 @@
val output = ActionIntentCreator.createShare(uri)
- assertThat(output).hasAction(Intent.ACTION_CHOOSER)
- assertThat(output)
+ assertThatIntent(output).hasAction(Intent.ACTION_CHOOSER)
+ assertThatIntent(output)
.hasFlags(
Intent.FLAG_ACTIVITY_NEW_TASK or
Intent.FLAG_ACTIVITY_CLEAR_TASK or
Intent.FLAG_GRANT_READ_URI_PERMISSION
)
- assertThat(output).extras().parcelable<Intent>(Intent.EXTRA_INTENT).isNotNull()
+ assertThatIntent(output).extras().parcelable<Intent>(Intent.EXTRA_INTENT).isNotNull()
val wrappedIntent = output.getParcelableExtra(Intent.EXTRA_INTENT, Intent::class.java)
- assertThat(wrappedIntent).hasAction(Intent.ACTION_SEND)
- assertThat(wrappedIntent).hasData(uri)
- assertThat(wrappedIntent).hasType("image/png")
- assertThat(wrappedIntent).extras().doesNotContainKey(Intent.EXTRA_SUBJECT)
- assertThat(wrappedIntent).extras().doesNotContainKey(Intent.EXTRA_TEXT)
- assertThat(wrappedIntent).extras().parcelable<Uri>(Intent.EXTRA_STREAM).isEqualTo(uri)
+ assertThatIntent(wrappedIntent).hasAction(Intent.ACTION_SEND)
+ assertThatIntent(wrappedIntent).hasData(uri)
+ assertThatIntent(wrappedIntent).hasType("image/png")
+ assertThatIntent(wrappedIntent).extras().doesNotContainKey(Intent.EXTRA_SUBJECT)
+ assertThatIntent(wrappedIntent).extras().doesNotContainKey(Intent.EXTRA_TEXT)
+ assertThatIntent(wrappedIntent).extras().parcelable<Uri>(Intent.EXTRA_STREAM).isEqualTo(uri)
}
@Test
@@ -64,7 +65,7 @@
val output = ActionIntentCreator.createShare(uri)
- assertThat(output.getParcelableExtra(Intent.EXTRA_INTENT, Intent::class.java))
+ assertThatIntent(output.getParcelableExtra(Intent.EXTRA_INTENT, Intent::class.java))
.hasData(Uri.parse("content://fake"))
}
@@ -75,8 +76,8 @@
val output = ActionIntentCreator.createShareWithSubject(uri, subject)
- assertThat(output).hasAction(Intent.ACTION_CHOOSER)
- assertThat(output)
+ assertThatIntent(output).hasAction(Intent.ACTION_CHOOSER)
+ assertThatIntent(output)
.hasFlags(
Intent.FLAG_ACTIVITY_NEW_TASK or
Intent.FLAG_ACTIVITY_CLEAR_TASK or
@@ -84,12 +85,12 @@
)
val wrappedIntent = output.getParcelableExtra(Intent.EXTRA_INTENT, Intent::class.java)
- assertThat(wrappedIntent).hasAction(Intent.ACTION_SEND)
- assertThat(wrappedIntent).hasData(uri)
- assertThat(wrappedIntent).hasType("image/png")
- assertThat(wrappedIntent).extras().string(Intent.EXTRA_SUBJECT).isEqualTo(subject)
- assertThat(wrappedIntent).extras().doesNotContainKey(Intent.EXTRA_TEXT)
- assertThat(wrappedIntent).extras().parcelable<Uri>(Intent.EXTRA_STREAM).isEqualTo(uri)
+ assertThatIntent(wrappedIntent).hasAction(Intent.ACTION_SEND)
+ assertThatIntent(wrappedIntent).hasData(uri)
+ assertThatIntent(wrappedIntent).hasType("image/png")
+ assertThatIntent(wrappedIntent).extras().string(Intent.EXTRA_SUBJECT).isEqualTo(subject)
+ assertThatIntent(wrappedIntent).extras().doesNotContainKey(Intent.EXTRA_TEXT)
+ assertThatIntent(wrappedIntent).extras().parcelable<Uri>(Intent.EXTRA_STREAM).isEqualTo(uri)
}
@Test
@@ -99,8 +100,8 @@
val output = ActionIntentCreator.createShareWithText(uri, extraText)
- assertThat(output).hasAction(Intent.ACTION_CHOOSER)
- assertThat(output)
+ assertThatIntent(output).hasAction(Intent.ACTION_CHOOSER)
+ assertThatIntent(output)
.hasFlags(
Intent.FLAG_ACTIVITY_NEW_TASK or
Intent.FLAG_ACTIVITY_CLEAR_TASK or
@@ -108,12 +109,12 @@
)
val wrappedIntent = output.getParcelableExtra(Intent.EXTRA_INTENT, Intent::class.java)
- assertThat(wrappedIntent).hasAction(Intent.ACTION_SEND)
- assertThat(wrappedIntent).hasData(uri)
- assertThat(wrappedIntent).hasType("image/png")
- assertThat(wrappedIntent).extras().doesNotContainKey(Intent.EXTRA_SUBJECT)
- assertThat(wrappedIntent).extras().string(Intent.EXTRA_TEXT).isEqualTo(extraText)
- assertThat(wrappedIntent).extras().parcelable<Uri>(Intent.EXTRA_STREAM).isEqualTo(uri)
+ assertThatIntent(wrappedIntent).hasAction(Intent.ACTION_SEND)
+ assertThatIntent(wrappedIntent).hasData(uri)
+ assertThatIntent(wrappedIntent).hasType("image/png")
+ assertThatIntent(wrappedIntent).extras().doesNotContainKey(Intent.EXTRA_SUBJECT)
+ assertThatIntent(wrappedIntent).extras().string(Intent.EXTRA_TEXT).isEqualTo(extraText)
+ assertThatIntent(wrappedIntent).extras().parcelable<Uri>(Intent.EXTRA_STREAM).isEqualTo(uri)
}
@Test
@@ -125,11 +126,12 @@
val output = ActionIntentCreator.createEdit(uri, context)
- assertThat(output).hasAction(Intent.ACTION_EDIT)
- assertThat(output).hasData(uri)
- assertThat(output).hasType("image/png")
+ assertThatIntent(output).hasAction(Intent.ACTION_EDIT)
+ assertThatIntent(output).hasData(uri)
+ assertThatIntent(output).hasType("image/png")
assertWithMessage("getComponent()").that(output.component).isNull()
- assertThat(output)
+ assertThat(output.getStringExtra("edit_source")).isEqualTo("screenshot")
+ assertThatIntent(output)
.hasFlags(
Intent.FLAG_GRANT_READ_URI_PERMISSION or
Intent.FLAG_GRANT_WRITE_URI_PERMISSION or
@@ -146,7 +148,7 @@
val output = ActionIntentCreator.createEdit(uri, context)
- assertThat(output).hasData(Uri.parse("content://fake"))
+ assertThatIntent(output).hasData(Uri.parse("content://fake"))
}
@Test
@@ -160,6 +162,6 @@
val output = ActionIntentCreator.createEdit(uri, context)
- assertThat(output).hasComponent(component)
+ assertThatIntent(output).hasComponent(component)
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java
index eb4ae1a..7aeafeb 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java
@@ -539,6 +539,23 @@
}
@Test
+ public void onKeyguardStatusViewHeightChange_animatesNextTopPaddingChangeForNSSL() {
+ ArgumentCaptor<View.OnLayoutChangeListener> captor =
+ ArgumentCaptor.forClass(View.OnLayoutChangeListener.class);
+ verify(mKeyguardStatusView).addOnLayoutChangeListener(captor.capture());
+ View.OnLayoutChangeListener listener = captor.getValue();
+
+ clearInvocations(mNotificationStackScrollLayoutController);
+
+ when(mKeyguardStatusView.getHeight()).thenReturn(0);
+ listener.onLayoutChange(mKeyguardStatusView, /* left= */ 0, /* top= */ 0, /* right= */
+ 0, /* bottom= */ 0, /* oldLeft= */ 0, /* oldTop= */ 0, /* oldRight= */
+ 0, /* oldBottom = */ 200);
+
+ verify(mNotificationStackScrollLayoutController).animateNextTopPaddingChange();
+ }
+
+ @Test
public void testCanCollapsePanelOnTouch_trueForKeyGuard() {
mStatusBarStateController.setState(KEYGUARD);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt
index 1edeeff..3cce423 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt
@@ -18,6 +18,7 @@
import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import android.view.KeyEvent
import android.view.MotionEvent
import android.view.ViewGroup
import androidx.test.filters.SmallTest
@@ -38,6 +39,7 @@
import com.android.systemui.dump.logcatLogBuffer
import com.android.systemui.flags.FakeFeatureFlags
import com.android.systemui.flags.Flags
+import com.android.systemui.keyevent.domain.interactor.KeyEventInteractor
import com.android.systemui.keyguard.KeyguardUnlockAnimationController
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor
import com.android.systemui.keyguard.shared.model.TransitionStep
@@ -118,8 +120,10 @@
@Mock lateinit var keyguardTransitionInteractor: KeyguardTransitionInteractor
@Mock
lateinit var primaryBouncerToGoneTransitionViewModel: PrimaryBouncerToGoneTransitionViewModel
+ @Mock lateinit var keyEventInteractor: KeyEventInteractor
private val notificationExpansionRepository = NotificationExpansionRepository()
+ private lateinit var fakeClock: FakeSystemClock
private lateinit var interactionEventHandlerCaptor: ArgumentCaptor<InteractionEventHandler>
private lateinit var interactionEventHandler: InteractionEventHandler
@@ -148,6 +152,7 @@
featureFlags.set(Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED, false)
testScope = TestScope()
+ fakeClock = FakeSystemClock()
underTest =
NotificationShadeWindowViewController(
lockscreenShadeTransitionController,
@@ -180,7 +185,7 @@
primaryBouncerToGoneTransitionViewModel,
notificationExpansionRepository,
featureFlags,
- FakeSystemClock(),
+ fakeClock,
BouncerMessageInteractor(
FakeBouncerMessageRepository(),
mock(BouncerMessageFactory::class.java),
@@ -188,7 +193,8 @@
CountDownTimerUtil(),
featureFlags
),
- BouncerLogger(logcatLogBuffer("BouncerLog"))
+ BouncerLogger(logcatLogBuffer("BouncerLog")),
+ keyEventInteractor,
)
underTest.setupExpandedStatusBar()
@@ -328,6 +334,33 @@
}
@Test
+ fun handleDispatchTouchEvent_launchAnimationRunningTimesOut() =
+ testScope.runTest {
+ // GIVEN touch dispatcher in a state that returns true
+ underTest.setStatusBarViewController(phoneStatusBarViewController)
+ whenever(keyguardUnlockAnimationController.isPlayingCannedUnlockAnimation()).thenReturn(
+ true
+ )
+ assertThat(interactionEventHandler.handleDispatchTouchEvent(DOWN_EVENT)).isTrue()
+
+ // WHEN launch animation is running for 2 seconds
+ fakeClock.setUptimeMillis(10000)
+ underTest.setExpandAnimationRunning(true)
+ fakeClock.advanceTime(2000)
+
+ // THEN touch is ignored
+ assertThat(interactionEventHandler.handleDispatchTouchEvent(DOWN_EVENT)).isFalse()
+
+ // WHEN Launch animation is running for 6 seconds
+ fakeClock.advanceTime(4000)
+
+ // THEN move is ignored, down is handled, and window is notified
+ assertThat(interactionEventHandler.handleDispatchTouchEvent(MOVE_EVENT)).isFalse()
+ assertThat(interactionEventHandler.handleDispatchTouchEvent(DOWN_EVENT)).isTrue()
+ verify(notificationShadeWindowController).setLaunchingActivity(false)
+ }
+
+ @Test
fun shouldInterceptTouchEvent_statusBarKeyguardViewManagerShouldIntercept() {
// down event should be intercepted by keyguardViewManager
whenever(statusBarKeyguardViewManager.shouldInterceptTouchEvent(DOWN_EVENT))
@@ -345,8 +378,30 @@
verify(view).findViewById<ViewGroup>(R.id.keyguard_message_area)
}
+ @Test
+ fun forwardsDispatchKeyEvent() {
+ val keyEvent = KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_B)
+ interactionEventHandler.dispatchKeyEvent(keyEvent)
+ verify(keyEventInteractor).dispatchKeyEvent(keyEvent)
+ }
+
+ @Test
+ fun forwardsDispatchKeyEventPreIme() {
+ val keyEvent = KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_B)
+ interactionEventHandler.dispatchKeyEventPreIme(keyEvent)
+ verify(keyEventInteractor).dispatchKeyEventPreIme(keyEvent)
+ }
+
+ @Test
+ fun forwardsInterceptMediaKey() {
+ val keyEvent = KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_VOLUME_UP)
+ interactionEventHandler.interceptMediaKey(keyEvent)
+ verify(keyEventInteractor).interceptMediaKey(keyEvent)
+ }
+
companion object {
private val DOWN_EVENT = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0)
+ private val MOVE_EVENT = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_MOVE, 0f, 0f, 0)
private const val VIEW_BOTTOM = 100
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt
index 829184c..66d48d6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt
@@ -38,6 +38,7 @@
import com.android.systemui.dump.logcatLogBuffer
import com.android.systemui.flags.FakeFeatureFlags
import com.android.systemui.flags.Flags
+import com.android.systemui.keyevent.domain.interactor.KeyEventInteractor
import com.android.systemui.keyguard.KeyguardUnlockAnimationController
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor
import com.android.systemui.keyguard.ui.viewmodel.PrimaryBouncerToGoneTransitionViewModel
@@ -198,7 +199,8 @@
CountDownTimerUtil(),
featureFlags
),
- BouncerLogger(logcatLogBuffer("BouncerLog"))
+ BouncerLogger(logcatLogBuffer("BouncerLog")),
+ Mockito.mock(KeyEventInteractor::class.java),
)
controller.setupExpandedStatusBar()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/carrier/ShadeCarrierGroupControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/carrier/ShadeCarrierGroupControllerTest.java
index 31bfa3fd..5fa6b3a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/carrier/ShadeCarrierGroupControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/carrier/ShadeCarrierGroupControllerTest.java
@@ -29,6 +29,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
@@ -50,6 +51,12 @@
import com.android.systemui.statusbar.connectivity.MobileDataIndicators;
import com.android.systemui.statusbar.connectivity.NetworkController;
import com.android.systemui.statusbar.connectivity.SignalCallback;
+import com.android.systemui.statusbar.connectivity.ui.MobileContextProvider;
+import com.android.systemui.statusbar.pipeline.StatusBarPipelineFlags;
+import com.android.systemui.statusbar.pipeline.mobile.ui.MobileUiAdapter;
+import com.android.systemui.statusbar.pipeline.mobile.ui.MobileViewLogger;
+import com.android.systemui.statusbar.pipeline.mobile.ui.viewmodel.MobileIconsViewModel;
+import com.android.systemui.statusbar.pipeline.mobile.ui.viewmodel.ShadeCarrierGroupMobileIconViewModel;
import com.android.systemui.util.CarrierConfigTracker;
import com.android.systemui.utils.leaks.LeakCheckedTest;
import com.android.systemui.utils.os.FakeHandler;
@@ -61,6 +68,10 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
@SmallTest
@@ -95,6 +106,18 @@
private TestableLooper mTestableLooper;
@Mock
private ShadeCarrierGroupController.OnSingleCarrierChangedListener mOnSingleCarrierChangedListener;
+ @Mock
+ private MobileUiAdapter mMobileUiAdapter;
+ @Mock
+ private MobileIconsViewModel mMobileIconsViewModel;
+ @Mock
+ private ShadeCarrierGroupMobileIconViewModel mShadeCarrierGroupMobileIconViewModel;
+ @Mock
+ private MobileViewLogger mMobileViewLogger;
+ @Mock
+ private MobileContextProvider mMobileContextProvider;
+ @Mock
+ private StatusBarPipelineFlags mStatusBarPipelineFlags;
private FakeSlotIndexResolver mSlotIndexResolver;
private ClickListenerTextView mNoCarrierTextView;
@@ -133,16 +156,35 @@
mSlotIndexResolver = new FakeSlotIndexResolver();
+ when(mMobileUiAdapter.getMobileIconsViewModel()).thenReturn(mMobileIconsViewModel);
+
mShadeCarrierGroupController = new ShadeCarrierGroupController.Builder(
- mActivityStarter, handler, TestableLooper.get(this).getLooper(),
- mNetworkController, mCarrierTextControllerBuilder, mContext, mCarrierConfigTracker,
- mSlotIndexResolver)
+ mActivityStarter,
+ handler,
+ TestableLooper.get(this).getLooper(),
+ mNetworkController,
+ mCarrierTextControllerBuilder,
+ mContext,
+ mCarrierConfigTracker,
+ mSlotIndexResolver,
+ mMobileUiAdapter,
+ mMobileContextProvider,
+ mStatusBarPipelineFlags
+ )
.setShadeCarrierGroup(mShadeCarrierGroup)
.build();
mShadeCarrierGroupController.setListening(true);
}
+ private void setupWithNewPipeline() {
+ when(mStatusBarPipelineFlags.useNewShadeCarrierGroupMobileIcons()).thenReturn(true);
+ when(mMobileContextProvider.getMobileContextForSub(anyInt(), any())).thenReturn(mContext);
+ when(mMobileIconsViewModel.getLogger()).thenReturn(mMobileViewLogger);
+ when(mMobileIconsViewModel.viewModelForSub(anyInt(), any()))
+ .thenReturn(mShadeCarrierGroupMobileIconViewModel);
+ }
+
@Test
public void testInitiallyMultiCarrier() {
assertFalse(mShadeCarrierGroupController.isSingleCarrier());
@@ -406,6 +448,129 @@
verify(mOnSingleCarrierChangedListener, never()).onSingleCarrierChanged(anyBoolean());
}
+ @TestableLooper.RunWithLooper(setAsMainLooper = true)
+ @Test
+ public void testUpdateModernMobileIcons_addSubscription() {
+ setupWithNewPipeline();
+
+ mShadeCarrier1.setVisibility(View.GONE);
+ mShadeCarrier2.setVisibility(View.GONE);
+ mShadeCarrier3.setVisibility(View.GONE);
+
+ List<Integer> subIds = new ArrayList<>();
+ subIds.add(0);
+ mShadeCarrierGroupController.updateModernMobileIcons(subIds);
+
+ verify(mShadeCarrier1).addModernMobileView(any());
+ verify(mShadeCarrier2, never()).addModernMobileView(any());
+ verify(mShadeCarrier3, never()).addModernMobileView(any());
+
+ resetShadeCarriers();
+
+ subIds.add(1);
+ mShadeCarrierGroupController.updateModernMobileIcons(subIds);
+
+ verify(mShadeCarrier1, times(1)).removeModernMobileView();
+
+ verify(mShadeCarrier1).addModernMobileView(any());
+ verify(mShadeCarrier2).addModernMobileView(any());
+ verify(mShadeCarrier3, never()).addModernMobileView(any());
+ }
+
+ @TestableLooper.RunWithLooper(setAsMainLooper = true)
+ @Test
+ public void testUpdateModernMobileIcons_removeSubscription() {
+ setupWithNewPipeline();
+
+ List<Integer> subIds = new ArrayList<>();
+ subIds.add(0);
+ subIds.add(1);
+ mShadeCarrierGroupController.updateModernMobileIcons(subIds);
+
+ verify(mShadeCarrier1).addModernMobileView(any());
+ verify(mShadeCarrier2).addModernMobileView(any());
+ verify(mShadeCarrier3, never()).addModernMobileView(any());
+
+ resetShadeCarriers();
+
+ subIds.remove(1);
+ mShadeCarrierGroupController.updateModernMobileIcons(subIds);
+
+ verify(mShadeCarrier1, times(1)).removeModernMobileView();
+ verify(mShadeCarrier2, times(1)).removeModernMobileView();
+
+ verify(mShadeCarrier1).addModernMobileView(any());
+ verify(mShadeCarrier2, never()).addModernMobileView(any());
+ verify(mShadeCarrier3, never()).addModernMobileView(any());
+ }
+
+ @TestableLooper.RunWithLooper(setAsMainLooper = true)
+ @Test
+ public void testUpdateModernMobileIcons_removeSubscriptionOutOfOrder() {
+ setupWithNewPipeline();
+
+ List<Integer> subIds = new ArrayList<>();
+ subIds.add(0);
+ subIds.add(1);
+ subIds.add(2);
+ mShadeCarrierGroupController.updateModernMobileIcons(subIds);
+
+ verify(mShadeCarrier1).addModernMobileView(any());
+ verify(mShadeCarrier2).addModernMobileView(any());
+ verify(mShadeCarrier3).addModernMobileView(any());
+
+ resetShadeCarriers();
+
+ subIds.remove(1);
+ mShadeCarrierGroupController.updateModernMobileIcons(subIds);
+
+ verify(mShadeCarrier1).removeModernMobileView();
+ verify(mShadeCarrier2).removeModernMobileView();
+ verify(mShadeCarrier3).removeModernMobileView();
+
+ verify(mShadeCarrier1).addModernMobileView(any());
+ verify(mShadeCarrier2, never()).addModernMobileView(any());
+ verify(mShadeCarrier3).addModernMobileView(any());
+ }
+
+ @TestableLooper.RunWithLooper(setAsMainLooper = true)
+ @Test
+ public void testProcessSubIdList_moreSubsThanSimSlots_listLimitedToMax() {
+ setupWithNewPipeline();
+
+ List<Integer> subIds = Arrays.asList(0, 1, 2, 2);
+
+ assertThat(mShadeCarrierGroupController.processSubIdList(subIds).size()).isEqualTo(3);
+ }
+
+ @TestableLooper.RunWithLooper(setAsMainLooper = true)
+ @Test
+ public void testProcessSubIdList_invalidSimSlotIndexFilteredOut() {
+ setupWithNewPipeline();
+
+ List<Integer> subIds = Arrays.asList(0, 1, -1);
+
+ List<ShadeCarrierGroupController.IconData> processedSubs =
+ mShadeCarrierGroupController.processSubIdList(subIds);
+ assertThat(processedSubs).hasSize(2);
+ assertThat(processedSubs.get(0).subId).isNotEqualTo(-1);
+ assertThat(processedSubs.get(1).subId).isNotEqualTo(-1);
+ }
+
+ @TestableLooper.RunWithLooper(setAsMainLooper = true)
+ @Test
+ public void testProcessSubIdList_indexGreaterThanSimSlotsFilteredOut() {
+ setupWithNewPipeline();
+
+ List<Integer> subIds = Arrays.asList(0, 4);
+
+ List<ShadeCarrierGroupController.IconData> processedSubs =
+ mShadeCarrierGroupController.processSubIdList(subIds);
+ assertThat(processedSubs).hasSize(1);
+ assertThat(processedSubs.get(0).subId).isNotEqualTo(4);
+ }
+
+
@Test
public void testOnlyInternalViewsHaveClickableListener() {
ArgumentCaptor<View.OnClickListener> captor =
@@ -447,6 +612,12 @@
.isEqualTo(Settings.ACTION_WIRELESS_SETTINGS);
}
+ private void resetShadeCarriers() {
+ reset(mShadeCarrier1);
+ reset(mShadeCarrier2);
+ reset(mShadeCarrier3);
+ }
+
private class FakeSlotIndexResolver implements ShadeCarrierGroupController.SlotIndexResolver {
public boolean overrideInvalid;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shared/clocks/ClockRegistryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shared/clocks/ClockRegistryTest.kt
index 9495fdd..ecaf137 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shared/clocks/ClockRegistryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shared/clocks/ClockRegistryTest.kt
@@ -227,6 +227,25 @@
}
@Test
+ fun activeClockId_changeAfterPluginConnected() {
+ val plugin1 = FakeClockPlugin()
+ .addClock("clock_1", "clock 1")
+ .addClock("clock_2", "clock 2")
+
+ val plugin2 = FakeClockPlugin()
+ .addClock("clock_3", "clock 3", { mockClock })
+ .addClock("clock_4", "clock 4")
+
+ registry.applySettings(ClockSettings("clock_3", null))
+
+ pluginListener.onPluginLoaded(plugin1, mockContext, mockPluginLifecycle)
+ assertEquals(DEFAULT_CLOCK_ID, registry.activeClockId)
+
+ pluginListener.onPluginLoaded(plugin2, mockContext, mockPluginLifecycle)
+ assertEquals("clock_3", registry.activeClockId)
+ }
+
+ @Test
fun createDefaultClock_pluginDisconnected() {
val plugin1 = FakeClockPlugin()
.addClock("clock_1", "clock 1")
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/render/GroupExpansionManagerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/render/GroupExpansionManagerTest.kt
index 4a94dc8..38a8f414 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/render/GroupExpansionManagerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/render/GroupExpansionManagerTest.kt
@@ -21,11 +21,21 @@
import com.android.systemui.dump.DumpManager
import com.android.systemui.flags.FakeFeatureFlags
import com.android.systemui.flags.Flags
+import com.android.systemui.statusbar.notification.collection.GroupEntryBuilder
+import com.android.systemui.statusbar.notification.collection.ListEntry
+import com.android.systemui.statusbar.notification.collection.NotifPipeline
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder
+import com.android.systemui.statusbar.notification.collection.listbuilder.OnBeforeRenderListListener
+import com.android.systemui.statusbar.notification.collection.render.GroupExpansionManager.OnGroupExpansionChangeListener
+import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.mock
+import com.android.systemui.util.mockito.withArgCaptor
import org.junit.Assert
import org.junit.Before
import org.junit.Test
+import org.mockito.Mockito.never
+import org.mockito.Mockito.verify
+import org.mockito.Mockito.verifyNoMoreInteractions
import org.mockito.Mockito.`when` as whenever
@SmallTest
@@ -36,13 +46,43 @@
private val groupMembershipManager: GroupMembershipManager = mock()
private val featureFlags = FakeFeatureFlags()
- private val entry1 = NotificationEntryBuilder().build()
- private val entry2 = NotificationEntryBuilder().build()
+ private val pipeline: NotifPipeline = mock()
+ private lateinit var beforeRenderListListener: OnBeforeRenderListListener
+
+ private val summary1 = notificationEntry("foo", 1)
+ private val summary2 = notificationEntry("bar", 1)
+ private val entries =
+ listOf<ListEntry>(
+ GroupEntryBuilder()
+ .setSummary(summary1)
+ .setChildren(
+ listOf(
+ notificationEntry("foo", 2),
+ notificationEntry("foo", 3),
+ notificationEntry("foo", 4)
+ )
+ )
+ .build(),
+ GroupEntryBuilder()
+ .setSummary(summary2)
+ .setChildren(
+ listOf(
+ notificationEntry("bar", 2),
+ notificationEntry("bar", 3),
+ notificationEntry("bar", 4)
+ )
+ )
+ .build(),
+ notificationEntry("baz", 1)
+ )
+
+ private fun notificationEntry(pkg: String, id: Int) =
+ NotificationEntryBuilder().setPkg(pkg).setId(id).build().apply { row = mock() }
@Before
fun setUp() {
- whenever(groupMembershipManager.getGroupSummary(entry1)).thenReturn(entry1)
- whenever(groupMembershipManager.getGroupSummary(entry2)).thenReturn(entry2)
+ whenever(groupMembershipManager.getGroupSummary(summary1)).thenReturn(summary1)
+ whenever(groupMembershipManager.getGroupSummary(summary2)).thenReturn(summary2)
gem = GroupExpansionManagerImpl(dumpManager, groupMembershipManager, featureFlags)
}
@@ -54,15 +94,15 @@
var listenerCalledCount = 0
gem.registerGroupExpansionChangeListener { _, _ -> listenerCalledCount++ }
- gem.setGroupExpanded(entry1, false)
+ gem.setGroupExpanded(summary1, false)
Assert.assertEquals(0, listenerCalledCount)
- gem.setGroupExpanded(entry1, true)
+ gem.setGroupExpanded(summary1, true)
Assert.assertEquals(1, listenerCalledCount)
- gem.setGroupExpanded(entry2, true)
+ gem.setGroupExpanded(summary2, true)
Assert.assertEquals(2, listenerCalledCount)
- gem.setGroupExpanded(entry1, true)
+ gem.setGroupExpanded(summary1, true)
Assert.assertEquals(2, listenerCalledCount)
- gem.setGroupExpanded(entry2, false)
+ gem.setGroupExpanded(summary2, false)
Assert.assertEquals(3, listenerCalledCount)
}
@@ -73,15 +113,39 @@
var listenerCalledCount = 0
gem.registerGroupExpansionChangeListener { _, _ -> listenerCalledCount++ }
- gem.setGroupExpanded(entry1, false)
+ gem.setGroupExpanded(summary1, false)
Assert.assertEquals(1, listenerCalledCount)
- gem.setGroupExpanded(entry1, true)
+ gem.setGroupExpanded(summary1, true)
Assert.assertEquals(2, listenerCalledCount)
- gem.setGroupExpanded(entry2, true)
+ gem.setGroupExpanded(summary2, true)
Assert.assertEquals(3, listenerCalledCount)
- gem.setGroupExpanded(entry1, true)
+ gem.setGroupExpanded(summary1, true)
Assert.assertEquals(4, listenerCalledCount)
- gem.setGroupExpanded(entry2, false)
+ gem.setGroupExpanded(summary2, false)
Assert.assertEquals(5, listenerCalledCount)
}
+
+ @Test
+ fun testSyncWithPipeline() {
+ featureFlags.set(Flags.NOTIFICATION_GROUP_EXPANSION_CHANGE, true)
+ gem.attach(pipeline)
+ beforeRenderListListener = withArgCaptor {
+ verify(pipeline).addOnBeforeRenderListListener(capture())
+ }
+
+ val listener: OnGroupExpansionChangeListener = mock()
+ gem.registerGroupExpansionChangeListener(listener)
+
+ beforeRenderListListener.onBeforeRenderList(entries)
+ verify(listener, never()).onGroupExpansionChange(any(), any())
+
+ // Expand one of the groups.
+ gem.setGroupExpanded(summary1, true)
+ verify(listener).onGroupExpansionChange(summary1.row, true)
+
+ // Empty the pipeline list and verify that the group is no longer expanded.
+ beforeRenderListListener.onBeforeRenderList(emptyList())
+ verify(listener).onGroupExpansionChange(summary1.row, false)
+ verifyNoMoreInteractions(listener)
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconAreaControllerViewBinderWrapperImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconAreaControllerViewBinderWrapperImplTest.kt
new file mode 100644
index 0000000..b8792a8
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/NotificationIconAreaControllerViewBinderWrapperImplTest.kt
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.statusbar.notification.icon.ui.viewbinder
+
+import android.testing.AndroidTestingRunner
+import android.testing.TestableLooper.RunWithLooper
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.demomode.DemoModeController
+import com.android.systemui.flags.FeatureFlags
+import com.android.systemui.plugins.DarkIconDispatcher
+import com.android.systemui.plugins.statusbar.StatusBarStateController
+import com.android.systemui.statusbar.NotificationListener
+import com.android.systemui.statusbar.NotificationMediaManager
+import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator
+import com.android.systemui.statusbar.notification.collection.provider.SectionStyleProvider
+import com.android.systemui.statusbar.notification.icon.ui.viewmodel.NotificationIconContainerAlwaysOnDisplayViewModel
+import com.android.systemui.statusbar.notification.icon.ui.viewmodel.NotificationIconContainerShelfViewModel
+import com.android.systemui.statusbar.notification.icon.ui.viewmodel.NotificationIconContainerStatusBarViewModel
+import com.android.systemui.statusbar.phone.DozeParameters
+import com.android.systemui.statusbar.phone.KeyguardBypassController
+import com.android.systemui.statusbar.phone.NotificationIconContainer
+import com.android.systemui.statusbar.phone.ScreenOffAnimationController
+import com.android.systemui.statusbar.window.StatusBarWindowController
+import com.android.systemui.util.mockito.whenever
+import com.android.wm.shell.bubbles.Bubbles
+import java.util.Optional
+import org.junit.Assert.assertFalse
+import org.junit.Assert.assertTrue
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mock
+import org.mockito.Mockito.verify
+import org.mockito.MockitoAnnotations
+
+@SmallTest
+@RunWith(AndroidTestingRunner::class)
+@RunWithLooper(setAsMainLooper = true)
+class NotificationIconAreaControllerViewBinderWrapperImplTest : SysuiTestCase() {
+ @Mock private lateinit var notifListener: NotificationListener
+ @Mock private lateinit var statusBarStateController: StatusBarStateController
+ @Mock private lateinit var wakeUpCoordinator: NotificationWakeUpCoordinator
+ @Mock private lateinit var keyguardBypassController: KeyguardBypassController
+ @Mock private lateinit var notifMediaManager: NotificationMediaManager
+ @Mock private lateinit var dozeParams: DozeParameters
+ @Mock private lateinit var sectionStyleProvider: SectionStyleProvider
+ @Mock private lateinit var darkIconDispatcher: DarkIconDispatcher
+ @Mock private lateinit var statusBarWindowController: StatusBarWindowController
+ @Mock private lateinit var screenOffAnimController: ScreenOffAnimationController
+ @Mock private lateinit var bubbles: Bubbles
+ @Mock private lateinit var demoModeController: DemoModeController
+ @Mock private lateinit var aodIcons: NotificationIconContainer
+ @Mock private lateinit var featureFlags: FeatureFlags
+
+ private val shelfViewModel = NotificationIconContainerShelfViewModel()
+ private val statusBarViewModel = NotificationIconContainerStatusBarViewModel()
+ private val aodViewModel = NotificationIconContainerAlwaysOnDisplayViewModel()
+
+ private lateinit var underTest: NotificationIconAreaControllerViewBinderWrapperImpl
+
+ @Before
+ fun setup() {
+ MockitoAnnotations.initMocks(this)
+ underTest =
+ NotificationIconAreaControllerViewBinderWrapperImpl(
+ mContext,
+ statusBarStateController,
+ wakeUpCoordinator,
+ keyguardBypassController,
+ notifMediaManager,
+ notifListener,
+ dozeParams,
+ sectionStyleProvider,
+ Optional.of(bubbles),
+ demoModeController,
+ darkIconDispatcher,
+ featureFlags,
+ statusBarWindowController,
+ screenOffAnimController,
+ shelfViewModel,
+ statusBarViewModel,
+ aodViewModel,
+ )
+ }
+
+ @Test
+ fun testNotificationIcons_settingHideIcons() {
+ underTest.settingsListener.onStatusBarIconsBehaviorChanged(true)
+ assertFalse(underTest.shouldShowLowPriorityIcons())
+ }
+
+ @Test
+ fun testNotificationIcons_settingShowIcons() {
+ underTest.settingsListener.onStatusBarIconsBehaviorChanged(false)
+ assertTrue(underTest.shouldShowLowPriorityIcons())
+ }
+
+ @Test
+ fun testAppearResetsTranslation() {
+ underTest.setupAodIcons(aodIcons)
+ whenever(dozeParams.shouldControlScreenOff()).thenReturn(false)
+ underTest.appearAodIcons()
+ verify(aodIcons).translationY = 0f
+ verify(aodIcons).alpha = 1.0f
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
index 987861d..77c9b8b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithmTest.kt
@@ -1,6 +1,7 @@
package com.android.systemui.statusbar.notification.stack
import android.annotation.DimenRes
+import android.content.pm.PackageManager
import android.widget.FrameLayout
import androidx.test.filters.SmallTest
import com.android.keyguard.BouncerPanelExpansionCalculator.aboutToShowBouncerProgress
@@ -21,6 +22,7 @@
import junit.framework.Assert.assertEquals
import junit.framework.Assert.assertFalse
import junit.framework.Assert.assertTrue
+import org.junit.Assume
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@@ -66,6 +68,8 @@
@Before
fun setUp() {
+ Assume.assumeFalse(isTv())
+
whenever(notificationShelf.viewState).thenReturn(ExpandableViewState())
whenever(notificationRow.viewState).thenReturn(ExpandableViewState())
ambientState.isSmallScreen = true
@@ -73,6 +77,10 @@
hostView.addView(notificationRow)
}
+ private fun isTv(): Boolean {
+ return context.packageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK)
+ }
+
@Test
fun resetViewStates_defaultHun_yTranslationIsInset() {
whenever(notificationRow.isPinned).thenReturn(true)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java
index 8545b89..3ad3c15 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java
@@ -18,6 +18,8 @@
import static android.view.Display.DEFAULT_DISPLAY;
+import static com.android.systemui.flags.Flags.ONE_WAY_HAPTICS_API_MIGRATION;
+
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
@@ -29,8 +31,10 @@
import android.app.StatusBarManager;
import android.os.PowerManager;
import android.os.UserHandle;
+import android.os.VibrationEffect;
import android.os.Vibrator;
import android.testing.AndroidTestingRunner;
+import android.view.HapticFeedbackConstants;
import android.view.WindowInsets;
import androidx.test.filters.SmallTest;
@@ -42,6 +46,7 @@
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.assist.AssistManager;
+import com.android.systemui.flags.FakeFeatureFlags;
import com.android.systemui.keyguard.WakefulnessLifecycle;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.qs.QSHost;
@@ -98,6 +103,7 @@
@Mock private UserTracker mUserTracker;
@Mock private QSHost mQSHost;
@Mock private ActivityStarter mActivityStarter;
+ private final FakeFeatureFlags mFeatureFlags = new FakeFeatureFlags();
CentralSurfacesCommandQueueCallbacks mSbcqCallbacks;
@@ -134,7 +140,8 @@
mCameraLauncherLazy,
mUserTracker,
mQSHost,
- mActivityStarter);
+ mActivityStarter,
+ mFeatureFlags);
when(mUserTracker.getUserHandle()).thenReturn(
UserHandle.of(ActivityManager.getCurrentUser()));
@@ -241,4 +248,24 @@
verifyZeroInteractions(mSystemBarAttributesListener);
}
+
+ @Test
+ public void vibrateOnNavigationKeyDown_oneWayHapticsDisabled_usesVibrate() {
+ mFeatureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, false);
+
+ mSbcqCallbacks.vibrateOnNavigationKeyDown();
+
+ verify(mVibratorHelper).vibrate(VibrationEffect.EFFECT_TICK);
+ }
+
+ @Test
+ public void vibrateOnNavigationKeyDown_oneWayHapticsEnabled_usesPerformHapticFeedback() {
+ mFeatureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, true);
+
+ mSbcqCallbacks.vibrateOnNavigationKeyDown();
+
+ verify(mShadeViewController).performHapticFeedback(
+ HapticFeedbackConstants.GESTURE_START
+ );
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImplTest.java
similarity index 94%
rename from packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerTest.java
rename to packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImplTest.java
index 8e1dcf0..1b8cfd4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImplTest.java
@@ -48,7 +48,7 @@
@SmallTest
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
-public class NotificationIconAreaControllerTest extends SysuiTestCase {
+public class LegacyNotificationIconAreaControllerImplTest extends SysuiTestCase {
@Mock
private NotificationListener mListener;
@@ -70,7 +70,7 @@
StatusBarWindowController mStatusBarWindowController;
@Mock
ScreenOffAnimationController mScreenOffAnimationController;
- private NotificationIconAreaController mController;
+ private LegacyNotificationIconAreaControllerImpl mController;
@Mock
private Bubbles mBubbles;
@Mock private DemoModeController mDemoModeController;
@@ -82,7 +82,7 @@
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
- mController = new NotificationIconAreaController(
+ mController = new LegacyNotificationIconAreaControllerImpl(
mContext,
mStatusBarStateController,
mWakeUpCoordinator,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewControllerTest.kt
index 2e92bb9..4c3c3f9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarViewControllerTest.kt
@@ -16,6 +16,10 @@
package com.android.systemui.statusbar.phone
+import android.app.StatusBarManager.WINDOW_STATE_HIDDEN
+import android.app.StatusBarManager.WINDOW_STATE_HIDING
+import android.app.StatusBarManager.WINDOW_STATE_SHOWING
+import android.app.StatusBarManager.WINDOW_STATUS_BAR
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.ViewTreeObserver
@@ -27,16 +31,19 @@
import com.android.systemui.SysuiTestCase
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
-import com.android.systemui.scene.domain.interactor.SceneInteractor
+import com.android.systemui.scene.ui.view.WindowRootView
import com.android.systemui.shade.ShadeControllerImpl
import com.android.systemui.shade.ShadeLogger
import com.android.systemui.shade.ShadeViewController
+import com.android.systemui.statusbar.CommandQueue
import com.android.systemui.statusbar.policy.ConfigurationController
+import com.android.systemui.statusbar.window.StatusBarWindowStateController
import com.android.systemui.unfold.SysUIUnfoldComponent
import com.android.systemui.unfold.config.UnfoldTransitionConfig
import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider
import com.android.systemui.user.ui.viewmodel.StatusBarUserChipViewModel
import com.android.systemui.util.mockito.any
+import com.android.systemui.util.mockito.argumentCaptor
import com.android.systemui.util.mockito.whenever
import com.android.systemui.util.view.ViewUtil
import com.google.common.truth.Truth.assertThat
@@ -75,13 +82,16 @@
@Mock
private lateinit var centralSurfacesImpl: CentralSurfacesImpl
@Mock
+ private lateinit var commandQueue: CommandQueue
+ @Mock
private lateinit var shadeControllerImpl: ShadeControllerImpl
@Mock
- private lateinit var sceneInteractor: Provider<SceneInteractor>
+ private lateinit var windowRootView: Provider<WindowRootView>
@Mock
private lateinit var shadeLogger: ShadeLogger
@Mock
private lateinit var viewUtil: ViewUtil
+ private lateinit var statusBarWindowStateController: StatusBarWindowStateController
private lateinit var view: PhoneStatusBarView
private lateinit var controller: PhoneStatusBarViewController
@@ -91,6 +101,9 @@
@Before
fun setUp() {
MockitoAnnotations.initMocks(this)
+
+ statusBarWindowStateController = StatusBarWindowStateController(DISPLAY_ID, commandQueue)
+
`when`(sysuiUnfoldComponent.getStatusBarMoveFromCenterAnimationController())
.thenReturn(moveFromCenterAnimation)
// create the view and controller on main thread as it requires main looper
@@ -186,6 +199,42 @@
verify(shadeViewController, never()).handleExternalTouch(any())
}
+ @Test
+ fun onTouch_windowHidden_centralSurfacesNotNotified() {
+ val callback = getCommandQueueCallback()
+ callback.setWindowState(DISPLAY_ID, WINDOW_STATUS_BAR, WINDOW_STATE_HIDDEN)
+
+ controller.onTouch(MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0))
+
+ verify(centralSurfacesImpl, never()).setInteracting(any(), any())
+ }
+
+ @Test
+ fun onTouch_windowHiding_centralSurfacesNotNotified() {
+ val callback = getCommandQueueCallback()
+ callback.setWindowState(DISPLAY_ID, WINDOW_STATUS_BAR, WINDOW_STATE_HIDING)
+
+ controller.onTouch(MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0))
+
+ verify(centralSurfacesImpl, never()).setInteracting(any(), any())
+ }
+
+ @Test
+ fun onTouch_windowShowing_centralSurfacesNotified() {
+ val callback = getCommandQueueCallback()
+ callback.setWindowState(DISPLAY_ID, WINDOW_STATUS_BAR, WINDOW_STATE_SHOWING)
+
+ controller.onTouch(MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0))
+
+ verify(centralSurfacesImpl).setInteracting(any(), any())
+ }
+
+ private fun getCommandQueueCallback(): CommandQueue.Callbacks {
+ val captor = argumentCaptor<CommandQueue.Callbacks>()
+ verify(commandQueue).addCallback(captor.capture())
+ return captor.value!!
+ }
+
private fun createViewMock(): PhoneStatusBarView {
val view = spy(view)
val viewTreeObserver = mock(ViewTreeObserver::class.java)
@@ -201,9 +250,10 @@
featureFlags,
userChipViewModel,
centralSurfacesImpl,
+ statusBarWindowStateController,
shadeControllerImpl,
shadeViewController,
- sceneInteractor,
+ windowRootView,
shadeLogger,
viewUtil,
configurationController,
@@ -218,4 +268,8 @@
override var isHingeAngleEnabled: Boolean = false
override val halfFoldedTimeoutMillis: Int = 0
}
+
+ private companion object {
+ const val DISPLAY_ID = 1
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
index 0dc1d9a..6b3bd22 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
@@ -1802,6 +1802,15 @@
assertFalse(ScrimState.UNLOCKED.mAnimateChange);
}
+ @Test
+ public void testNotifScrimAlpha_1f_afterUnlockFinishedAndExpanded() {
+ mScrimController.transitionTo(ScrimState.KEYGUARD);
+ when(mKeyguardUnlockAnimationController.isPlayingCannedUnlockAnimation()).thenReturn(true);
+ mScrimController.transitionTo(ScrimState.UNLOCKED);
+ mScrimController.onUnlockAnimationFinished();
+ assertAlphaAfterExpansion(mNotificationsScrim, 1f, 1f);
+ }
+
private void assertAlphaAfterExpansion(ScrimView scrim, float expectedAlpha, float expansion) {
mScrimController.setRawPanelExpansionFraction(expansion);
finishAnimationsImmediately();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java
index 823155b..b8f2cab 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java
@@ -81,7 +81,7 @@
import com.android.systemui.util.time.FakeSystemClock;
import org.junit.Before;
-import org.junit.ClassRule;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -136,8 +136,8 @@
private StatusBarWindowStateController mStatusBarWindowStateController;
@Mock
private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
- @ClassRule
- public static AnimatorTestRule mAnimatorTestRule = new AnimatorTestRule();
+ @Rule
+ public final AnimatorTestRule mAnimatorTestRule = new AnimatorTestRule();
private List<StatusBarWindowStateListener> mStatusBarWindowStateListeners = new ArrayList<>();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/FakeMobileConnectionRepository.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/FakeMobileConnectionRepository.kt
index 50ee6a3..ff28753 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/FakeMobileConnectionRepository.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/FakeMobileConnectionRepository.kt
@@ -52,12 +52,19 @@
override val cdmaRoaming = MutableStateFlow(false)
- override val networkName =
- MutableStateFlow<NetworkNameModel>(NetworkNameModel.Default("default"))
+ override val networkName: MutableStateFlow<NetworkNameModel> =
+ MutableStateFlow(NetworkNameModel.Default(DEFAULT_NETWORK_NAME))
+
+ override val carrierName: MutableStateFlow<NetworkNameModel> =
+ MutableStateFlow(NetworkNameModel.Default(DEFAULT_NETWORK_NAME))
override val isAllowedDuringAirplaneMode = MutableStateFlow(false)
fun setDataEnabled(enabled: Boolean) {
_dataEnabled.value = enabled
}
+
+ companion object {
+ const val DEFAULT_NETWORK_NAME = "default name"
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/FakeMobileConnectionsRepository.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/FakeMobileConnectionsRepository.kt
index 3591c17..99e4030 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/FakeMobileConnectionsRepository.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/FakeMobileConnectionsRepository.kt
@@ -75,7 +75,11 @@
override fun getRepoForSubId(subId: Int): MobileConnectionRepository {
return subIdRepos[subId]
- ?: FakeMobileConnectionRepository(subId, tableLogBuffer).also { subIdRepos[subId] = it }
+ ?: FakeMobileConnectionRepository(
+ subId,
+ tableLogBuffer,
+ )
+ .also { subIdRepos[subId] = it }
}
override val defaultDataSubRatConfig = MutableStateFlow(MobileMappings.Config())
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcherTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcherTest.kt
index 5a887eb..d005972 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcherTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcherTest.kt
@@ -243,13 +243,29 @@
private val IMMEDIATE = Dispatchers.Main.immediate
private const val SUB_1_ID = 1
+ private const val SUB_1_NAME = "Carrier $SUB_1_ID"
private val SUB_1 =
- mock<SubscriptionInfo>().also { whenever(it.subscriptionId).thenReturn(SUB_1_ID) }
- private val MODEL_1 = SubscriptionModel(subscriptionId = SUB_1_ID)
+ mock<SubscriptionInfo>().also {
+ whenever(it.subscriptionId).thenReturn(SUB_1_ID)
+ whenever(it.carrierName).thenReturn(SUB_1_NAME)
+ }
+ private val MODEL_1 =
+ SubscriptionModel(
+ subscriptionId = SUB_1_ID,
+ carrierName = SUB_1_NAME,
+ )
private const val SUB_2_ID = 2
+ private const val SUB_2_NAME = "Carrier $SUB_2_ID"
private val SUB_2 =
- mock<SubscriptionInfo>().also { whenever(it.subscriptionId).thenReturn(SUB_2_ID) }
- private val MODEL_2 = SubscriptionModel(subscriptionId = SUB_2_ID)
+ mock<SubscriptionInfo>().also {
+ whenever(it.subscriptionId).thenReturn(SUB_2_ID)
+ whenever(it.carrierName).thenReturn(SUB_2_NAME)
+ }
+ private val MODEL_2 =
+ SubscriptionModel(
+ subscriptionId = SUB_2_ID,
+ carrierName = SUB_2_NAME,
+ )
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionParameterizedTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionParameterizedTest.kt
index 7573b28..57f97ec 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionParameterizedTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionParameterizedTest.kt
@@ -38,7 +38,6 @@
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancel
import kotlinx.coroutines.flow.MutableStateFlow
-import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.UnconfinedTestDispatcher
@@ -140,6 +139,7 @@
launch { conn.carrierNetworkChangeActive.collect {} }
launch { conn.isRoaming.collect {} }
launch { conn.networkName.collect {} }
+ launch { conn.carrierName.collect {} }
launch { conn.isEmergencyOnly.collect {} }
launch { conn.dataConnectionState.collect {} }
}
@@ -163,6 +163,8 @@
assertThat(conn.isRoaming.value).isEqualTo(model.roaming)
assertThat(conn.networkName.value)
.isEqualTo(NetworkNameModel.IntentDerived(model.name))
+ assertThat(conn.carrierName.value)
+ .isEqualTo(NetworkNameModel.SubscriptionDerived("${model.name} ${model.subId}"))
// TODO(b/261029387): check these once we start handling them
assertThat(conn.isEmergencyOnly.value).isFalse()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionsRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionsRepositoryTest.kt
index efaf152..2712b70 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionsRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/demo/DemoMobileConnectionsRepositoryTest.kt
@@ -546,6 +546,7 @@
launch { conn.carrierNetworkChangeActive.collect {} }
launch { conn.isRoaming.collect {} }
launch { conn.networkName.collect {} }
+ launch { conn.carrierName.collect {} }
launch { conn.isEmergencyOnly.collect {} }
launch { conn.dataConnectionState.collect {} }
}
@@ -571,6 +572,8 @@
assertThat(conn.isRoaming.value).isEqualTo(model.roaming)
assertThat(conn.networkName.value)
.isEqualTo(NetworkNameModel.IntentDerived(model.name))
+ assertThat(conn.carrierName.value)
+ .isEqualTo(NetworkNameModel.SubscriptionDerived("${model.name} ${model.subId}"))
// TODO(b/261029387) check these once we start handling them
assertThat(conn.isEmergencyOnly.value).isFalse()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepositoryTest.kt
index 3dd2eaf..9c0cb17 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepositoryTest.kt
@@ -26,6 +26,7 @@
import com.android.systemui.log.table.TableLogBuffer
import com.android.systemui.log.table.TableLogBufferFactory
import com.android.systemui.statusbar.pipeline.mobile.data.model.NetworkNameModel
+import com.android.systemui.statusbar.pipeline.mobile.data.model.SubscriptionModel
import com.android.systemui.statusbar.pipeline.mobile.data.repository.FakeMobileConnectionRepository
import com.android.systemui.statusbar.pipeline.mobile.data.repository.MobileConnectionRepository
import com.android.systemui.statusbar.pipeline.mobile.data.repository.prod.FullMobileConnectionRepository.Companion.COL_EMERGENCY
@@ -43,6 +44,7 @@
import java.io.PrintWriter
import java.io.StringWriter
import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.test.TestScope
@@ -79,28 +81,51 @@
private val mobileFactory = mock<MobileConnectionRepositoryImpl.Factory>()
private val carrierMergedFactory = mock<CarrierMergedConnectionRepository.Factory>()
+ private val subscriptionModel =
+ MutableStateFlow(
+ SubscriptionModel(
+ subscriptionId = SUB_ID,
+ carrierName = DEFAULT_NAME,
+ )
+ )
+
private lateinit var mobileRepo: FakeMobileConnectionRepository
private lateinit var carrierMergedRepo: FakeMobileConnectionRepository
@Before
fun setUp() {
- mobileRepo = FakeMobileConnectionRepository(SUB_ID, tableLogBuffer)
+ mobileRepo =
+ FakeMobileConnectionRepository(
+ SUB_ID,
+ tableLogBuffer,
+ )
carrierMergedRepo =
- FakeMobileConnectionRepository(SUB_ID, tableLogBuffer).apply {
- // Mimicks the real carrier merged repository
- this.isAllowedDuringAirplaneMode.value = true
- }
+ FakeMobileConnectionRepository(
+ SUB_ID,
+ tableLogBuffer,
+ )
+ .apply {
+ // Mimicks the real carrier merged repository
+ this.isAllowedDuringAirplaneMode.value = true
+ }
whenever(
mobileFactory.build(
eq(SUB_ID),
any(),
- eq(DEFAULT_NAME),
+ any(),
+ eq(DEFAULT_NAME_MODEL),
eq(SEP),
)
)
.thenReturn(mobileRepo)
- whenever(carrierMergedFactory.build(eq(SUB_ID), any())).thenReturn(carrierMergedRepo)
+ whenever(
+ carrierMergedFactory.build(
+ eq(SUB_ID),
+ any(),
+ )
+ )
+ .thenReturn(carrierMergedRepo)
}
@Test
@@ -120,7 +145,8 @@
.build(
SUB_ID,
tableLogBuffer,
- DEFAULT_NAME,
+ subscriptionModel,
+ DEFAULT_NAME_MODEL,
SEP,
)
}
@@ -138,7 +164,11 @@
assertThat(underTest.activeRepo.value).isEqualTo(mobileRepo)
assertThat(underTest.operatorAlphaShort.value).isEqualTo(nonCarrierMergedName)
- verify(carrierMergedFactory, never()).build(SUB_ID, tableLogBuffer)
+ verify(carrierMergedFactory, never())
+ .build(
+ SUB_ID,
+ tableLogBuffer,
+ )
}
@Test
@@ -348,7 +378,8 @@
factory.build(
SUB_ID,
startingIsCarrierMerged = false,
- DEFAULT_NAME,
+ subscriptionModel,
+ DEFAULT_NAME_MODEL,
SEP,
)
@@ -356,7 +387,8 @@
factory.build(
SUB_ID,
startingIsCarrierMerged = false,
- DEFAULT_NAME,
+ subscriptionModel,
+ DEFAULT_NAME_MODEL,
SEP,
)
@@ -388,7 +420,8 @@
factory.build(
SUB_ID,
startingIsCarrierMerged = false,
- DEFAULT_NAME,
+ subscriptionModel,
+ DEFAULT_NAME_MODEL,
SEP,
)
@@ -397,7 +430,8 @@
factory.build(
SUB_ID,
startingIsCarrierMerged = true,
- DEFAULT_NAME,
+ subscriptionModel,
+ DEFAULT_NAME_MODEL,
SEP,
)
@@ -623,7 +657,8 @@
SUB_ID,
startingIsCarrierMerged,
tableLogBuffer,
- DEFAULT_NAME,
+ subscriptionModel,
+ DEFAULT_NAME_MODEL,
SEP,
testScope.backgroundScope,
mobileFactory,
@@ -639,8 +674,9 @@
val realRepo =
MobileConnectionRepositoryImpl(
SUB_ID,
- defaultNetworkName = NetworkNameModel.Default("default"),
- networkNameSeparator = SEP,
+ subscriptionModel,
+ DEFAULT_NAME_MODEL,
+ SEP,
telephonyManager,
systemUiCarrierConfig = mock(),
fakeBroadcastDispatcher,
@@ -654,7 +690,8 @@
mobileFactory.build(
eq(SUB_ID),
any(),
- eq(DEFAULT_NAME),
+ any(),
+ eq(DEFAULT_NAME_MODEL),
eq(SEP),
)
)
@@ -677,7 +714,13 @@
testScope.backgroundScope,
wifiRepository,
)
- whenever(carrierMergedFactory.build(eq(SUB_ID), any())).thenReturn(realRepo)
+ whenever(
+ carrierMergedFactory.build(
+ eq(SUB_ID),
+ any(),
+ )
+ )
+ .thenReturn(realRepo)
return realRepo
}
@@ -690,7 +733,8 @@
private companion object {
const val SUB_ID = 42
- private val DEFAULT_NAME = NetworkNameModel.Default("default name")
+ private val DEFAULT_NAME = "default name"
+ private val DEFAULT_NAME_MODEL = NetworkNameModel.Default(DEFAULT_NAME)
private const val SEP = "-"
private const val BUFFER_SEPARATOR = "|"
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryTest.kt
index 1ff737b..e50e5e3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionRepositoryTest.kt
@@ -62,6 +62,7 @@
import com.android.systemui.statusbar.pipeline.mobile.data.model.ResolvedNetworkType.DefaultNetworkType
import com.android.systemui.statusbar.pipeline.mobile.data.model.ResolvedNetworkType.OverrideNetworkType
import com.android.systemui.statusbar.pipeline.mobile.data.model.ResolvedNetworkType.UnknownNetworkType
+import com.android.systemui.statusbar.pipeline.mobile.data.model.SubscriptionModel
import com.android.systemui.statusbar.pipeline.mobile.data.model.SystemUiCarrierConfig
import com.android.systemui.statusbar.pipeline.mobile.data.model.SystemUiCarrierConfigTest.Companion.configWithOverride
import com.android.systemui.statusbar.pipeline.mobile.data.model.SystemUiCarrierConfigTest.Companion.createTestConfig
@@ -78,6 +79,7 @@
import com.android.systemui.util.mockito.whenever
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.test.TestScope
@@ -109,6 +111,14 @@
private val testDispatcher = UnconfinedTestDispatcher()
private val testScope = TestScope(testDispatcher)
+ private val subscriptionModel: MutableStateFlow<SubscriptionModel?> =
+ MutableStateFlow(
+ SubscriptionModel(
+ subscriptionId = SUB_1_ID,
+ carrierName = DEFAULT_NAME,
+ )
+ )
+
@Before
fun setUp() {
MockitoAnnotations.initMocks(this)
@@ -119,7 +129,8 @@
underTest =
MobileConnectionRepositoryImpl(
SUB_1_ID,
- DEFAULT_NAME,
+ subscriptionModel,
+ DEFAULT_NAME_MODEL,
SEP,
telephonyManager,
systemUiCarrierConfig,
@@ -179,6 +190,7 @@
// gsmLevel updates, no change to cdmaLevel
strength = signalStrength(gsmLevel = 3, cdmaLevel = 2, isGsm = true)
+ callback.onSignalStrengthsChanged(strength)
assertThat(latest).isEqualTo(2)
@@ -638,12 +650,51 @@
}
@Test
+ fun networkNameForSubId_updates() =
+ testScope.runTest {
+ var latest: NetworkNameModel? = null
+ val job = underTest.carrierName.onEach { latest = it }.launchIn(this)
+
+ subscriptionModel.value =
+ SubscriptionModel(
+ subscriptionId = SUB_1_ID,
+ carrierName = DEFAULT_NAME,
+ )
+
+ assertThat(latest?.name).isEqualTo(DEFAULT_NAME)
+
+ val updatedName = "Derived Carrier"
+ subscriptionModel.value =
+ SubscriptionModel(
+ subscriptionId = SUB_1_ID,
+ carrierName = updatedName,
+ )
+
+ assertThat(latest?.name).isEqualTo(updatedName)
+
+ job.cancel()
+ }
+
+ @Test
+ fun networkNameForSubId_defaultWhenSubscriptionModelNull() =
+ testScope.runTest {
+ var latest: NetworkNameModel? = null
+ val job = underTest.carrierName.onEach { latest = it }.launchIn(this)
+
+ subscriptionModel.value = null
+
+ assertThat(latest?.name).isEqualTo(DEFAULT_NAME)
+
+ job.cancel()
+ }
+
+ @Test
fun networkName_default() =
testScope.runTest {
var latest: NetworkNameModel? = null
val job = underTest.networkName.onEach { latest = it }.launchIn(this)
- assertThat(latest).isEqualTo(DEFAULT_NAME)
+ assertThat(latest).isEqualTo(DEFAULT_NAME_MODEL)
job.cancel()
}
@@ -701,7 +752,7 @@
fakeBroadcastDispatcher.sendIntentToMatchingReceiversOnly(context, intentWithoutInfo)
- assertThat(latest).isEqualTo(DEFAULT_NAME)
+ assertThat(latest).isEqualTo(DEFAULT_NAME_MODEL)
job.cancel()
}
@@ -852,8 +903,9 @@
companion object {
private const val SUB_1_ID = 1
- private val DEFAULT_NAME = NetworkNameModel.Default("default name")
- private const val SEP = "-"
+ private val DEFAULT_NAME = "Fake Mobile Network"
+ private val DEFAULT_NAME_MODEL = NetworkNameModel.Default(DEFAULT_NAME)
+ private val SEP = "-"
private const val SPN = "testSpn"
private const val PLMN = "testPlmn"
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionTelephonySmokeTests.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionTelephonySmokeTests.kt
index 4f15aed..ea60aa7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionTelephonySmokeTests.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionTelephonySmokeTests.kt
@@ -36,6 +36,7 @@
import com.android.systemui.statusbar.pipeline.mobile.data.model.DataConnectionState
import com.android.systemui.statusbar.pipeline.mobile.data.model.NetworkNameModel
import com.android.systemui.statusbar.pipeline.mobile.data.model.ResolvedNetworkType
+import com.android.systemui.statusbar.pipeline.mobile.data.model.SubscriptionModel
import com.android.systemui.statusbar.pipeline.mobile.data.model.SystemUiCarrierConfig
import com.android.systemui.statusbar.pipeline.mobile.data.model.SystemUiCarrierConfigTest
import com.android.systemui.statusbar.pipeline.mobile.data.repository.FakeMobileConnectionsRepository
@@ -47,6 +48,7 @@
import com.android.systemui.util.mockito.whenever
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.test.TestScope
@@ -97,6 +99,7 @@
@Mock private lateinit var telephonyManager: TelephonyManager
@Mock private lateinit var logger: MobileInputLogger
@Mock private lateinit var tableLogger: TableLogBuffer
+ @Mock private lateinit var subscriptionModel: StateFlow<SubscriptionModel?>
private val mobileMappings = FakeMobileMappingsProxy()
private val systemUiCarrierConfig =
@@ -113,11 +116,16 @@
MockitoAnnotations.initMocks(this)
whenever(telephonyManager.subscriptionId).thenReturn(SUB_1_ID)
- connectionsRepo = FakeMobileConnectionsRepository(mobileMappings, tableLogger)
+ connectionsRepo =
+ FakeMobileConnectionsRepository(
+ mobileMappings,
+ tableLogger,
+ )
underTest =
MobileConnectionRepositoryImpl(
SUB_1_ID,
+ subscriptionModel,
DEFAULT_NAME,
SEP,
telephonyManager,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryTest.kt
index c8b6f13d..fd05cc4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryTest.kt
@@ -1190,30 +1190,36 @@
companion object {
// Subscription 1
private const val SUB_1_ID = 1
+ private const val SUB_1_NAME = "Carrier $SUB_1_ID"
private val GROUP_1 = ParcelUuid(UUID.randomUUID())
private val SUB_1 =
mock<SubscriptionInfo>().also {
whenever(it.subscriptionId).thenReturn(SUB_1_ID)
whenever(it.groupUuid).thenReturn(GROUP_1)
+ whenever(it.carrierName).thenReturn(SUB_1_NAME)
}
private val MODEL_1 =
SubscriptionModel(
subscriptionId = SUB_1_ID,
groupUuid = GROUP_1,
+ carrierName = SUB_1_NAME,
)
// Subscription 2
private const val SUB_2_ID = 2
+ private const val SUB_2_NAME = "Carrier $SUB_2_ID"
private val GROUP_2 = ParcelUuid(UUID.randomUUID())
private val SUB_2 =
mock<SubscriptionInfo>().also {
whenever(it.subscriptionId).thenReturn(SUB_2_ID)
whenever(it.groupUuid).thenReturn(GROUP_2)
+ whenever(it.carrierName).thenReturn(SUB_2_NAME)
}
private val MODEL_2 =
SubscriptionModel(
subscriptionId = SUB_2_ID,
groupUuid = GROUP_2,
+ carrierName = SUB_2_NAME,
)
// Subs 3 and 4 are considered to be in the same group ------------------------------------
@@ -1242,9 +1248,14 @@
// Carrier merged subscription
private const val SUB_CM_ID = 5
+ private const val SUB_CM_NAME = "Carrier $SUB_CM_ID"
private val SUB_CM =
- mock<SubscriptionInfo>().also { whenever(it.subscriptionId).thenReturn(SUB_CM_ID) }
- private val MODEL_CM = SubscriptionModel(subscriptionId = SUB_CM_ID)
+ mock<SubscriptionInfo>().also {
+ whenever(it.subscriptionId).thenReturn(SUB_CM_ID)
+ whenever(it.carrierName).thenReturn(SUB_CM_NAME)
+ }
+ private val MODEL_CM =
+ SubscriptionModel(subscriptionId = SUB_CM_ID, carrierName = SUB_CM_NAME)
private val WIFI_INFO_CM =
mock<WifiInfo>().apply {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/FakeMobileIconInteractor.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/FakeMobileIconInteractor.kt
index 8d1da69..a3df785 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/FakeMobileIconInteractor.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/FakeMobileIconInteractor.kt
@@ -44,6 +44,8 @@
override val mobileIsDefault = MutableStateFlow(true)
+ override val isSingleCarrier = MutableStateFlow(true)
+
override val networkTypeIconGroup =
MutableStateFlow<NetworkTypeIconModel>(
NetworkTypeIconModel.DefaultIcon(TelephonyIcons.THREE_G)
@@ -51,6 +53,8 @@
override val networkName = MutableStateFlow(NetworkNameModel.IntentDerived("demo mode"))
+ override val carrierName = MutableStateFlow("demo mode")
+
private val _isEmergencyOnly = MutableStateFlow(false)
override val isEmergencyOnly = _isEmergencyOnly
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/FakeMobileIconsInteractor.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/FakeMobileIconsInteractor.kt
index b2bbcfd..82b7ec4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/FakeMobileIconsInteractor.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/FakeMobileIconsInteractor.kt
@@ -64,6 +64,8 @@
override val mobileIsDefault = MutableStateFlow(false)
+ override val isSingleCarrier = MutableStateFlow(true)
+
private val _defaultMobileIconMapping = MutableStateFlow(TEST_MAPPING)
override val defaultMobileIconMapping = _defaultMobileIconMapping
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconInteractorTest.kt
index 58d3804..e3c59ad 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconInteractorTest.kt
@@ -29,6 +29,7 @@
import com.android.systemui.statusbar.pipeline.mobile.data.model.ResolvedNetworkType.CarrierMergedNetworkType
import com.android.systemui.statusbar.pipeline.mobile.data.model.ResolvedNetworkType.DefaultNetworkType
import com.android.systemui.statusbar.pipeline.mobile.data.model.ResolvedNetworkType.OverrideNetworkType
+import com.android.systemui.statusbar.pipeline.mobile.data.model.SubscriptionModel
import com.android.systemui.statusbar.pipeline.mobile.data.repository.FakeMobileConnectionRepository
import com.android.systemui.statusbar.pipeline.mobile.domain.interactor.FakeMobileIconsInteractor.Companion.FIVE_G_OVERRIDE
import com.android.systemui.statusbar.pipeline.mobile.domain.interactor.FakeMobileIconsInteractor.Companion.FOUR_G
@@ -40,6 +41,7 @@
import com.android.systemui.util.mockito.whenever
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.test.TestScope
@@ -56,6 +58,15 @@
private lateinit var underTest: MobileIconInteractor
private val mobileMappingsProxy = FakeMobileMappingsProxy()
private val mobileIconsInteractor = FakeMobileIconsInteractor(mobileMappingsProxy, mock())
+
+ private val subscriptionModel =
+ MutableStateFlow(
+ SubscriptionModel(
+ subscriptionId = SUB_1_ID,
+ carrierName = DEFAULT_NAME,
+ )
+ )
+
private val connectionRepository = FakeMobileConnectionRepository(SUB_1_ID, mock())
private val testDispatcher = UnconfinedTestDispatcher()
@@ -432,7 +443,7 @@
}
@Test
- fun networkName_usesOperatorAlphaShotWhenNonNullAndRepoIsDefault() =
+ fun networkName_usesOperatorAlphaShortWhenNonNullAndRepoIsDefault() =
testScope.runTest {
var latest: NetworkNameModel? = null
val job = underTest.networkName.onEach { latest = it }.launchIn(this)
@@ -440,7 +451,7 @@
val testOperatorName = "operatorAlphaShort"
// Default network name, operator name is non-null, uses the operator name
- connectionRepository.networkName.value = DEFAULT_NAME
+ connectionRepository.networkName.value = DEFAULT_NAME_MODEL
connectionRepository.operatorAlphaShort.value = testOperatorName
assertThat(latest).isEqualTo(NetworkNameModel.IntentDerived(testOperatorName))
@@ -448,10 +459,39 @@
// Default network name, operator name is null, uses the default
connectionRepository.operatorAlphaShort.value = null
+ assertThat(latest).isEqualTo(DEFAULT_NAME_MODEL)
+
+ // Derived network name, operator name non-null, uses the derived name
+ connectionRepository.networkName.value = DERIVED_NAME_MODEL
+ connectionRepository.operatorAlphaShort.value = testOperatorName
+
+ assertThat(latest).isEqualTo(DERIVED_NAME_MODEL)
+
+ job.cancel()
+ }
+
+ @Test
+ fun networkNameForSubId_usesOperatorAlphaShortWhenNonNullAndRepoIsDefault() =
+ testScope.runTest {
+ var latest: String? = null
+ val job = underTest.carrierName.onEach { latest = it }.launchIn(this)
+
+ val testOperatorName = "operatorAlphaShort"
+
+ // Default network name, operator name is non-null, uses the operator name
+ connectionRepository.carrierName.value = DEFAULT_NAME_MODEL
+ connectionRepository.operatorAlphaShort.value = testOperatorName
+
+ assertThat(latest).isEqualTo(testOperatorName)
+
+ // Default network name, operator name is null, uses the default
+ connectionRepository.operatorAlphaShort.value = null
+
assertThat(latest).isEqualTo(DEFAULT_NAME)
// Derived network name, operator name non-null, uses the derived name
- connectionRepository.networkName.value = DERIVED_NAME
+ connectionRepository.carrierName.value =
+ NetworkNameModel.SubscriptionDerived(DERIVED_NAME)
connectionRepository.operatorAlphaShort.value = testOperatorName
assertThat(latest).isEqualTo(DERIVED_NAME)
@@ -460,6 +500,21 @@
}
@Test
+ fun isSingleCarrier_matchesParent() =
+ testScope.runTest {
+ var latest: Boolean? = null
+ val job = underTest.isSingleCarrier.onEach { latest = it }.launchIn(this)
+
+ mobileIconsInteractor.isSingleCarrier.value = true
+ assertThat(latest).isTrue()
+
+ mobileIconsInteractor.isSingleCarrier.value = false
+ assertThat(latest).isFalse()
+
+ job.cancel()
+ }
+
+ @Test
fun isForceHidden_matchesParent() =
testScope.runTest {
var latest: Boolean? = null
@@ -494,6 +549,7 @@
mobileIconsInteractor.activeDataConnectionHasDataEnabled,
mobileIconsInteractor.alwaysShowDataRatIcon,
mobileIconsInteractor.alwaysUseCdmaLevel,
+ mobileIconsInteractor.isSingleCarrier,
mobileIconsInteractor.mobileIsDefault,
mobileIconsInteractor.defaultMobileIconMapping,
mobileIconsInteractor.defaultMobileIconGroup,
@@ -510,7 +566,9 @@
private const val SUB_1_ID = 1
- private val DEFAULT_NAME = NetworkNameModel.Default("test default name")
- private val DERIVED_NAME = NetworkNameModel.IntentDerived("test derived name")
+ private val DEFAULT_NAME = "test default name"
+ private val DEFAULT_NAME_MODEL = NetworkNameModel.Default(DEFAULT_NAME)
+ private val DERIVED_NAME = "test derived name"
+ private val DERIVED_NAME_MODEL = NetworkNameModel.IntentDerived(DERIVED_NAME)
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractorTest.kt
index 1fb76b0..3e6f909 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/domain/interactor/MobileIconsInteractorTest.kt
@@ -527,6 +527,57 @@
}
@Test
+ fun isSingleCarrier_zeroSubscriptions_false() =
+ testScope.runTest {
+ var latest: Boolean? = true
+ val job = underTest.isSingleCarrier.onEach { latest = it }.launchIn(this)
+
+ connectionsRepository.setSubscriptions(emptyList())
+ assertThat(latest).isFalse()
+
+ job.cancel()
+ }
+
+ @Test
+ fun isSingleCarrier_oneSubscription_true() =
+ testScope.runTest {
+ var latest: Boolean? = false
+ val job = underTest.isSingleCarrier.onEach { latest = it }.launchIn(this)
+
+ connectionsRepository.setSubscriptions(listOf(SUB_1))
+ assertThat(latest).isTrue()
+
+ job.cancel()
+ }
+
+ @Test
+ fun isSingleCarrier_twoSubscriptions_false() =
+ testScope.runTest {
+ var latest: Boolean? = true
+ val job = underTest.isSingleCarrier.onEach { latest = it }.launchIn(this)
+
+ connectionsRepository.setSubscriptions(listOf(SUB_1, SUB_2))
+ assertThat(latest).isFalse()
+
+ job.cancel()
+ }
+
+ @Test
+ fun isSingleCarrier_updates() =
+ testScope.runTest {
+ var latest: Boolean? = false
+ val job = underTest.isSingleCarrier.onEach { latest = it }.launchIn(this)
+
+ connectionsRepository.setSubscriptions(listOf(SUB_1))
+ assertThat(latest).isTrue()
+
+ connectionsRepository.setSubscriptions(listOf(SUB_1, SUB_2))
+ assertThat(latest).isFalse()
+
+ job.cancel()
+ }
+
+ @Test
fun mobileIsDefault_mobileFalseAndCarrierMergedFalse_false() =
testScope.runTest {
var latest: Boolean? = null
@@ -745,6 +796,7 @@
subscriptionId = subscriptionIds.first,
isOpportunistic = opportunistic.first,
groupUuid = groupUuid,
+ carrierName = "Carrier ${subscriptionIds.first}"
)
val sub2 =
@@ -752,6 +804,7 @@
subscriptionId = subscriptionIds.second,
isOpportunistic = opportunistic.second,
groupUuid = groupUuid,
+ carrierName = "Carrier ${opportunistic.second}"
)
return Pair(sub1, sub2)
@@ -760,11 +813,13 @@
companion object {
private const val SUB_1_ID = 1
- private val SUB_1 = SubscriptionModel(subscriptionId = SUB_1_ID)
+ private val SUB_1 =
+ SubscriptionModel(subscriptionId = SUB_1_ID, carrierName = "Carrier $SUB_1_ID")
private val CONNECTION_1 = FakeMobileConnectionRepository(SUB_1_ID, mock())
private const val SUB_2_ID = 2
- private val SUB_2 = SubscriptionModel(subscriptionId = SUB_2_ID)
+ private val SUB_2 =
+ SubscriptionModel(subscriptionId = SUB_2_ID, carrierName = "Carrier $SUB_2_ID")
private val CONNECTION_2 = FakeMobileConnectionRepository(SUB_2_ID, mock())
private const val SUB_3_ID = 3
@@ -773,6 +828,7 @@
subscriptionId = SUB_3_ID,
isOpportunistic = true,
groupUuid = ParcelUuid(UUID.randomUUID()),
+ carrierName = "Carrier $SUB_3_ID"
)
private val CONNECTION_3 = FakeMobileConnectionRepository(SUB_3_ID, mock())
@@ -782,6 +838,7 @@
subscriptionId = SUB_4_ID,
isOpportunistic = true,
groupUuid = ParcelUuid(UUID.randomUUID()),
+ carrierName = "Carrier $SUB_4_ID"
)
private val CONNECTION_4 = FakeMobileConnectionRepository(SUB_4_ID, mock())
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconsViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconsViewModelTest.kt
index f0458fa..065dfba 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconsViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/ui/viewmodel/MobileIconsViewModelTest.kt
@@ -92,15 +92,31 @@
interactor.filteredSubscriptions.value =
listOf(
- SubscriptionModel(subscriptionId = 1, isOpportunistic = false),
+ SubscriptionModel(
+ subscriptionId = 1,
+ isOpportunistic = false,
+ carrierName = "Carrier 1",
+ ),
)
assertThat(latest).isEqualTo(listOf(1))
interactor.filteredSubscriptions.value =
listOf(
- SubscriptionModel(subscriptionId = 2, isOpportunistic = false),
- SubscriptionModel(subscriptionId = 5, isOpportunistic = true),
- SubscriptionModel(subscriptionId = 7, isOpportunistic = true),
+ SubscriptionModel(
+ subscriptionId = 2,
+ isOpportunistic = false,
+ carrierName = "Carrier 2",
+ ),
+ SubscriptionModel(
+ subscriptionId = 5,
+ isOpportunistic = true,
+ carrierName = "Carrier 5",
+ ),
+ SubscriptionModel(
+ subscriptionId = 7,
+ isOpportunistic = true,
+ carrierName = "Carrier 7",
+ ),
)
assertThat(latest).isEqualTo(listOf(2, 5, 7))
@@ -138,6 +154,33 @@
}
@Test
+ fun caching_mobileIconInteractorIsReusedForSameSubId() =
+ testScope.runTest {
+ val interactor1 = underTest.mobileIconInteractorForSub(1)
+ val interactor2 = underTest.mobileIconInteractorForSub(1)
+
+ assertThat(interactor1).isSameInstanceAs(interactor2)
+ }
+
+ @Test
+ fun caching_invalidInteractorssAreRemovedFromCacheWhenSubDisappears() =
+ testScope.runTest {
+ // Retrieve interactors to trigger caching
+ val interactor1 = underTest.mobileIconInteractorForSub(1)
+ val interactor2 = underTest.mobileIconInteractorForSub(2)
+
+ // Both impls are cached
+ assertThat(underTest.mobileIconInteractorSubIdCache)
+ .containsExactly(1, interactor1, 2, interactor2)
+
+ // SUB_1 is removed from the list...
+ interactor.filteredSubscriptions.value = listOf(SUB_2)
+
+ // ... and dropped from the cache
+ assertThat(underTest.mobileIconInteractorSubIdCache).containsExactly(2, interactor2)
+ }
+
+ @Test
fun firstMobileSubShowingNetworkTypeIcon_noSubs_false() =
testScope.runTest {
var latest: Boolean? = null
@@ -308,8 +351,23 @@
}
companion object {
- private val SUB_1 = SubscriptionModel(subscriptionId = 1, isOpportunistic = false)
- private val SUB_2 = SubscriptionModel(subscriptionId = 2, isOpportunistic = false)
- private val SUB_3 = SubscriptionModel(subscriptionId = 3, isOpportunistic = false)
+ private val SUB_1 =
+ SubscriptionModel(
+ subscriptionId = 1,
+ isOpportunistic = false,
+ carrierName = "Carrier 1",
+ )
+ private val SUB_2 =
+ SubscriptionModel(
+ subscriptionId = 2,
+ isOpportunistic = false,
+ carrierName = "Carrier 2",
+ )
+ private val SUB_3 =
+ SubscriptionModel(
+ subscriptionId = 3,
+ isOpportunistic = false,
+ carrierName = "Carrier 3",
+ )
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/InflatedSmartRepliesTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/InflatedSmartRepliesTest.java
index 85052e6..e431865 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/InflatedSmartRepliesTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/InflatedSmartRepliesTest.java
@@ -64,7 +64,7 @@
public class InflatedSmartRepliesTest extends SysuiTestCase {
private static final Intent TEST_INTENT = new Intent("com.android.SMART_REPLY_VIEW_ACTION");
- private static final Intent WHITELISTED_TEST_INTENT =
+ private static final Intent ALLOWLISTED_TEST_INTENT =
new Intent("com.android.WHITELISTED_TEST_ACTION");
@Mock private SmartReplyConstants mSmartReplyConstants;
@@ -343,7 +343,7 @@
assertThat(smartReplyState.getSmartReplies().choices)
.containsExactlyElementsIn(mEntry.getSmartReplies()).inOrder();
- // Since no apps are whitelisted no actions should be shown.
+ // Since no apps are allowlisted no actions should be shown.
assertThat(smartReplyState.getSmartActions().actions).isEmpty();
assertThat(smartReplyState.getSuppressedActions()).isNull();
assertThat(smartReplyState.getHasPhishingAction()).isFalse();
@@ -358,7 +358,7 @@
allowedResolveInfo.activityInfo.packageName = allowedPackage;
when(mPackageManagerWrapper
.resolveActivity(
- argThat(intent -> WHITELISTED_TEST_INTENT.getAction().equals(
+ argThat(intent -> ALLOWLISTED_TEST_INTENT.getAction().equals(
intent.getAction())),
anyInt() /* flags */))
.thenReturn(allowedResolveInfo);
@@ -368,7 +368,7 @@
// suggestions.
setupAppGeneratedReplies(null /* smartReplies */);
ArrayList<Notification.Action> actions = new ArrayList<>();
- actions.add(createAction("allowed action", WHITELISTED_TEST_INTENT));
+ actions.add(createAction("allowed action", ALLOWLISTED_TEST_INTENT));
actions.add(createAction("non-allowed action", TEST_INTENT));
modifyRanking(mEntry)
@@ -379,7 +379,7 @@
InflatedSmartReplyState smartReplyState =
mSmartReplyStateInflater.chooseSmartRepliesAndActions(mEntry);
- // Only the action for the whitelisted package should be allowed.
+ // Only the action for the allowlisted package should be allowed.
assertThat(smartReplyState.getSmartActions().actions)
.containsExactly(mEntry.getSmartActions().get(0));
assertThat(smartReplyState.getSuppressedActions()).isNull();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java
index ef39ff8..79feb41 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/RemoteInputViewTest.java
@@ -82,7 +82,7 @@
import org.junit.After;
import org.junit.Before;
-import org.junit.ClassRule;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
@@ -111,8 +111,8 @@
private BlockingQueueIntentReceiver mReceiver;
private final UiEventLoggerFake mUiEventLoggerFake = new UiEventLoggerFake();
- @ClassRule
- public static AnimatorTestRule mAnimatorTestRule = new AnimatorTestRule();
+ @Rule
+ public final AnimatorTestRule mAnimatorTestRule = new AnimatorTestRule();
@Before
public void setUp() throws Exception {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/VariableDateViewControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/VariableDateViewControllerTest.kt
index b698e70..b78e839 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/VariableDateViewControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/VariableDateViewControllerTest.kt
@@ -26,6 +26,7 @@
import com.android.systemui.shade.ShadeExpansionStateManager
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.capture
+import com.android.systemui.util.mockito.mock
import com.android.systemui.util.time.FakeSystemClock
import com.google.common.truth.Truth.assertThat
import org.junit.Before
@@ -105,6 +106,7 @@
systemClock,
broadcastDispatcher,
shadeExpansionStateManager,
+ mock(),
testableHandler,
view
)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogControllerImplTest.java
index 462fd0a..69d7586 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogControllerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogControllerImplTest.java
@@ -104,8 +104,6 @@
private UserTracker mUserTracker;
@Mock
private DumpManager mDumpManager;
- @Mock
- private Handler mHandler;
@Before
@@ -130,7 +128,7 @@
mBroadcastDispatcher, mRingerModeTracker, mThreadFactory, mAudioManager,
mNotificationManager, mVibrator, mIAudioService, mAccessibilityManager,
mPackageManager, mWakefullnessLifcycle, mKeyguardManager,
- mActivityManager, mUserTracker, mDumpManager, mHandler, mCallback);
+ mActivityManager, mUserTracker, mDumpManager, mCallback);
mVolumeController.setEnableDialogs(true, true);
}
@@ -245,12 +243,11 @@
ActivityManager activityManager,
UserTracker userTracker,
DumpManager dumpManager,
- Handler mainHandler,
C callback) {
super(context, broadcastDispatcher, ringerModeTracker, theadFactory, audioManager,
notificationManager, optionalVibrator, iAudioService, accessibilityManager,
packageManager, wakefulnessLifecycle, keyguardManager,
- activityManager, userTracker, dumpManager, mainHandler);
+ activityManager, userTracker, dumpManager);
mCallbacks = callback;
ArgumentCaptor<WakefulnessLifecycle.Observer> observerCaptor =
diff --git a/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogImplTest.java
index fa18e57..c12df98 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/volume/VolumeDialogImplTest.java
@@ -31,14 +31,13 @@
import static org.junit.Assume.assumeNotNull;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.mock;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.animation.AnimatorTestRule;
import android.app.KeyguardManager;
import android.content.res.Configuration;
import android.media.AudioManager;
@@ -85,14 +84,14 @@
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
public class VolumeDialogImplTest extends SysuiTestCase {
- private static final AnimatorTestRule sAnimatorTestRule = new AnimatorTestRule();
-
VolumeDialogImpl mDialog;
View mActiveRinger;
View mDrawerContainer;
View mDrawerVibrate;
View mDrawerMute;
View mDrawerNormal;
+ CaptionsToggleImageButton mODICaptionsIcon;
+
private TestableLooper mTestableLooper;
private ConfigurationController mConfigurationController;
private int mOriginalOrientation;
@@ -177,9 +176,14 @@
mActiveRinger = mDialog.getDialogView().findViewById(
R.id.volume_new_ringer_active_icon_container);
mDrawerContainer = mDialog.getDialogView().findViewById(R.id.volume_drawer_container);
- mDrawerVibrate = mDrawerContainer.findViewById(R.id.volume_drawer_vibrate);
- mDrawerMute = mDrawerContainer.findViewById(R.id.volume_drawer_mute);
- mDrawerNormal = mDrawerContainer.findViewById(R.id.volume_drawer_normal);
+
+ // Drawer is not always available, e.g. on TVs
+ if (mDrawerContainer != null) {
+ mDrawerVibrate = mDrawerContainer.findViewById(R.id.volume_drawer_vibrate);
+ mDrawerMute = mDrawerContainer.findViewById(R.id.volume_drawer_mute);
+ mDrawerNormal = mDrawerContainer.findViewById(R.id.volume_drawer_normal);
+ }
+ mODICaptionsIcon = mDialog.getDialogView().findViewById(R.id.odi_captions_icon);
Prefs.putInt(mContext,
Prefs.Key.SEEN_RINGER_GUIDANCE_COUNT,
@@ -188,6 +192,10 @@
Prefs.putBoolean(mContext, Prefs.Key.HAS_SEEN_ODI_CAPTIONS_TOOLTIP, false);
}
+ private void assumeHasDrawer() {
+ assumeNotNull("Layout does not contain drawer", mDrawerContainer);
+ }
+
private State createShellState() {
State state = new VolumeDialogController.State();
for (int i = AudioManager.STREAM_VOICE_CALL; i <= AudioManager.STREAM_ACCESSIBILITY; i++) {
@@ -359,6 +367,8 @@
@Test
public void testSelectVibrateFromDrawer() {
+ assumeHasDrawer();
+
mFeatureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, false);
final State initialUnsetState = new State();
initialUnsetState.ringerModeInternal = AudioManager.RINGER_MODE_NORMAL;
@@ -374,6 +384,8 @@
@Test
public void testSelectVibrateFromDrawer_OnewayAPI_On() {
+ assumeHasDrawer();
+
mFeatureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, true);
final State initialUnsetState = new State();
initialUnsetState.ringerModeInternal = RINGER_MODE_NORMAL;
@@ -389,6 +401,8 @@
@Test
public void testSelectMuteFromDrawer() {
+ assumeHasDrawer();
+
mFeatureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, false);
final State initialUnsetState = new State();
initialUnsetState.ringerModeInternal = AudioManager.RINGER_MODE_NORMAL;
@@ -404,6 +418,8 @@
@Test
public void testSelectMuteFromDrawer_OnewayAPI_On() {
+ assumeHasDrawer();
+
mFeatureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, true);
final State initialUnsetState = new State();
initialUnsetState.ringerModeInternal = RINGER_MODE_NORMAL;
@@ -419,6 +435,8 @@
@Test
public void testSelectNormalFromDrawer() {
+ assumeHasDrawer();
+
mFeatureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, false);
final State initialUnsetState = new State();
initialUnsetState.ringerModeInternal = AudioManager.RINGER_MODE_VIBRATE;
@@ -434,6 +452,8 @@
@Test
public void testSelectNormalFromDrawer_OnewayAPI_On() {
+ assumeHasDrawer();
+
mFeatureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, true);
final State initialUnsetState = new State();
initialUnsetState.ringerModeInternal = AudioManager.RINGER_MODE_VIBRATE;
@@ -479,123 +499,45 @@
@Test
public void ifPortraitHalfOpen_drawVerticallyTop() {
- DevicePostureController devicePostureController = mock(DevicePostureController.class);
- when(devicePostureController.getDevicePosture())
- .thenReturn(DevicePostureController.DEVICE_POSTURE_CLOSED);
-
- VolumeDialogImpl dialog = new VolumeDialogImpl(
- getContext(),
- mVolumeDialogController,
- mAccessibilityMgr,
- mDeviceProvisionedController,
- mConfigurationController,
- mMediaOutputDialogFactory,
- mVolumePanelFactory,
- mActivityStarter,
- mInteractionJankMonitor,
- false,
- mCsdWarningDialogFactory,
- devicePostureController,
- mTestableLooper.getLooper(),
- mDumpManager,
- mFeatureFlags
- );
- dialog.init(0 , null);
-
- verify(devicePostureController).addCallback(any());
- dialog.onPostureChanged(DevicePostureController.DEVICE_POSTURE_HALF_OPENED);
+ mDialog.onPostureChanged(DevicePostureController.DEVICE_POSTURE_HALF_OPENED);
mTestableLooper.processAllMessages(); // let dismiss() finish
setOrientation(Configuration.ORIENTATION_PORTRAIT);
// Call show() to trigger layout updates before verifying position
- dialog.show(SHOW_REASON_UNKNOWN);
+ mDialog.show(SHOW_REASON_UNKNOWN);
mTestableLooper.processAllMessages(); // let show() finish before assessing its side-effect
- int gravity = dialog.getWindowGravity();
+ int gravity = mDialog.getWindowGravity();
assertEquals(Gravity.TOP, gravity & Gravity.VERTICAL_GRAVITY_MASK);
-
- cleanUp(dialog);
}
@Test
public void ifPortraitAndOpen_drawCenterVertically() {
- DevicePostureController devicePostureController = mock(DevicePostureController.class);
- when(devicePostureController.getDevicePosture())
- .thenReturn(DevicePostureController.DEVICE_POSTURE_CLOSED);
-
- VolumeDialogImpl dialog = new VolumeDialogImpl(
- getContext(),
- mVolumeDialogController,
- mAccessibilityMgr,
- mDeviceProvisionedController,
- mConfigurationController,
- mMediaOutputDialogFactory,
- mVolumePanelFactory,
- mActivityStarter,
- mInteractionJankMonitor,
- false,
- mCsdWarningDialogFactory,
- devicePostureController,
- mTestableLooper.getLooper(),
- mDumpManager,
- mFeatureFlags
- );
- dialog.init(0, null);
-
- verify(devicePostureController).addCallback(any());
- dialog.onPostureChanged(DevicePostureController.DEVICE_POSTURE_OPENED);
+ mDialog.onPostureChanged(DevicePostureController.DEVICE_POSTURE_OPENED);
mTestableLooper.processAllMessages(); // let dismiss() finish
setOrientation(Configuration.ORIENTATION_PORTRAIT);
- dialog.show(SHOW_REASON_UNKNOWN);
+ mDialog.show(SHOW_REASON_UNKNOWN);
mTestableLooper.processAllMessages(); // let show() finish before assessing its side-effect
- int gravity = dialog.getWindowGravity();
+ int gravity = mDialog.getWindowGravity();
assertEquals(Gravity.CENTER_VERTICAL, gravity & Gravity.VERTICAL_GRAVITY_MASK);
-
- cleanUp(dialog);
}
@Test
public void ifLandscapeAndHalfOpen_drawCenterVertically() {
- DevicePostureController devicePostureController = mock(DevicePostureController.class);
- when(devicePostureController.getDevicePosture())
- .thenReturn(DevicePostureController.DEVICE_POSTURE_CLOSED);
-
- VolumeDialogImpl dialog = new VolumeDialogImpl(
- getContext(),
- mVolumeDialogController,
- mAccessibilityMgr,
- mDeviceProvisionedController,
- mConfigurationController,
- mMediaOutputDialogFactory,
- mVolumePanelFactory,
- mActivityStarter,
- mInteractionJankMonitor,
- false,
- mCsdWarningDialogFactory,
- devicePostureController,
- mTestableLooper.getLooper(),
- mDumpManager,
- mFeatureFlags
- );
- dialog.init(0, null);
-
- verify(devicePostureController).addCallback(any());
- dialog.onPostureChanged(DevicePostureController.DEVICE_POSTURE_HALF_OPENED);
+ mDialog.onPostureChanged(DevicePostureController.DEVICE_POSTURE_HALF_OPENED);
mTestableLooper.processAllMessages(); // let dismiss() finish
setOrientation(Configuration.ORIENTATION_LANDSCAPE);
- dialog.show(SHOW_REASON_UNKNOWN);
+ mDialog.show(SHOW_REASON_UNKNOWN);
mTestableLooper.processAllMessages(); // let show() finish before assessing its side-effect
- int gravity = dialog.getWindowGravity();
+ int gravity = mDialog.getWindowGravity();
assertEquals(Gravity.CENTER_VERTICAL, gravity & Gravity.VERTICAL_GRAVITY_MASK);
-
- cleanUp(dialog);
}
@Test
@@ -606,31 +548,9 @@
@Test
public void dialogDestroy_removesPostureControllerCallback() {
- VolumeDialogImpl dialog = new VolumeDialogImpl(
- getContext(),
- mVolumeDialogController,
- mAccessibilityMgr,
- mDeviceProvisionedController,
- mConfigurationController,
- mMediaOutputDialogFactory,
- mVolumePanelFactory,
- mActivityStarter,
- mInteractionJankMonitor,
- false,
- mCsdWarningDialogFactory,
- mPostureController,
- mTestableLooper.getLooper(),
- mDumpManager,
- mFeatureFlags
- );
- dialog.init(0, null);
-
verify(mPostureController, never()).removeCallback(any());
- dialog.destroy();
-
+ mDialog.destroy();
verify(mPostureController).removeCallback(any());
-
- cleanUp(dialog);
}
private void setOrientation(int orientation) {
@@ -688,11 +608,35 @@
assertRingerContainerDescribesItsState(RINGER_MODE_VIBRATE, RingerDrawerState.CLOSE);
}
+ @Test
+ public void testOnCaptionEnabledStateChanged_checkBeforeSwitchTrue_setCaptionsEnabledState() {
+ ArgumentCaptor<VolumeDialogController.Callbacks> controllerCallbackCapture =
+ ArgumentCaptor.forClass(VolumeDialogController.Callbacks.class);
+ verify(mVolumeDialogController).addCallback(controllerCallbackCapture.capture(), any());
+ VolumeDialogController.Callbacks callbacks = controllerCallbackCapture.getValue();
+
+ callbacks.onCaptionEnabledStateChanged(true, true);
+ verify(mVolumeDialogController).setCaptionsEnabledState(eq(false));
+ }
+
+ @Test
+ public void testOnCaptionEnabledStateChanged_checkBeforeSwitchFalse_getCaptionsEnabledTrue() {
+ ArgumentCaptor<VolumeDialogController.Callbacks> controllerCallbackCapture =
+ ArgumentCaptor.forClass(VolumeDialogController.Callbacks.class);
+ verify(mVolumeDialogController).addCallback(controllerCallbackCapture.capture(), any());
+ VolumeDialogController.Callbacks callbacks = controllerCallbackCapture.getValue();
+
+ callbacks.onCaptionEnabledStateChanged(true, false);
+ assertTrue(mODICaptionsIcon.getCaptionsEnabled());
+ }
+
/**
* The content description should include ringer state, and the correct one.
*/
private void assertRingerContainerDescribesItsState(int ringerMode,
RingerDrawerState drawerState) {
+ assumeHasDrawer();
+
State state = createShellState();
state.ringerModeInternal = ringerMode;
mFeatureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, true);
@@ -727,7 +671,6 @@
public void teardown() {
cleanUp(mDialog);
setOrientation(mOriginalOrientation);
- sAnimatorTestRule.advanceTimeBy(mLongestHideShowAnimationDuration);
mTestableLooper.moveTimeForward(mLongestHideShowAnimationDuration);
mTestableLooper.processAllMessages();
reset(mPostureController);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/wallpapers/WallpaperLocalColorExtractorTest.java b/packages/SystemUI/tests/src/com/android/systemui/wallpapers/WallpaperLocalColorExtractorTest.java
index fc5f782..1125d41 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/wallpapers/WallpaperLocalColorExtractorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/wallpapers/WallpaperLocalColorExtractorTest.java
@@ -109,6 +109,7 @@
WallpaperLocalColorExtractor colorExtractor = new WallpaperLocalColorExtractor(
mBackgroundExecutor,
+ new Object(),
new WallpaperLocalColorExtractor.WallpaperLocalColorExtractorCallback() {
@Override
public void onColorsProcessed(List<RectF> regions,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubbleEducationControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubbleEducationControllerTest.kt
new file mode 100644
index 0000000..94ed608
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubbleEducationControllerTest.kt
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.wmshell
+
+import android.content.ContentResolver
+import android.content.Context
+import android.content.SharedPreferences
+import android.testing.AndroidTestingRunner
+import android.testing.TestableLooper
+import androidx.test.filters.SmallTest
+import com.android.systemui.model.SysUiStateTest
+import com.android.wm.shell.bubbles.Bubble
+import com.android.wm.shell.bubbles.BubbleEducationController
+import com.android.wm.shell.bubbles.PREF_MANAGED_EDUCATION
+import com.android.wm.shell.bubbles.PREF_STACK_EDUCATION
+import org.junit.Assert.assertEquals
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentMatchers.anyBoolean
+import org.mockito.ArgumentMatchers.anyInt
+import org.mockito.ArgumentMatchers.anyString
+import org.mockito.Mockito
+
+@SmallTest
+@RunWith(AndroidTestingRunner::class)
+@TestableLooper.RunWithLooper(setAsMainLooper = true)
+class BubbleEducationControllerTest : SysUiStateTest() {
+ private val sharedPrefsEditor = Mockito.mock(SharedPreferences.Editor::class.java)
+ private val sharedPrefs = Mockito.mock(SharedPreferences::class.java)
+ private val context = Mockito.mock(Context::class.java)
+ private lateinit var sut: BubbleEducationController
+
+ @Before
+ fun setUp() {
+ Mockito.`when`(context.packageName).thenReturn("packageName")
+ Mockito.`when`(context.getSharedPreferences(anyString(), anyInt())).thenReturn(sharedPrefs)
+ Mockito.`when`(context.contentResolver)
+ .thenReturn(Mockito.mock(ContentResolver::class.java))
+ Mockito.`when`(sharedPrefs.edit()).thenReturn(sharedPrefsEditor)
+ sut = BubbleEducationController(context)
+ }
+
+ @Test
+ fun testSeenStackEducation_read() {
+ Mockito.`when`(sharedPrefs.getBoolean(anyString(), anyBoolean())).thenReturn(true)
+ assertEquals(sut.hasSeenStackEducation, true)
+ Mockito.verify(sharedPrefs).getBoolean(PREF_STACK_EDUCATION, false)
+ }
+
+ @Test
+ fun testSeenStackEducation_write() {
+ sut.hasSeenStackEducation = true
+ Mockito.verify(sharedPrefsEditor).putBoolean(PREF_STACK_EDUCATION, true)
+ }
+
+ @Test
+ fun testSeenManageEducation_read() {
+ Mockito.`when`(sharedPrefs.getBoolean(anyString(), anyBoolean())).thenReturn(true)
+ assertEquals(sut.hasSeenManageEducation, true)
+ Mockito.verify(sharedPrefs).getBoolean(PREF_MANAGED_EDUCATION, false)
+ }
+
+ @Test
+ fun testSeenManageEducation_write() {
+ sut.hasSeenManageEducation = true
+ Mockito.verify(sharedPrefsEditor).putBoolean(PREF_MANAGED_EDUCATION, true)
+ }
+
+ @Test
+ fun testShouldShowStackEducation() {
+ val bubble = Mockito.mock(Bubble::class.java)
+ // When bubble is null
+ assertEquals(sut.shouldShowStackEducation(null), false)
+ // When bubble is not conversation
+ Mockito.`when`(bubble.isConversation).thenReturn(false)
+ assertEquals(sut.shouldShowStackEducation(bubble), false)
+ // When bubble is conversation and has seen stack edu
+ Mockito.`when`(bubble.isConversation).thenReturn(true)
+ Mockito.`when`(sharedPrefs.getBoolean(anyString(), anyBoolean())).thenReturn(true)
+ assertEquals(sut.shouldShowStackEducation(bubble), false)
+ // When bubble is conversation and has not seen stack edu
+ Mockito.`when`(bubble.isConversation).thenReturn(true)
+ Mockito.`when`(sharedPrefs.getBoolean(anyString(), anyBoolean())).thenReturn(false)
+ assertEquals(sut.shouldShowStackEducation(bubble), true)
+ }
+
+ @Test
+ fun testShouldShowManageEducation() {
+ val bubble = Mockito.mock(Bubble::class.java)
+ // When bubble is null
+ assertEquals(sut.shouldShowManageEducation(null), false)
+ // When bubble is not conversation
+ Mockito.`when`(bubble.isConversation).thenReturn(false)
+ assertEquals(sut.shouldShowManageEducation(bubble), false)
+ // When bubble is conversation and has seen stack edu
+ Mockito.`when`(bubble.isConversation).thenReturn(true)
+ Mockito.`when`(sharedPrefs.getBoolean(anyString(), anyBoolean())).thenReturn(true)
+ assertEquals(sut.shouldShowManageEducation(bubble), false)
+ // When bubble is conversation and has not seen stack edu
+ Mockito.`when`(bubble.isConversation).thenReturn(true)
+ Mockito.`when`(sharedPrefs.getBoolean(anyString(), anyBoolean())).thenReturn(false)
+ assertEquals(sut.shouldShowManageEducation(bubble), true)
+ }
+}
diff --git a/packages/SystemUI/tests/utils/src/android/animation/AnimatorTestRule.java b/packages/SystemUI/tests/utils/src/android/animation/AnimatorTestRule.java
index 19c68e8..41dbc14 100644
--- a/packages/SystemUI/tests/utils/src/android/animation/AnimatorTestRule.java
+++ b/packages/SystemUI/tests/utils/src/android/animation/AnimatorTestRule.java
@@ -49,7 +49,7 @@
* public class SampleAnimatorTest {
*
* {@literal @}Rule
- * public AnimatorTestRule sAnimatorTestRule = new AnimatorTestRule();
+ * public final AnimatorTestRule mAnimatorTestRule = new AnimatorTestRule();
*
* {@literal @}UiThreadTest
* {@literal @}Test
@@ -58,7 +58,7 @@
* animator.setDuration(1000L);
* assertThat(animator.getAnimatedValue(), is(0));
* animator.start();
- * sAnimatorTestRule.advanceTimeBy(500L);
+ * mAnimatorTestRule.advanceTimeBy(500L);
* assertThat(animator.getAnimatedValue(), is(500));
* }
* }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/flags/FakeFeatureFlags.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/flags/FakeFeatureFlags.kt
index 013dbb4..43c9c99 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/flags/FakeFeatureFlags.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/flags/FakeFeatureFlags.kt
@@ -18,7 +18,17 @@
import java.io.PrintWriter
-class FakeFeatureFlags : FeatureFlags {
+class FakeFeatureFlagsClassic : FakeFeatureFlags()
+
+@Deprecated(
+ message = "Use FakeFeatureFlagsClassic instead.",
+ replaceWith =
+ ReplaceWith(
+ "FakeFeatureFlagsClassic",
+ "com.android.systemui.flags.FakeFeatureFlagsClassic",
+ ),
+)
+open class FakeFeatureFlags : FeatureFlagsClassic {
private val booleanFlags = mutableMapOf<String, Boolean>()
private val stringFlags = mutableMapOf<String, String>()
private val intFlags = mutableMapOf<String, Int>()
@@ -66,12 +76,11 @@
* Set the given flag's default value if no other value has been set.
*
* REMINDER: You should always test your code with your flag in both configurations, so
- * generally you should be setting a particular value. This method should be reserved for
- * situations where the flag needs to be read (e.g. in the class constructor), but its
- * value shouldn't affect the actual test cases. In those cases, it's mildly safer to use
- * this method than to hard-code `false` or `true` because then at least if you're wrong,
- * and the flag value *does* matter, you'll notice when the flag is flipped and tests
- * start failing.
+ * generally you should be setting a particular value. This method should be reserved for
+ * situations where the flag needs to be read (e.g. in the class constructor), but its value
+ * shouldn't affect the actual test cases. In those cases, it's mildly safer to use this method
+ * than to hard-code `false` or `true` because then at least if you're wrong, and the flag value
+ * *does* matter, you'll notice when the flag is flipped and tests start failing.
*/
fun setDefault(flag: BooleanFlag) = booleanFlags.putIfAbsent(flag.name, flag.default)
@@ -79,12 +88,11 @@
* Set the given flag's default value if no other value has been set.
*
* REMINDER: You should always test your code with your flag in both configurations, so
- * generally you should be setting a particular value. This method should be reserved for
- * situations where the flag needs to be read (e.g. in the class constructor), but its
- * value shouldn't affect the actual test cases. In those cases, it's mildly safer to use
- * this method than to hard-code `false` or `true` because then at least if you're wrong,
- * and the flag value *does* matter, you'll notice when the flag is flipped and tests
- * start failing.
+ * generally you should be setting a particular value. This method should be reserved for
+ * situations where the flag needs to be read (e.g. in the class constructor), but its value
+ * shouldn't affect the actual test cases. In those cases, it's mildly safer to use this method
+ * than to hard-code `false` or `true` because then at least if you're wrong, and the flag value
+ * *does* matter, you'll notice when the flag is flipped and tests start failing.
*/
fun setDefault(flag: SysPropBooleanFlag) = booleanFlags.putIfAbsent(flag.name, flag.default)
@@ -123,10 +131,8 @@
}
override fun removeListener(listener: FlagListenable.Listener) {
- listenerflagNames.remove(listener)?.let {
- flagNames -> flagNames.forEach {
- id -> flagListeners[id]?.remove(listener)
- }
+ listenerflagNames.remove(listener)?.let { flagNames ->
+ flagNames.forEach { id -> flagListeners[id]?.remove(listener) }
}
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/data/repository/FakeBiometricSettingsRepository.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/data/repository/FakeBiometricSettingsRepository.kt
index 8c98aea..e91e955 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/data/repository/FakeBiometricSettingsRepository.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/data/repository/FakeBiometricSettingsRepository.kt
@@ -22,32 +22,24 @@
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
-import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.map
class FakeBiometricSettingsRepository : BiometricSettingsRepository {
+ private val _isFingerprintEnrolledAndEnabled = MutableStateFlow(false)
+ override val isFingerprintEnrolledAndEnabled: StateFlow<Boolean>
+ get() = _isFingerprintEnrolledAndEnabled
- private val _isFingerprintEnrolled = MutableStateFlow<Boolean>(false)
- override val isFingerprintEnrolled: StateFlow<Boolean> = _isFingerprintEnrolled.asStateFlow()
+ private val _isFingerprintAuthCurrentlyAllowed = MutableStateFlow(false)
+ override val isFingerprintAuthCurrentlyAllowed: StateFlow<Boolean>
+ get() = _isFingerprintAuthCurrentlyAllowed
- private val _isFaceEnrolled = MutableStateFlow(false)
- override val isFaceEnrolled: Flow<Boolean>
- get() = _isFaceEnrolled
+ private val _isFaceAuthEnrolledAndEnabled = MutableStateFlow(false)
+ override val isFaceAuthEnrolledAndEnabled: Flow<Boolean>
+ get() = _isFaceAuthEnrolledAndEnabled
- private val _isFaceAuthEnabled = MutableStateFlow(false)
- override val isFaceAuthenticationEnabled: Flow<Boolean>
- get() = _isFaceAuthEnabled
-
- private val _isStrongBiometricAllowed = MutableStateFlow(false)
- override val isStrongBiometricAllowed = _isStrongBiometricAllowed.asStateFlow()
-
- private val _isNonStrongBiometricAllowed = MutableStateFlow(false)
- override val isNonStrongBiometricAllowed: StateFlow<Boolean>
- get() = _isNonStrongBiometricAllowed
-
- private val _isFingerprintEnabledByDevicePolicy = MutableStateFlow(false)
- override val isFingerprintEnabledByDevicePolicy =
- _isFingerprintEnabledByDevicePolicy.asStateFlow()
+ private val _isFaceAuthCurrentlyAllowed = MutableStateFlow(false)
+ override val isFaceAuthCurrentlyAllowed: Flow<Boolean>
+ get() = _isFaceAuthCurrentlyAllowed
private val _isFaceAuthSupportedInCurrentPosture = MutableStateFlow(false)
override val isFaceAuthSupportedInCurrentPosture: Flow<Boolean>
@@ -59,34 +51,33 @@
private val _authFlags = MutableStateFlow(AuthenticationFlags(0, 0))
override val authenticationFlags: Flow<AuthenticationFlags>
get() = _authFlags
- fun setFingerprintEnrolled(isFingerprintEnrolled: Boolean) {
- _isFingerprintEnrolled.value = isFingerprintEnrolled
- }
-
- fun setStrongBiometricAllowed(isStrongBiometricAllowed: Boolean) {
- _isStrongBiometricAllowed.value = isStrongBiometricAllowed
- }
-
- fun setFingerprintEnabledByDevicePolicy(isFingerprintEnabledByDevicePolicy: Boolean) {
- _isFingerprintEnabledByDevicePolicy.value = isFingerprintEnabledByDevicePolicy
- }
fun setAuthenticationFlags(value: AuthenticationFlags) {
_authFlags.value = value
}
- fun setFaceEnrolled(isFaceEnrolled: Boolean) {
- _isFaceEnrolled.value = isFaceEnrolled
+ fun setIsFingerprintAuthEnrolledAndEnabled(value: Boolean) {
+ _isFingerprintEnrolledAndEnabled.value = value
+ _isFingerprintAuthCurrentlyAllowed.value = _isFingerprintAuthCurrentlyAllowed.value && value
+ }
+
+ fun setIsFingerprintAuthCurrentlyAllowed(value: Boolean) {
+ _isFingerprintAuthCurrentlyAllowed.value = value
+ }
+
+ fun setIsFaceAuthEnrolledAndEnabled(value: Boolean) {
+ _isFaceAuthEnrolledAndEnabled.value = value
+ _isFaceAuthCurrentlyAllowed.value = _isFaceAuthCurrentlyAllowed.value && value
+ }
+
+ fun setIsFaceAuthCurrentlyAllowed(value: Boolean) {
+ _isFaceAuthCurrentlyAllowed.value = value
}
fun setIsFaceAuthSupportedInCurrentPosture(value: Boolean) {
_isFaceAuthSupportedInCurrentPosture.value = value
}
- fun setIsFaceAuthEnabled(enabled: Boolean) {
- _isFaceAuthEnabled.value = enabled
- }
-
fun setIsUserInLockdown(value: Boolean) {
if (value) {
setAuthenticationFlags(
@@ -105,12 +96,4 @@
)
}
}
-
- fun setIsNonStrongBiometricAllowed(value: Boolean) {
- _isNonStrongBiometricAllowed.value = value
- }
-
- fun setIsStrongBiometricAllowed(value: Boolean) {
- _isStrongBiometricAllowed.value = value
- }
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/scene/SceneTestUtils.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/scene/SceneTestUtils.kt
index dd45331..f0e1111 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/scene/SceneTestUtils.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/scene/SceneTestUtils.kt
@@ -39,8 +39,6 @@
import com.android.systemui.keyguard.shared.model.WakefulnessState
import com.android.systemui.scene.data.repository.SceneContainerRepository
import com.android.systemui.scene.domain.interactor.SceneInteractor
-import com.android.systemui.scene.shared.model.RemoteUserInput
-import com.android.systemui.scene.shared.model.RemoteUserInputAction
import com.android.systemui.scene.shared.model.SceneContainerConfig
import com.android.systemui.scene.shared.model.SceneKey
import com.android.systemui.user.data.repository.FakeUserRepository
@@ -196,15 +194,6 @@
}
companion object {
- val REMOTE_INPUT_DOWN_GESTURE =
- listOf(
- RemoteUserInput(10f, 10f, RemoteUserInputAction.DOWN),
- RemoteUserInput(10f, 20f, RemoteUserInputAction.MOVE),
- RemoteUserInput(10f, 30f, RemoteUserInputAction.MOVE),
- RemoteUserInput(10f, 40f, RemoteUserInputAction.MOVE),
- RemoteUserInput(10f, 40f, RemoteUserInputAction.UP),
- )
-
fun DomainLayerAuthenticationMethodModel.toDataLayer(): DataLayerAuthenticationMethodModel {
return when (this) {
DomainLayerAuthenticationMethodModel.None -> DataLayerAuthenticationMethodModel.None
diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
index 819f8a1..7e09b5e 100644
--- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
+++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
@@ -3958,14 +3958,14 @@
mContext.enforceCallingOrSelfPermission(
android.Manifest.permission.BIND_APPWIDGET, null);
} catch (SecurityException se) {
- if (!isCallerBindAppWidgetWhiteListedLocked(packageName)) {
+ if (!isCallerBindAppWidgetAllowListedLocked(packageName)) {
return false;
}
}
return true;
}
- private boolean isCallerBindAppWidgetWhiteListedLocked(String packageName) {
+ private boolean isCallerBindAppWidgetAllowListedLocked(String packageName) {
final int userId = UserHandle.getCallingUserId();
final int packageUid = getUidForPackage(packageName, userId);
if (packageUid < 0) {
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
index 63a607c..5b8bdd5 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
@@ -1413,7 +1413,7 @@
Slog.v(TAG, "setAugmentedAutofillWhitelistLocked(packages=" + packages + ", activities="
+ activities + ")");
}
- whitelistForAugmentedAutofillPackages(packages, activities);
+ allowlistForAugmentedAutofillPackages(packages, activities);
final String serviceName;
if (mRemoteAugmentedAutofillServiceInfo != null) {
serviceName = mRemoteAugmentedAutofillServiceInfo.getComponentName()
@@ -1477,7 +1477,7 @@
/**
* @throws IllegalArgumentException if packages or components are empty.
*/
- private void whitelistForAugmentedAutofillPackages(@Nullable List<String> packages,
+ private void allowlistForAugmentedAutofillPackages(@Nullable List<String> packages,
@Nullable List<ComponentName> components) {
// TODO(b/123100824): add CTS test for when it's null
synchronized (mLock) {
diff --git a/services/autofill/java/com/android/server/autofill/InlineSuggestionRendorInfoCallbackOnResultListener.java b/services/autofill/java/com/android/server/autofill/InlineSuggestionRendorInfoCallbackOnResultListener.java
new file mode 100644
index 0000000..7351ef5
--- /dev/null
+++ b/services/autofill/java/com/android/server/autofill/InlineSuggestionRendorInfoCallbackOnResultListener.java
@@ -0,0 +1,65 @@
+/*
+ * 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.server.autofill;
+
+import android.annotation.Nullable;
+import android.os.Bundle;
+import android.os.RemoteCallback;
+import android.util.Slog;
+import android.view.autofill.AutofillId;
+import android.view.inputmethod.InlineSuggestionsRequest;
+
+import java.lang.ref.WeakReference;
+import java.util.function.Consumer;
+
+final class InlineSuggestionRendorInfoCallbackOnResultListener implements
+ RemoteCallback.OnResultListener{
+ private static final String TAG = "InlineSuggestionRendorInfoCallbackOnResultListener";
+
+ private final int mRequestIdCopy;
+ private final AutofillId mFocusedId;
+ private final WeakReference<Session> mSessionWeakReference;
+ private final Consumer<InlineSuggestionsRequest> mInlineSuggestionsRequestConsumer;
+
+ InlineSuggestionRendorInfoCallbackOnResultListener(WeakReference<Session> sessionWeakReference,
+ int requestIdCopy,
+ Consumer<InlineSuggestionsRequest> inlineSuggestionsRequestConsumer,
+ AutofillId focusedId) {
+ this.mRequestIdCopy = requestIdCopy;
+ this.mInlineSuggestionsRequestConsumer = inlineSuggestionsRequestConsumer;
+ this.mSessionWeakReference = sessionWeakReference;
+ this.mFocusedId = focusedId;
+ }
+ public void onResult(@Nullable Bundle result) {
+ Session session = this.mSessionWeakReference.get();
+ if (session == null) {
+ Slog.wtf(TAG, "Session is null before trying to call onResult");
+ return;
+ }
+ synchronized (session.mLock) {
+ if (session.mDestroyed) {
+ Slog.wtf(TAG, "Session is destroyed before trying to call onResult");
+ return;
+ }
+ session.mInlineSessionController.onCreateInlineSuggestionsRequestLocked(
+ this.mFocusedId,
+ session.inlineSuggestionsRequestCacheDecorator(
+ this.mInlineSuggestionsRequestConsumer, this.mRequestIdCopy),
+ result);
+ }
+ }
+}
diff --git a/services/autofill/java/com/android/server/autofill/InlineSuggestionRequestConsumer.java b/services/autofill/java/com/android/server/autofill/InlineSuggestionRequestConsumer.java
new file mode 100644
index 0000000..a3efb25
--- /dev/null
+++ b/services/autofill/java/com/android/server/autofill/InlineSuggestionRequestConsumer.java
@@ -0,0 +1,55 @@
+/*
+ * 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.server.autofill;
+
+import android.util.Slog;
+import android.view.inputmethod.InlineSuggestionsRequest;
+
+import java.lang.ref.WeakReference;
+import java.util.function.Consumer;
+
+class InlineSuggestionRequestConsumer implements Consumer<InlineSuggestionsRequest> {
+
+ static final String TAG = "InlineSuggestionRequestConsumer";
+
+ private final WeakReference<Session.AssistDataReceiverImpl> mAssistDataReceiverWeakReference;
+ private final WeakReference<ViewState> mViewStateWeakReference;
+
+ InlineSuggestionRequestConsumer(WeakReference<Session.AssistDataReceiverImpl>
+ assistDataReceiverWeakReference,
+ WeakReference<ViewState> viewStateWeakReference) {
+ mAssistDataReceiverWeakReference = assistDataReceiverWeakReference;
+ mViewStateWeakReference = viewStateWeakReference;
+ }
+
+ @Override
+ public void accept(InlineSuggestionsRequest inlineSuggestionsRequest) {
+ Session.AssistDataReceiverImpl assistDataReceiver = mAssistDataReceiverWeakReference.get();
+ ViewState viewState = mViewStateWeakReference.get();
+ if (assistDataReceiver == null) {
+ Slog.wtf(TAG, "assistDataReceiver is null when accepting new inline suggestion"
+ + "requests");
+ return;
+ }
+
+ if (viewState == null) {
+ Slog.wtf(TAG, "view state is null when accepting new inline suggestion requests");
+ return;
+ }
+ assistDataReceiver.handleInlineSuggestionRequest(inlineSuggestionsRequest, viewState);
+ }
+}
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index 1827a5b..1ae9125 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -326,7 +326,7 @@
* Id of the View currently being displayed.
*/
@GuardedBy("mLock")
- @Nullable private AutofillId mCurrentViewId;
+ private @Nullable AutofillId mCurrentViewId;
@GuardedBy("mLock")
private IAutoFillManagerClient mClient;
@@ -374,7 +374,7 @@
private Bundle mClientState;
@GuardedBy("mLock")
- private boolean mDestroyed;
+ boolean mDestroyed;
/**
* Helper used to handle state of Save UI when it must be hiding to show a custom description
@@ -453,7 +453,7 @@
private ArrayList<AutofillId> mAugmentedAutofillableIds;
@NonNull
- private final AutofillInlineSessionController mInlineSessionController;
+ final AutofillInlineSessionController mInlineSessionController;
/**
* Receiver of assist data from the app's {@link Activity}.
@@ -623,7 +623,7 @@
* TODO(b/151867668): improve how asynchronous data dependencies are handled, without using
* CountDownLatch.
*/
- private final class AssistDataReceiverImpl extends IAssistDataReceiver.Stub {
+ final class AssistDataReceiverImpl extends IAssistDataReceiver.Stub {
@GuardedBy("mLock")
private boolean mWaitForInlineRequest;
@GuardedBy("mLock")
@@ -638,18 +638,28 @@
mPendingFillRequest = null;
mWaitForInlineRequest = isInlineRequest;
mPendingInlineSuggestionsRequest = null;
- return isInlineRequest ? (inlineSuggestionsRequest) -> {
- synchronized (mLock) {
- if (!mWaitForInlineRequest || mPendingInlineSuggestionsRequest != null) {
- return;
- }
- mWaitForInlineRequest = inlineSuggestionsRequest != null;
- mPendingInlineSuggestionsRequest = inlineSuggestionsRequest;
- mWaitForInlineRequest = inlineSuggestionsRequest != null;
- maybeRequestFillFromServiceLocked();
- viewState.resetState(ViewState.STATE_PENDING_CREATE_INLINE_REQUEST);
+ if (isInlineRequest) {
+ WeakReference<AssistDataReceiverImpl> assistDataReceiverWeakReference =
+ new WeakReference<AssistDataReceiverImpl>(this);
+ WeakReference<ViewState> viewStateWeakReference =
+ new WeakReference<ViewState>(viewState);
+ return new InlineSuggestionRequestConsumer(assistDataReceiverWeakReference,
+ viewStateWeakReference);
+ }
+ return null;
+ }
+
+ void handleInlineSuggestionRequest(InlineSuggestionsRequest inlineSuggestionsRequest,
+ ViewState viewState) {
+ synchronized (mLock) {
+ if (!mWaitForInlineRequest || mPendingInlineSuggestionsRequest != null) {
+ return;
}
- } : null;
+ mWaitForInlineRequest = inlineSuggestionsRequest != null;
+ mPendingInlineSuggestionsRequest = inlineSuggestionsRequest;
+ maybeRequestFillFromServiceLocked();
+ viewState.resetState(ViewState.STATE_PENDING_CREATE_INLINE_REQUEST);
+ }
}
void newAutofillRequestLocked(@Nullable InlineSuggestionsRequest inlineRequest) {
@@ -1276,18 +1286,22 @@
viewState, /* isInlineRequest= */ true);
}
if (inlineSuggestionsRequestConsumer != null) {
- final AutofillId focusedId = mCurrentViewId;
final int requestIdCopy = requestId;
+ final AutofillId focusedId = mCurrentViewId;
+
+ WeakReference sessionWeakReference = new WeakReference<Session>(this);
+ InlineSuggestionRendorInfoCallbackOnResultListener
+ inlineSuggestionRendorInfoCallbackOnResultListener =
+ new InlineSuggestionRendorInfoCallbackOnResultListener(
+ sessionWeakReference,
+ requestIdCopy,
+ inlineSuggestionsRequestConsumer,
+ focusedId);
+ RemoteCallback inlineSuggestionRendorInfoCallback = new RemoteCallback(
+ inlineSuggestionRendorInfoCallbackOnResultListener, mHandler);
+
remoteRenderService.getInlineSuggestionsRendererInfo(
- new RemoteCallback((extras) -> {
- synchronized (mLock) {
- mInlineSessionController.onCreateInlineSuggestionsRequestLocked(
- focusedId, inlineSuggestionsRequestCacheDecorator(
- inlineSuggestionsRequestConsumer, requestIdCopy),
- extras);
- }
- }, mHandler)
- );
+ inlineSuggestionRendorInfoCallback);
viewState.setState(ViewState.STATE_PENDING_CREATE_INLINE_REQUEST);
}
} else if (mSessionFlags.mClientSuggestionsEnabled) {
@@ -5554,7 +5568,7 @@
}
@NonNull
- private Consumer<InlineSuggestionsRequest> inlineSuggestionsRequestCacheDecorator(
+ Consumer<InlineSuggestionsRequest> inlineSuggestionsRequestCacheDecorator(
@NonNull Consumer<InlineSuggestionsRequest> consumer, int requestId) {
return inlineSuggestionsRequest -> {
consumer.accept(inlineSuggestionsRequest);
diff --git a/services/backup/java/com/android/server/backup/UserBackupManagerService.java b/services/backup/java/com/android/server/backup/UserBackupManagerService.java
index b6baf7e..b573800 100644
--- a/services/backup/java/com/android/server/backup/UserBackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/UserBackupManagerService.java
@@ -133,7 +133,8 @@
import com.android.server.backup.transport.TransportNotAvailableException;
import com.android.server.backup.transport.TransportNotRegisteredException;
import com.android.server.backup.utils.BackupEligibilityRules;
-import com.android.server.backup.utils.BackupManagerMonitorUtils;
+import com.android.server.backup.utils.BackupManagerMonitorDumpsysUtils;
+import com.android.server.backup.utils.BackupManagerMonitorEventSender;
import com.android.server.backup.utils.BackupObserverUtils;
import com.android.server.backup.utils.SparseArrayUtils;
@@ -142,6 +143,7 @@
import com.google.android.collect.Sets;
import java.io.BufferedInputStream;
+import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -150,6 +152,7 @@
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
+import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.RandomAccessFile;
@@ -1834,12 +1837,14 @@
*/
public int requestBackup(String[] packages, IBackupObserver observer,
IBackupManagerMonitor monitor, int flags) {
+ BackupManagerMonitorEventSender mBackupManagerMonitorEventSender =
+ getBMMEventSender(monitor);
mContext.enforceCallingPermission(android.Manifest.permission.BACKUP, "requestBackup");
if (packages == null || packages.length < 1) {
Slog.e(TAG, addUserIdToLogMessage(mUserId, "No packages named for backup request"));
BackupObserverUtils.sendBackupFinished(observer, BackupManager.ERROR_TRANSPORT_ABORTED);
- monitor = BackupManagerMonitorUtils.monitorEvent(monitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_NO_PACKAGES,
null, BackupManagerMonitor.LOG_EVENT_CATEGORY_TRANSPORT, null);
throw new IllegalArgumentException("No packages are provided for backup");
@@ -1857,7 +1862,7 @@
final int logTag = mSetupComplete
? BackupManagerMonitor.LOG_EVENT_ID_BACKUP_DISABLED
: BackupManagerMonitor.LOG_EVENT_ID_DEVICE_NOT_PROVISIONED;
- monitor = BackupManagerMonitorUtils.monitorEvent(monitor, logTag, null,
+ mBackupManagerMonitorEventSender.monitorEvent(logTag, null,
BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY, null);
return BackupManager.ERROR_BACKUP_NOT_ALLOWED;
}
@@ -1875,7 +1880,7 @@
} catch (TransportNotRegisteredException | TransportNotAvailableException
| RemoteException e) {
BackupObserverUtils.sendBackupFinished(observer, BackupManager.ERROR_TRANSPORT_ABORTED);
- monitor = BackupManagerMonitorUtils.monitorEvent(monitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_TRANSPORT_IS_NULL,
null, BackupManagerMonitor.LOG_EVENT_CATEGORY_TRANSPORT, null);
return BackupManager.ERROR_TRANSPORT_ABORTED;
@@ -3070,7 +3075,9 @@
/* caller */ "BMS.reportDelayedRestoreResult");
IBackupManagerMonitor monitor = transportClient.getBackupManagerMonitor();
- BackupManagerMonitorUtils.sendAgentLoggingResults(monitor, packageInfo, results,
+ BackupManagerMonitorEventSender mBackupManagerMonitorEventSender =
+ getBMMEventSender(monitor);
+ mBackupManagerMonitorEventSender.sendAgentLoggingResults(packageInfo, results,
BackupAnnotations.OperationType.RESTORE);
} catch (NameNotFoundException | TransportNotAvailableException
| TransportNotRegisteredException | RemoteException e) {
@@ -3194,6 +3201,11 @@
}
}
+ @VisibleForTesting
+ BackupManagerMonitorEventSender getBMMEventSender(IBackupManagerMonitor monitor) {
+ return new BackupManagerMonitorEventSender(monitor);
+ }
+
/** User-configurable enabling/disabling of backups. */
public void setBackupEnabled(boolean enable) {
setBackupEnabled(enable, /* persistToDisk */ true);
@@ -4152,6 +4164,7 @@
}
}
dumpInternal(pw);
+ dumpBMMEvents(pw);
} finally {
Binder.restoreCallingIdentity(identityToken);
}
@@ -4169,6 +4182,23 @@
}
}
+ private void dumpBMMEvents(PrintWriter pw) {
+ BackupManagerMonitorDumpsysUtils bm =
+ new BackupManagerMonitorDumpsysUtils();
+ File events = bm.getBMMEventsFile();
+ pw.println("START OF BACKUP MANAGER MONITOR EVENTS");
+ try (BufferedReader reader = new BufferedReader(new FileReader(events))) {
+ String line;
+ while ((line = reader.readLine()) != null) {
+ pw.println(line);
+ }
+ } catch (IOException e) {
+ Slog.e(TAG, "IO Exception when reading BMM events from file: " + e);
+ pw.println("IO Exception when reading BMM events from file");
+ }
+ pw.println("END OF BACKUP MANAGER MONITOR EVENTS");
+ }
+
@NeverCompile // Avoid size overhead of debugging code.
private void dumpInternal(PrintWriter pw) {
// Add prefix for only non-system users so that system user dumpsys is the same as before
diff --git a/services/backup/java/com/android/server/backup/fullbackup/FullBackupEngine.java b/services/backup/java/com/android/server/backup/fullbackup/FullBackupEngine.java
index ad29422..1271206 100644
--- a/services/backup/java/com/android/server/backup/fullbackup/FullBackupEngine.java
+++ b/services/backup/java/com/android/server/backup/fullbackup/FullBackupEngine.java
@@ -23,13 +23,11 @@
import static com.android.server.backup.UserBackupManagerService.BACKUP_METADATA_FILENAME;
import static com.android.server.backup.UserBackupManagerService.SHARED_BACKUP_AGENT_PACKAGE;
-import android.annotation.Nullable;
import android.annotation.UserIdInt;
import android.app.ApplicationThreadConstants;
import android.app.IBackupAgent;
import android.app.backup.BackupTransport;
import android.app.backup.FullBackupDataOutput;
-import android.app.backup.IBackupManagerMonitor;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
@@ -44,7 +42,7 @@
import com.android.server.backup.UserBackupManagerService;
import com.android.server.backup.remote.RemoteCall;
import com.android.server.backup.utils.BackupEligibilityRules;
-import com.android.server.backup.utils.BackupManagerMonitorUtils;
+import com.android.server.backup.utils.BackupManagerMonitorEventSender;
import com.android.server.backup.utils.FullBackupUtils;
import java.io.File;
@@ -69,7 +67,7 @@
private final int mTransportFlags;
private final BackupAgentTimeoutParameters mAgentTimeoutParameters;
private final BackupEligibilityRules mBackupEligibilityRules;
- @Nullable private final IBackupManagerMonitor mMonitor;
+ private final BackupManagerMonitorEventSender mBackupManagerMonitorEventSender;
class FullBackupRunner implements Runnable {
private final @UserIdInt int mUserId;
@@ -198,7 +196,7 @@
int opToken,
int transportFlags,
BackupEligibilityRules backupEligibilityRules,
- IBackupManagerMonitor monitor) {
+ BackupManagerMonitorEventSender backupManagerMonitorEventSender) {
this.backupManagerService = backupManagerService;
mOutput = output;
mPreflightHook = preflightHook;
@@ -213,7 +211,7 @@
backupManagerService.getAgentTimeoutParameters(),
"Timeout parameters cannot be null");
mBackupEligibilityRules = backupEligibilityRules;
- mMonitor = monitor;
+ mBackupManagerMonitorEventSender = backupManagerMonitorEventSender;
}
public int preflightCheck() throws RemoteException {
@@ -270,7 +268,7 @@
result = BackupTransport.TRANSPORT_OK;
}
- BackupManagerMonitorUtils.monitorAgentLoggingResults(mMonitor, mPkg, mAgent);
+ mBackupManagerMonitorEventSender.monitorAgentLoggingResults(mPkg, mAgent);
} catch (IOException e) {
Slog.e(TAG, "Error backing up " + mPkg.packageName + ": " + e.getMessage());
result = BackupTransport.AGENT_ERROR;
diff --git a/services/backup/java/com/android/server/backup/fullbackup/PerformAdbBackupTask.java b/services/backup/java/com/android/server/backup/fullbackup/PerformAdbBackupTask.java
index cba1e29..dc67091 100644
--- a/services/backup/java/com/android/server/backup/fullbackup/PerformAdbBackupTask.java
+++ b/services/backup/java/com/android/server/backup/fullbackup/PerformAdbBackupTask.java
@@ -40,6 +40,7 @@
import com.android.server.backup.OperationStorage;
import com.android.server.backup.UserBackupManagerService;
import com.android.server.backup.utils.BackupEligibilityRules;
+import com.android.server.backup.utils.BackupManagerMonitorEventSender;
import com.android.server.backup.utils.PasswordUtils;
import java.io.ByteArrayOutputStream;
@@ -421,7 +422,7 @@
mCurrentOpToken,
/*transportFlags=*/ 0,
mBackupEligibilityRules,
- /* monitor= */ null);
+ new BackupManagerMonitorEventSender(null));
sendOnBackupPackage(isSharedStorage ? "Shared storage" : pkg.packageName);
// Don't need to check preflight result as there is no preflight hook.
diff --git a/services/backup/java/com/android/server/backup/fullbackup/PerformFullTransportBackupTask.java b/services/backup/java/com/android/server/backup/fullbackup/PerformFullTransportBackupTask.java
index 162046a..6aed9aa 100644
--- a/services/backup/java/com/android/server/backup/fullbackup/PerformFullTransportBackupTask.java
+++ b/services/backup/java/com/android/server/backup/fullbackup/PerformFullTransportBackupTask.java
@@ -54,7 +54,7 @@
import com.android.server.backup.transport.TransportConnection;
import com.android.server.backup.transport.TransportNotAvailableException;
import com.android.server.backup.utils.BackupEligibilityRules;
-import com.android.server.backup.utils.BackupManagerMonitorUtils;
+import com.android.server.backup.utils.BackupManagerMonitorEventSender;
import com.android.server.backup.utils.BackupObserverUtils;
import com.google.android.collect.Sets;
@@ -153,7 +153,6 @@
CountDownLatch mLatch;
FullBackupJob mJob; // if a scheduled job needs to be finished afterwards
IBackupObserver mBackupObserver;
- @Nullable private IBackupManagerMonitor mMonitor;
boolean mUserInitiated;
SinglePackageBackupRunner mBackupRunner;
private final int mBackupRunnerOpToken;
@@ -167,6 +166,7 @@
private final int mCurrentOpToken;
private final BackupAgentTimeoutParameters mAgentTimeoutParameters;
private final BackupEligibilityRules mBackupEligibilityRules;
+ private BackupManagerMonitorEventSender mBackupManagerMonitorEventSender;
public PerformFullTransportBackupTask(UserBackupManagerService backupManagerService,
OperationStorage operationStorage,
@@ -185,11 +185,12 @@
mJob = runningJob;
mPackages = new ArrayList<>(whichPackages.length);
mBackupObserver = backupObserver;
- mMonitor = monitor;
mListener = (listener != null) ? listener : OnTaskFinishedListener.NOP;
mUserInitiated = userInitiated;
mCurrentOpToken = backupManagerService.generateRandomIntegerToken();
mBackupRunnerOpToken = backupManagerService.generateRandomIntegerToken();
+ mBackupManagerMonitorEventSender =
+ new BackupManagerMonitorEventSender(monitor);
mAgentTimeoutParameters = Objects.requireNonNull(
backupManagerService.getAgentTimeoutParameters(),
"Timeout parameters cannot be null");
@@ -218,7 +219,7 @@
if (MORE_DEBUG) {
Slog.d(TAG, "Ignoring ineligible package " + pkg);
}
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_PACKAGE_INELIGIBLE,
mCurrentPackage,
BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -233,7 +234,7 @@
Slog.d(TAG, "Ignoring full-data backup of key/value participant "
+ pkg);
}
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_PACKAGE_KEY_VALUE_PARTICIPANT,
mCurrentPackage,
BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -248,7 +249,7 @@
if (MORE_DEBUG) {
Slog.d(TAG, "Ignoring stopped package " + pkg);
}
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_PACKAGE_STOPPED,
mCurrentPackage,
BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -260,7 +261,7 @@
mPackages.add(info);
} catch (NameNotFoundException e) {
Slog.i(TAG, "Requested package " + pkg + " not found; ignoring");
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_PACKAGE_NOT_FOUND,
mCurrentPackage,
BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -356,8 +357,8 @@
} else {
monitoringEvent = BackupManagerMonitor.LOG_EVENT_ID_DEVICE_NOT_PROVISIONED;
}
- mMonitor = BackupManagerMonitorUtils
- .monitorEvent(mMonitor, monitoringEvent, null,
+ mBackupManagerMonitorEventSender
+ .monitorEvent(monitoringEvent, null,
BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
null);
mUpdateSchedule = false;
@@ -369,7 +370,7 @@
if (transport == null) {
Slog.w(TAG, "Transport not present; full data backup not performed");
backupRunStatus = BackupManager.ERROR_TRANSPORT_ABORTED;
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_PACKAGE_TRANSPORT_NOT_PRESENT,
mCurrentPackage, BackupManagerMonitor.LOG_EVENT_CATEGORY_TRANSPORT,
null);
@@ -378,9 +379,10 @@
// In some cases there may not be a monitor passed in when creating this task. So, if we
// don't have one already we ask the transport for a monitor.
- if (mMonitor == null) {
+ if (mBackupManagerMonitorEventSender.getMonitor() == null) {
try {
- mMonitor = transport.getBackupManagerMonitor();
+ mBackupManagerMonitorEventSender
+ .setMonitor(transport.getBackupManagerMonitor());
} catch (RemoteException e) {
Slog.i(TAG, "Failed to retrieve monitor from transport");
}
@@ -457,11 +459,11 @@
+ packageName + ": " + preflightResult
+ ", not running backup.");
}
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_ERROR_PREFLIGHT,
mCurrentPackage,
BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
- BackupManagerMonitorUtils.putMonitoringExtra(null,
+ mBackupManagerMonitorEventSender.putMonitoringExtra(null,
BackupManagerMonitor.EXTRA_LOG_PREFLIGHT_ERROR,
preflightResult));
backupPackageStatus = (int) preflightResult;
@@ -492,7 +494,7 @@
if (backupPackageStatus == BackupTransport.TRANSPORT_QUOTA_EXCEEDED) {
Slog.w(TAG, "Package hit quota limit in-flight " + packageName
+ ": " + totalRead + " of " + quota);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_QUOTA_HIT_PREFLIGHT,
mCurrentPackage,
BackupManagerMonitor.LOG_EVENT_CATEGORY_TRANSPORT,
@@ -647,11 +649,11 @@
} catch (Exception e) {
backupRunStatus = BackupManager.ERROR_TRANSPORT_ABORTED;
Slog.w(TAG, "Exception trying full transport backup", e);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_EXCEPTION_FULL_BACKUP,
mCurrentPackage,
BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
- BackupManagerMonitorUtils.putMonitoringExtra(null,
+ mBackupManagerMonitorEventSender.putMonitoringExtra(null,
BackupManagerMonitor.EXTRA_LOG_EXCEPTION_FULL_BACKUP,
Log.getStackTraceString(e)));
@@ -885,7 +887,7 @@
mCurrentOpToken,
mTransportFlags,
mBackupEligibilityRules,
- mMonitor);
+ mBackupManagerMonitorEventSender);
try {
try {
if (!mIsCancelled) {
@@ -967,7 +969,7 @@
Slog.w(TAG, "Full backup cancel of " + mTarget.packageName);
}
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_FULL_BACKUP_CANCEL,
mCurrentPackage, BackupManagerMonitor.LOG_EVENT_CATEGORY_AGENT, null);
mIsCancelled = true;
diff --git a/services/backup/java/com/android/server/backup/keyvalue/KeyValueBackupReporter.java b/services/backup/java/com/android/server/backup/keyvalue/KeyValueBackupReporter.java
index 4632cb0..20c8cf6 100644
--- a/services/backup/java/com/android/server/backup/keyvalue/KeyValueBackupReporter.java
+++ b/services/backup/java/com/android/server/backup/keyvalue/KeyValueBackupReporter.java
@@ -32,7 +32,7 @@
import com.android.server.backup.DataChangedJournal;
import com.android.server.backup.UserBackupManagerService;
import com.android.server.backup.remote.RemoteResult;
-import com.android.server.backup.utils.BackupManagerMonitorUtils;
+import com.android.server.backup.utils.BackupManagerMonitorEventSender;
import com.android.server.backup.utils.BackupObserverUtils;
import java.io.File;
@@ -65,21 +65,21 @@
private final UserBackupManagerService mBackupManagerService;
private final IBackupObserver mObserver;
- @Nullable private IBackupManagerMonitor mMonitor;
+ private final BackupManagerMonitorEventSender mBackupManagerMonitorEventSender;
KeyValueBackupReporter(
UserBackupManagerService backupManagerService,
IBackupObserver observer,
- @Nullable IBackupManagerMonitor monitor) {
+ BackupManagerMonitorEventSender backupManagerMonitorEventSender) {
mBackupManagerService = backupManagerService;
mObserver = observer;
- mMonitor = monitor;
+ mBackupManagerMonitorEventSender = backupManagerMonitorEventSender;
}
/** Returns the monitor or {@code null} if we lost connection to it. */
@Nullable
IBackupManagerMonitor getMonitor() {
- return mMonitor;
+ return mBackupManagerMonitorEventSender.getMonitor();
}
IBackupObserver getObserver() {
@@ -208,13 +208,11 @@
void onAgentIllegalKey(PackageInfo packageInfo, String key) {
String packageName = packageInfo.packageName;
EventLog.writeEvent(EventLogTags.BACKUP_AGENT_FAILURE, packageName, "bad key");
- mMonitor =
- BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_ILLEGAL_KEY,
packageInfo,
BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
- BackupManagerMonitorUtils.putMonitoringExtra(
+ mBackupManagerMonitorEventSender.putMonitoringExtra(
null, BackupManagerMonitor.EXTRA_LOG_ILLEGAL_KEY, key));
BackupObserverUtils.sendBackupOnPackageResult(
mObserver, packageName, BackupManager.ERROR_AGENT_FAILURE);
@@ -254,13 +252,11 @@
if (MORE_DEBUG) {
Slog.i(TAG, "No backup data written, not calling transport");
}
- mMonitor =
- BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
- BackupManagerMonitor.LOG_EVENT_ID_NO_DATA_TO_SEND,
- packageInfo,
- BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
- null);
+ mBackupManagerMonitorEventSender.monitorEvent(
+ BackupManagerMonitor.LOG_EVENT_ID_NO_DATA_TO_SEND,
+ packageInfo,
+ BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
+ null);
}
void onPackageBackupComplete(String packageName, long size) {
@@ -291,8 +287,7 @@
void onPackageBackupNonIncrementalRequired(PackageInfo packageInfo) {
Slog.i(TAG, "Transport lost data, retrying package");
- BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_TRANSPORT_NON_INCREMENTAL_BACKUP_REQUIRED,
packageInfo,
BackupManagerMonitor.LOG_EVENT_CATEGORY_TRANSPORT,
@@ -335,28 +330,24 @@
EventLog.writeEvent(EventLogTags.BACKUP_AGENT_FAILURE, packageName);
// Time-out used to be implemented as cancel w/ cancelAll = false.
// TODO: Change monitoring event to reflect time-out as an event itself.
- mMonitor =
- BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
- BackupManagerMonitor.LOG_EVENT_ID_KEY_VALUE_BACKUP_CANCEL,
- packageInfo,
- BackupManagerMonitor.LOG_EVENT_CATEGORY_AGENT,
- BackupManagerMonitorUtils.putMonitoringExtra(
- null, BackupManagerMonitor.EXTRA_LOG_CANCEL_ALL, false));
+ mBackupManagerMonitorEventSender.monitorEvent(
+ BackupManagerMonitor.LOG_EVENT_ID_KEY_VALUE_BACKUP_CANCEL,
+ packageInfo,
+ BackupManagerMonitor.LOG_EVENT_CATEGORY_AGENT,
+ mBackupManagerMonitorEventSender.putMonitoringExtra(
+ null, BackupManagerMonitor.EXTRA_LOG_CANCEL_ALL, false));
}
void onAgentCancelled(@Nullable PackageInfo packageInfo) {
String packageName = getPackageName(packageInfo);
Slog.i(TAG, "Cancel backing up " + packageName);
EventLog.writeEvent(EventLogTags.BACKUP_AGENT_FAILURE, packageName);
- mMonitor =
- BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
- BackupManagerMonitor.LOG_EVENT_ID_KEY_VALUE_BACKUP_CANCEL,
- packageInfo,
- BackupManagerMonitor.LOG_EVENT_CATEGORY_AGENT,
- BackupManagerMonitorUtils.putMonitoringExtra(
- null, BackupManagerMonitor.EXTRA_LOG_CANCEL_ALL, true));
+ mBackupManagerMonitorEventSender.monitorEvent(
+ BackupManagerMonitor.LOG_EVENT_ID_KEY_VALUE_BACKUP_CANCEL,
+ packageInfo,
+ BackupManagerMonitor.LOG_EVENT_CATEGORY_AGENT,
+ mBackupManagerMonitorEventSender.putMonitoringExtra(
+ null, BackupManagerMonitor.EXTRA_LOG_CANCEL_ALL, true));
}
void onAgentResultError(@Nullable PackageInfo packageInfo) {
diff --git a/services/backup/java/com/android/server/backup/keyvalue/KeyValueBackupTask.java b/services/backup/java/com/android/server/backup/keyvalue/KeyValueBackupTask.java
index 41e8092..3a6e1ca 100644
--- a/services/backup/java/com/android/server/backup/keyvalue/KeyValueBackupTask.java
+++ b/services/backup/java/com/android/server/backup/keyvalue/KeyValueBackupTask.java
@@ -68,7 +68,7 @@
import com.android.server.backup.transport.TransportConnection;
import com.android.server.backup.transport.TransportNotAvailableException;
import com.android.server.backup.utils.BackupEligibilityRules;
-import com.android.server.backup.utils.BackupManagerMonitorUtils;
+import com.android.server.backup.utils.BackupManagerMonitorEventSender;
import libcore.io.IoUtils;
@@ -225,7 +225,8 @@
boolean nonIncremental,
BackupEligibilityRules backupEligibilityRules) {
KeyValueBackupReporter reporter =
- new KeyValueBackupReporter(backupManagerService, observer, monitor);
+ new KeyValueBackupReporter(backupManagerService, observer,
+ new BackupManagerMonitorEventSender(monitor));
KeyValueBackupTask task =
new KeyValueBackupTask(
backupManagerService,
@@ -698,8 +699,9 @@
try {
extractAgentData(mCurrentPackage);
- BackupManagerMonitorUtils.monitorAgentLoggingResults(
- mReporter.getMonitor(), mCurrentPackage, mAgent);
+ BackupManagerMonitorEventSender mBackupManagerMonitorEventSender =
+ new BackupManagerMonitorEventSender(mReporter.getMonitor());
+ mBackupManagerMonitorEventSender.monitorAgentLoggingResults(mCurrentPackage, mAgent);
int status = sendDataToTransport(mCurrentPackage);
cleanUpAgentForTransportStatus(status);
} catch (AgentException | TaskException e) {
diff --git a/services/backup/java/com/android/server/backup/restore/PerformUnifiedRestoreTask.java b/services/backup/java/com/android/server/backup/restore/PerformUnifiedRestoreTask.java
index 8cbb5dc..e04bf11 100644
--- a/services/backup/java/com/android/server/backup/restore/PerformUnifiedRestoreTask.java
+++ b/services/backup/java/com/android/server/backup/restore/PerformUnifiedRestoreTask.java
@@ -16,6 +16,8 @@
package com.android.server.backup.restore;
+import static android.app.backup.BackupAnnotations.OperationType.RESTORE;
+
import static com.android.server.backup.BackupManagerService.DEBUG;
import static com.android.server.backup.BackupManagerService.MORE_DEBUG;
import static com.android.server.backup.BackupManagerService.TAG;
@@ -30,6 +32,7 @@
import android.annotation.Nullable;
import android.app.ApplicationThreadConstants;
import android.app.IBackupAgent;
+import android.app.backup.BackupAnnotations;
import android.app.backup.BackupDataInput;
import android.app.backup.BackupDataOutput;
import android.app.backup.BackupManagerMonitor;
@@ -70,7 +73,7 @@
import com.android.server.backup.transport.BackupTransportClient;
import com.android.server.backup.transport.TransportConnection;
import com.android.server.backup.utils.BackupEligibilityRules;
-import com.android.server.backup.utils.BackupManagerMonitorUtils;
+import com.android.server.backup.utils.BackupManagerMonitorEventSender;
import libcore.io.IoUtils;
@@ -84,7 +87,6 @@
import java.util.Set;
public class PerformUnifiedRestoreTask implements BackupRestoreTask {
-
private UserBackupManagerService backupManagerService;
private final OperationStorage mOperationStorage;
private final int mUserId;
@@ -98,8 +100,7 @@
// Restore observer; may be null
private IRestoreObserver mObserver;
- // BackuoManagerMonitor; may be null
- private IBackupManagerMonitor mMonitor;
+ private BackupManagerMonitorEventSender mBackupManagerMonitorEventSender;
// Token identifying the dataset to the transport
private long mToken;
@@ -181,6 +182,8 @@
mUserId = 0;
mBackupEligibilityRules = null;
this.backupManagerService = backupManagerService;
+ mBackupManagerMonitorEventSender =
+ new BackupManagerMonitorEventSender(/*monitor*/null);
}
// This task can assume that the wakelock is properly held for it and doesn't have to worry
@@ -208,7 +211,8 @@
mTransportConnection = transportConnection;
mObserver = observer;
- mMonitor = monitor;
+ mBackupManagerMonitorEventSender =
+ new BackupManagerMonitorEventSender(monitor);
mToken = restoreSetToken;
mPmToken = pmToken;
mTargetPackage = targetPackage;
@@ -410,8 +414,8 @@
// If the requester of the restore has not passed in a monitor, we ask the transport
// for one.
- if (mMonitor == null) {
- mMonitor = transport.getBackupManagerMonitor();
+ if (mBackupManagerMonitorEventSender.getMonitor() == null) {
+ mBackupManagerMonitorEventSender.setMonitor(transport.getBackupManagerMonitor());
}
mStatus = transport.startRestore(mToken, packages);
@@ -425,10 +429,12 @@
RestoreDescription desc = transport.nextRestorePackage();
if (desc == null) {
Slog.e(TAG, "No restore metadata available; halting");
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ Bundle monitoringExtras = addRestoreOperationTypeToEvent(/*extras*/null);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_NO_RESTORE_METADATA_AVAILABLE,
mCurrentPackage,
- BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY, null);
+ BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
+ monitoringExtras);
mStatus = BackupTransport.TRANSPORT_ERROR;
executeNextState(UnifiedRestoreState.FINAL);
return;
@@ -437,10 +443,12 @@
desc.getPackageName())) {
Slog.e(TAG, "Required package metadata but got "
+ desc.getPackageName());
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ Bundle monitoringExtras = addRestoreOperationTypeToEvent(/*extras*/null);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_NO_PM_METADATA_RECEIVED,
mCurrentPackage,
- BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY, null);
+ BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
+ monitoringExtras);
mStatus = BackupTransport.TRANSPORT_ERROR;
executeNextState(UnifiedRestoreState.FINAL);
return;
@@ -472,10 +480,12 @@
// the restore operation.
if (!mPmAgent.hasMetadata()) {
Slog.e(TAG, "PM agent has no metadata, so not restoring");
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ Bundle monitoringExtras = addRestoreOperationTypeToEvent(/*extras*/null);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_PM_AGENT_HAS_NO_METADATA,
mCurrentPackage,
- BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY, null);
+ BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
+ monitoringExtras);
EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE,
PACKAGE_MANAGER_SENTINEL,
"Package manager restore metadata missing");
@@ -492,10 +502,12 @@
} catch (Exception e) {
// If we lost the transport at any time, halt
Slog.e(TAG, "Unable to contact transport for restore: " + e.getMessage());
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ Bundle monitoringExtras = addRestoreOperationTypeToEvent(/*extras*/null);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_LOST_TRANSPORT,
null,
- BackupManagerMonitor.LOG_EVENT_CATEGORY_TRANSPORT, null);
+ BackupManagerMonitor.LOG_EVENT_CATEGORY_TRANSPORT,
+ monitoringExtras);
mStatus = BackupTransport.TRANSPORT_ERROR;
backupManagerService.getBackupHandler().removeMessages(
MSG_BACKUP_RESTORE_STEP, this);
@@ -552,11 +564,12 @@
// Whoops, we thought we could restore this package but it
// turns out not to be present. Skip it.
Slog.e(TAG, "Package not present: " + pkgName);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ Bundle monitoringExtras = addRestoreOperationTypeToEvent(/*extras*/null);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_PACKAGE_NOT_PRESENT,
mCurrentPackage,
BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
- null);
+ monitoringExtras);
EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE, pkgName,
"Package missing on device");
nextState = UnifiedRestoreState.RUNNING_QUEUE;
@@ -572,13 +585,15 @@
String message = "Source version " + metaInfo.versionCode
+ " > installed version " + mCurrentPackage.getLongVersionCode();
Slog.w(TAG, "Package " + pkgName + ": " + message);
- Bundle monitoringExtras = BackupManagerMonitorUtils.putMonitoringExtra(null,
+ Bundle monitoringExtras = mBackupManagerMonitorEventSender.putMonitoringExtra(
+ null,
BackupManagerMonitor.EXTRA_LOG_RESTORE_VERSION,
metaInfo.versionCode);
- monitoringExtras = BackupManagerMonitorUtils.putMonitoringExtra(
+ monitoringExtras = mBackupManagerMonitorEventSender.putMonitoringExtra(
monitoringExtras,
BackupManagerMonitor.EXTRA_LOG_RESTORE_ANYWAY, false);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ monitoringExtras = addRestoreOperationTypeToEvent(monitoringExtras);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_RESTORE_VERSION_HIGHER,
mCurrentPackage,
BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -593,13 +608,15 @@
+ " > installed version " + mCurrentPackage.getLongVersionCode()
+ " but restoreAnyVersion");
}
- Bundle monitoringExtras = BackupManagerMonitorUtils.putMonitoringExtra(null,
+ Bundle monitoringExtras = mBackupManagerMonitorEventSender.putMonitoringExtra(
+ null,
BackupManagerMonitor.EXTRA_LOG_RESTORE_VERSION,
metaInfo.versionCode);
- monitoringExtras = BackupManagerMonitorUtils.putMonitoringExtra(
+ monitoringExtras = mBackupManagerMonitorEventSender.putMonitoringExtra(
monitoringExtras,
BackupManagerMonitor.EXTRA_LOG_RESTORE_ANYWAY, true);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ monitoringExtras = addRestoreOperationTypeToEvent(monitoringExtras);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_RESTORE_VERSION_HIGHER,
mCurrentPackage,
BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -652,9 +669,10 @@
Slog.i(TAG, "Data exists for package " + packageName
+ " but app has no agent; skipping");
}
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ Bundle monitoringExtras = addRestoreOperationTypeToEvent(/*extras*/null);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_APP_HAS_NO_AGENT, mCurrentPackage,
- BackupManagerMonitor.LOG_EVENT_CATEGORY_AGENT, null);
+ BackupManagerMonitor.LOG_EVENT_CATEGORY_AGENT, monitoringExtras);
EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE, packageName,
"Package has no agent");
executeNextState(UnifiedRestoreState.RUNNING_QUEUE);
@@ -665,9 +683,11 @@
PackageManagerInternal pmi = LocalServices.getService(PackageManagerInternal.class);
if (!BackupUtils.signaturesMatch(metaInfo.sigHashes, mCurrentPackage, pmi)) {
Slog.w(TAG, "Signature mismatch restoring " + packageName);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ Bundle monitoringExtras = addRestoreOperationTypeToEvent(/*extras*/null);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_SIGNATURE_MISMATCH, mCurrentPackage,
- BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY, null);
+ BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
+ monitoringExtras);
EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE, packageName,
"Signature mismatch");
executeNextState(UnifiedRestoreState.RUNNING_QUEUE);
@@ -681,9 +701,11 @@
mBackupEligibilityRules.getBackupDestination());
if (mAgent == null) {
Slog.w(TAG, "Can't find backup agent for " + packageName);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ Bundle monitoringExtras = addRestoreOperationTypeToEvent(/*extras*/null);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_CANT_FIND_AGENT, mCurrentPackage,
- BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY, null);
+ BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
+ monitoringExtras);
EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE, packageName,
"Restore agent missing");
executeNextState(UnifiedRestoreState.RUNNING_QUEUE);
@@ -941,8 +963,9 @@
EventLog.writeEvent(EventLogTags.FULL_RESTORE_PACKAGE,
mCurrentPackage.packageName);
- mEngine = new FullRestoreEngine(backupManagerService, mOperationStorage, this, null,
- mMonitor, mCurrentPackage, false, mEphemeralOpToken, false,
+ mEngine = new FullRestoreEngine(backupManagerService, mOperationStorage,
+ this, null, mBackupManagerMonitorEventSender.getMonitor(),
+ mCurrentPackage, false, mEphemeralOpToken, false,
mBackupEligibilityRules);
mEngineThread = new FullRestoreEngineThread(mEngine, mEnginePipes[0]);
@@ -1095,10 +1118,11 @@
if (DEBUG) {
Slog.w(TAG, "Full-data restore target timed out; shutting down");
}
-
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ Bundle monitoringExtras = addRestoreOperationTypeToEvent(/*extras*/null);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_FULL_RESTORE_TIMEOUT,
- mCurrentPackage, BackupManagerMonitor.LOG_EVENT_CATEGORY_AGENT, null);
+ mCurrentPackage, BackupManagerMonitor.LOG_EVENT_CATEGORY_AGENT,
+ monitoringExtras);
mEngineThread.handleTimeout();
IoUtils.closeQuietly(mEnginePipes[1]);
@@ -1322,7 +1346,7 @@
// Ask the agent for logs after doRestoreFinished() has completed executing to allow
// it to finalize its logs.
- BackupManagerMonitorUtils.monitorAgentLoggingResults(mMonitor, mCurrentPackage,
+ mBackupManagerMonitorEventSender.monitorAgentLoggingResults(mCurrentPackage,
mAgent);
// Just go back to running the restore queue
@@ -1358,9 +1382,10 @@
public void handleCancel(boolean cancelAll) {
mOperationStorage.removeOperation(mEphemeralOpToken);
Slog.e(TAG, "Timeout restoring application " + mCurrentPackage.packageName);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(mMonitor,
+ Bundle monitoringExtras = addRestoreOperationTypeToEvent(/*extras*/null);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_KEY_VALUE_RESTORE_TIMEOUT,
- mCurrentPackage, BackupManagerMonitor.LOG_EVENT_CATEGORY_AGENT, null);
+ mCurrentPackage, BackupManagerMonitor.LOG_EVENT_CATEGORY_AGENT, monitoringExtras);
EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE,
mCurrentPackage.packageName, "restore timeout");
// Handle like an agent that threw on invocation: wipe it and go on to the next
@@ -1433,4 +1458,10 @@
}
}
}
+
+ private Bundle addRestoreOperationTypeToEvent (@Nullable Bundle extra) {
+ return mBackupManagerMonitorEventSender.putMonitoringExtra(
+ extra,
+ BackupManagerMonitor.EXTRA_LOG_OPERATION_TYPE, RESTORE);
+ }
}
diff --git a/services/backup/java/com/android/server/backup/utils/BackupManagerMonitorDumpsysUtils.java b/services/backup/java/com/android/server/backup/utils/BackupManagerMonitorDumpsysUtils.java
new file mode 100644
index 0000000..0b55ca2
--- /dev/null
+++ b/services/backup/java/com/android/server/backup/utils/BackupManagerMonitorDumpsysUtils.java
@@ -0,0 +1,260 @@
+/*
+ * 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.server.backup.utils;
+
+import android.app.backup.BackupAnnotations;
+import android.app.backup.BackupManagerMonitor;
+import android.app.backup.BackupRestoreEventLogger;
+import android.os.Bundle;
+import android.os.Environment;
+import android.util.Slog;
+
+import com.android.internal.util.FastPrintWriter;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Map;
+
+
+/*
+ * Util class to parse a BMM event and write it to a text file, to be the printed in
+ * the backup dumpsys
+ *
+ * Note: this class is note thread safe
+ */
+public class BackupManagerMonitorDumpsysUtils {
+
+ private static final String TAG = "BackupManagerMonitorDumpsysUtils";
+ // Name of the subdirectory where the text file containing the BMM events will be stored.
+ // Same as {@link UserBackupManagerFiles}
+ private static final String BACKUP_PERSISTENT_DIR = "backup";
+
+ /**
+ * Parses the BackupManagerMonitor bundle for a RESTORE event in a series of strings that
+ * will be persisted in a text file and printed in the dumpsys.
+ *
+ * If the evenntBundle passed is not a RESTORE event, return early
+ *
+ * Key information related to the event:
+ * - Timestamp (HAS TO ALWAYS BE THE FIRST LINE OF EACH EVENT)
+ * - Event ID
+ * - Event Category
+ * - Operation type
+ * - Package name (can be null)
+ * - Agent logs (if available)
+ *
+ * Example of formatting:
+ * RESTORE Event: [2023-08-18 17:16:00.735] Agent - Agent logging results
+ * Package name: com.android.wallpaperbackup
+ * Agent Logs:
+ * Data Type: wlp_img_system
+ * Item restored: 0/1
+ * Agent Error - Category: no_wallpaper, Count: 1
+ * Data Type: wlp_img_lock
+ * Item restored: 0/1
+ * Agent Error - Category: no_wallpaper, Count: 1
+ */
+ public void parseBackupManagerMonitorRestoreEventForDumpsys(Bundle eventBundle) {
+ if (eventBundle == null) {
+ return;
+ }
+
+ if (!isOpTypeRestore(eventBundle)) {
+ //We only log Restore events
+ return;
+ }
+
+ if (!eventBundle.containsKey(BackupManagerMonitor.EXTRA_LOG_EVENT_ID)
+ || !eventBundle.containsKey(BackupManagerMonitor.EXTRA_LOG_EVENT_CATEGORY)) {
+ Slog.w(TAG, "Event id and category are not optional fields.");
+ return;
+ }
+ File bmmEvents = getBMMEventsFile();
+
+ try (FileOutputStream out = new FileOutputStream(bmmEvents, /*append*/ true);
+ PrintWriter pw = new FastPrintWriter(out);) {
+
+ int eventCategory = eventBundle.getInt(BackupManagerMonitor.EXTRA_LOG_EVENT_CATEGORY);
+ int eventId = eventBundle.getInt(BackupManagerMonitor.EXTRA_LOG_EVENT_ID);
+
+ if (eventId == BackupManagerMonitor.LOG_EVENT_ID_AGENT_LOGGING_RESULTS &&
+ !hasAgentLogging(eventBundle)) {
+ // Do not record an empty agent logging event
+ return;
+ }
+
+ pw.println("RESTORE Event: [" + timestamp() + "] " +
+ getCategory(eventCategory) + " - " +
+ getId(eventId));
+
+ if (eventBundle.containsKey(BackupManagerMonitor.EXTRA_LOG_EVENT_PACKAGE_NAME)) {
+ pw.println("\tPackage name: "
+ + eventBundle.getString(BackupManagerMonitor.EXTRA_LOG_EVENT_PACKAGE_NAME));
+ }
+
+ // TODO(b/296818666): add extras to the events
+ addAgentLogsIfAvailable(eventBundle, pw);
+ } catch (java.io.IOException e) {
+ Slog.e(TAG, "IO Exception when writing BMM events to file: " + e);
+ }
+
+ }
+
+ private boolean hasAgentLogging(Bundle eventBundle) {
+ if (eventBundle.containsKey(BackupManagerMonitor.EXTRA_LOG_AGENT_LOGGING_RESULTS)) {
+ ArrayList<BackupRestoreEventLogger.DataTypeResult> agentLogs =
+ eventBundle.getParcelableArrayList(
+ BackupManagerMonitor.EXTRA_LOG_AGENT_LOGGING_RESULTS);
+
+ return !agentLogs.isEmpty();
+ }
+ return false;
+ }
+
+ /**
+ * Extracts agent logs from the BackupManagerMonitor event. These logs detail:
+ * - the data type for the agent
+ * - the count of successfully restored items
+ * - the count of items that failed to restore
+ * - the metadata associated with this datatype
+ * - any errors
+ */
+ private void addAgentLogsIfAvailable(Bundle eventBundle, PrintWriter pw) {
+ if (hasAgentLogging(eventBundle)) {
+ pw.println("\tAgent Logs:");
+ ArrayList<BackupRestoreEventLogger.DataTypeResult> agentLogs =
+ eventBundle.getParcelableArrayList(
+ BackupManagerMonitor.EXTRA_LOG_AGENT_LOGGING_RESULTS);
+ for (BackupRestoreEventLogger.DataTypeResult result : agentLogs) {
+ int totalItems = result.getFailCount() + result.getSuccessCount();
+ pw.println("\t\tData Type: " + result.getDataType());
+ pw.println("\t\t\tItem restored: " + result.getSuccessCount() + "/" +
+ totalItems);
+ for (Map.Entry<String, Integer> entry : result.getErrors().entrySet()) {
+ pw.println("\t\t\tAgent Error - Category: " +
+ entry.getKey() + ", Count: " + entry.getValue());
+ }
+ }
+ }
+ }
+
+ /*
+ * Get the path of the text files which stores the BMM events
+ */
+ public File getBMMEventsFile() {
+ File dataDir = new File(Environment.getDataDirectory(), BACKUP_PERSISTENT_DIR);
+ File fname = new File(dataDir, "bmmevents.txt");
+ return fname;
+ }
+
+ private String timestamp() {
+ long currentTime = System.currentTimeMillis();
+ Date date = new Date(currentTime);
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+ return dateFormat.format(date);
+ }
+
+ private String getCategory(int code) {
+ String category = switch (code) {
+ case BackupManagerMonitor.LOG_EVENT_CATEGORY_TRANSPORT -> "Transport";
+ case BackupManagerMonitor.LOG_EVENT_CATEGORY_AGENT -> "Agent";
+ case BackupManagerMonitor.LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY ->
+ "Backup Manager Policy";
+ default -> "Unknown category code: " + code;
+ };
+ return category;
+ }
+
+ private String getId(int code) {
+ String id = switch (code) {
+ case BackupManagerMonitor.LOG_EVENT_ID_FULL_BACKUP_CANCEL -> "Full backup cancel";
+ case BackupManagerMonitor.LOG_EVENT_ID_ILLEGAL_KEY -> "Illegal key";
+ case BackupManagerMonitor.LOG_EVENT_ID_NO_DATA_TO_SEND -> "No data to send";
+ case BackupManagerMonitor.LOG_EVENT_ID_PACKAGE_INELIGIBLE -> "Package ineligible";
+ case BackupManagerMonitor.LOG_EVENT_ID_PACKAGE_KEY_VALUE_PARTICIPANT ->
+ "Package key-value participant";
+ case BackupManagerMonitor.LOG_EVENT_ID_PACKAGE_STOPPED -> "Package stopped";
+ case BackupManagerMonitor.LOG_EVENT_ID_PACKAGE_NOT_FOUND -> "Package not found";
+ case BackupManagerMonitor.LOG_EVENT_ID_BACKUP_DISABLED -> "Backup disabled";
+ case BackupManagerMonitor.LOG_EVENT_ID_DEVICE_NOT_PROVISIONED ->
+ "Device not provisioned";
+ case BackupManagerMonitor.LOG_EVENT_ID_PACKAGE_TRANSPORT_NOT_PRESENT ->
+ "Package transport not present";
+ case BackupManagerMonitor.LOG_EVENT_ID_ERROR_PREFLIGHT -> "Error preflight";
+ case BackupManagerMonitor.LOG_EVENT_ID_QUOTA_HIT_PREFLIGHT -> "Quota hit preflight";
+ case BackupManagerMonitor.LOG_EVENT_ID_EXCEPTION_FULL_BACKUP -> "Exception full backup";
+ case BackupManagerMonitor.LOG_EVENT_ID_KEY_VALUE_BACKUP_CANCEL ->
+ "Key-value backup cancel";
+ case BackupManagerMonitor.LOG_EVENT_ID_NO_RESTORE_METADATA_AVAILABLE ->
+ "No restore metadata available";
+ case BackupManagerMonitor.LOG_EVENT_ID_NO_PM_METADATA_RECEIVED ->
+ "No PM metadata received";
+ case BackupManagerMonitor.LOG_EVENT_ID_PM_AGENT_HAS_NO_METADATA ->
+ "PM agent has no metadata";
+ case BackupManagerMonitor.LOG_EVENT_ID_LOST_TRANSPORT -> "Lost transport";
+ case BackupManagerMonitor.LOG_EVENT_ID_PACKAGE_NOT_PRESENT -> "Package not present";
+ case BackupManagerMonitor.LOG_EVENT_ID_RESTORE_VERSION_HIGHER ->
+ "Restore version higher";
+ case BackupManagerMonitor.LOG_EVENT_ID_APP_HAS_NO_AGENT -> "App has no agent";
+ case BackupManagerMonitor.LOG_EVENT_ID_SIGNATURE_MISMATCH -> "Signature mismatch";
+ case BackupManagerMonitor.LOG_EVENT_ID_CANT_FIND_AGENT -> "Can't find agent";
+ case BackupManagerMonitor.LOG_EVENT_ID_KEY_VALUE_RESTORE_TIMEOUT ->
+ "Key-value restore timeout";
+ case BackupManagerMonitor.LOG_EVENT_ID_RESTORE_ANY_VERSION -> "Restore any version";
+ case BackupManagerMonitor.LOG_EVENT_ID_VERSIONS_MATCH -> "Versions match";
+ case BackupManagerMonitor.LOG_EVENT_ID_VERSION_OF_BACKUP_OLDER ->
+ "Version of backup older";
+ case BackupManagerMonitor.LOG_EVENT_ID_FULL_RESTORE_SIGNATURE_MISMATCH ->
+ "Full restore signature mismatch";
+ case BackupManagerMonitor.LOG_EVENT_ID_SYSTEM_APP_NO_AGENT -> "System app no agent";
+ case BackupManagerMonitor.LOG_EVENT_ID_FULL_RESTORE_ALLOW_BACKUP_FALSE ->
+ "Full restore allow backup false";
+ case BackupManagerMonitor.LOG_EVENT_ID_APK_NOT_INSTALLED -> "APK not installed";
+ case BackupManagerMonitor.LOG_EVENT_ID_CANNOT_RESTORE_WITHOUT_APK ->
+ "Cannot restore without APK";
+ case BackupManagerMonitor.LOG_EVENT_ID_MISSING_SIGNATURE -> "Missing signature";
+ case BackupManagerMonitor.LOG_EVENT_ID_EXPECTED_DIFFERENT_PACKAGE ->
+ "Expected different package";
+ case BackupManagerMonitor.LOG_EVENT_ID_UNKNOWN_VERSION -> "Unknown version";
+ case BackupManagerMonitor.LOG_EVENT_ID_FULL_RESTORE_TIMEOUT -> "Full restore timeout";
+ case BackupManagerMonitor.LOG_EVENT_ID_CORRUPT_MANIFEST -> "Corrupt manifest";
+ case BackupManagerMonitor.LOG_EVENT_ID_WIDGET_METADATA_MISMATCH ->
+ "Widget metadata mismatch";
+ case BackupManagerMonitor.LOG_EVENT_ID_WIDGET_UNKNOWN_VERSION ->
+ "Widget unknown version";
+ case BackupManagerMonitor.LOG_EVENT_ID_NO_PACKAGES -> "No packages";
+ case BackupManagerMonitor.LOG_EVENT_ID_TRANSPORT_IS_NULL -> "Transport is null";
+ case BackupManagerMonitor.LOG_EVENT_ID_TRANSPORT_NON_INCREMENTAL_BACKUP_REQUIRED ->
+ "Transport non-incremental backup required";
+ case BackupManagerMonitor.LOG_EVENT_ID_AGENT_LOGGING_RESULTS -> "Agent logging results";
+ default -> "Unknown log event ID: " + code;
+ };
+ return id;
+ }
+
+ private boolean isOpTypeRestore(Bundle eventBundle) {
+ return switch (eventBundle.getInt(
+ BackupManagerMonitor.EXTRA_LOG_OPERATION_TYPE, -1)) {
+ case BackupAnnotations.OperationType.RESTORE -> true;
+ default -> false;
+ };
+ }
+}
diff --git a/services/backup/java/com/android/server/backup/utils/BackupManagerMonitorUtils.java b/services/backup/java/com/android/server/backup/utils/BackupManagerMonitorEventSender.java
similarity index 69%
rename from services/backup/java/com/android/server/backup/utils/BackupManagerMonitorUtils.java
rename to services/backup/java/com/android/server/backup/utils/BackupManagerMonitorEventSender.java
index 439b836..92e3107 100644
--- a/services/backup/java/com/android/server/backup/utils/BackupManagerMonitorUtils.java
+++ b/services/backup/java/com/android/server/backup/utils/BackupManagerMonitorEventSender.java
@@ -25,7 +25,6 @@
import static com.android.server.backup.BackupManagerService.DEBUG;
import static com.android.server.backup.BackupManagerService.TAG;
-import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.IBackupAgent;
import android.app.backup.BackupAnnotations.OperationType;
@@ -37,6 +36,7 @@
import android.os.RemoteException;
import android.util.Slog;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.infra.AndroidFuture;
import java.util.List;
@@ -44,9 +44,9 @@
import java.util.concurrent.TimeoutException;
/**
- * Utility methods to communicate with BackupManagerMonitor.
+ * Utility methods to log BackupManagerMonitor events.
*/
-public class BackupManagerMonitorUtils {
+public class BackupManagerMonitorEventSender {
/**
* Timeout for how long we wait before we give up on getting logs from a {@link IBackupAgent}.
* We expect this to be very fast since the agent immediately returns whatever logs have been
@@ -54,51 +54,77 @@
* for non-essential logs.
*/
private static final int AGENT_LOGGER_RESULTS_TIMEOUT_MILLIS = 500;
+ @Nullable private IBackupManagerMonitor mMonitor;
+ private final BackupManagerMonitorDumpsysUtils mBackupManagerMonitorDumpsysUtils;
+ public BackupManagerMonitorEventSender(@Nullable IBackupManagerMonitor monitor) {
+ mMonitor = monitor;
+ mBackupManagerMonitorDumpsysUtils = new BackupManagerMonitorDumpsysUtils();
+ }
+
+ @VisibleForTesting
+ BackupManagerMonitorEventSender(@Nullable IBackupManagerMonitor monitor,
+ BackupManagerMonitorDumpsysUtils backupManagerMonitorDumpsysUtils) {
+ mMonitor = monitor;
+ mBackupManagerMonitorDumpsysUtils = backupManagerMonitorDumpsysUtils;
+ }
+
+ public void setMonitor(IBackupManagerMonitor monitor) {
+ mMonitor = monitor;
+ }
+
+ public IBackupManagerMonitor getMonitor() {
+ return mMonitor;
+ }
/**
* Notifies monitor about the event.
*
* Calls {@link IBackupManagerMonitor#onEvent(Bundle)} with a bundle representing current event.
*
- * @param monitor - implementation of {@link IBackupManagerMonitor} to notify.
* @param id - event id.
* @param pkg - package event is related to.
* @param category - event category.
* @param extras - additional event data.
- * @return <code>monitor</code> if call succeeded and <code>null</code> otherwise.
*/
- @Nullable
- public static IBackupManagerMonitor monitorEvent(
- @Nullable IBackupManagerMonitor monitor,
+ public void monitorEvent(
int id,
PackageInfo pkg,
int category,
Bundle extras) {
- if (monitor != null) {
- try {
- Bundle bundle = new Bundle();
- bundle.putInt(BackupManagerMonitor.EXTRA_LOG_EVENT_ID, id);
- bundle.putInt(BackupManagerMonitor.EXTRA_LOG_EVENT_CATEGORY, category);
- if (pkg != null) {
- bundle.putString(EXTRA_LOG_EVENT_PACKAGE_NAME,
- pkg.packageName);
- bundle.putInt(BackupManagerMonitor.EXTRA_LOG_EVENT_PACKAGE_VERSION,
- pkg.versionCode);
- bundle.putLong(BackupManagerMonitor.EXTRA_LOG_EVENT_PACKAGE_LONG_VERSION,
- pkg.getLongVersionCode());
- }
- if (extras != null) {
- bundle.putAll(extras);
- }
- monitor.onEvent(bundle);
- return monitor;
- } catch (RemoteException e) {
- if (DEBUG) {
- Slog.w(TAG, "backup manager monitor went away");
+ try {
+ Bundle bundle = new Bundle();
+ bundle.putInt(BackupManagerMonitor.EXTRA_LOG_EVENT_ID, id);
+ bundle.putInt(BackupManagerMonitor.EXTRA_LOG_EVENT_CATEGORY, category);
+ if (pkg != null) {
+ bundle.putString(EXTRA_LOG_EVENT_PACKAGE_NAME,
+ pkg.packageName);
+ bundle.putInt(BackupManagerMonitor.EXTRA_LOG_EVENT_PACKAGE_VERSION,
+ pkg.versionCode);
+ bundle.putLong(BackupManagerMonitor.EXTRA_LOG_EVENT_PACKAGE_LONG_VERSION,
+ pkg.getLongVersionCode());
+ }
+ if (extras != null) {
+ bundle.putAll(extras);
+ if (extras.containsKey(EXTRA_LOG_OPERATION_TYPE) &&
+ extras.getInt(EXTRA_LOG_OPERATION_TYPE) == OperationType.RESTORE){
+ mBackupManagerMonitorDumpsysUtils
+ .parseBackupManagerMonitorRestoreEventForDumpsys(bundle);
}
}
+
+ if (mMonitor != null) {
+ mMonitor.onEvent(bundle);
+ } else {
+ if (DEBUG) {
+ Slog.w(TAG, "backup manager monitor is null unable to send event");
+ }
+ }
+ } catch (RemoteException e) {
+ mMonitor = null;
+ if (DEBUG) {
+ Slog.w(TAG, "backup manager monitor went away");
+ }
}
- return null;
}
/**
@@ -108,17 +134,12 @@
* <p>Note that this method does two separate binder calls (one to the agent and one to the
* monitor).
*
- * @param monitor - implementation of {@link IBackupManagerMonitor} to notify.
* @param pkg - package the {@code agent} belongs to.
* @param agent - the {@link IBackupAgent} to retrieve logs from.
- * @return {@code null} if the monitor is null. {@code monitor} if we fail to retrieve the logs
- * from the {@code agent}. Otherwise, the result of {@link
- * #monitorEvent(IBackupManagerMonitor, int, PackageInfo, int, Bundle)}.
*/
- public static IBackupManagerMonitor monitorAgentLoggingResults(
- @Nullable IBackupManagerMonitor monitor, PackageInfo pkg, IBackupAgent agent) {
- if (monitor == null) {
- return null;
+ public void monitorAgentLoggingResults(PackageInfo pkg, IBackupAgent agent) {
+ if (mMonitor == null) {
+ Slog.i(TAG, "backup manager monitor is null unable to send event"+pkg);
}
try {
@@ -127,7 +148,7 @@
AndroidFuture<Integer> operationTypeFuture = new AndroidFuture<>();
agent.getLoggerResults(resultsFuture);
agent.getOperationType(operationTypeFuture);
- return sendAgentLoggingResults(monitor, pkg,
+ sendAgentLoggingResults(pkg,
resultsFuture.get(AGENT_LOGGER_RESULTS_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS),
operationTypeFuture.get(AGENT_LOGGER_RESULTS_TIMEOUT_MILLIS,
TimeUnit.MILLISECONDS));
@@ -136,18 +157,15 @@
} catch (Exception e) {
Slog.w(TAG, "Failed to retrieve logging results from agent", e);
}
- return monitor;
}
- public static IBackupManagerMonitor sendAgentLoggingResults(
- @NonNull IBackupManagerMonitor monitor, PackageInfo pkg, List<DataTypeResult> results,
+ public void sendAgentLoggingResults(PackageInfo pkg, List<DataTypeResult> results,
@OperationType int operationType) {
Bundle loggerResultsBundle = new Bundle();
loggerResultsBundle.putParcelableList(
EXTRA_LOG_AGENT_LOGGING_RESULTS, results);
loggerResultsBundle.putInt(EXTRA_LOG_OPERATION_TYPE, operationType);
- return monitorEvent(
- monitor,
+ monitorEvent(
LOG_EVENT_ID_AGENT_LOGGING_RESULTS,
pkg,
LOG_EVENT_CATEGORY_AGENT,
diff --git a/services/backup/java/com/android/server/backup/utils/TarBackupReader.java b/services/backup/java/com/android/server/backup/utils/TarBackupReader.java
index 71ca8ca..78a9952 100644
--- a/services/backup/java/com/android/server/backup/utils/TarBackupReader.java
+++ b/services/backup/java/com/android/server/backup/utils/TarBackupReader.java
@@ -85,7 +85,8 @@
private final InputStream mInputStream;
private final BytesReadListener mBytesReadListener;
- private IBackupManagerMonitor mMonitor;
+
+ private BackupManagerMonitorEventSender mBackupManagerMonitorEventSender;
// Widget blob to be restored out-of-band.
private byte[] mWidgetData = null;
@@ -94,7 +95,7 @@
IBackupManagerMonitor monitor) {
mInputStream = inputStream;
mBytesReadListener = bytesReadListener;
- mMonitor = monitor;
+ mBackupManagerMonitorEventSender = new BackupManagerMonitorEventSender(monitor);
}
/**
@@ -323,24 +324,22 @@
return sigs;
} else {
Slog.i(TAG, "Missing signature on backed-up package " + info.packageName);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
LOG_EVENT_ID_MISSING_SIGNATURE,
null,
LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
- BackupManagerMonitorUtils.putMonitoringExtra(null,
+ mBackupManagerMonitorEventSender.putMonitoringExtra(null,
EXTRA_LOG_EVENT_PACKAGE_NAME, info.packageName));
}
} else {
Slog.i(TAG, "Expected package " + info.packageName
+ " but restore manifest claims " + manifestPackage);
- Bundle monitoringExtras = BackupManagerMonitorUtils.putMonitoringExtra(null,
- EXTRA_LOG_EVENT_PACKAGE_NAME, info.packageName);
- monitoringExtras = BackupManagerMonitorUtils.putMonitoringExtra(
+ Bundle monitoringExtras = mBackupManagerMonitorEventSender.putMonitoringExtra(
+ null, EXTRA_LOG_EVENT_PACKAGE_NAME, info.packageName);
+ monitoringExtras = mBackupManagerMonitorEventSender.putMonitoringExtra(
monitoringExtras,
EXTRA_LOG_MANIFEST_PACKAGE_NAME, manifestPackage);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
LOG_EVENT_ID_EXPECTED_DIFFERENT_PACKAGE,
null,
LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -349,12 +348,11 @@
} else {
Slog.i(TAG, "Unknown restore manifest version " + version
+ " for package " + info.packageName);
- Bundle monitoringExtras = BackupManagerMonitorUtils.putMonitoringExtra(null,
- EXTRA_LOG_EVENT_PACKAGE_NAME, info.packageName);
- monitoringExtras = BackupManagerMonitorUtils.putMonitoringExtra(monitoringExtras,
- EXTRA_LOG_EVENT_PACKAGE_VERSION, version);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ Bundle monitoringExtras = mBackupManagerMonitorEventSender.putMonitoringExtra(
+ null, EXTRA_LOG_EVENT_PACKAGE_NAME, info.packageName);
+ monitoringExtras = mBackupManagerMonitorEventSender.putMonitoringExtra(
+ monitoringExtras, EXTRA_LOG_EVENT_PACKAGE_VERSION, version);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_UNKNOWN_VERSION,
null,
LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -363,12 +361,12 @@
}
} catch (NumberFormatException e) {
Slog.w(TAG, "Corrupt restore manifest for package " + info.packageName);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_CORRUPT_MANIFEST,
null,
LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
- BackupManagerMonitorUtils.putMonitoringExtra(null, EXTRA_LOG_EVENT_PACKAGE_NAME,
+ mBackupManagerMonitorEventSender.putMonitoringExtra(null,
+ EXTRA_LOG_EVENT_PACKAGE_NAME,
info.packageName));
} catch (IllegalArgumentException e) {
Slog.w(TAG, e.getMessage());
@@ -436,8 +434,7 @@
if ((pkgInfo.applicationInfo.flags
& ApplicationInfo.FLAG_RESTORE_ANY_VERSION) != 0) {
Slog.i(TAG, "Package has restoreAnyVersion; taking data");
- mMonitor = BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
LOG_EVENT_ID_RESTORE_ANY_VERSION,
pkgInfo,
LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -446,8 +443,7 @@
} else if (pkgInfo.getLongVersionCode() >= info.version) {
Slog.i(TAG, "Sig + version match; taking data");
policy = RestorePolicy.ACCEPT;
- mMonitor = BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
LOG_EVENT_ID_VERSIONS_MATCH,
pkgInfo,
LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -466,12 +462,11 @@
} else {
Slog.i(TAG, "Data requires newer version "
+ info.version + "; ignoring");
- mMonitor = BackupManagerMonitorUtils
- .monitorEvent(mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
LOG_EVENT_ID_VERSION_OF_BACKUP_OLDER,
pkgInfo,
LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
- BackupManagerMonitorUtils
+ mBackupManagerMonitorEventSender
.putMonitoringExtra(
null,
EXTRA_LOG_OLD_VERSION,
@@ -484,8 +479,7 @@
Slog.w(TAG, "Restore manifest signatures do not match "
+ "installed application for "
+ info.packageName);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
LOG_EVENT_ID_FULL_RESTORE_SIGNATURE_MISMATCH,
pkgInfo,
LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -494,8 +488,7 @@
} else {
Slog.w(TAG, "Package " + info.packageName
+ " is system level with no agent");
- mMonitor = BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
LOG_EVENT_ID_SYSTEM_APP_NO_AGENT,
pkgInfo,
LOG_EVENT_CATEGORY_AGENT,
@@ -506,8 +499,7 @@
Slog.i(TAG,
"Restore manifest from " + info.packageName + " but allowBackup=false");
}
- mMonitor = BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
LOG_EVENT_ID_FULL_RESTORE_ALLOW_BACKUP_FALSE,
pkgInfo,
LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -526,14 +518,13 @@
} else {
policy = RestorePolicy.IGNORE;
}
- Bundle monitoringExtras = BackupManagerMonitorUtils.putMonitoringExtra(
+ Bundle monitoringExtras = mBackupManagerMonitorEventSender.putMonitoringExtra(
null,
EXTRA_LOG_EVENT_PACKAGE_NAME, info.packageName);
- monitoringExtras = BackupManagerMonitorUtils.putMonitoringExtra(
+ monitoringExtras = mBackupManagerMonitorEventSender.putMonitoringExtra(
monitoringExtras,
EXTRA_LOG_POLICY_ALLOW_APKS, allowApks);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
LOG_EVENT_ID_APK_NOT_INSTALLED,
null,
LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -543,12 +534,11 @@
if (policy == RestorePolicy.ACCEPT_IF_APK && !info.hasApk) {
Slog.i(TAG, "Cannot restore package " + info.packageName
+ " without the matching .apk");
- mMonitor = BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
LOG_EVENT_ID_CANNOT_RESTORE_WITHOUT_APK,
null,
LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
- BackupManagerMonitorUtils.putMonitoringExtra(null,
+ mBackupManagerMonitorEventSender.putMonitoringExtra(null,
EXTRA_LOG_EVENT_PACKAGE_NAME, info.packageName));
}
@@ -632,12 +622,11 @@
"Metadata mismatch: package " + info.packageName + " but widget data for "
+ pkg);
- Bundle monitoringExtras = BackupManagerMonitorUtils.putMonitoringExtra(null,
+ Bundle monitoringExtras = mBackupManagerMonitorEventSender.putMonitoringExtra(null,
EXTRA_LOG_EVENT_PACKAGE_NAME, info.packageName);
- monitoringExtras = BackupManagerMonitorUtils.putMonitoringExtra(monitoringExtras,
- BackupManagerMonitor.EXTRA_LOG_WIDGET_PACKAGE_NAME, pkg);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ monitoringExtras = mBackupManagerMonitorEventSender.putMonitoringExtra(
+ monitoringExtras, BackupManagerMonitor.EXTRA_LOG_WIDGET_PACKAGE_NAME, pkg);
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_WIDGET_METADATA_MISMATCH,
null,
LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -646,13 +635,12 @@
} else {
Slog.w(TAG, "Unsupported metadata version " + version);
- Bundle monitoringExtras = BackupManagerMonitorUtils
+ Bundle monitoringExtras = mBackupManagerMonitorEventSender
.putMonitoringExtra(null, EXTRA_LOG_EVENT_PACKAGE_NAME,
info.packageName);
- monitoringExtras = BackupManagerMonitorUtils.putMonitoringExtra(monitoringExtras,
+ monitoringExtras = mBackupManagerMonitorEventSender.putMonitoringExtra(monitoringExtras,
EXTRA_LOG_EVENT_PACKAGE_VERSION, version);
- mMonitor = BackupManagerMonitorUtils.monitorEvent(
- mMonitor,
+ mBackupManagerMonitorEventSender.monitorEvent(
BackupManagerMonitor.LOG_EVENT_ID_WIDGET_UNKNOWN_VERSION,
null,
LOG_EVENT_CATEGORY_BACKUP_MANAGER_POLICY,
@@ -810,7 +798,7 @@
}
public IBackupManagerMonitor getMonitor() {
- return mMonitor;
+ return mBackupManagerMonitorEventSender.getMonitor();
}
public byte[] getWidgetData() {
diff --git a/services/companion/java/com/android/server/companion/AssociationRequestsProcessor.java b/services/companion/java/com/android/server/companion/AssociationRequestsProcessor.java
index fd45d24..6964763 100644
--- a/services/companion/java/com/android/server/companion/AssociationRequestsProcessor.java
+++ b/services/companion/java/com/android/server/companion/AssociationRequestsProcessor.java
@@ -313,14 +313,14 @@
public void enableSystemDataSync(int associationId, int flags) {
AssociationInfo association = mAssociationStore.getAssociationById(associationId);
- AssociationInfo updated = AssociationInfo.builder(association)
+ AssociationInfo updated = (new AssociationInfo.Builder(association))
.setSystemDataSyncFlags(association.getSystemDataSyncFlags() | flags).build();
mAssociationStore.updateAssociation(updated);
}
public void disableSystemDataSync(int associationId, int flags) {
AssociationInfo association = mAssociationStore.getAssociationById(associationId);
- AssociationInfo updated = AssociationInfo.builder(association)
+ AssociationInfo updated = (new AssociationInfo.Builder(association))
.setSystemDataSyncFlags(association.getSystemDataSyncFlags() & (~flags)).build();
mAssociationStore.updateAssociation(updated);
}
diff --git a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
index 996c68b..1ce7d96 100644
--- a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
+++ b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
@@ -891,7 +891,7 @@
}
// AssociationInfo class is immutable: create a new AssociationInfo object with updated
// timestamp.
- association = AssociationInfo.builder(association)
+ association = (new AssociationInfo.Builder(association))
.setLastTimeConnected(System.currentTimeMillis())
.build();
mAssociationStore.updateAssociation(association);
@@ -945,7 +945,7 @@
// AssociationInfo class is immutable: create a new AssociationInfo object with updated
// flag.
- association = AssociationInfo.builder(association)
+ association = (new AssociationInfo.Builder(association))
.setNotifyOnDeviceNearby(active)
.build();
// Do not need to call {@link BleCompanionDeviceScanner#restartScan()} since it will
@@ -1016,7 +1016,7 @@
@Override
public void setAssociationTag(int associationId, String tag) {
AssociationInfo association = getAssociationWithCallerChecks(associationId);
- association = AssociationInfo.builder(association).setTag(tag).build();
+ association = (new AssociationInfo.Builder(association)).setTag(tag).build();
mAssociationStore.updateAssociation(association);
}
@@ -1255,7 +1255,7 @@
*/
private void addToPendingRoleHolderRemoval(@NonNull AssociationInfo association) {
// First: set revoked flag.
- association = AssociationInfo.builder(association)
+ association = (new AssociationInfo.Builder(association))
.setRevoked(true)
.build();
diff --git a/services/companion/java/com/android/server/companion/virtual/Android.bp b/services/companion/java/com/android/server/companion/virtual/Android.bp
new file mode 100644
index 0000000..50a09b9
--- /dev/null
+++ b/services/companion/java/com/android/server/companion/virtual/Android.bp
@@ -0,0 +1,12 @@
+java_aconfig_library {
+ name: "virtualdevice_flags_lib",
+ aconfig_declarations: "virtualdevice_flags",
+}
+
+aconfig_declarations {
+ name: "virtualdevice_flags",
+ package: "com.android.server.companion.virtual",
+ srcs: [
+ "flags.aconfig",
+ ],
+}
\ No newline at end of file
diff --git a/services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java b/services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java
index ee6c28e..d1be5a9 100644
--- a/services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java
+++ b/services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java
@@ -43,6 +43,7 @@
import android.companion.virtual.audio.IAudioRoutingCallback;
import android.companion.virtual.sensor.VirtualSensor;
import android.companion.virtual.sensor.VirtualSensorEvent;
+import android.content.AttributionSource;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -125,6 +126,7 @@
private final VirtualDeviceManagerService mService;
private final PendingTrampolineCallback mPendingTrampolineCallback;
private final int mOwnerUid;
+ private final String mOwnerPackageName;
private int mDeviceId;
private @Nullable String mPersistentDeviceId;
// Thou shall not hold the mVirtualDeviceLock over the mInputController calls.
@@ -196,7 +198,7 @@
AssociationInfo associationInfo,
VirtualDeviceManagerService service,
IBinder token,
- int ownerUid,
+ AttributionSource attributionSource,
int deviceId,
CameraAccessController cameraAccessController,
PendingTrampolineCallback pendingTrampolineCallback,
@@ -209,7 +211,7 @@
associationInfo,
service,
token,
- ownerUid,
+ attributionSource,
deviceId,
/* inputController= */ null,
cameraAccessController,
@@ -227,7 +229,7 @@
AssociationInfo associationInfo,
VirtualDeviceManagerService service,
IBinder token,
- int ownerUid,
+ AttributionSource attributionSource,
int deviceId,
InputController inputController,
CameraAccessController cameraAccessController,
@@ -238,7 +240,8 @@
VirtualDeviceParams params,
DisplayManagerGlobal displayManager) {
super(PermissionEnforcer.fromContext(context));
- UserHandle ownerUserHandle = UserHandle.getUserHandleForUid(ownerUid);
+ mOwnerPackageName = attributionSource.getPackageName();
+ UserHandle ownerUserHandle = UserHandle.getUserHandleForUid(attributionSource.getUid());
mContext = context.createContextAsUser(ownerUserHandle, 0);
mAssociationInfo = associationInfo;
mPersistentDeviceId = PERSISTENT_ID_PREFIX_CDM_ASSOCIATION + associationInfo.getId();
@@ -247,7 +250,7 @@
mActivityListener = activityListener;
mSoundEffectListener = soundEffectListener;
mRunningAppsChangedCallback = runningAppsChangedCallback;
- mOwnerUid = ownerUid;
+ mOwnerUid = attributionSource.getUid();
mDeviceId = deviceId;
mAppToken = token;
mParams = params;
@@ -771,7 +774,9 @@
fout.println(" VirtualDevice: ");
fout.println(" mDeviceId: " + mDeviceId);
fout.println(" mAssociationId: " + mAssociationInfo.getId());
- fout.println(" mParams: " + mParams);
+ fout.println(" mOwnerPackageName: " + mOwnerPackageName);
+ fout.println(" mParams: ");
+ mParams.dump(fout, " ");
fout.println(" mVirtualDisplayIds: ");
synchronized (mVirtualDeviceLock) {
for (int i = 0; i < mVirtualDisplays.size(); i++) {
diff --git a/services/companion/java/com/android/server/companion/virtual/VirtualDeviceManagerService.java b/services/companion/java/com/android/server/companion/virtual/VirtualDeviceManagerService.java
index 77508a8..e558498 100644
--- a/services/companion/java/com/android/server/companion/virtual/VirtualDeviceManagerService.java
+++ b/services/companion/java/com/android/server/companion/virtual/VirtualDeviceManagerService.java
@@ -35,6 +35,7 @@
import android.companion.virtual.VirtualDeviceManager;
import android.companion.virtual.VirtualDeviceParams;
import android.companion.virtual.sensor.VirtualSensor;
+import android.content.AttributionSource;
import android.content.Context;
import android.content.Intent;
import android.hardware.display.IVirtualDisplayCallback;
@@ -314,13 +315,15 @@
@Override // Binder call
public IVirtualDevice createVirtualDevice(
IBinder token,
- String packageName,
+ AttributionSource attributionSource,
int associationId,
@NonNull VirtualDeviceParams params,
@NonNull IVirtualDeviceActivityListener activityListener,
@NonNull IVirtualDeviceSoundEffectListener soundEffectListener) {
createVirtualDevice_enforcePermission();
+ attributionSource.enforceCallingUid();
final int callingUid = getCallingUid();
+ final String packageName = attributionSource.getPackageName();
if (!PermissionUtils.validateCallingPackageName(getContext(), packageName)) {
throw new SecurityException(
"Package name " + packageName + " does not belong to calling uid "
@@ -340,10 +343,9 @@
final int deviceId = sNextUniqueIndex.getAndIncrement();
final Consumer<ArraySet<Integer>> runningAppsChangedCallback =
runningUids -> notifyRunningAppsChanged(deviceId, runningUids);
- VirtualDeviceImpl virtualDevice = new VirtualDeviceImpl(getContext(),
- associationInfo, VirtualDeviceManagerService.this, token, callingUid,
- deviceId, cameraAccessController,
- mPendingTrampolineCallback, activityListener,
+ VirtualDeviceImpl virtualDevice = new VirtualDeviceImpl(getContext(), associationInfo,
+ VirtualDeviceManagerService.this, token, attributionSource, deviceId,
+ cameraAccessController, mPendingTrampolineCallback, activityListener,
soundEffectListener, runningAppsChangedCallback, params);
synchronized (mVirtualDeviceManagerLock) {
if (mVirtualDevices.size() == 0) {
diff --git a/services/companion/java/com/android/server/companion/virtual/flags.aconfig b/services/companion/java/com/android/server/companion/virtual/flags.aconfig
new file mode 100644
index 0000000..4fe4c87
--- /dev/null
+++ b/services/companion/java/com/android/server/companion/virtual/flags.aconfig
@@ -0,0 +1,8 @@
+package: "com.android.server.companion.virtual"
+
+flag {
+ name: "dump_history"
+ namespace: "virtual_devices"
+ description: "This flag controls if a history of virtual devices is shown in dumpsys virtualdevices"
+ bug: "293114719"
+}
\ No newline at end of file
diff --git a/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java b/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java
index 315972c..f594170 100644
--- a/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java
+++ b/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java
@@ -1225,15 +1225,13 @@
public ContentCaptureOptions getOptions(@UserIdInt int userId,
@NonNull String packageName) {
boolean isContentCaptureReceiverEnabled;
- boolean isContentProtectionReceiverEnabled;
+ boolean isContentProtectionReceiverEnabled =
+ isContentProtectionReceiverEnabled(userId, packageName);
ArraySet<ComponentName> whitelistedComponents = null;
synchronized (mGlobalWhitelistStateLock) {
isContentCaptureReceiverEnabled =
isContentCaptureReceiverEnabled(userId, packageName);
- isContentProtectionReceiverEnabled =
- isContentProtectionReceiverEnabled(userId, packageName);
-
if (!isContentCaptureReceiverEnabled) {
// Full package is not allowlisted: check individual components next
whitelistedComponents = getWhitelistedComponents(userId, packageName);
diff --git a/services/core/Android.bp b/services/core/Android.bp
index a4d72b1..66a77a3 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -191,6 +191,7 @@
"apache-commons-math",
"power_optimization_flags_lib",
"notification_flags_lib",
+ "pm_flags_lib",
],
javac_shard_size: 50,
javacflags: [
@@ -240,4 +241,4 @@
prebuilt_etc {
name: "protolog.conf.json.gz",
src: ":services.core.json.gz",
-}
\ No newline at end of file
+}
diff --git a/services/core/java/android/content/pm/PackageManagerInternal.java b/services/core/java/android/content/pm/PackageManagerInternal.java
index fc51e2e..557e4ac 100644
--- a/services/core/java/android/content/pm/PackageManagerInternal.java
+++ b/services/core/java/android/content/pm/PackageManagerInternal.java
@@ -1374,7 +1374,7 @@
* and the package should get out of stopped state and be enabled.
*/
public abstract void notifyComponentUsed(@NonNull String packageName,
- @UserIdInt int userId, @NonNull String recentCallingPackage);
+ @UserIdInt int userId, @NonNull String recentCallingPackage, @NonNull String debugInfo);
/** @deprecated For legacy shell command only. */
@Deprecated
@@ -1403,4 +1403,10 @@
*/
public abstract int[] getDistractingPackageRestrictionsAsUser(
@NonNull String[] packageNames, int userId);
+
+ /**
+ * Checks if package is quarantined for a specific user.
+ */
+ public abstract boolean isPackageQuarantined(@NonNull String packageName,
+ @UserIdInt int userId);
}
diff --git a/services/core/java/com/android/server/EventLogTags.logtags b/services/core/java/com/android/server/EventLogTags.logtags
index b67e627..d47a399 100644
--- a/services/core/java/com/android/server/EventLogTags.logtags
+++ b/services/core/java/com/android/server/EventLogTags.logtags
@@ -81,7 +81,7 @@
# when a notification has been clicked
27520 notification_clicked (key|3),(lifespan|1),(freshness|1),(exposure|1),(rank|1),(count|1)
# when a notification action button has been clicked
-27521 notification_action_clicked (key|3),(action_index|1),(lifespan|1),(freshness|1),(exposure|1),(rank|1),(count|1)
+27521 notification_action_clicked (key|3),(piIdentifier|3),(pendingIntent|3),(action_index|1),(lifespan|1),(freshness|1),(exposure|1),(rank|1),(count|1)
# when a notification has been canceled
27530 notification_canceled (key|3),(reason|1),(lifespan|1),(freshness|1),(exposure|1),(rank|1),(count|1),(listener|3)
# replaces 27510 with a row per notification
diff --git a/services/core/java/com/android/server/PackageWatchdog.java b/services/core/java/com/android/server/PackageWatchdog.java
index f4f5c95..d256aea 100644
--- a/services/core/java/com/android/server/PackageWatchdog.java
+++ b/services/core/java/com/android/server/PackageWatchdog.java
@@ -580,7 +580,6 @@
PackageHealthObserverImpact.USER_IMPACT_LEVEL_10,
PackageHealthObserverImpact.USER_IMPACT_LEVEL_30,
PackageHealthObserverImpact.USER_IMPACT_LEVEL_50,
- PackageHealthObserverImpact.USER_IMPACT_LEVEL_60,
PackageHealthObserverImpact.USER_IMPACT_LEVEL_70,
PackageHealthObserverImpact.USER_IMPACT_LEVEL_100})
public @interface PackageHealthObserverImpact {
@@ -591,7 +590,6 @@
/* Actions having medium user impact, user of a device will likely notice. */
int USER_IMPACT_LEVEL_30 = 30;
int USER_IMPACT_LEVEL_50 = 50;
- int USER_IMPACT_LEVEL_60 = 60;
int USER_IMPACT_LEVEL_70 = 70;
/* Action has high user impact, a last resort, user of a device will be very frustrated. */
int USER_IMPACT_LEVEL_100 = 100;
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java
index 830d55a..7fb9580 100644
--- a/services/core/java/com/android/server/StorageManagerService.java
+++ b/services/core/java/com/android/server/StorageManagerService.java
@@ -1289,6 +1289,16 @@
return mVold.supportsBlockCheckpoint();
}
+ private void prepareUserStorageForMoveInternal(String fromVolumeUuid, String toVolumeUuid,
+ List<UserInfo> users) throws Exception {
+
+ final int flags = StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE;
+ for (UserInfo user : users) {
+ prepareUserStorageInternal(fromVolumeUuid, user.id, user.serialNumber, flags);
+ prepareUserStorageInternal(toVolumeUuid, user.id, user.serialNumber, flags);
+ }
+ }
+
@Override
public void onAwakeStateChanged(boolean isAwake) {
// Ignored
@@ -2912,6 +2922,7 @@
final VolumeInfo from;
final VolumeInfo to;
+ final List<UserInfo> users;
synchronized (mLock) {
if (Objects.equals(mPrimaryStorageUuid, volumeUuid)) {
@@ -2925,7 +2936,7 @@
mMoveTargetUuid = volumeUuid;
// We need all the users unlocked to move their primary storage
- final List<UserInfo> users = mContext.getSystemService(UserManager.class).getUsers();
+ users = mContext.getSystemService(UserManager.class).getUsers();
for (UserInfo user : users) {
if (StorageManager.isFileEncrypted() && !isUserKeyUnlocked(user.id)) {
Slog.w(TAG, "Failing move due to locked user " + user.id);
@@ -2961,6 +2972,19 @@
}
}
+ // Prepare the storage before move, this is required to unlock adoptable storage (as the
+ // keys are tied to prepare user data step) & also is required for the destination files to
+ // end up with the correct SELinux labels and encryption policies for directories
+ try {
+ prepareUserStorageForMoveInternal(mPrimaryStorageUuid, volumeUuid, users);
+ } catch (Exception e) {
+ Slog.w(TAG, "Failing move due to failure on prepare user data", e);
+ synchronized (mLock) {
+ onMoveStatusLocked(PackageManager.MOVE_FAILED_INTERNAL_ERROR);
+ }
+ return;
+ }
+
try {
mVold.moveStorage(from.id, to.id, new IVoldTaskListener.Stub() {
@Override
@@ -4904,5 +4928,16 @@
mCloudProviderChangeListeners.add(listener);
mHandler.obtainMessage(H_CLOUD_MEDIA_PROVIDER_CHANGED, listener).sendToTarget();
}
+
+ @Override
+ public void prepareUserStorageForMove(String fromVolumeUuid, String toVolumeUuid,
+ List<UserInfo> users) {
+ try {
+ prepareUserStorageForMoveInternal(fromVolumeUuid, toVolumeUuid, users);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
}
}
diff --git a/services/core/java/com/android/server/VcnManagementService.java b/services/core/java/com/android/server/VcnManagementService.java
index c6e9a7d..7acca19 100644
--- a/services/core/java/com/android/server/VcnManagementService.java
+++ b/services/core/java/com/android/server/VcnManagementService.java
@@ -456,7 +456,13 @@
final List<SubscriptionInfo> subscriptionInfos = new ArrayList<>();
Binder.withCleanCallingIdentity(
() -> {
- subscriptionInfos.addAll(subMgr.getSubscriptionsInGroup(subscriptionGroup));
+ List<SubscriptionInfo> subsInGroup =
+ subMgr.getSubscriptionsInGroup(subscriptionGroup);
+ if (subsInGroup == null) {
+ logWtf("Received null from getSubscriptionsInGroup");
+ subsInGroup = Collections.emptyList();
+ }
+ subscriptionInfos.addAll(subsInGroup);
});
for (SubscriptionInfo info : subscriptionInfos) {
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index d398260..330742a 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -5309,11 +5309,12 @@
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "performing bindService to " + authenticatorInfo.componentName);
}
- int flags = Context.BIND_AUTO_CREATE;
+ long flags = Context.BIND_FILTER_OUT_QUARANTINED_COMPONENTS | Context.BIND_AUTO_CREATE;
if (mAuthenticatorCache.getBindInstantServiceAllowed(mAccounts.userId)) {
flags |= Context.BIND_ALLOW_INSTANT;
}
- if (!mContext.bindServiceAsUser(intent, this, flags, UserHandle.of(mAccounts.userId))) {
+ if (!mContext.bindServiceAsUser(intent, this, Context.BindServiceFlags.of(flags),
+ UserHandle.of(mAccounts.userId))) {
Log.w(TAG, "bindService to " + authenticatorInfo.componentName + " failed");
// Perform unbind as per documentation at Context.bindServiceAsUser
mContext.unbindService(this);
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index cb246f6..93fe0c9 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -3601,6 +3601,8 @@
|| (flags & Context.BIND_EXTERNAL_SERVICE_LONG) != 0;
final boolean allowInstant = (flags & Context.BIND_ALLOW_INSTANT) != 0;
final boolean inSharedIsolatedProcess = (flags & Context.BIND_SHARED_ISOLATED_PROCESS) != 0;
+ final boolean filterOutQuarantined =
+ (flags & Context.BIND_FILTER_OUT_QUARANTINED_COMPONENTS) != 0;
ProcessRecord attributedApp = null;
if (sdkSandboxClientAppUid > 0) {
@@ -3610,7 +3612,7 @@
isSdkSandboxService, sdkSandboxClientAppUid, sdkSandboxClientAppPackage,
resolvedType, callingPackage, callingPid, callingUid, userId, true, callerFg,
isBindExternal, allowInstant, null /* fgsDelegateOptions */,
- inSharedIsolatedProcess);
+ inSharedIsolatedProcess, filterOutQuarantined);
if (res == null) {
return 0;
}
@@ -4119,6 +4121,20 @@
boolean createIfNeeded, boolean callingFromFg, boolean isBindExternal,
boolean allowInstant, ForegroundServiceDelegationOptions fgsDelegateOptions,
boolean inSharedIsolatedProcess) {
+ return retrieveServiceLocked(service, instanceName, isSdkSandboxService,
+ sdkSandboxClientAppUid, sdkSandboxClientAppPackage, resolvedType, callingPackage,
+ callingPid, callingUid, userId, createIfNeeded, callingFromFg, isBindExternal,
+ allowInstant, fgsDelegateOptions, inSharedIsolatedProcess,
+ false /* filterOutQuarantined */);
+ }
+
+ private ServiceLookupResult retrieveServiceLocked(Intent service,
+ String instanceName, boolean isSdkSandboxService, int sdkSandboxClientAppUid,
+ String sdkSandboxClientAppPackage, String resolvedType,
+ String callingPackage, int callingPid, int callingUid, int userId,
+ boolean createIfNeeded, boolean callingFromFg, boolean isBindExternal,
+ boolean allowInstant, ForegroundServiceDelegationOptions fgsDelegateOptions,
+ boolean inSharedIsolatedProcess, boolean filterOutQuarantined) {
if (isSdkSandboxService && instanceName == null) {
throw new IllegalArgumentException("No instanceName provided for sdk sandbox process");
}
@@ -4235,11 +4251,14 @@
if (r == null) {
try {
- int flags = ActivityManagerService.STOCK_PM_FLAGS
+ long flags = ActivityManagerService.STOCK_PM_FLAGS
| PackageManager.MATCH_DEBUG_TRIAGED_MISSING;
if (allowInstant) {
flags |= PackageManager.MATCH_INSTANT;
}
+ if (filterOutQuarantined) {
+ flags |= PackageManager.FILTER_OUT_QUARANTINED_COMPONENTS;
+ }
// TODO: come back and remove this assumption to triage all services
ResolveInfo rInfo = mAm.getPackageManagerInternal().resolveService(service,
resolvedType, flags, userId, callingUid);
@@ -5118,7 +5137,7 @@
try {
mAm.mPackageManagerInt.notifyComponentUsed(
- r.packageName, r.userId, r.mRecentCallingPackage);
+ r.packageName, r.userId, r.mRecentCallingPackage, r.toString());
} catch (IllegalArgumentException e) {
Slog.w(TAG, "Failed trying to unstop package "
+ r.packageName + ": " + e);
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 4dc76db..c4816fb 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -58,6 +58,7 @@
import static android.app.ProcessMemoryState.HOSTING_COMPONENT_TYPE_PERSISTENT;
import static android.app.ProcessMemoryState.HOSTING_COMPONENT_TYPE_SYSTEM;
import static android.content.pm.ApplicationInfo.HIDDEN_API_ENFORCEMENT_DEFAULT;
+import static android.content.pm.PackageManager.FILTER_OUT_QUARANTINED_COMPONENTS;
import static android.content.pm.PackageManager.GET_SHARED_LIBRARY_FILES;
import static android.content.pm.PackageManager.MATCH_ALL;
import static android.content.pm.PackageManager.MATCH_ANY_USER;
@@ -14221,7 +14222,8 @@
private List<ResolveInfo> collectReceiverComponents(Intent intent, String resolvedType,
int callingUid, int[] users, int[] broadcastAllowList) {
// TODO: come back and remove this assumption to triage all broadcasts
- int pmFlags = STOCK_PM_FLAGS | MATCH_DEBUG_TRIAGED_MISSING;
+ long pmFlags = STOCK_PM_FLAGS | MATCH_DEBUG_TRIAGED_MISSING
+ | FILTER_OUT_QUARANTINED_COMPONENTS;
List<ResolveInfo> receivers = null;
HashSet<ComponentName> singleUserReceivers = null;
@@ -14849,6 +14851,16 @@
mAtmInternal.onPackagesSuspendedChanged(packageNames, suspended,
userIdExtra);
+
+ final boolean quarantined = intent.getBooleanExtra(
+ Intent.EXTRA_QUARANTINED, false);
+ if (suspended && quarantined && packageNames != null) {
+ for (int i = 0; i < packageNames.length; i++) {
+ forceStopPackageLocked(packageNames[i], -1, false, true, true,
+ false, false, userId, "suspended");
+ }
+ }
+
break;
}
break;
diff --git a/services/core/java/com/android/server/am/BatteryStatsService.java b/services/core/java/com/android/server/am/BatteryStatsService.java
index 04ebb2b..610b8af 100644
--- a/services/core/java/com/android/server/am/BatteryStatsService.java
+++ b/services/core/java/com/android/server/am/BatteryStatsService.java
@@ -156,6 +156,7 @@
private final PowerProfile mPowerProfile;
private final CpuScalingPolicies mCpuScalingPolicies;
+ private final BatteryStatsImpl.BatteryStatsConfig mBatteryStatsConfig;
final BatteryStatsImpl mStats;
final CpuWakeupStats mCpuWakeupStats;
private final BatteryUsageStatsStore mBatteryUsageStatsStore;
@@ -374,22 +375,24 @@
mPowerProfile = new PowerProfile(context);
mCpuScalingPolicies = new CpuScalingPolicyReader().read();
- mStats = new BatteryStatsImpl(systemDir, handler, this,
+ final boolean resetOnUnplugHighBatteryLevel = context.getResources().getBoolean(
+ com.android.internal.R.bool.config_batteryStatsResetOnUnplugHighBatteryLevel);
+ final boolean resetOnUnplugAfterSignificantCharge = context.getResources().getBoolean(
+ com.android.internal.R.bool.config_batteryStatsResetOnUnplugAfterSignificantCharge);
+ final long powerStatsThrottlePeriodCpu = context.getResources().getInteger(
+ com.android.internal.R.integer.config_defaultPowerStatsThrottlePeriodCpu);
+ mBatteryStatsConfig =
+ new BatteryStatsImpl.BatteryStatsConfig.Builder()
+ .setResetOnUnplugHighBatteryLevel(resetOnUnplugHighBatteryLevel)
+ .setResetOnUnplugAfterSignificantCharge(resetOnUnplugAfterSignificantCharge)
+ .setPowerStatsThrottlePeriodCpu(powerStatsThrottlePeriodCpu)
+ .build();
+ mStats = new BatteryStatsImpl(mBatteryStatsConfig, systemDir, handler, this,
this, mUserManagerUserInfoProvider, mPowerProfile, mCpuScalingPolicies);
mWorker = new BatteryExternalStatsWorker(context, mStats);
mStats.setExternalStatsSyncLocked(mWorker);
mStats.setRadioScanningTimeoutLocked(mContext.getResources().getInteger(
com.android.internal.R.integer.config_radioScanningTimeout) * 1000L);
-
- final boolean resetOnUnplugHighBatteryLevel = context.getResources().getBoolean(
- com.android.internal.R.bool.config_batteryStatsResetOnUnplugHighBatteryLevel);
- final boolean resetOnUnplugAfterSignificantCharge = context.getResources().getBoolean(
- com.android.internal.R.bool.config_batteryStatsResetOnUnplugAfterSignificantCharge);
- mStats.setBatteryStatsConfig(
- new BatteryStatsImpl.BatteryStatsConfig.Builder()
- .setResetOnUnplugHighBatteryLevel(resetOnUnplugHighBatteryLevel)
- .setResetOnUnplugAfterSignificantCharge(resetOnUnplugAfterSignificantCharge)
- .build());
mStats.startTrackingSystemServerCpuTime();
if (BATTERY_USAGE_STORE_ENABLED) {
@@ -2591,6 +2594,7 @@
pw.println(" --proto: output as a binary protobuffer");
pw.println(" --model power-profile: use the power profile model"
+ " even if measured energy is available");
+ pw.println(" --sample: collect and dump a sample of stats for debugging purpose");
pw.println(" <package.name>: optional name of package to filter output by.");
pw.println(" -h: print this help text.");
pw.println("Battery stats (batterystats) commands:");
@@ -2623,6 +2627,14 @@
}
}
+ private void dumpStatsSample(PrintWriter pw) {
+ mStats.dumpStatsSample(pw);
+ }
+
+ private void dumpAggregatedStats(PrintWriter pw) {
+ mStats.dumpAggregatedStats(pw, /* startTime */ 0, /* endTime */0);
+ }
+
private void dumpMeasuredEnergyStats(PrintWriter pw) {
// Wait for the completion of pending works if there is any
awaitCompletion();
@@ -2864,6 +2876,12 @@
mCpuWakeupStats.dump(new IndentingPrintWriter(pw, " "),
SystemClock.elapsedRealtime());
return;
+ } else if ("--sample".equals(arg)) {
+ dumpStatsSample(pw);
+ return;
+ } else if ("--aggregated".equals(arg)) {
+ dumpAggregatedStats(pw);
+ return;
} else if ("-a".equals(arg)) {
flags |= BatteryStats.DUMP_VERBOSE;
} else if (arg.length() > 0 && arg.charAt(0) == '-'){
@@ -2924,6 +2942,7 @@
in.unmarshall(raw, 0, raw.length);
in.setDataPosition(0);
BatteryStatsImpl checkinStats = new BatteryStatsImpl(
+ mBatteryStatsConfig,
null, mStats.mHandler, null, null,
mUserManagerUserInfoProvider, mPowerProfile,
mCpuScalingPolicies);
@@ -2965,6 +2984,7 @@
in.unmarshall(raw, 0, raw.length);
in.setDataPosition(0);
BatteryStatsImpl checkinStats = new BatteryStatsImpl(
+ mBatteryStatsConfig,
null, mStats.mHandler, null, null,
mUserManagerUserInfoProvider, mPowerProfile,
mCpuScalingPolicies);
diff --git a/services/core/java/com/android/server/am/ComponentAliasResolver.java b/services/core/java/com/android/server/am/ComponentAliasResolver.java
index 6e93ce4..3fa6102 100644
--- a/services/core/java/com/android/server/am/ComponentAliasResolver.java
+++ b/services/core/java/com/android/server/am/ComponentAliasResolver.java
@@ -457,7 +457,7 @@
@Nullable
public Resolution<ResolveInfo> resolveReceiver(@NonNull Intent intent,
@NonNull ResolveInfo receiver, @Nullable String resolvedType,
- int packageFlags, int userId, int callingUid, boolean forSend) {
+ long packageFlags, int userId, int callingUid, boolean forSend) {
// Resolve this alias.
final Resolution<ComponentName> resolution = resolveComponentAlias(() ->
receiver.activityInfo.getComponentName());
diff --git a/services/core/java/com/android/server/am/ContentProviderHelper.java b/services/core/java/com/android/server/am/ContentProviderHelper.java
index 65fd54a..9219623 100644
--- a/services/core/java/com/android/server/am/ContentProviderHelper.java
+++ b/services/core/java/com/android/server/am/ContentProviderHelper.java
@@ -293,7 +293,8 @@
return holder;
}
- // Don't expose providers between normal apps and instant apps
+ // Don't expose providers between normal apps and instant apps; enforce limited
+ // package visibility (introduced in Android 11); etc.
try {
if (AppGlobals.getPackageManager()
.resolveContentProvider(name, /*flags=*/ 0, userId) == null) {
@@ -509,7 +510,8 @@
checkTime(startTime,
"getContentProviderImpl: before set stopped state");
mService.mPackageManagerInt.notifyComponentUsed(
- cpr.appInfo.packageName, userId, callingPackage);
+ cpr.appInfo.packageName, userId, callingPackage,
+ cpr.toString());
checkTime(startTime, "getContentProviderImpl: after set stopped state");
} catch (IllegalArgumentException e) {
Slog.w(TAG, "Failed trying to unstop package "
diff --git a/services/core/java/com/android/server/am/ServiceRecord.java b/services/core/java/com/android/server/am/ServiceRecord.java
index 8a8e2af..70a1c91 100644
--- a/services/core/java/com/android/server/am/ServiceRecord.java
+++ b/services/core/java/com/android/server/am/ServiceRecord.java
@@ -1531,7 +1531,11 @@
sb.append("ServiceRecord{")
.append(Integer.toHexString(System.identityHashCode(this)))
.append(" u").append(userId)
- .append(' ').append(shortInstanceName).append('}');
+ .append(' ').append(shortInstanceName);
+ if (mRecentCallingPackage != null) {
+ sb.append(" c:").append(mRecentCallingPackage);
+ }
+ sb.append('}');
return stringName = sb.toString();
}
diff --git a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
index 0e4465d..1d09dce 100644
--- a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
+++ b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
@@ -87,7 +87,6 @@
DeviceConfig.NAMESPACE_CAMERA_NATIVE,
DeviceConfig.NAMESPACE_CONFIGURATION,
DeviceConfig.NAMESPACE_CONNECTIVITY,
- DeviceConfig.NAMESPACE_CORE_EXPERIMENTS_TEAM_INTERNAL,
DeviceConfig.NAMESPACE_EDGETPU_NATIVE,
DeviceConfig.NAMESPACE_INPUT_NATIVE_BOOT,
DeviceConfig.NAMESPACE_INTELLIGENCE_CONTENT_SUGGESTIONS,
@@ -115,19 +114,29 @@
NAMESPACE_TETHERING_U_OR_LATER_NATIVE
};
+ // All the aconfig flags under the listed DeviceConfig scopes will be synced to native level.
+ @VisibleForTesting
+ static final String[] sDeviceConfigAconfigScopes = new String[] {
+ DeviceConfig.NAMESPACE_CORE_EXPERIMENTS_TEAM_INTERNAL,
+ };
+
private final String[] mGlobalSettings;
private final String[] mDeviceConfigScopes;
+ private final String[] mDeviceConfigAconfigScopes;
+
private final ContentResolver mContentResolver;
@VisibleForTesting
protected SettingsToPropertiesMapper(ContentResolver contentResolver,
String[] globalSettings,
- String[] deviceConfigScopes) {
+ String[] deviceConfigScopes,
+ String[] deviceConfigAconfigScopes) {
mContentResolver = contentResolver;
mGlobalSettings = globalSettings;
mDeviceConfigScopes = deviceConfigScopes;
+ mDeviceConfigAconfigScopes = deviceConfigAconfigScopes;
}
@VisibleForTesting
@@ -173,6 +182,36 @@
return;
}
setProperty(propertyName, properties.getString(key, null));
+
+ // for legacy namespaces, they can also be used for trunk stable
+ // purposes. so push flag also into trunk stable slot in sys prop,
+ // later all legacy usage will be refactored and the sync to old
+ // sys prop slot can be removed.
+ String aconfigPropertyName = makeAconfigFlagPropertyName(scope, key);
+ if (aconfigPropertyName == null) {
+ log("unable to construct system property for " + scope + "/"
+ + key);
+ return;
+ }
+ setProperty(aconfigPropertyName, properties.getString(key, null));
+ }
+ });
+ }
+
+ for (String deviceConfigAconfigScope : mDeviceConfigAconfigScopes) {
+ DeviceConfig.addOnPropertiesChangedListener(
+ deviceConfigAconfigScope,
+ AsyncTask.THREAD_POOL_EXECUTOR,
+ (DeviceConfig.Properties properties) -> {
+ String scope = properties.getNamespace();
+ for (String key : properties.getKeyset()) {
+ String aconfigPropertyName = makeAconfigFlagPropertyName(scope, key);
+ if (aconfigPropertyName == null) {
+ log("unable to construct system property for " + scope + "/"
+ + key);
+ return;
+ }
+ setProperty(aconfigPropertyName, properties.getString(key, null));
}
});
}
@@ -180,7 +219,10 @@
public static SettingsToPropertiesMapper start(ContentResolver contentResolver) {
SettingsToPropertiesMapper mapper = new SettingsToPropertiesMapper(
- contentResolver, sGlobalSettings, sDeviceConfigScopes);
+ contentResolver,
+ sGlobalSettings,
+ sDeviceConfigScopes,
+ sDeviceConfigAconfigScopes);
mapper.updatePropertiesFromSettings();
return mapper;
}
@@ -243,6 +285,28 @@
return propertyName;
}
+ /**
+ * system property name constructing rule for aconfig flags:
+ * "persist.device_config.aconfig_flags.[category_name].[flag_name]".
+ * If the name contains invalid characters or substrings for system property name,
+ * will return null.
+ * @param categoryName
+ * @param flagName
+ * @return
+ */
+ @VisibleForTesting
+ static String makeAconfigFlagPropertyName(String categoryName, String flagName) {
+ String propertyName = SYSTEM_PROPERTY_PREFIX + "aconfig_flags." +
+ categoryName + "." + flagName;
+
+ if (!propertyName.matches(SYSTEM_PROPERTY_VALID_CHARACTERS_REGEX)
+ || propertyName.contains(SYSTEM_PROPERTY_INVALID_SUBSTRING)) {
+ return null;
+ }
+
+ return propertyName;
+ }
+
private void setProperty(String key, String value) {
// Check if need to clear the property
if (value == null) {
diff --git a/services/core/java/com/android/server/apphibernation/AppHibernationService.java b/services/core/java/com/android/server/apphibernation/AppHibernationService.java
index 86da39b..a17b3d5 100644
--- a/services/core/java/com/android/server/apphibernation/AppHibernationService.java
+++ b/services/core/java/com/android/server/apphibernation/AppHibernationService.java
@@ -97,7 +97,7 @@
*/
public final class AppHibernationService extends SystemService {
private static final String TAG = "AppHibernationService";
- private static final int PACKAGE_MATCH_FLAGS =
+ private static final long PACKAGE_MATCH_FLAGS =
PackageManager.MATCH_DIRECT_BOOT_AWARE
| PackageManager.MATCH_DIRECT_BOOT_UNAWARE
| PackageManager.MATCH_UNINSTALLED_PACKAGES
diff --git a/services/core/java/com/android/server/audio/AudioDeviceBroker.java b/services/core/java/com/android/server/audio/AudioDeviceBroker.java
index d89171d..4a523af 100644
--- a/services/core/java/com/android/server/audio/AudioDeviceBroker.java
+++ b/services/core/java/com/android/server/audio/AudioDeviceBroker.java
@@ -391,7 +391,6 @@
final boolean wasBtScoRequested = isBluetoothScoRequested();
CommunicationRouteClient client;
-
// Save previous client route in case of failure to start BT SCO audio
AudioDeviceAttributes prevClientDevice = null;
boolean prevPrivileged = false;
@@ -1043,7 +1042,7 @@
synchronized (mBluetoothAudioStateLock) {
mBluetoothScoOn = on;
updateAudioHalBluetoothState();
- postUpdateCommunicationRouteClient(eventSource);
+ postUpdateCommunicationRouteClient(isBluetoothScoRequested(), eventSource);
}
}
@@ -1395,8 +1394,10 @@
MSG_I_SAVE_CLEAR_PREF_DEVICES_FOR_CAPTURE_PRESET, SENDMSG_QUEUE, capturePreset);
}
- /*package*/ void postUpdateCommunicationRouteClient(String eventSource) {
- sendLMsgNoDelay(MSG_L_UPDATE_COMMUNICATION_ROUTE_CLIENT, SENDMSG_QUEUE, eventSource);
+ /*package*/ void postUpdateCommunicationRouteClient(
+ boolean wasBtScoRequested, String eventSource) {
+ sendILMsgNoDelay(MSG_IL_UPDATE_COMMUNICATION_ROUTE_CLIENT, SENDMSG_QUEUE,
+ wasBtScoRequested ? 1 : 0, eventSource);
}
/*package*/ void postSetCommunicationDeviceForClient(CommunicationDeviceInfo info) {
@@ -1708,7 +1709,8 @@
: AudioSystem.STREAM_DEFAULT);
if (btInfo.mProfile == BluetoothProfile.LE_AUDIO
|| btInfo.mProfile == BluetoothProfile.HEARING_AID) {
- onUpdateCommunicationRouteClient("setBluetoothActiveDevice");
+ onUpdateCommunicationRouteClient(isBluetoothScoRequested(),
+ "setBluetoothActiveDevice");
}
}
}
@@ -1762,9 +1764,11 @@
case MSG_I_SET_MODE_OWNER:
synchronized (mSetModeLock) {
synchronized (mDeviceStateLock) {
+ boolean wasBtScoRequested = isBluetoothScoRequested();
mAudioModeOwner = (AudioModeInfo) msg.obj;
if (mAudioModeOwner.mMode != AudioSystem.MODE_RINGTONE) {
- onUpdateCommunicationRouteClient("setNewModeOwner");
+ onUpdateCommunicationRouteClient(
+ wasBtScoRequested, "setNewModeOwner");
}
}
}
@@ -1787,10 +1791,10 @@
}
break;
- case MSG_L_UPDATE_COMMUNICATION_ROUTE_CLIENT:
+ case MSG_IL_UPDATE_COMMUNICATION_ROUTE_CLIENT:
synchronized (mSetModeLock) {
synchronized (mDeviceStateLock) {
- onUpdateCommunicationRouteClient((String) msg.obj);
+ onUpdateCommunicationRouteClient(msg.arg1 == 1, (String) msg.obj);
}
}
break;
@@ -1971,7 +1975,7 @@
private static final int MSG_I_SAVE_CLEAR_PREF_DEVICES_FOR_CAPTURE_PRESET = 38;
private static final int MSG_L_SET_COMMUNICATION_DEVICE_FOR_CLIENT = 42;
- private static final int MSG_L_UPDATE_COMMUNICATION_ROUTE_CLIENT = 43;
+ private static final int MSG_IL_UPDATE_COMMUNICATION_ROUTE_CLIENT = 43;
private static final int MSG_I_SCO_AUDIO_STATE_CHANGED = 44;
private static final int MSG_L_BT_ACTIVE_DEVICE_CHANGE_EXT = 45;
@@ -2328,16 +2332,20 @@
*/
// @GuardedBy("mSetModeLock")
@GuardedBy("mDeviceStateLock")
- private void onUpdateCommunicationRouteClient(String eventSource) {
- updateCommunicationRoute(eventSource);
+ private void onUpdateCommunicationRouteClient(boolean wasBtScoRequested, String eventSource) {
CommunicationRouteClient crc = topCommunicationRouteClient();
if (AudioService.DEBUG_COMM_RTE) {
- Log.v(TAG, "onUpdateCommunicationRouteClient, crc: "
- + crc + " eventSource: " + eventSource);
+ Log.v(TAG, "onUpdateCommunicationRouteClient, crc: " + crc
+ + " wasBtScoRequested: " + wasBtScoRequested + " eventSource: " + eventSource);
}
if (crc != null) {
setCommunicationRouteForClient(crc.getBinder(), crc.getUid(), crc.getDevice(),
BtHelper.SCO_MODE_UNDEFINED, crc.isPrivileged(), eventSource);
+ } else {
+ if (!isBluetoothScoRequested() && wasBtScoRequested) {
+ mBtHelper.stopBluetoothSco(eventSource);
+ }
+ updateCommunicationRoute(eventSource);
}
}
@@ -2401,7 +2409,11 @@
}
@GuardedBy("mDeviceStateLock")
- private boolean communnicationDeviceCompatOn() {
+ // LE Audio: For system server (Telecom) and APKs targeting S and above, we let the audio
+ // policy routing rules select the default communication device.
+ // For older APKs, we force LE Audio headset when connected as those APKs cannot select a LE
+ // Audiodevice explicitly.
+ private boolean communnicationDeviceLeAudioCompatOn() {
return mAudioModeOwner.mMode == AudioSystem.MODE_IN_COMMUNICATION
&& !(CompatChanges.isChangeEnabled(
USE_SET_COMMUNICATION_DEVICE, mAudioModeOwner.mUid)
@@ -2409,19 +2421,25 @@
}
@GuardedBy("mDeviceStateLock")
+ // Hearing Aid: For system server (Telecom) and IN_CALL mode we let the audio
+ // policy routing rules select the default communication device.
+ // For 3p apps and IN_COMMUNICATION mode we force Hearing aid when connected to maintain
+ // backwards compatibility
+ private boolean communnicationDeviceHaCompatOn() {
+ return mAudioModeOwner.mMode == AudioSystem.MODE_IN_COMMUNICATION
+ && !(mAudioModeOwner.mUid == android.os.Process.SYSTEM_UID);
+ }
+
+ @GuardedBy("mDeviceStateLock")
AudioDeviceAttributes getDefaultCommunicationDevice() {
- // For system server (Telecom) and APKs targeting S and above, we let the audio
- // policy routing rules select the default communication device.
- // For older APKs, we force Hearing Aid or LE Audio headset when connected as
- // those APKs cannot select a LE Audio or Hearing Aid device explicitly.
AudioDeviceAttributes device = null;
- if (communnicationDeviceCompatOn()) {
- // If both LE and Hearing Aid are active (thie should not happen),
- // priority to Hearing Aid.
+ // If both LE and Hearing Aid are active (thie should not happen),
+ // priority to Hearing Aid.
+ if (communnicationDeviceHaCompatOn()) {
device = mDeviceInventory.getDeviceOfType(AudioSystem.DEVICE_OUT_HEARING_AID);
- if (device == null) {
- device = mDeviceInventory.getDeviceOfType(AudioSystem.DEVICE_OUT_BLE_HEADSET);
- }
+ }
+ if (device == null && communnicationDeviceLeAudioCompatOn()) {
+ device = mDeviceInventory.getDeviceOfType(AudioSystem.DEVICE_OUT_BLE_HEADSET);
}
return device;
}
@@ -2431,6 +2449,7 @@
List<AudioRecordingConfiguration> recordConfigs) {
synchronized (mSetModeLock) {
synchronized (mDeviceStateLock) {
+ final boolean wasBtScoRequested = isBluetoothScoRequested();
boolean updateCommunicationRoute = false;
for (CommunicationRouteClient crc : mCommunicationRouteClients) {
boolean wasActive = crc.isActive();
@@ -2459,7 +2478,8 @@
}
}
if (updateCommunicationRoute) {
- postUpdateCommunicationRouteClient("updateCommunicationRouteClientsActivity");
+ postUpdateCommunicationRouteClient(
+ wasBtScoRequested, "updateCommunicationRouteClientsActivity");
}
}
}
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index 76c4cfe..5f15995 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -43,6 +43,7 @@
import static com.android.server.utils.EventLogger.Event.ALOGW;
import android.Manifest;
+import android.annotation.EnforcePermission;
import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
@@ -7636,6 +7637,10 @@
throw new IllegalArgumentException("Illegal BluetoothProfile profile for device "
+ previousDevice + " -> " + newDevice + ". Got: " + profile);
}
+
+ sDeviceLogger.enqueue(new EventLogger.StringEvent("BlutoothActiveDeviceChanged for "
+ + BluetoothProfile.getProfileName(profile) + ", device update " + previousDevice
+ + " -> " + newDevice));
AudioDeviceBroker.BtDeviceChangedData data =
new AudioDeviceBroker.BtDeviceChangedData(newDevice, previousDevice, info,
"AudioService");
@@ -9685,6 +9690,9 @@
}
} else if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1);
+ sDeviceLogger.enqueue(new EventLogger.StringEvent(
+ "BluetoothAdapter ACTION_STATE_CHANGED with state " + state));
+
if (state == BluetoothAdapter.STATE_OFF ||
state == BluetoothAdapter.STATE_TURNING_OFF) {
mDeviceBroker.disconnectAllBluetoothProfiles();
@@ -9998,6 +10006,14 @@
return mMediaFocusControl.abandonAudioFocus(fd, clientId, aa, callingPackageName);
}
+ /** see {@link AudioManager#getFocusDuckedUidsForTest()} */
+ @Override
+ @EnforcePermission("android.permission.QUERY_AUDIO_STATE")
+ public @NonNull List<Integer> getFocusDuckedUidsForTest() {
+ super.getFocusDuckedUidsForTest_enforcePermission();
+ return mPlaybackMonitor.getFocusDuckedUids();
+ }
+
public void unregisterAudioFocusClient(String clientId) {
new MediaMetrics.Item(mMetricsId + "focus")
.set(MediaMetrics.Property.CLIENT_NAME, clientId)
@@ -10014,6 +10030,68 @@
return mMediaFocusControl.getFocusRampTimeMs(focusGain, attr);
}
+ /**
+ * Test method to return the duration of the fade out applied on the players of a focus loser
+ * @see AudioManager#getFocusFadeOutDurationForTest()
+ * @return the fade out duration, in ms
+ */
+ @EnforcePermission("android.permission.QUERY_AUDIO_STATE")
+ public long getFocusFadeOutDurationForTest() {
+ super.getFocusFadeOutDurationForTest_enforcePermission();
+ return mMediaFocusControl.getFocusFadeOutDurationForTest();
+ }
+
+ /**
+ * Test method to return the length of time after a fade out before the focus loser is unmuted
+ * (and is faded back in).
+ * @see AudioManager#getFocusUnmuteDelayAfterFadeOutForTest()
+ * @return the time gap after a fade out completion on focus loss, and fade in start, in ms
+ */
+ @Override
+ @EnforcePermission("android.permission.QUERY_AUDIO_STATE")
+ public long getFocusUnmuteDelayAfterFadeOutForTest() {
+ super.getFocusUnmuteDelayAfterFadeOutForTest_enforcePermission();
+ return mMediaFocusControl.getFocusUnmuteDelayAfterFadeOutForTest();
+ }
+
+ /**
+ * Test method to start preventing applications from requesting audio focus during a test,
+ * which could interfere with the testing of the functionality/behavior under test.
+ * Calling this method needs to be paired with a call to {@link #exitAudioFocusFreezeForTest}
+ * when the testing is done. If this is not the case (e.g. in case of a test crash),
+ * a death observer mechanism will ensure the system is not left in a bad state, but this should
+ * not be relied on when implementing tests.
+ * @see AudioManager#enterAudioFocusFreezeForTest(List)
+ * @param cb IBinder to track the death of the client of this method
+ * @param exemptedUids a list of UIDs that are exempt from the freeze. This would for instance
+ * be those of the test runner and other players used in the test
+ * @return true if the focus freeze mode is successfully entered, false if there was an issue,
+ * such as another freeze currently used.
+ */
+ @Override
+ @EnforcePermission("android.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED")
+ public boolean enterAudioFocusFreezeForTest(IBinder cb, int[] exemptedUids) {
+ super.enterAudioFocusFreezeForTest_enforcePermission();
+ Objects.requireNonNull(exemptedUids);
+ Objects.requireNonNull(cb);
+ return mMediaFocusControl.enterAudioFocusFreezeForTest(cb, exemptedUids);
+ }
+
+ /**
+ * Test method to end preventing applications from requesting audio focus during a test.
+ * @see AudioManager#exitAudioFocusFreezeForTest()
+ * @param cb IBinder identifying the client of this method
+ * @return true if the focus freeze mode is successfully exited, false if there was an issue,
+ * such as the freeze already having ended, or not started.
+ */
+ @Override
+ @EnforcePermission("android.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED")
+ public boolean exitAudioFocusFreezeForTest(IBinder cb) {
+ super.exitAudioFocusFreezeForTest_enforcePermission();
+ Objects.requireNonNull(cb);
+ return mMediaFocusControl.exitAudioFocusFreezeForTest(cb);
+ }
+
/** only public for mocking/spying, do not call outside of AudioService */
@VisibleForTesting
public boolean hasAudioFocusUsers() {
@@ -10021,6 +10099,7 @@
}
/** see {@link AudioManager#getFadeOutDurationOnFocusLossMillis(AudioAttributes)} */
+ @Override
public long getFadeOutDurationOnFocusLossMillis(AudioAttributes aa) {
if (!enforceQueryAudioStateForTest("fade out duration")) {
return 0;
@@ -10742,6 +10821,27 @@
@Override
@android.annotation.EnforcePermission(MODIFY_AUDIO_SETTINGS_PRIVILEGED)
+ public boolean isCsdAsAFeatureAvailable() {
+ super.isCsdAsAFeatureAvailable_enforcePermission();
+ return mSoundDoseHelper.isCsdAsAFeatureAvailable();
+ }
+
+ @Override
+ @android.annotation.EnforcePermission(MODIFY_AUDIO_SETTINGS_PRIVILEGED)
+ public boolean isCsdAsAFeatureEnabled() {
+ super.isCsdAsAFeatureEnabled_enforcePermission();
+ return mSoundDoseHelper.isCsdAsAFeatureEnabled();
+ }
+
+ @Override
+ @android.annotation.EnforcePermission(MODIFY_AUDIO_SETTINGS_PRIVILEGED)
+ public void setCsdAsAFeatureEnabled(boolean csdToggleValue) {
+ super.setCsdAsAFeatureEnabled_enforcePermission();
+ mSoundDoseHelper.setCsdAsAFeatureEnabled(csdToggleValue);
+ }
+
+ @Override
+ @android.annotation.EnforcePermission(MODIFY_AUDIO_SETTINGS_PRIVILEGED)
public void setBluetoothAudioDeviceCategory(@NonNull String address, boolean isBle,
@AudioDeviceCategory int btAudioDeviceCategory) {
super.setBluetoothAudioDeviceCategory_enforcePermission();
diff --git a/services/core/java/com/android/server/audio/BtHelper.java b/services/core/java/com/android/server/audio/BtHelper.java
index 3560797..b350363 100644
--- a/services/core/java/com/android/server/audio/BtHelper.java
+++ b/services/core/java/com/android/server/audio/BtHelper.java
@@ -329,7 +329,7 @@
default:
break;
}
- if(broadcast) {
+ if (broadcast) {
broadcastScoConnectionState(scoAudioState);
//FIXME: this is to maintain compatibility with deprecated intent
// AudioManager.ACTION_SCO_AUDIO_STATE_CHANGED. Remove when appropriate.
@@ -459,6 +459,8 @@
//@GuardedBy("AudioDeviceBroker.mDeviceStateLock")
/*package*/ synchronized void onBtProfileDisconnected(int profile) {
+ AudioService.sDeviceLogger.enqueue(new EventLogger.StringEvent(
+ "BT profile " + BluetoothProfile.getProfileName(profile) + " disconnected"));
switch (profile) {
case BluetoothProfile.A2DP:
mA2dp = null;
@@ -487,6 +489,9 @@
@GuardedBy("AudioDeviceBroker.mDeviceStateLock")
/*package*/ synchronized void onBtProfileConnected(int profile, BluetoothProfile proxy) {
+ AudioService.sDeviceLogger.enqueue(new EventLogger.StringEvent(
+ "BT profile " + BluetoothProfile.getProfileName(profile) + " connected to proxy "
+ + proxy));
if (profile == BluetoothProfile.HEADSET) {
onHeadsetProfileConnected((BluetoothHeadset) proxy);
return;
@@ -718,8 +723,10 @@
checkScoAudioState();
if (state == BluetoothHeadset.STATE_AUDIO_CONNECTED) {
// Make sure that the state transitions to CONNECTING even if we cannot initiate
- // the connection.
- broadcastScoConnectionState(AudioManager.SCO_AUDIO_STATE_CONNECTING);
+ // the connection except if already connected internally
+ if (mScoAudioState != SCO_STATE_ACTIVE_INTERNAL) {
+ broadcastScoConnectionState(AudioManager.SCO_AUDIO_STATE_CONNECTING);
+ }
switch (mScoAudioState) {
case SCO_STATE_INACTIVE:
mScoAudioMode = scoAudioMode;
@@ -775,7 +782,7 @@
broadcastScoConnectionState(AudioManager.SCO_AUDIO_STATE_CONNECTED);
break;
case SCO_STATE_ACTIVE_INTERNAL:
- Log.w(TAG, "requestScoState: already in ACTIVE mode, simply return");
+ // Already in ACTIVE mode, simply return
break;
case SCO_STATE_ACTIVE_EXTERNAL:
/* Confirm SCO Audio connection to requesting app as it is already connected
diff --git a/services/core/java/com/android/server/audio/FocusRequester.java b/services/core/java/com/android/server/audio/FocusRequester.java
index 88a4b05..010d5f4 100644
--- a/services/core/java/com/android/server/audio/FocusRequester.java
+++ b/services/core/java/com/android/server/audio/FocusRequester.java
@@ -43,7 +43,7 @@
public class FocusRequester {
// on purpose not using this classe's name, as it will only be used from MediaFocusControl
- private static final String TAG = "MediaFocusControl";
+ private static final String TAG = "FocusRequester";
private static final boolean DEBUG = false;
private AudioFocusDeathHandler mDeathHandler; // may be null
@@ -340,6 +340,9 @@
@GuardedBy("MediaFocusControl.mAudioFocusLock")
boolean handleFocusLossFromGain(int focusGain, final FocusRequester frWinner, boolean forceDuck)
{
+ if (DEBUG) {
+ Log.i(TAG, "handleFocusLossFromGain for " + mClientId + " gain:" + focusGain);
+ }
final int focusLoss = focusLossForGainRequest(focusGain);
handleFocusLoss(focusLoss, frWinner, forceDuck);
return (focusLoss == AudioManager.AUDIOFOCUS_LOSS);
@@ -378,6 +381,9 @@
@GuardedBy("MediaFocusControl.mAudioFocusLock")
void handleFocusLoss(int focusLoss, @Nullable final FocusRequester frWinner, boolean forceDuck)
{
+ if (DEBUG) {
+ Log.i(TAG, "handleFocusLoss for " + mClientId + " loss:" + focusLoss);
+ }
try {
if (focusLoss != mFocusLossReceived) {
mFocusLossReceived = focusLoss;
@@ -427,6 +433,9 @@
toAudioFocusInfo(), true /* wasDispatched */);
mFocusLossWasNotified = true;
fd.dispatchAudioFocusChange(mFocusLossReceived, mClientId);
+ } else if (DEBUG) {
+ Log.i(TAG, "NOT dispatching " + focusChangeToString(mFocusLossReceived)
+ + " to " + mClientId + " no IAudioFocusDispatcher");
}
}
} catch (android.os.RemoteException e) {
diff --git a/services/core/java/com/android/server/audio/MediaFocusControl.java b/services/core/java/com/android/server/audio/MediaFocusControl.java
index b218096..65f6c9b 100644
--- a/services/core/java/com/android/server/audio/MediaFocusControl.java
+++ b/services/core/java/com/android/server/audio/MediaFocusControl.java
@@ -45,6 +45,7 @@
import java.io.PrintWriter;
import java.text.DateFormat;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
@@ -122,6 +123,23 @@
dumpMultiAudioFocus(pw);
}
+ /**
+ * Test method to return the duration of the fade out applied on the players of a focus loser
+ * @return the fade out duration in ms
+ */
+ public long getFocusFadeOutDurationForTest() {
+ return FadeOutManager.FADE_OUT_DURATION_MS;
+ }
+
+ /**
+ * Test method to return the length of time after a fade out before the focus loser is unmuted
+ * (and is faded back in).
+ * @return the time gap after a fade out completion on focus loss, and fade in start in ms
+ */
+ public long getFocusUnmuteDelayAfterFadeOutForTest() {
+ return FadeOutManager.DELAY_FADE_IN_OFFENDERS_MS;
+ }
+
//=================================================================
// PlayerFocusEnforcer implementation
@Override
@@ -304,17 +322,26 @@
@GuardedBy("mAudioFocusLock")
private void propagateFocusLossFromGain_syncAf(int focusGain, final FocusRequester fr,
boolean forceDuck) {
+ if (DEBUG) {
+ Log.i(TAG, "propagateFocusLossFromGain_syncAf gain:" + focusGain);
+ }
final List<String> clientsToRemove = new LinkedList<String>();
// going through the audio focus stack to signal new focus, traversing order doesn't
// matter as all entries respond to the same external focus gain
if (!mFocusStack.empty()) {
for (FocusRequester focusLoser : mFocusStack) {
+ if (DEBUG) {
+ Log.i(TAG, "propagateFocusLossFromGain_syncAf checking client:"
+ + focusLoser.getClientId());
+ }
final boolean isDefinitiveLoss =
focusLoser.handleFocusLossFromGain(focusGain, fr, forceDuck);
if (isDefinitiveLoss) {
clientsToRemove.add(focusLoser.getClientId());
}
}
+ } else if (DEBUG) {
+ Log.i(TAG, "propagateFocusLossFromGain_syncAf empty stack");
}
if (mMultiAudioFocusEnabled && !mMultiAudioFocusList.isEmpty()) {
@@ -370,6 +397,9 @@
@GuardedBy("mAudioFocusLock")
private void removeFocusStackEntry(String clientToRemove, boolean signal,
boolean notifyFocusFollowers) {
+ if (DEBUG) {
+ Log.i(TAG, "removeFocusStackEntry client:" + clientToRemove);
+ }
AudioFocusInfo abandonSource = null;
// is the current top of the focus stack abandoning focus? (because of request, not death)
if (!mFocusStack.empty() && mFocusStack.peek().hasSameClient(clientToRemove))
@@ -1000,6 +1030,24 @@
}
synchronized(mAudioFocusLock) {
+ // check whether a focus freeze is in place and filter
+ if (isFocusFrozenForTest()) {
+ int focusRequesterUid;
+ if ((flags & AudioManager.AUDIOFOCUS_FLAG_TEST)
+ == AudioManager.AUDIOFOCUS_FLAG_TEST) {
+ focusRequesterUid = testUid;
+ } else {
+ focusRequesterUid = Binder.getCallingUid();
+ }
+ if (isFocusFrozenForTestForUid(focusRequesterUid)) {
+ Log.i(TAG, "requestAudioFocus: focus frozen for test for uid:"
+ + focusRequesterUid);
+ return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
+ }
+ Log.i(TAG, "requestAudioFocus: focus frozen for test but uid:" + focusRequesterUid
+ + " is exempt");
+ }
+
if (mFocusStack.size() > MAX_STACK_SIZE) {
Log.e(TAG, "Max AudioFocus stack size reached, failing requestAudioFocus()");
return AudioManager.AUDIOFOCUS_REQUEST_FAILED;
@@ -1191,6 +1239,110 @@
return AudioManager.AUDIOFOCUS_REQUEST_GRANTED;
}
+ /**
+ * Reference to the caller of {@link #enterAudioFocusFreezeForTest(IBinder, int[])}
+ * Will be null when there is no focus freeze for test
+ */
+ @GuardedBy("mAudioFocusLock")
+ @Nullable
+ private IBinder mFocusFreezerForTest = null;
+
+ /**
+ * The death handler for {@link #mFocusFreezerForTest}
+ * Will be null when there is no focus freeze for test
+ */
+ @GuardedBy("mAudioFocusLock")
+ @Nullable
+ private IBinder.DeathRecipient mFocusFreezerDeathHandler = null;
+
+ /**
+ * Array of UIDs exempt from focus freeze when focus is frozen for test, null during normal
+ * operations.
+ * Will be null when there is no focus freeze for test
+ */
+ @GuardedBy("mAudioFocusLock")
+ @Nullable
+ private int[] mFocusFreezeExemptUids = null;
+
+ @GuardedBy("mAudioFocusLock")
+ private boolean isFocusFrozenForTest() {
+ return (mFocusFreezerForTest != null);
+ }
+
+ /**
+ * Checks if the given UID can request focus when a focus freeze is in place for a test.
+ * Focus can be requested if focus is not frozen or if it's frozen but the UID is exempt.
+ * @param uidToCheck
+ * @return true if that UID is barred from requesting focus, false if its focus request
+ * can proceed being processed
+ */
+ @GuardedBy("mAudioFocusLock")
+ private boolean isFocusFrozenForTestForUid(int uidToCheck) {
+ if (isFocusFrozenForTest()) {
+ return false;
+ }
+ // check the list of exempts (array is not null because we're in a freeze for test
+ for (int uid : mFocusFreezeExemptUids) {
+ if (uid == uidToCheck) {
+ return false;
+ }
+ }
+ // uid was not found in the exempt list, its focus request is denied
+ return true;
+ }
+
+ protected boolean enterAudioFocusFreezeForTest(
+ @NonNull IBinder cb, @NonNull int[] exemptedUids) {
+ Log.i(TAG, "enterAudioFocusFreezeForTest UIDs exempt:" + Arrays.toString(exemptedUids));
+ synchronized (mAudioFocusLock) {
+ if (mFocusFreezerForTest != null) {
+ Log.e(TAG, "Error enterAudioFocusFreezeForTest: focus already frozen");
+ return false;
+ }
+ // new focus freeze, register death handler
+ try {
+ mFocusFreezerDeathHandler = new IBinder.DeathRecipient() {
+ @Override
+ public void binderDied() {
+ Log.i(TAG, "Audio focus freezer died, exiting focus freeze for test");
+ releaseFocusFreeze();
+ }
+ };
+ cb.linkToDeath(mFocusFreezerDeathHandler, 0);
+ mFocusFreezerForTest = cb;
+ mFocusFreezeExemptUids = exemptedUids.clone();
+ } catch (RemoteException e) {
+ // client has already died!
+ mFocusFreezerForTest = null;
+ mFocusFreezeExemptUids = null;
+ return false;
+ }
+ }
+ return true;
+ }
+
+ protected boolean exitAudioFocusFreezeForTest(@NonNull IBinder cb) {
+ synchronized (mAudioFocusLock) {
+ if (mFocusFreezerForTest != cb) {
+ Log.e(TAG, "Error exitAudioFocusFreezeForTest: "
+ + ((mFocusFreezerForTest == null)
+ ? "call to exit while not frozen"
+ : "call to exit not coming from freeze owner"));
+ return false;
+ }
+ mFocusFreezerForTest.unlinkToDeath(mFocusFreezerDeathHandler, 0);
+ releaseFocusFreeze();
+ }
+ return true;
+ }
+
+ private void releaseFocusFreeze() {
+ synchronized (mAudioFocusLock) {
+ mFocusFreezerDeathHandler = null;
+ mFocusFreezeExemptUids = null;
+ mFocusFreezerForTest = null;
+ }
+ }
protected void unregisterAudioFocusClient(String clientId) {
synchronized(mAudioFocusLock) {
diff --git a/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java b/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java
index 23a0782..54fa6fb 100644
--- a/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java
+++ b/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java
@@ -1208,6 +1208,17 @@
}
}
+ protected @NonNull List<Integer> getFocusDuckedUids() {
+ final ArrayList<Integer> duckedUids;
+ synchronized (mPlayerLock) {
+ duckedUids = new ArrayList(mDuckingManager.mDuckers.keySet());
+ }
+ if (DEBUG) {
+ Log.i(TAG, "current ducked UIDs: " + duckedUids);
+ }
+ return duckedUids;
+ }
+
//=================================================================
// For logging
private static final class PlayerEvent extends EventLogger.Event {
diff --git a/services/core/java/com/android/server/audio/SoundDoseHelper.java b/services/core/java/com/android/server/audio/SoundDoseHelper.java
index 1578193..95b6c2c 100644
--- a/services/core/java/com/android/server/audio/SoundDoseHelper.java
+++ b/services/core/java/com/android/server/audio/SoundDoseHelper.java
@@ -37,13 +37,11 @@
import android.media.ISoundDoseCallback;
import android.media.SoundDoseRecord;
import android.os.Binder;
-import android.os.HandlerExecutor;
import android.os.Message;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.UserHandle;
-import android.provider.DeviceConfig;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
@@ -143,8 +141,6 @@
private static final int SAFE_MEDIA_VOLUME_UNINITIALIZED = -1;
- private static final String FEATURE_FLAG_ENABLE_CSD = "enable_csd";
-
private final EventLogger mLogger = new EventLogger(AudioService.LOG_NB_EVENTS_SOUND_DOSE,
"CSD updates");
@@ -193,7 +189,15 @@
private final AtomicBoolean mEnableCsd = new AtomicBoolean(false);
- private ArrayList<ISoundDose.AudioDeviceCategory> mCachedAudioDeviceCategories =
+ private final Object mCsdAsAFeatureLock = new Object();
+
+ @GuardedBy("mCsdAsAFeatureLock")
+ private boolean mIsCsdAsAFeatureAvailable = false;
+
+ @GuardedBy("mCsdAsAFeatureLock")
+ private boolean mIsCsdAsAFeatureEnabled = false;
+
+ private final ArrayList<ISoundDose.AudioDeviceCategory> mCachedAudioDeviceCategories =
new ArrayList<>();
private final Object mCsdStateLock = new Object();
@@ -315,10 +319,6 @@
mAlarmManager = (AlarmManager) mContext.getSystemService(
Context.ALARM_SERVICE);
-
- DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_MEDIA,
- new HandlerExecutor(mAudioHandler),
- p -> updateCsdEnabled("onPropertiesChanged"));
}
void initSafeVolumes() {
@@ -493,6 +493,38 @@
return false;
}
+ boolean isCsdAsAFeatureAvailable() {
+ synchronized (mCsdAsAFeatureLock) {
+ return mIsCsdAsAFeatureAvailable;
+ }
+ }
+
+ boolean isCsdAsAFeatureEnabled() {
+ synchronized (mCsdAsAFeatureLock) {
+ return mIsCsdAsAFeatureEnabled;
+ }
+ }
+
+ void setCsdAsAFeatureEnabled(boolean csdAsAFeatureEnabled) {
+ boolean doUpdate;
+ synchronized (mCsdAsAFeatureLock) {
+ doUpdate = mIsCsdAsAFeatureEnabled != csdAsAFeatureEnabled && mIsCsdAsAFeatureAvailable;
+ mIsCsdAsAFeatureEnabled = csdAsAFeatureEnabled;
+ final long callingIdentity = Binder.clearCallingIdentity();
+ try {
+ mSettings.putSecureIntForUser(mAudioService.getContentResolver(),
+ Settings.Secure.AUDIO_SAFE_CSD_AS_A_FEATURE_ENABLED,
+ mIsCsdAsAFeatureEnabled ? 1 : 0, UserHandle.USER_CURRENT);
+ } finally {
+ Binder.restoreCallingIdentity(callingIdentity);
+ }
+ }
+
+ if (doUpdate) {
+ updateCsdEnabled("setCsdAsAFeatureEnabled");
+ }
+ }
+
void setAudioDeviceCategory(String address, int internalAudioType, boolean isHeadphone) {
if (!mEnableCsd.get()) {
return;
@@ -863,6 +895,13 @@
Log.e(TAG, "Exception while forcing the internal MEL computation", e);
}
+ synchronized (mCsdAsAFeatureLock) {
+ mIsCsdAsAFeatureEnabled = mSettings.getSecureIntForUser(
+ mAudioService.getContentResolver(),
+ Settings.Secure.AUDIO_SAFE_CSD_AS_A_FEATURE_ENABLED, 0,
+ UserHandle.USER_CURRENT) != 0;
+ }
+
synchronized (mCsdStateLock) {
if (mGlobalTimeOffsetInSecs == GLOBAL_TIME_OFFSET_UNINITIALIZED) {
mGlobalTimeOffsetInSecs = System.currentTimeMillis() / 1000L;
@@ -907,18 +946,23 @@
@GuardedBy("mSafeMediaVolumeStateLock")
private void updateSafeMediaVolume_l(String caller) {
- boolean safeMediaVolumeEnabled =
- SystemProperties.getBoolean(SYSTEM_PROPERTY_SAFEMEDIA_FORCE, false)
- || (mContext.getResources().getBoolean(
- com.android.internal.R.bool.config_safe_media_volume_enabled)
- && !mEnableCsd.get());
boolean safeMediaVolumeBypass =
- SystemProperties.getBoolean(SYSTEM_PROPERTY_SAFEMEDIA_BYPASS, false);
+ SystemProperties.getBoolean(SYSTEM_PROPERTY_SAFEMEDIA_BYPASS, false)
+ || mEnableCsd.get();
+ boolean safeMediaVolumeForce = SystemProperties.getBoolean(SYSTEM_PROPERTY_SAFEMEDIA_FORCE,
+ false);
+ // we are using the MCC overlaid legacy flag used for the safe volume enablement
+ // to determine whether the MCC enforces any safe hearing standard.
+ boolean mccEnforcedSafeMediaVolume = mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_safe_media_volume_enabled);
+
+ boolean safeVolumeEnabled =
+ (mccEnforcedSafeMediaVolume || safeMediaVolumeForce) && !safeMediaVolumeBypass;
// The persisted state is either "disabled" or "active": this is the state applied
// next time we boot and cannot be "inactive"
int persistedState;
- if (safeMediaVolumeEnabled && !safeMediaVolumeBypass) {
+ if (safeVolumeEnabled) {
persistedState = SAFE_MEDIA_VOLUME_ACTIVE;
// The state can already be "inactive" here if the user has forced it before
// the 30 seconds timeout for forced configuration. In this case we don't reset
@@ -945,22 +989,28 @@
}
private void updateCsdEnabled(String caller) {
- boolean newEnableCsd = SystemProperties.getBoolean(SYSTEM_PROPERTY_SAFEMEDIA_CSD_FORCE,
- false);
- if (!newEnableCsd) {
- final String featureFlagEnableCsdValue = DeviceConfig.getProperty(
- DeviceConfig.NAMESPACE_MEDIA,
- FEATURE_FLAG_ENABLE_CSD);
- if (featureFlagEnableCsdValue != null) {
- newEnableCsd = Boolean.parseBoolean(featureFlagEnableCsdValue);
+ boolean csdForce = SystemProperties.getBoolean(SYSTEM_PROPERTY_SAFEMEDIA_CSD_FORCE, false);
+ // we are using the MCC overlaid legacy flag used for the safe volume enablement
+ // to determine whether the MCC enforces any safe hearing standard.
+ boolean mccEnforcedSafeMedia = mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_safe_media_volume_enabled);
+ boolean csdEnable = mContext.getResources().getBoolean(
+ R.bool.config_safe_sound_dosage_enabled);
+ boolean newEnabledCsd = (mccEnforcedSafeMedia && csdEnable) || csdForce;
+
+ synchronized (mCsdAsAFeatureLock) {
+ if (!mccEnforcedSafeMedia && csdEnable) {
+ mIsCsdAsAFeatureAvailable = true;
+ newEnabledCsd = mIsCsdAsAFeatureEnabled || csdForce;
+ Log.v(TAG, caller + ": CSD as a feature is not enforced and enabled: "
+ + newEnabledCsd);
} else {
- newEnableCsd = mContext.getResources().getBoolean(
- R.bool.config_safe_sound_dosage_enabled);
+ mIsCsdAsAFeatureAvailable = false;
}
}
- if (mEnableCsd.compareAndSet(!newEnableCsd, newEnableCsd)) {
- Log.i(TAG, caller + ": enable CSD " + newEnableCsd);
+ if (mEnableCsd.compareAndSet(!newEnabledCsd, newEnabledCsd)) {
+ Log.i(TAG, caller + ": enabled CSD " + newEnabledCsd);
initCsd();
synchronized (mSafeMediaVolumeStateLock) {
diff --git a/services/core/java/com/android/server/biometrics/AuthenticationStats.java b/services/core/java/com/android/server/biometrics/AuthenticationStats.java
index 137a418..e109cc8 100644
--- a/services/core/java/com/android/server/biometrics/AuthenticationStats.java
+++ b/services/core/java/com/android/server/biometrics/AuthenticationStats.java
@@ -22,6 +22,8 @@
*/
public class AuthenticationStats {
+ private static final float FRR_NOT_ENOUGH_ATTEMPTS = -1.0f;
+
private final int mUserId;
private int mTotalAttempts;
private int mRejectedAttempts;
@@ -70,7 +72,7 @@
if (mTotalAttempts > 0) {
return mRejectedAttempts / (float) mTotalAttempts;
} else {
- return -1.0f;
+ return FRR_NOT_ENOUGH_ATTEMPTS;
}
}
@@ -87,4 +89,32 @@
mTotalAttempts = 0;
mRejectedAttempts = 0;
}
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+
+ if (!(obj instanceof AuthenticationStats)) {
+ return false;
+ }
+
+ AuthenticationStats target = (AuthenticationStats) obj;
+ return this.getUserId() == target.getUserId()
+ && this.getTotalAttempts()
+ == target.getTotalAttempts()
+ && this.getRejectedAttempts()
+ == target.getRejectedAttempts()
+ && this.getEnrollmentNotifications()
+ == target.getEnrollmentNotifications()
+ && this.getModality() == target.getModality();
+ }
+
+ @Override
+ public int hashCode() {
+ return String.format("userId: %d, totalAttempts: %d, rejectedAttempts: %d, "
+ + "enrollmentNotifications: %d, modality: %d", mUserId, mTotalAttempts,
+ mRejectedAttempts, mEnrollmentNotifications, mModality).hashCode();
+ }
}
diff --git a/services/core/java/com/android/server/biometrics/AuthenticationStatsCollector.java b/services/core/java/com/android/server/biometrics/AuthenticationStatsCollector.java
index c9cd814..97e5c6f 100644
--- a/services/core/java/com/android/server/biometrics/AuthenticationStatsCollector.java
+++ b/services/core/java/com/android/server/biometrics/AuthenticationStatsCollector.java
@@ -18,10 +18,18 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.content.BroadcastReceiver;
import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.pm.PackageManager;
+import android.hardware.face.FaceManager;
+import android.hardware.fingerprint.FingerprintManager;
+import android.os.UserHandle;
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.biometrics.sensors.BiometricNotification;
import java.util.HashMap;
import java.util.Map;
@@ -37,23 +45,60 @@
// The minimum number of attempts that will calculate the FRR and trigger the notification.
private static final int MINIMUM_ATTEMPTS = 500;
+ // Upload the data every 50 attempts (average number of daily authentications).
+ private static final int AUTHENTICATION_UPLOAD_INTERVAL = 50;
// The maximum number of eligible biometric enrollment notification can be sent.
private static final int MAXIMUM_ENROLLMENT_NOTIFICATIONS = 2;
+ @NonNull private final Context mContext;
+
private final float mThreshold;
private final int mModality;
@NonNull private final Map<Integer, AuthenticationStats> mUserAuthenticationStatsMap;
- public AuthenticationStatsCollector(@NonNull Context context, int modality) {
+ // TODO(b/295582896): Find a way to make this NonNull
+ @Nullable private AuthenticationStatsPersister mAuthenticationStatsPersister;
+ @NonNull private BiometricNotification mBiometricNotification;
+
+ private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(@NonNull Context context, @NonNull Intent intent) {
+ final int userId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL);
+ if (userId != UserHandle.USER_NULL
+ && intent.getAction().equals(Intent.ACTION_USER_REMOVED)) {
+ onUserRemoved(userId);
+ }
+ }
+ };
+
+ public AuthenticationStatsCollector(@NonNull Context context, int modality,
+ @NonNull BiometricNotification biometricNotification) {
+ mContext = context;
mThreshold = context.getResources()
.getFraction(R.fraction.config_biometricNotificationFrrThreshold, 1, 1);
mUserAuthenticationStatsMap = new HashMap<>();
mModality = modality;
+ mBiometricNotification = biometricNotification;
+
+ context.registerReceiver(mBroadcastReceiver, new IntentFilter(Intent.ACTION_USER_REMOVED));
+ }
+
+ private void initializeUserAuthenticationStatsMap() {
+ mAuthenticationStatsPersister = new AuthenticationStatsPersister(mContext);
+ for (AuthenticationStats stats : mAuthenticationStatsPersister.getAllFrrStats(mModality)) {
+ mUserAuthenticationStatsMap.put(stats.getUserId(), stats);
+ }
}
/** Update total authentication and rejected attempts. */
public void authenticate(int userId, boolean authenticated) {
+ // SharedPreference is not ready when starting system server, initialize
+ // mUserAuthenticationStatsMap in authentication to ensure SharedPreference
+ // is ready for application use.
+ if (mUserAuthenticationStatsMap.isEmpty()) {
+ initializeUserAuthenticationStatsMap();
+ }
// Check if this is a new user.
if (!mUserAuthenticationStatsMap.containsKey(userId)) {
mUserAuthenticationStatsMap.put(userId, new AuthenticationStats(userId, mModality));
@@ -67,26 +112,67 @@
sendNotificationIfNeeded(userId);
}
+ /** Check if a notification should be sent after a calculation cycle. */
private void sendNotificationIfNeeded(int userId) {
AuthenticationStats authenticationStats = mUserAuthenticationStatsMap.get(userId);
- if (authenticationStats.getTotalAttempts() >= MINIMUM_ATTEMPTS) {
- // Send notification if FRR exceeds the threshold
- if (authenticationStats.getEnrollmentNotifications() < MAXIMUM_ENROLLMENT_NOTIFICATIONS
- && authenticationStats.getFrr() >= mThreshold) {
- // TODO(wenhuiy): Send notifications.
- }
+ if (authenticationStats.getTotalAttempts() < MINIMUM_ATTEMPTS) {
+ return;
+ }
+ // Don't send notification if FRR below the threshold.
+ if (authenticationStats.getEnrollmentNotifications() >= MAXIMUM_ENROLLMENT_NOTIFICATIONS
+ || authenticationStats.getFrr() < mThreshold) {
authenticationStats.resetData();
+ return;
+ }
+
+ authenticationStats.resetData();
+
+ final PackageManager packageManager = mContext.getPackageManager();
+
+ // Don't send notification to single-modality devices.
+ if (!packageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)
+ || !packageManager.hasSystemFeature(PackageManager.FEATURE_FACE)) {
+ return;
+ }
+
+ final FaceManager faceManager = mContext.getSystemService(FaceManager.class);
+ final boolean hasEnrolledFace = faceManager.hasEnrolledTemplates(userId);
+
+ final FingerprintManager fingerprintManager = mContext
+ .getSystemService(FingerprintManager.class);
+ final boolean hasEnrolledFingerprint = fingerprintManager.hasEnrolledTemplates(userId);
+
+ // Don't send notification when both face and fingerprint are enrolled.
+ if (hasEnrolledFace && hasEnrolledFingerprint) {
+ return;
+ }
+ if (hasEnrolledFace && !hasEnrolledFingerprint) {
+ mBiometricNotification.sendFpEnrollNotification(mContext);
+ } else if (!hasEnrolledFace && hasEnrolledFingerprint) {
+ mBiometricNotification.sendFaceEnrollNotification(mContext);
}
}
private void persistDataIfNeeded(int userId) {
AuthenticationStats authenticationStats = mUserAuthenticationStatsMap.get(userId);
- if (authenticationStats.getTotalAttempts() % 50 == 0) {
- // TODO(wenhuiy): Persist data.
+ if (authenticationStats.getTotalAttempts() % AUTHENTICATION_UPLOAD_INTERVAL == 0) {
+ mAuthenticationStatsPersister.persistFrrStats(authenticationStats.getUserId(),
+ authenticationStats.getTotalAttempts(),
+ authenticationStats.getRejectedAttempts(),
+ authenticationStats.getEnrollmentNotifications(),
+ authenticationStats.getModality());
}
}
+ private void onUserRemoved(final int userId) {
+ if (mAuthenticationStatsPersister == null) {
+ initializeUserAuthenticationStatsMap();
+ }
+ mUserAuthenticationStatsMap.remove(userId);
+ mAuthenticationStatsPersister.removeFrrStats(userId);
+ }
+
/**
* Only being used in tests. Callers should not make any changes to the returned
* authentication stats.
diff --git a/services/core/java/com/android/server/biometrics/AuthenticationStatsPersister.java b/services/core/java/com/android/server/biometrics/AuthenticationStatsPersister.java
new file mode 100644
index 0000000..21e93a8
--- /dev/null
+++ b/services/core/java/com/android/server/biometrics/AuthenticationStatsPersister.java
@@ -0,0 +1,215 @@
+/*
+ * 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.server.biometrics;
+
+import android.annotation.NonNull;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.hardware.biometrics.BiometricsProtoEnums;
+import android.os.Environment;
+import android.util.Slog;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Persists and retrieves stats for Biometric Authentication.
+ * Authentication stats include userId, total attempts, rejected attempts,
+ * and the number of sent enrollment notifications.
+ * Data are stored in SharedPreferences in a form of a set of JSON objects,
+ * where it's one element per user.
+ */
+public class AuthenticationStatsPersister {
+
+ private static final String TAG = "AuthenticationStatsPersister";
+ private static final String FILE_NAME = "authentication_stats";
+ private static final String USER_ID = "user_id";
+ private static final String FACE_ATTEMPTS = "face_attempts";
+ private static final String FACE_REJECTIONS = "face_rejections";
+ private static final String FINGERPRINT_ATTEMPTS = "fingerprint_attempts";
+ private static final String FINGERPRINT_REJECTIONS = "fingerprint_rejections";
+ private static final String ENROLLMENT_NOTIFICATIONS = "enrollment_notifications";
+ private static final String KEY = "frr_stats";
+
+ @NonNull private final SharedPreferences mSharedPreferences;
+
+ AuthenticationStatsPersister(@NonNull Context context) {
+ // The package info in the context isn't initialized in the way it is for normal apps,
+ // so the standard, name-based context.getSharedPreferences doesn't work. Instead, we
+ // build the path manually below using the same policy that appears in ContextImpl.
+ final File prefsFile = new File(Environment.getDataSystemDeDirectory(), FILE_NAME);
+ mSharedPreferences = context.getSharedPreferences(prefsFile, Context.MODE_PRIVATE);
+ }
+
+ /**
+ * Get all frr data from SharedPreference.
+ */
+ public List<AuthenticationStats> getAllFrrStats(int modality) {
+ List<AuthenticationStats> authenticationStatsList = new ArrayList<>();
+ for (String frrStats : readFrrStats()) {
+ try {
+ JSONObject frrStatsJson = new JSONObject(frrStats);
+ if (modality == BiometricsProtoEnums.MODALITY_FACE) {
+ authenticationStatsList.add(new AuthenticationStats(
+ getIntValue(frrStatsJson, USER_ID, -1 /* defaultValue */),
+ getIntValue(frrStatsJson, FACE_ATTEMPTS),
+ getIntValue(frrStatsJson, FACE_REJECTIONS),
+ getIntValue(frrStatsJson, ENROLLMENT_NOTIFICATIONS),
+ modality));
+ } else if (modality == BiometricsProtoEnums.MODALITY_FINGERPRINT) {
+ authenticationStatsList.add(new AuthenticationStats(
+ getIntValue(frrStatsJson, USER_ID, -1 /* defaultValue */),
+ getIntValue(frrStatsJson, FINGERPRINT_ATTEMPTS),
+ getIntValue(frrStatsJson, FINGERPRINT_REJECTIONS),
+ getIntValue(frrStatsJson, ENROLLMENT_NOTIFICATIONS),
+ modality));
+ }
+ } catch (JSONException e) {
+ Slog.w(TAG, String.format("Unable to resolve authentication stats JSON: %s",
+ frrStats));
+ }
+ }
+ return authenticationStatsList;
+ }
+
+ /**
+ * Remove frr data for a specific user.
+ */
+ public void removeFrrStats(int userId) {
+ try {
+ // Copy into a new HashSet to allow modification.
+ Set<String> frrStatsSet = new HashSet<>(readFrrStats());
+
+ // Remove the old authentication stat for the user if it exists.
+ for (Iterator<String> iterator = frrStatsSet.iterator(); iterator.hasNext();) {
+ String frrStats = iterator.next();
+ JSONObject frrStatJson = new JSONObject(frrStats);
+ if (getValue(frrStatJson, USER_ID).equals(String.valueOf(userId))) {
+ iterator.remove();
+ break;
+ }
+ }
+
+ mSharedPreferences.edit().putStringSet(KEY, frrStatsSet).apply();
+ } catch (JSONException ignored) {
+ }
+ }
+
+ /**
+ * Persist frr data for a specific user.
+ */
+ public void persistFrrStats(int userId, int totalAttempts, int rejectedAttempts,
+ int enrollmentNotifications, int modality) {
+ try {
+ // Copy into a new HashSet to allow modification.
+ Set<String> frrStatsSet = new HashSet<>(readFrrStats());
+
+ // Remove the old authentication stat for the user if it exists.
+ JSONObject frrStatJson = null;
+ for (Iterator<String> iterator = frrStatsSet.iterator(); iterator.hasNext();) {
+ String frrStats = iterator.next();
+ frrStatJson = new JSONObject(frrStats);
+ if (getValue(frrStatJson, USER_ID).equals(String.valueOf(userId))) {
+ iterator.remove();
+ break;
+ }
+ }
+
+ // If there's existing frr stats in the file, we want to update the stats for the given
+ // modality and keep the stats for other modalities.
+ if (frrStatJson != null) {
+ frrStatsSet.add(buildFrrStats(frrStatJson, totalAttempts, rejectedAttempts,
+ enrollmentNotifications, modality));
+ } else {
+ frrStatsSet.add(buildFrrStats(userId, totalAttempts, rejectedAttempts,
+ enrollmentNotifications, modality));
+ }
+
+ mSharedPreferences.edit().putStringSet(KEY, frrStatsSet).apply();
+
+ } catch (JSONException e) {
+ Slog.e(TAG, "Unable to persist authentication stats");
+ }
+ }
+
+ private Set<String> readFrrStats() {
+ return mSharedPreferences.getStringSet(KEY, Set.of());
+ }
+
+ // Update frr stats for existing frrStats JSONObject and build the new string.
+ private String buildFrrStats(JSONObject frrStats, int totalAttempts, int rejectedAttempts,
+ int enrollmentNotifications, int modality) throws JSONException {
+ if (modality == BiometricsProtoEnums.MODALITY_FACE) {
+ return frrStats
+ .put(FACE_ATTEMPTS, totalAttempts)
+ .put(FACE_REJECTIONS, rejectedAttempts)
+ .put(ENROLLMENT_NOTIFICATIONS, enrollmentNotifications)
+ .toString();
+ } else if (modality == BiometricsProtoEnums.MODALITY_FINGERPRINT) {
+ return frrStats
+ .put(FINGERPRINT_ATTEMPTS, totalAttempts)
+ .put(FINGERPRINT_REJECTIONS, rejectedAttempts)
+ .put(ENROLLMENT_NOTIFICATIONS, enrollmentNotifications)
+ .toString();
+ } else {
+ return frrStats.toString();
+ }
+ }
+
+ // Build string for new user and new authentication stats.
+ private String buildFrrStats(int userId, int totalAttempts, int rejectedAttempts,
+ int enrollmentNotifications, int modality)
+ throws JSONException {
+ if (modality == BiometricsProtoEnums.MODALITY_FACE) {
+ return new JSONObject()
+ .put(USER_ID, userId)
+ .put(FACE_ATTEMPTS, totalAttempts)
+ .put(FACE_REJECTIONS, rejectedAttempts)
+ .put(ENROLLMENT_NOTIFICATIONS, enrollmentNotifications)
+ .toString();
+ } else if (modality == BiometricsProtoEnums.MODALITY_FINGERPRINT) {
+ return new JSONObject()
+ .put(USER_ID, userId)
+ .put(FINGERPRINT_ATTEMPTS, totalAttempts)
+ .put(FINGERPRINT_REJECTIONS, rejectedAttempts)
+ .put(ENROLLMENT_NOTIFICATIONS, enrollmentNotifications)
+ .toString();
+ } else {
+ return "";
+ }
+ }
+
+ private String getValue(JSONObject jsonObject, String key) throws JSONException {
+ return jsonObject.has(key) ? jsonObject.getString(key) : "";
+ }
+
+ private int getIntValue(JSONObject jsonObject, String key) throws JSONException {
+ return getIntValue(jsonObject, key, 0 /* defaultValue */);
+ }
+
+ private int getIntValue(JSONObject jsonObject, String key, int defaultValue)
+ throws JSONException {
+ return jsonObject.has(key) ? jsonObject.getInt(key) : defaultValue;
+ }
+}
diff --git a/services/core/java/com/android/server/biometrics/log/OperationContextExt.java b/services/core/java/com/android/server/biometrics/log/OperationContextExt.java
index 4a10e8e..f78ca43 100644
--- a/services/core/java/com/android/server/biometrics/log/OperationContextExt.java
+++ b/services/core/java/com/android/server/biometrics/log/OperationContextExt.java
@@ -103,8 +103,14 @@
*/
@NonNull
public OperationContext toAidlContext(@NonNull FingerprintAuthenticateOptions options) {
- mAidlContext.authenticateReason = AuthenticateReason
- .fingerprintAuthenticateReason(getAuthReason(options));
+ if (options.getVendorReason() != null) {
+ mAidlContext.authenticateReason = AuthenticateReason
+ .vendorAuthenticateReason(options.getVendorReason());
+
+ } else {
+ mAidlContext.authenticateReason = AuthenticateReason
+ .fingerprintAuthenticateReason(getAuthReason(options));
+ }
mAidlContext.wakeReason = getWakeReason(options);
return mAidlContext;
diff --git a/services/core/java/com/android/server/biometrics/sensors/BiometricNotification.java b/services/core/java/com/android/server/biometrics/sensors/BiometricNotification.java
new file mode 100644
index 0000000..90e1860
--- /dev/null
+++ b/services/core/java/com/android/server/biometrics/sensors/BiometricNotification.java
@@ -0,0 +1,36 @@
+/*
+ * 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.server.biometrics.sensors;
+
+import android.annotation.NonNull;
+import android.content.Context;
+
+/**
+ * Interface for biometrics to send notifications.
+ */
+public interface BiometricNotification {
+
+ /**
+ * Sends a face enrollment notification.
+ */
+ void sendFaceEnrollNotification(@NonNull Context context);
+
+ /**
+ * Sends a fingerprint enrollment notification.
+ */
+ void sendFpEnrollNotification(@NonNull Context context);
+}
diff --git a/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationImpl.java b/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationImpl.java
new file mode 100644
index 0000000..7b42046
--- /dev/null
+++ b/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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.server.biometrics.sensors;
+
+import android.annotation.NonNull;
+import android.content.Context;
+
+import com.android.server.biometrics.AuthenticationStatsCollector;
+
+/**
+ * Implementation to send biometric notifications for {@link AuthenticationStatsCollector}.
+ */
+public class BiometricNotificationImpl implements BiometricNotification {
+
+ @Override
+ public void sendFaceEnrollNotification(@NonNull Context context) {
+ BiometricNotificationUtils.showFaceEnrollNotification(context);
+ }
+
+ @Override
+ public void sendFpEnrollNotification(@NonNull Context context) {
+ BiometricNotificationUtils.showFingerprintEnrollNotification(context);
+ }
+}
diff --git a/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java b/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java
index f516a49..2ff695d 100644
--- a/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java
+++ b/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java
@@ -35,9 +35,22 @@
public class BiometricNotificationUtils {
private static final String TAG = "BiometricNotificationUtils";
- private static final String RE_ENROLL_NOTIFICATION_TAG = "FaceService";
- private static final String BAD_CALIBRATION_NOTIFICATION_TAG = "FingerprintService";
+ private static final String FACE_RE_ENROLL_NOTIFICATION_TAG = "FaceReEnroll";
+ private static final String FACE_ENROLL_NOTIFICATION_TAG = "FaceEnroll";
+ private static final String FINGERPRINT_ENROLL_NOTIFICATION_TAG = "FingerprintEnroll";
+ private static final String BAD_CALIBRATION_NOTIFICATION_TAG = "FingerprintBadCalibration";
private static final String KEY_RE_ENROLL_FACE = "re_enroll_face_unlock";
+ private static final String FACE_SETTINGS_ACTION = "android.settings.FACE_SETTINGS";
+ private static final String FINGERPRINT_SETTINGS_ACTION =
+ "android.settings.FINGERPRINT_SETTINGS";
+ private static final String FACE_ENROLL_ACTION = "android.settings.FACE_ENROLL";
+ private static final String FINGERPRINT_ENROLL_ACTION = "android.settings.FINGERPRINT_ENROLL";
+ private static final String SETTINGS_PACKAGE = "com.android.settings";
+ private static final String FACE_ENROLL_CHANNEL = "FaceEnrollNotificationChannel";
+ private static final String FACE_RE_ENROLL_CHANNEL = "FaceReEnrollNotificationChannel";
+ private static final String FINGERPRINT_ENROLL_CHANNEL = "FingerprintEnrollNotificationChannel";
+ private static final String FINGERPRINT_BAD_CALIBRATION_CHANNEL =
+ "FingerprintBadCalibrationNotificationChannel";
private static final int NOTIFICATION_ID = 1;
private static final long NOTIFICATION_INTERVAL_MS = 24 * 60 * 60 * 1000;
private static long sLastAlertTime = 0;
@@ -56,18 +69,67 @@
final String content =
context.getString(R.string.face_recalibrate_notification_content);
- final Intent intent = new Intent("android.settings.FACE_SETTINGS");
- intent.setPackage("com.android.settings");
+ final Intent intent = new Intent(FACE_SETTINGS_ACTION);
+ intent.setPackage(SETTINGS_PACKAGE);
intent.putExtra(KEY_RE_ENROLL_FACE, true);
final PendingIntent pendingIntent = PendingIntent.getActivityAsUser(context,
0 /* requestCode */, intent, PendingIntent.FLAG_IMMUTABLE /* flags */,
null /* options */, UserHandle.CURRENT);
- final String channelName = "FaceEnrollNotificationChannel";
+ showNotificationHelper(context, name, title, content, pendingIntent, FACE_RE_ENROLL_CHANNEL,
+ FACE_RE_ENROLL_NOTIFICATION_TAG, Notification.VISIBILITY_SECRET);
+ }
- showNotificationHelper(context, name, title, content, pendingIntent, channelName,
- RE_ENROLL_NOTIFICATION_TAG);
+ /**
+ * Shows a face enrollment notification.
+ */
+ public static void showFaceEnrollNotification(@NonNull Context context) {
+
+ final String name =
+ context.getString(R.string.device_unlock_notification_name);
+ final String title =
+ context.getString(R.string.alternative_unlock_setup_notification_title);
+ final String content =
+ context.getString(R.string.alternative_face_setup_notification_content);
+
+ final Intent intent = new Intent(FACE_ENROLL_ACTION);
+ intent.setPackage(SETTINGS_PACKAGE);
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ context.startActivity(intent);
+
+ final PendingIntent pendingIntent = PendingIntent.getActivityAsUser(context,
+ 0 /* requestCode */, intent, PendingIntent.FLAG_IMMUTABLE /* flags */,
+ null /* options */, UserHandle.CURRENT);
+
+ showNotificationHelper(context, name, title, content, pendingIntent, FACE_ENROLL_CHANNEL,
+ FACE_ENROLL_NOTIFICATION_TAG, Notification.VISIBILITY_PUBLIC);
+ }
+
+ /**
+ * Shows a fingerprint enrollment notification.
+ */
+ public static void showFingerprintEnrollNotification(@NonNull Context context) {
+
+ final String name =
+ context.getString(R.string.device_unlock_notification_name);
+ final String title =
+ context.getString(R.string.alternative_unlock_setup_notification_title);
+ final String content =
+ context.getString(R.string.alternative_fp_setup_notification_content);
+
+ final Intent intent = new Intent(FINGERPRINT_ENROLL_ACTION);
+ intent.setPackage(SETTINGS_PACKAGE);
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ context.startActivity(intent);
+
+ final PendingIntent pendingIntent = PendingIntent.getActivityAsUser(context,
+ 0 /* requestCode */, intent, PendingIntent.FLAG_IMMUTABLE /* flags */,
+ null /* options */, UserHandle.CURRENT);
+
+ showNotificationHelper(context, name, title, content, pendingIntent,
+ FINGERPRINT_ENROLL_CHANNEL, FINGERPRINT_ENROLL_NOTIFICATION_TAG,
+ Notification.VISIBILITY_PUBLIC);
}
/**
@@ -93,22 +155,21 @@
final String content =
context.getString(R.string.fingerprint_recalibrate_notification_content);
- final Intent intent = new Intent("android.settings.FINGERPRINT_SETTINGS");
- intent.setPackage("com.android.settings");
+ final Intent intent = new Intent(FINGERPRINT_SETTINGS_ACTION);
+ intent.setPackage(SETTINGS_PACKAGE);
final PendingIntent pendingIntent = PendingIntent.getActivityAsUser(context,
0 /* requestCode */, intent, PendingIntent.FLAG_IMMUTABLE /* flags */,
null /* options */, UserHandle.CURRENT);
- final String channelName = "FingerprintBadCalibrationNotificationChannel";
-
- showNotificationHelper(context, name, title, content, pendingIntent, channelName,
- BAD_CALIBRATION_NOTIFICATION_TAG);
+ showNotificationHelper(context, name, title, content, pendingIntent,
+ FINGERPRINT_BAD_CALIBRATION_CHANNEL, BAD_CALIBRATION_NOTIFICATION_TAG,
+ Notification.VISIBILITY_SECRET);
}
private static void showNotificationHelper(Context context, String name, String title,
String content, PendingIntent pendingIntent, String channelName,
- String notificationTag) {
+ String notificationTag, int visibility) {
final NotificationManager notificationManager =
context.getSystemService(NotificationManager.class);
final NotificationChannel channel = new NotificationChannel(channelName, name,
@@ -123,7 +184,7 @@
.setAutoCancel(true)
.setCategory(Notification.CATEGORY_SYSTEM)
.setContentIntent(pendingIntent)
- .setVisibility(Notification.VISIBILITY_SECRET)
+ .setVisibility(visibility)
.build();
notificationManager.createNotificationChannel(channel);
@@ -134,10 +195,30 @@
/**
* Cancels a face re-enrollment notification
*/
- public static void cancelReEnrollNotification(@NonNull Context context) {
+ public static void cancelFaceReEnrollNotification(@NonNull Context context) {
final NotificationManager notificationManager =
context.getSystemService(NotificationManager.class);
- notificationManager.cancelAsUser(RE_ENROLL_NOTIFICATION_TAG, NOTIFICATION_ID,
+ notificationManager.cancelAsUser(FACE_RE_ENROLL_NOTIFICATION_TAG, NOTIFICATION_ID,
+ UserHandle.CURRENT);
+ }
+
+ /**
+ * Cancels a face enrollment notification
+ */
+ public static void cancelFaceEnrollNotification(@NonNull Context context) {
+ final NotificationManager notificationManager =
+ context.getSystemService(NotificationManager.class);
+ notificationManager.cancelAsUser(FACE_ENROLL_NOTIFICATION_TAG, NOTIFICATION_ID,
+ UserHandle.CURRENT);
+ }
+
+ /**
+ * Cancels a fingerprint enrollment notification
+ */
+ public static void cancelFingerprintEnrollNotification(@NonNull Context context) {
+ final NotificationManager notificationManager =
+ context.getSystemService(NotificationManager.class);
+ notificationManager.cancelAsUser(FINGERPRINT_ENROLL_NOTIFICATION_TAG, NOTIFICATION_ID,
UserHandle.CURRENT);
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceEnrollClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceEnrollClient.java
index 722c9af..f55cf05 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceEnrollClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceEnrollClient.java
@@ -109,7 +109,8 @@
public void start(@NonNull ClientMonitorCallback callback) {
super.start(callback);
- BiometricNotificationUtils.cancelReEnrollNotification(getContext());
+ BiometricNotificationUtils.cancelFaceEnrollNotification(getContext());
+ BiometricNotificationUtils.cancelFaceReEnrollNotification(getContext());
}
@NonNull
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceProvider.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceProvider.java
index a7d160c..28f0a4d 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceProvider.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceProvider.java
@@ -56,6 +56,7 @@
import com.android.server.biometrics.sensors.AuthSessionCoordinator;
import com.android.server.biometrics.sensors.AuthenticationClient;
import com.android.server.biometrics.sensors.BaseClientMonitor;
+import com.android.server.biometrics.sensors.BiometricNotificationImpl;
import com.android.server.biometrics.sensors.BiometricScheduler;
import com.android.server.biometrics.sensors.BiometricStateCallback;
import com.android.server.biometrics.sensors.ClientMonitorCallback;
@@ -177,7 +178,7 @@
mDaemon = daemon;
mAuthenticationStatsCollector = new AuthenticationStatsCollector(mContext,
- BiometricsProtoEnums.MODALITY_FACE);
+ BiometricsProtoEnums.MODALITY_FACE, new BiometricNotificationImpl());
for (SensorProps prop : props) {
final int sensorId = prop.commonProps.sensorId;
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/Face10.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/Face10.java
index 10991d5..8086261 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/Face10.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/Face10.java
@@ -62,7 +62,7 @@
import com.android.server.biometrics.sensors.AcquisitionClient;
import com.android.server.biometrics.sensors.AuthenticationConsumer;
import com.android.server.biometrics.sensors.BaseClientMonitor;
-import com.android.server.biometrics.sensors.BiometricNotificationUtils;
+import com.android.server.biometrics.sensors.BiometricNotificationImpl;
import com.android.server.biometrics.sensors.BiometricScheduler;
import com.android.server.biometrics.sensors.BiometricStateCallback;
import com.android.server.biometrics.sensors.ClientMonitorCallback;
@@ -367,7 +367,7 @@
});
mAuthenticationStatsCollector = new AuthenticationStatsCollector(mContext,
- BiometricsProtoEnums.MODALITY_FACE);
+ BiometricsProtoEnums.MODALITY_FACE, new BiometricNotificationImpl());
try {
ActivityManager.getService().registerUserSwitchObserver(mUserSwitchObserver, TAG);
@@ -615,8 +615,6 @@
mHandler.post(() -> {
scheduleUpdateActiveUserWithoutHandler(userId);
- BiometricNotificationUtils.cancelReEnrollNotification(mContext);
-
final FaceEnrollClient client = new FaceEnrollClient(mContext, mLazyDaemon, token,
new ClientMonitorCallbackConverter(receiver), userId, hardwareAuthToken,
opPackageName, id, FaceUtils.getLegacyInstance(mSensorId), disabledFeatures,
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceEnrollClient.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceEnrollClient.java
index 16d2f7a..27b9c79 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceEnrollClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceEnrollClient.java
@@ -33,6 +33,7 @@
import com.android.server.biometrics.Utils;
import com.android.server.biometrics.log.BiometricContext;
import com.android.server.biometrics.log.BiometricLogger;
+import com.android.server.biometrics.sensors.BiometricNotificationUtils;
import com.android.server.biometrics.sensors.BiometricUtils;
import com.android.server.biometrics.sensors.ClientMonitorCallback;
import com.android.server.biometrics.sensors.ClientMonitorCallbackConverter;
@@ -71,6 +72,14 @@
.getIntArray(R.array.config_face_acquire_vendor_enroll_ignorelist);
}
+ @Override
+ public void start(@NonNull ClientMonitorCallback callback) {
+ super.start(callback);
+
+ BiometricNotificationUtils.cancelFaceEnrollNotification(getContext());
+ BiometricNotificationUtils.cancelFaceReEnrollNotification(getContext());
+ }
+
@NonNull
@Override
protected ClientMonitorCallback wrapCallbackForStart(@NonNull ClientMonitorCallback callback) {
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintEnrollClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintEnrollClient.java
index f9e08d6..46ff6b4 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintEnrollClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintEnrollClient.java
@@ -104,6 +104,13 @@
}
}
+ @Override
+ public void start(@NonNull ClientMonitorCallback callback) {
+ super.start(callback);
+
+ BiometricNotificationUtils.cancelFingerprintEnrollNotification(getContext());
+ }
+
@NonNull
@Override
protected ClientMonitorCallback wrapCallbackForStart(@NonNull ClientMonitorCallback callback) {
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java
index 2d062db..5f4b894 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java
@@ -64,6 +64,7 @@
import com.android.server.biometrics.sensors.AuthSessionCoordinator;
import com.android.server.biometrics.sensors.AuthenticationClient;
import com.android.server.biometrics.sensors.BaseClientMonitor;
+import com.android.server.biometrics.sensors.BiometricNotificationImpl;
import com.android.server.biometrics.sensors.BiometricScheduler;
import com.android.server.biometrics.sensors.BiometricStateCallback;
import com.android.server.biometrics.sensors.ClientMonitorCallback;
@@ -184,7 +185,7 @@
mDaemon = daemon;
mAuthenticationStatsCollector = new AuthenticationStatsCollector(mContext,
- BiometricsProtoEnums.MODALITY_FINGERPRINT);
+ BiometricsProtoEnums.MODALITY_FINGERPRINT, new BiometricNotificationImpl());
final List<SensorLocationInternal> workaroundLocations = getWorkaroundSensorProps(context);
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java
index 4b07dca..d0b71fc 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java
@@ -66,6 +66,7 @@
import com.android.server.biometrics.sensors.AuthenticationClient;
import com.android.server.biometrics.sensors.AuthenticationConsumer;
import com.android.server.biometrics.sensors.BaseClientMonitor;
+import com.android.server.biometrics.sensors.BiometricNotificationImpl;
import com.android.server.biometrics.sensors.BiometricScheduler;
import com.android.server.biometrics.sensors.BiometricStateCallback;
import com.android.server.biometrics.sensors.ClientMonitorCallback;
@@ -354,7 +355,7 @@
});
mAuthenticationStatsCollector = new AuthenticationStatsCollector(mContext,
- BiometricsProtoEnums.MODALITY_FINGERPRINT);
+ BiometricsProtoEnums.MODALITY_FINGERPRINT, new BiometricNotificationImpl());
try {
ActivityManager.getService().registerUserSwitchObserver(mUserSwitchObserver, TAG);
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintEnrollClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintEnrollClient.java
index 6fee84a..382e7e2 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintEnrollClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintEnrollClient.java
@@ -81,6 +81,13 @@
}
}
+ @Override
+ public void start(@NonNull ClientMonitorCallback callback) {
+ super.start(callback);
+
+ BiometricNotificationUtils.cancelFingerprintEnrollNotification(getContext());
+ }
+
@NonNull
@Override
protected ClientMonitorCallback wrapCallbackForStart(@NonNull ClientMonitorCallback callback) {
diff --git a/services/core/java/com/android/server/content/SyncManager.java b/services/core/java/com/android/server/content/SyncManager.java
index 3e31bd1..0aac7c2 100644
--- a/services/core/java/com/android/server/content/SyncManager.java
+++ b/services/core/java/com/android/server/content/SyncManager.java
@@ -220,8 +220,10 @@
private static final int SYNC_OP_STATE_INVALID_SYNC_DISABLED = 5;
/** Flags used when connecting to a sync adapter service */
- private static final int SYNC_ADAPTER_CONNECTION_FLAGS = Context.BIND_AUTO_CREATE
- | Context.BIND_NOT_FOREGROUND | Context.BIND_ALLOW_OOM_MANAGEMENT;
+ private static final Context.BindServiceFlags SYNC_ADAPTER_CONNECTION_FLAGS =
+ Context.BindServiceFlags.of(
+ Context.BIND_FILTER_OUT_QUARANTINED_COMPONENTS | Context.BIND_AUTO_CREATE
+ | Context.BIND_NOT_FOREGROUND | Context.BIND_ALLOW_OOM_MANAGEMENT);
/** Singleton instance. */
@GuardedBy("SyncManager.class")
diff --git a/services/core/java/com/android/server/display/DisplayDevice.java b/services/core/java/com/android/server/display/DisplayDevice.java
index d57dc47..8642fb8 100644
--- a/services/core/java/com/android/server/display/DisplayDevice.java
+++ b/services/core/java/com/android/server/display/DisplayDevice.java
@@ -16,6 +16,9 @@
package com.android.server.display;
+import static android.view.Surface.ROTATION_270;
+import static android.view.Surface.ROTATION_90;
+
import android.annotation.Nullable;
import android.content.Context;
import android.graphics.Point;
@@ -132,12 +135,15 @@
/**
* Returns the default size of the surface associated with the display, or null if the surface
* is not provided for layer mirroring by SurfaceFlinger. For non virtual displays, this will
- * be the actual display device's size.
+ * be the actual display device's size, reflecting the current rotation.
*/
@Nullable
public Point getDisplaySurfaceDefaultSizeLocked() {
DisplayDeviceInfo displayDeviceInfo = getDisplayDeviceInfoLocked();
- return new Point(displayDeviceInfo.width, displayDeviceInfo.height);
+ final boolean isRotated = mCurrentOrientation == ROTATION_90
+ || mCurrentOrientation == ROTATION_270;
+ return isRotated ? new Point(displayDeviceInfo.height, displayDeviceInfo.width)
+ : new Point(displayDeviceInfo.width, displayDeviceInfo.height);
}
/**
@@ -358,7 +364,7 @@
}
boolean isRotated = (mCurrentOrientation == Surface.ROTATION_90
- || mCurrentOrientation == Surface.ROTATION_270);
+ || mCurrentOrientation == ROTATION_270);
DisplayDeviceInfo info = getDisplayDeviceInfoLocked();
viewport.deviceWidth = isRotated ? info.height : info.width;
viewport.deviceHeight = isRotated ? info.width : info.height;
diff --git a/services/core/java/com/android/server/display/DisplayDeviceConfig.java b/services/core/java/com/android/server/display/DisplayDeviceConfig.java
index c131226..01eceda 100644
--- a/services/core/java/com/android/server/display/DisplayDeviceConfig.java
+++ b/services/core/java/com/android/server/display/DisplayDeviceConfig.java
@@ -2093,7 +2093,7 @@
/** Loads the refresh rate profiles. */
private void loadRefreshRateZoneProfiles(RefreshRateConfigs refreshRateConfigs) {
- if (refreshRateConfigs == null) {
+ if (refreshRateConfigs == null || refreshRateConfigs.getRefreshRateZoneProfiles() == null) {
return;
}
for (RefreshRateZone zone :
diff --git a/services/core/java/com/android/server/display/whitebalance/DisplayWhiteBalanceController.java b/services/core/java/com/android/server/display/whitebalance/DisplayWhiteBalanceController.java
index 4ad26c4..7ea576d 100644
--- a/services/core/java/com/android/server/display/whitebalance/DisplayWhiteBalanceController.java
+++ b/services/core/java/com/android/server/display/whitebalance/DisplayWhiteBalanceController.java
@@ -63,10 +63,15 @@
// high errors. This default is introduced to provide a fixed display color
// temperature when sensor readings become unreliable.
private final float mLowLightAmbientColorTemperature;
+ // As above, but used when in strong mode (idle screen brightness mode).
+ private final float mLowLightAmbientColorTemperatureStrong;
+
// In high brightness conditions certain color temperatures can cause peak display
// brightness to drop. This fixed color temperature can be used to compensate for
// this effect.
private final float mHighLightAmbientColorTemperature;
+ // As above, but used when in strong mode (idle screen brightness mode).
+ private final float mHighLightAmbientColorTemperatureStrong;
private final boolean mLightModeAllowed;
@@ -97,9 +102,11 @@
// ambient color temperature to the defaults. A piecewise linear relationship
// between low light brightness and low light bias.
private Spline.LinearSpline mLowLightAmbientBrightnessToBiasSpline;
+ private Spline.LinearSpline mLowLightAmbientBrightnessToBiasSplineStrong;
// A piecewise linear relationship between high light brightness and high light bias.
private Spline.LinearSpline mHighLightAmbientBrightnessToBiasSpline;
+ private Spline.LinearSpline mHighLightAmbientBrightnessToBiasSplineStrong;
private float mLatestAmbientColorTemperature;
private float mLatestAmbientBrightness;
@@ -134,17 +141,29 @@
* @param lowLightAmbientBrightnesses
* The ambient brightness used to map the ambient brightnesses to the biases used to
* interpolate to lowLightAmbientColorTemperature.
+ * @param lowLightAmbientBrightnessesStrong
+ * The ambient brightness used to map the ambient brightnesses to the biases used to
+ * interpolate to lowLightAmbientColorTemperature.
* @param lowLightAmbientBiases
* The biases used to map the ambient brightnesses to the biases used to interpolate to
* lowLightAmbientColorTemperature.
+ * @param lowLightAmbientBiasesStrong
+ * The biases used to map the ambient brightnesses to the biases used to interpolate to
+ * lowLightAmbientColorTemperature.
* @param lowLightAmbientColorTemperature
* The ambient color temperature to which we interpolate to based on the low light curve.
* @param highLightAmbientBrightnesses
* The ambient brightness used to map the ambient brightnesses to the biases used to
* interpolate to highLightAmbientColorTemperature.
+ * @param highLightAmbientBrightnessesStrong
+ * The ambient brightness used to map the ambient brightnesses to the biases used to
+ * interpolate to highLightAmbientColorTemperature.
* @param highLightAmbientBiases
* The biases used to map the ambient brightnesses to the biases used to interpolate to
* highLightAmbientColorTemperature.
+ * @param highLightAmbientBiasesStrong
+ * The biases used to map the ambient brightnesses to the biases used to interpolate to
+ * highLightAmbientColorTemperature.
* @param highLightAmbientColorTemperature
* The ambient color temperature to which we interpolate to based on the high light curve.
* @param ambientColorTemperatures
@@ -170,11 +189,17 @@
@NonNull AmbientFilter colorTemperatureFilter,
@NonNull DisplayWhiteBalanceThrottler throttler,
float[] lowLightAmbientBrightnesses,
+ float[] lowLightAmbientBrightnessesStrong,
float[] lowLightAmbientBiases,
+ float[] lowLightAmbientBiasesStrong,
float lowLightAmbientColorTemperature,
+ float lowLightAmbientColorTemperatureStrong,
float[] highLightAmbientBrightnesses,
+ float[] highLightAmbientBrightnessesStrong,
float[] highLightAmbientBiases,
+ float[] highLightAmbientBiasesStrong,
float highLightAmbientColorTemperature,
+ float highLightAmbientColorTemperatureStrong,
float[] ambientColorTemperatures,
float[] displayColorTemperatures,
float[] strongAmbientColorTemperatures,
@@ -188,7 +213,9 @@
mColorTemperatureFilter = colorTemperatureFilter;
mThrottler = throttler;
mLowLightAmbientColorTemperature = lowLightAmbientColorTemperature;
+ mLowLightAmbientColorTemperatureStrong = lowLightAmbientColorTemperatureStrong;
mHighLightAmbientColorTemperature = highLightAmbientColorTemperature;
+ mHighLightAmbientColorTemperatureStrong = highLightAmbientColorTemperatureStrong;
mAmbientColorTemperature = -1.0f;
mPendingAmbientColorTemperature = -1.0f;
mLastAmbientColorTemperature = -1.0f;
@@ -214,6 +241,23 @@
}
try {
+ mLowLightAmbientBrightnessToBiasSplineStrong = new Spline.LinearSpline(
+ lowLightAmbientBrightnessesStrong, lowLightAmbientBiasesStrong);
+ } catch (Exception e) {
+ Slog.e(TAG, "failed to create strong low light ambient brightness to bias spline.", e);
+ mLowLightAmbientBrightnessToBiasSplineStrong = null;
+ }
+ if (mLowLightAmbientBrightnessToBiasSplineStrong != null) {
+ if (mLowLightAmbientBrightnessToBiasSplineStrong.interpolate(0.0f) != 0.0f
+ || mLowLightAmbientBrightnessToBiasSplineStrong.interpolate(
+ Float.POSITIVE_INFINITY) != 1.0f) {
+ Slog.d(TAG, "invalid strong low light ambient brightness to bias spline, "
+ + "bias must begin at 0.0 and end at 1.0.");
+ mLowLightAmbientBrightnessToBiasSplineStrong = null;
+ }
+ }
+
+ try {
mHighLightAmbientBrightnessToBiasSpline = new Spline.LinearSpline(
highLightAmbientBrightnesses, highLightAmbientBiases);
} catch (Exception e) {
@@ -230,6 +274,23 @@
}
}
+ try {
+ mHighLightAmbientBrightnessToBiasSplineStrong = new Spline.LinearSpline(
+ highLightAmbientBrightnessesStrong, highLightAmbientBiasesStrong);
+ } catch (Exception e) {
+ Slog.e(TAG, "failed to create strong high light ambient brightness to bias spline.", e);
+ mHighLightAmbientBrightnessToBiasSplineStrong = null;
+ }
+ if (mHighLightAmbientBrightnessToBiasSplineStrong != null) {
+ if (mHighLightAmbientBrightnessToBiasSplineStrong.interpolate(0.0f) != 0.0f
+ || mHighLightAmbientBrightnessToBiasSplineStrong.interpolate(
+ Float.POSITIVE_INFINITY) != 1.0f) {
+ Slog.d(TAG, "invalid strong high light ambient brightness to bias spline, "
+ + "bias must begin at 0.0 and end at 1.0.");
+ mHighLightAmbientBrightnessToBiasSplineStrong = null;
+ }
+ }
+
if (mLowLightAmbientBrightnessToBiasSpline != null &&
mHighLightAmbientBrightnessToBiasSpline != null) {
if (lowLightAmbientBrightnesses[lowLightAmbientBrightnesses.length - 1] >
@@ -241,6 +302,18 @@
}
}
+ if (mLowLightAmbientBrightnessToBiasSplineStrong != null
+ && mHighLightAmbientBrightnessToBiasSplineStrong != null) {
+ if (lowLightAmbientBrightnessesStrong[lowLightAmbientBrightnessesStrong.length - 1]
+ > highLightAmbientBrightnessesStrong[0]) {
+ Slog.d(TAG,
+ "invalid strong low light and high light ambient brightness to bias "
+ + "spline combination, defined domains must not intersect.");
+ mLowLightAmbientBrightnessToBiasSplineStrong = null;
+ mHighLightAmbientBrightnessToBiasSplineStrong = null;
+ }
+ }
+
try {
mAmbientToDisplayColorTemperatureSpline = new Spline.LinearSpline(
ambientColorTemperatures, displayColorTemperatures);
@@ -365,7 +438,11 @@
mColorTemperatureFilter.dump(writer);
mThrottler.dump(writer);
writer.println(" mLowLightAmbientColorTemperature=" + mLowLightAmbientColorTemperature);
+ writer.println(" mLowLightAmbientColorTemperatureStrong="
+ + mLowLightAmbientColorTemperatureStrong);
writer.println(" mHighLightAmbientColorTemperature=" + mHighLightAmbientColorTemperature);
+ writer.println(" mHighLightAmbientColorTemperatureStrong="
+ + mHighLightAmbientColorTemperatureStrong);
writer.println(" mAmbientColorTemperature=" + mAmbientColorTemperature);
writer.println(" mPendingAmbientColorTemperature=" + mPendingAmbientColorTemperature);
writer.println(" mLastAmbientColorTemperature=" + mLastAmbientColorTemperature);
@@ -377,8 +454,12 @@
+ mStrongAmbientToDisplayColorTemperatureSpline);
writer.println(" mLowLightAmbientBrightnessToBiasSpline="
+ mLowLightAmbientBrightnessToBiasSpline);
+ writer.println(" mLowLightAmbientBrightnessToBiasSplineStrong="
+ + mLowLightAmbientBrightnessToBiasSplineStrong);
writer.println(" mHighLightAmbientBrightnessToBiasSpline="
+ mHighLightAmbientBrightnessToBiasSpline);
+ writer.println(" mHighLightAmbientBrightnessToBiasSplineStrong="
+ + mHighLightAmbientBrightnessToBiasSplineStrong);
}
@Override // AmbientSensor.AmbientBrightnessSensor.Callbacks
@@ -400,6 +481,17 @@
*/
public void updateAmbientColorTemperature() {
final long time = System.currentTimeMillis();
+ final float lowLightAmbientColorTemperature = mStrongModeEnabled
+ ? mLowLightAmbientColorTemperatureStrong : mLowLightAmbientColorTemperature;
+ final float highLightAmbientColorTemperature = mStrongModeEnabled
+ ? mHighLightAmbientColorTemperatureStrong : mHighLightAmbientColorTemperature;
+ final Spline.LinearSpline lowLightAmbientBrightnessToBiasSpline = mStrongModeEnabled
+ ? mLowLightAmbientBrightnessToBiasSplineStrong
+ : mLowLightAmbientBrightnessToBiasSpline;
+ final Spline.LinearSpline highLightAmbientBrightnessToBiasSpline = mStrongModeEnabled
+ ? mHighLightAmbientBrightnessToBiasSplineStrong
+ : mHighLightAmbientBrightnessToBiasSpline;
+
float ambientColorTemperature = mColorTemperatureFilter.getEstimate(time);
mLatestAmbientColorTemperature = ambientColorTemperature;
@@ -423,19 +515,19 @@
mLatestAmbientBrightness = ambientBrightness;
if (ambientColorTemperature != -1.0f && ambientBrightness != -1.0f
- && mLowLightAmbientBrightnessToBiasSpline != null) {
- float bias = mLowLightAmbientBrightnessToBiasSpline.interpolate(ambientBrightness);
+ && lowLightAmbientBrightnessToBiasSpline != null) {
+ float bias = lowLightAmbientBrightnessToBiasSpline.interpolate(ambientBrightness);
ambientColorTemperature =
bias * ambientColorTemperature + (1.0f - bias)
- * mLowLightAmbientColorTemperature;
+ * lowLightAmbientColorTemperature;
mLatestLowLightBias = bias;
}
if (ambientColorTemperature != -1.0f && ambientBrightness != -1.0f
- && mHighLightAmbientBrightnessToBiasSpline != null) {
- float bias = mHighLightAmbientBrightnessToBiasSpline.interpolate(ambientBrightness);
+ && highLightAmbientBrightnessToBiasSpline != null) {
+ float bias = highLightAmbientBrightnessToBiasSpline.interpolate(ambientBrightness);
ambientColorTemperature =
(1.0f - bias) * ambientColorTemperature + bias
- * mHighLightAmbientColorTemperature;
+ * highLightAmbientColorTemperature;
mLatestHighLightBias = bias;
}
diff --git a/services/core/java/com/android/server/display/whitebalance/DisplayWhiteBalanceFactory.java b/services/core/java/com/android/server/display/whitebalance/DisplayWhiteBalanceFactory.java
index 62f813f..39e6b3f 100644
--- a/services/core/java/com/android/server/display/whitebalance/DisplayWhiteBalanceFactory.java
+++ b/services/core/java/com/android/server/display/whitebalance/DisplayWhiteBalanceFactory.java
@@ -70,21 +70,39 @@
final float[] displayWhiteBalanceLowLightAmbientBrightnesses = getFloatArray(resources,
com.android.internal.R.array
.config_displayWhiteBalanceLowLightAmbientBrightnesses);
+ final float[] displayWhiteBalanceLowLightAmbientBrightnessesStrong = getFloatArray(
+ resources, com.android.internal.R.array
+ .config_displayWhiteBalanceLowLightAmbientBrightnessesStrong);
final float[] displayWhiteBalanceLowLightAmbientBiases = getFloatArray(resources,
com.android.internal.R.array
.config_displayWhiteBalanceLowLightAmbientBiases);
+ final float[] displayWhiteBalanceLowLightAmbientBiasesStrong = getFloatArray(resources,
+ com.android.internal.R.array
+ .config_displayWhiteBalanceLowLightAmbientBiasesStrong);
final float lowLightAmbientColorTemperature = getFloat(resources,
com.android.internal.R.dimen
.config_displayWhiteBalanceLowLightAmbientColorTemperature);
+ final float lowLightAmbientColorTemperatureStrong = getFloat(resources,
+ com.android.internal.R.dimen
+ .config_displayWhiteBalanceLowLightAmbientColorTemperatureStrong);
final float[] displayWhiteBalanceHighLightAmbientBrightnesses = getFloatArray(resources,
com.android.internal.R.array
.config_displayWhiteBalanceHighLightAmbientBrightnesses);
+ final float[] displayWhiteBalanceHighLightAmbientBrightnessesStrong = getFloatArray(
+ resources, com.android.internal.R.array
+ .config_displayWhiteBalanceHighLightAmbientBrightnessesStrong);
final float[] displayWhiteBalanceHighLightAmbientBiases = getFloatArray(resources,
com.android.internal.R.array
.config_displayWhiteBalanceHighLightAmbientBiases);
+ final float[] displayWhiteBalanceHighLightAmbientBiasesStrong = getFloatArray(resources,
+ com.android.internal.R.array
+ .config_displayWhiteBalanceHighLightAmbientBiasesStrong);
final float highLightAmbientColorTemperature = getFloat(resources,
com.android.internal.R.dimen
.config_displayWhiteBalanceHighLightAmbientColorTemperature);
+ final float highLightAmbientColorTemperatureStrong = getFloat(resources,
+ com.android.internal.R.dimen
+ .config_displayWhiteBalanceHighLightAmbientColorTemperatureStrong);
final float[] ambientColorTemperatures = getFloatArray(resources,
com.android.internal.R.array.config_displayWhiteBalanceAmbientColorTemperatures);
final float[] displayColorTemperatures = getFloatArray(resources,
@@ -100,9 +118,15 @@
final DisplayWhiteBalanceController controller = new DisplayWhiteBalanceController(
brightnessSensor, brightnessFilter, colorTemperatureSensor, colorTemperatureFilter,
throttler, displayWhiteBalanceLowLightAmbientBrightnesses,
- displayWhiteBalanceLowLightAmbientBiases, lowLightAmbientColorTemperature,
+ displayWhiteBalanceLowLightAmbientBrightnessesStrong,
+ displayWhiteBalanceLowLightAmbientBiases,
+ displayWhiteBalanceLowLightAmbientBiasesStrong, lowLightAmbientColorTemperature,
+ lowLightAmbientColorTemperatureStrong,
displayWhiteBalanceHighLightAmbientBrightnesses,
- displayWhiteBalanceHighLightAmbientBiases, highLightAmbientColorTemperature,
+ displayWhiteBalanceHighLightAmbientBrightnessesStrong,
+ displayWhiteBalanceHighLightAmbientBiases,
+ displayWhiteBalanceHighLightAmbientBiasesStrong, highLightAmbientColorTemperature,
+ highLightAmbientColorTemperatureStrong,
ambientColorTemperatures, displayColorTemperatures, strongAmbientColorTemperatures,
strongDisplayColorTemperatures, lightModeAllowed);
brightnessSensor.setCallbacks(controller);
diff --git a/services/core/java/com/android/server/hdmi/AbsoluteVolumeAudioStatusAction.java b/services/core/java/com/android/server/hdmi/AbsoluteVolumeAudioStatusAction.java
index d764ec4..9172dc0 100644
--- a/services/core/java/com/android/server/hdmi/AbsoluteVolumeAudioStatusAction.java
+++ b/services/core/java/com/android/server/hdmi/AbsoluteVolumeAudioStatusAction.java
@@ -32,6 +32,10 @@
private int mInitialAudioStatusRetriesLeft = 2;
+ // Flag to notify AudioService of the next audio status reported,
+ // regardless of whether the audio status changed.
+ private boolean mForceNextAudioStatusUpdate = false;
+
private static final int STATE_WAIT_FOR_INITIAL_AUDIO_STATUS = 1;
private static final int STATE_MONITOR_AUDIO_STATUS = 2;
@@ -70,6 +74,17 @@
return false;
}
+
+ /**
+ * If AVB has been enabled, send <Give Audio Status> and notify AudioService of the response.
+ */
+ void requestAndUpdateAudioStatus() {
+ if (mState == STATE_MONITOR_AUDIO_STATUS) {
+ mForceNextAudioStatusUpdate = true;
+ sendGiveAudioStatus();
+ }
+ }
+
private boolean handleReportAudioStatus(HdmiCecMessage cmd) {
if (mTargetAddress != cmd.getSource() || cmd.getParams().length == 0) {
return false;
@@ -89,12 +104,15 @@
localDevice().getService().enableAbsoluteVolumeBehavior(audioStatus);
mState = STATE_MONITOR_AUDIO_STATUS;
} else if (mState == STATE_MONITOR_AUDIO_STATUS) {
- if (audioStatus.getVolume() != mLastAudioStatus.getVolume()) {
+ if (mForceNextAudioStatusUpdate
+ || audioStatus.getVolume() != mLastAudioStatus.getVolume()) {
localDevice().getService().notifyAvbVolumeChange(audioStatus.getVolume());
}
- if (audioStatus.getMute() != mLastAudioStatus.getMute()) {
+ if (mForceNextAudioStatusUpdate
+ || audioStatus.getMute() != mLastAudioStatus.getMute()) {
localDevice().getService().notifyAvbMuteChange(audioStatus.getMute());
}
+ mForceNextAudioStatusUpdate = false;
}
mLastAudioStatus = audioStatus;
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
index 207d38e..0671464 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
@@ -1048,6 +1048,19 @@
}
/**
+ * If AVB has been enabled, request the System Audio device's audio status and notify
+ * AudioService of its response.
+ */
+ @ServiceThreadOnly
+ void requestAndUpdateAvbAudioStatus() {
+ assertRunOnServiceThread();
+ for (AbsoluteVolumeAudioStatusAction action :
+ getActions(AbsoluteVolumeAudioStatusAction.class)) {
+ action.requestAndUpdateAudioStatus();
+ }
+ }
+
+ /**
* Determines whether {@code targetAddress} supports <Set Audio Volume Level>. Does two things
* in parallel: send <Give Features> (to get <Report Features> in response),
* and send <Set Audio Volume Level> (to see if it gets a <Feature Abort> in response).
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index 5abb2b5..99fa3a3 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -4661,6 +4661,13 @@
// same keycode for all three mute options.
keyCode = KeyEvent.KEYCODE_VOLUME_MUTE;
break;
+ case AudioManager.ADJUST_SAME:
+ // Query the current audio status of the Audio System and display UI for it
+ // Only for TVs, because Playback devices don't display UI when using AVB
+ if (tv() != null) {
+ tv().requestAndUpdateAvbAudioStatus();
+ }
+ return;
default:
return;
}
diff --git a/services/core/java/com/android/server/input/FocusEventDebugGlobalMonitor.java b/services/core/java/com/android/server/input/FocusEventDebugGlobalMonitor.java
new file mode 100644
index 0000000..67c221f
--- /dev/null
+++ b/services/core/java/com/android/server/input/FocusEventDebugGlobalMonitor.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 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.server.input;
+
+import android.view.Display;
+import android.view.InputEvent;
+import android.view.InputEventReceiver;
+import android.view.MotionEvent;
+
+import com.android.server.UiThread;
+
+/**
+ * Receives input events before they are dispatched and reports them to FocusEventDebugView.
+ */
+class FocusEventDebugGlobalMonitor extends InputEventReceiver {
+ private final FocusEventDebugView mDebugView;
+
+ FocusEventDebugGlobalMonitor(FocusEventDebugView debugView, InputManagerService service) {
+ super(service.monitorInput("FocusEventDebugGlobalMonitor", Display.DEFAULT_DISPLAY),
+ UiThread.getHandler().getLooper());
+ mDebugView = debugView;
+ }
+
+ @Override
+ public void onInputEvent(InputEvent event) {
+ try {
+ if (event instanceof MotionEvent) {
+ mDebugView.reportMotionEvent((MotionEvent) event);
+ }
+ } finally {
+ finishInputEvent(event, false);
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/input/FocusEventDebugView.java b/services/core/java/com/android/server/input/FocusEventDebugView.java
index fba2aa6..4b8fabde 100644
--- a/services/core/java/com/android/server/input/FocusEventDebugView.java
+++ b/services/core/java/com/android/server/input/FocusEventDebugView.java
@@ -22,35 +22,47 @@
import android.animation.LayoutTransition;
import android.annotation.AnyThread;
+import android.annotation.Nullable;
import android.content.Context;
+import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.ColorMatrixColorFilter;
+import android.graphics.Paint;
import android.graphics.Typeface;
+import android.util.DisplayMetrics;
import android.util.Pair;
import android.util.Slog;
import android.util.TypedValue;
import android.view.Gravity;
-import android.view.InputEvent;
+import android.view.InputDevice;
import android.view.KeyEvent;
+import android.view.MotionEvent;
import android.view.RoundedCorner;
import android.view.View;
+import android.view.ViewConfiguration;
import android.view.WindowInsets;
import android.view.animation.AccelerateInterpolator;
import android.widget.HorizontalScrollView;
import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
import android.widget.TextView;
import com.android.internal.R;
+import com.android.internal.annotations.VisibleForTesting;
import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Supplier;
/**
* Displays focus events, such as physical keyboard KeyEvents and non-pointer MotionEvents on
* the screen.
*/
-class FocusEventDebugView extends LinearLayout {
+class FocusEventDebugView extends RelativeLayout {
private static final String TAG = FocusEventDebugView.class.getSimpleName();
@@ -63,43 +75,45 @@
private static final int KEY_VIEW_VERTICAL_PADDING_DP = 8;
private static final int KEY_VIEW_MIN_WIDTH_DP = 32;
private static final int KEY_VIEW_TEXT_SIZE_SP = 12;
+ private static final double ROTATY_GRAPH_HEIGHT_FRACTION = 0.5;
+ private final InputManagerService mService;
private final int mOuterPadding;
+ private final DisplayMetrics mDm;
// Tracks all keys that are currently pressed/down.
private final Map<Pair<Integer /*deviceId*/, Integer /*scanCode*/>, PressedKeyView>
mPressedKeys = new HashMap<>();
- private final PressedKeyContainer mPressedKeyContainer;
- private final PressedKeyContainer mPressedModifierContainer;
+ @Nullable
+ private FocusEventDebugGlobalMonitor mFocusEventDebugGlobalMonitor;
+ @Nullable
+ private PressedKeyContainer mPressedKeyContainer;
+ @Nullable
+ private PressedKeyContainer mPressedModifierContainer;
+ private final Supplier<RotaryInputValueView> mRotaryInputValueViewFactory;
+ @Nullable
+ private RotaryInputValueView mRotaryInputValueView;
+ private final Supplier<RotaryInputGraphView> mRotaryInputGraphViewFactory;
+ @Nullable
+ private RotaryInputGraphView mRotaryInputGraphView;
- FocusEventDebugView(Context c) {
+ @VisibleForTesting
+ FocusEventDebugView(Context c, InputManagerService service,
+ Supplier<RotaryInputValueView> rotaryInputValueViewFactory,
+ Supplier<RotaryInputGraphView> rotaryInputGraphViewFactory) {
super(c);
setFocusableInTouchMode(true);
- final var dm = mContext.getResources().getDisplayMetrics();
- mOuterPadding = (int) TypedValue.applyDimension(COMPLEX_UNIT_DIP, OUTER_PADDING_DP, dm);
+ mService = service;
+ mRotaryInputValueViewFactory = rotaryInputValueViewFactory;
+ mRotaryInputGraphViewFactory = rotaryInputGraphViewFactory;
+ mDm = mContext.getResources().getDisplayMetrics();
+ mOuterPadding = (int) TypedValue.applyDimension(COMPLEX_UNIT_DIP, OUTER_PADDING_DP, mDm);
+ }
- setOrientation(HORIZONTAL);
- setLayoutDirection(LAYOUT_DIRECTION_RTL);
- setGravity(Gravity.START | Gravity.BOTTOM);
-
- mPressedKeyContainer = new PressedKeyContainer(mContext);
- mPressedKeyContainer.setOrientation(HORIZONTAL);
- mPressedKeyContainer.setGravity(Gravity.RIGHT | Gravity.BOTTOM);
- mPressedKeyContainer.setLayoutDirection(LAYOUT_DIRECTION_LTR);
- final var scroller = new HorizontalScrollView(mContext);
- scroller.addView(mPressedKeyContainer);
- scroller.setHorizontalScrollBarEnabled(false);
- scroller.addOnLayoutChangeListener(
- (view, l, t, r, b, ol, ot, or, ob) -> scroller.fullScroll(View.FOCUS_RIGHT));
- scroller.setHorizontalFadingEdgeEnabled(true);
- addView(scroller, new LayoutParams(0, WRAP_CONTENT, 1));
-
- mPressedModifierContainer = new PressedKeyContainer(mContext);
- mPressedModifierContainer.setOrientation(VERTICAL);
- mPressedModifierContainer.setGravity(Gravity.LEFT | Gravity.BOTTOM);
- addView(mPressedModifierContainer, new LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
+ FocusEventDebugView(Context c, InputManagerService service) {
+ this(c, service, () -> new RotaryInputValueView(c), () -> new RotaryInputGraphView(c));
}
@Override
@@ -108,13 +122,13 @@
final RoundedCorner bottomLeft =
insets.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_LEFT);
- if (bottomLeft != null) {
+ if (bottomLeft != null && !insets.isRound()) {
paddingBottom = bottomLeft.getRadius();
}
final RoundedCorner bottomRight =
insets.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_RIGHT);
- if (bottomRight != null) {
+ if (bottomRight != null && !insets.isRound()) {
paddingBottom = Math.max(paddingBottom, bottomRight.getRadius());
}
@@ -135,17 +149,106 @@
return super.dispatchKeyEvent(event);
}
- /** Report an input event to the debug view. */
@AnyThread
- public void reportEvent(InputEvent event) {
- if (!(event instanceof KeyEvent)) {
- // TODO: Support non-pointer MotionEvents.
+ public void updateShowKeyPresses(boolean enabled) {
+ post(() -> handleUpdateShowKeyPresses(enabled));
+ }
+
+ @AnyThread
+ public void updateShowRotaryInput(boolean enabled) {
+ post(() -> handleUpdateShowRotaryInput(enabled));
+ }
+
+ private void handleUpdateShowKeyPresses(boolean enabled) {
+ if (enabled == showKeyPresses()) {
return;
}
+
+ if (!enabled) {
+ removeView(mPressedKeyContainer);
+ mPressedKeyContainer = null;
+ removeView(mPressedModifierContainer);
+ mPressedModifierContainer = null;
+ return;
+ }
+
+ mPressedKeyContainer = new PressedKeyContainer(mContext);
+ mPressedKeyContainer.setOrientation(LinearLayout.HORIZONTAL);
+ mPressedKeyContainer.setGravity(Gravity.RIGHT | Gravity.BOTTOM);
+ mPressedKeyContainer.setLayoutDirection(LAYOUT_DIRECTION_LTR);
+ final var scroller = new HorizontalScrollView(mContext);
+ scroller.addView(mPressedKeyContainer);
+ scroller.setHorizontalScrollBarEnabled(false);
+ scroller.addOnLayoutChangeListener(
+ (view, l, t, r, b, ol, ot, or, ob) -> scroller.fullScroll(View.FOCUS_RIGHT));
+ scroller.setHorizontalFadingEdgeEnabled(true);
+ LayoutParams scrollerLayoutParams = new LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
+ scrollerLayoutParams.addRule(ALIGN_PARENT_BOTTOM);
+ scrollerLayoutParams.addRule(ALIGN_PARENT_RIGHT);
+ addView(scroller, scrollerLayoutParams);
+
+ mPressedModifierContainer = new PressedKeyContainer(mContext);
+ mPressedModifierContainer.setOrientation(LinearLayout.VERTICAL);
+ mPressedModifierContainer.setGravity(Gravity.LEFT | Gravity.BOTTOM);
+ LayoutParams modifierLayoutParams = new LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
+ modifierLayoutParams.addRule(ALIGN_PARENT_BOTTOM);
+ modifierLayoutParams.addRule(ALIGN_PARENT_LEFT);
+ modifierLayoutParams.addRule(LEFT_OF, scroller.getId());
+ addView(mPressedModifierContainer, modifierLayoutParams);
+ }
+
+ @VisibleForTesting
+ void handleUpdateShowRotaryInput(boolean enabled) {
+ if (enabled == showRotaryInput()) {
+ return;
+ }
+
+ if (!enabled) {
+ mFocusEventDebugGlobalMonitor.dispose();
+ mFocusEventDebugGlobalMonitor = null;
+ removeView(mRotaryInputValueView);
+ mRotaryInputValueView = null;
+ removeView(mRotaryInputGraphView);
+ mRotaryInputGraphView = null;
+ return;
+ }
+
+ mFocusEventDebugGlobalMonitor = new FocusEventDebugGlobalMonitor(this, mService);
+
+ mRotaryInputValueView = mRotaryInputValueViewFactory.get();
+ LayoutParams valueLayoutParams = new LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
+ valueLayoutParams.addRule(CENTER_HORIZONTAL);
+ valueLayoutParams.addRule(ALIGN_PARENT_BOTTOM);
+ addView(mRotaryInputValueView, valueLayoutParams);
+
+ mRotaryInputGraphView = mRotaryInputGraphViewFactory.get();
+ LayoutParams graphLayoutParams = new LayoutParams(LayoutParams.MATCH_PARENT,
+ (int) (ROTATY_GRAPH_HEIGHT_FRACTION * mDm.heightPixels));
+ graphLayoutParams.addRule(CENTER_IN_PARENT);
+ addView(mRotaryInputGraphView, graphLayoutParams);
+ }
+
+ /** Report a key event to the debug view. */
+ @AnyThread
+ public void reportKeyEvent(KeyEvent event) {
post(() -> handleKeyEvent(KeyEvent.obtain((KeyEvent) event)));
}
+ /** Report a motion event to the debug view. */
+ @AnyThread
+ public void reportMotionEvent(MotionEvent event) {
+ if (event.getSource() != InputDevice.SOURCE_ROTARY_ENCODER) {
+ return;
+ }
+
+ post(() -> handleRotaryInput(MotionEvent.obtain((MotionEvent) event)));
+ }
+
private void handleKeyEvent(KeyEvent keyEvent) {
+ if (!showKeyPresses()) {
+ return;
+ }
+
final var identifier = new Pair<>(keyEvent.getDeviceId(), keyEvent.getScanCode());
final var container = KeyEvent.isModifierKey(keyEvent.getKeyCode())
? mPressedModifierContainer
@@ -185,6 +288,19 @@
keyEvent.recycle();
}
+ @VisibleForTesting
+ void handleRotaryInput(MotionEvent motionEvent) {
+ if (!showRotaryInput()) {
+ return;
+ }
+
+ float scrollAxisValue = motionEvent.getAxisValue(MotionEvent.AXIS_SCROLL);
+ mRotaryInputValueView.updateValue(scrollAxisValue);
+ mRotaryInputGraphView.addValue(scrollAxisValue, motionEvent.getEventTime());
+
+ motionEvent.recycle();
+ }
+
private static String getLabel(KeyEvent event) {
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_SPACE:
@@ -232,6 +348,23 @@
return label;
}
+ /** Determine whether to show key presses by checking one of the key-related objects. */
+ private boolean showKeyPresses() {
+ return mPressedKeyContainer != null;
+ }
+
+ /** Determine whether to show rotary input by checking one of the rotary-related objects. */
+ private boolean showRotaryInput() {
+ return mRotaryInputValueView != null;
+ }
+
+ /**
+ * Converts a dimension in scaled pixel units to integer display pixels.
+ */
+ private static int applyDimensionSp(int dimensionSp, DisplayMetrics dm) {
+ return (int) TypedValue.applyDimension(COMPLEX_UNIT_SP, dimensionSp, dm);
+ }
+
private static class PressedKeyView extends TextView {
private static final ColorFilter sInvertColors = new ColorMatrixColorFilter(new float[]{
@@ -340,4 +473,376 @@
invalidate();
}
}
+
+ // TODO(b/286086154): move RotaryInputGraphView and RotaryInputValueView to a subpackage.
+
+ /** Draws the most recent rotary input value and indicates whether the source is active. */
+ @VisibleForTesting
+ static class RotaryInputValueView extends TextView {
+
+ private static final int INACTIVE_TEXT_COLOR = 0xffff00ff;
+ private static final int ACTIVE_TEXT_COLOR = 0xff420f28;
+ private static final int TEXT_SIZE_SP = 8;
+ private static final int SIDE_PADDING_SP = 4;
+ /** Determines how long the active status lasts. */
+ private static final int ACTIVE_STATUS_DURATION = 250 /* milliseconds */;
+ private static final ColorFilter ACTIVE_BACKGROUND_FILTER =
+ new ColorMatrixColorFilter(new float[]{
+ 0, 0, 0, 0, 255, // red
+ 0, 0, 0, 0, 0, // green
+ 0, 0, 0, 0, 255, // blue
+ 0, 0, 0, 0, 200 // alpha
+ });
+
+ private final Runnable mUpdateActivityStatusCallback = () -> updateActivityStatus(false);
+ private final float mScaledVerticalScrollFactor;
+
+ @VisibleForTesting
+ RotaryInputValueView(Context c) {
+ super(c);
+
+ DisplayMetrics dm = mContext.getResources().getDisplayMetrics();
+ mScaledVerticalScrollFactor = ViewConfiguration.get(c).getScaledVerticalScrollFactor();
+
+ setText(getFormattedValue(0));
+ setTextColor(INACTIVE_TEXT_COLOR);
+ setTextSize(applyDimensionSp(TEXT_SIZE_SP, dm));
+ setPaddingRelative(applyDimensionSp(SIDE_PADDING_SP, dm), 0,
+ applyDimensionSp(SIDE_PADDING_SP, dm), 0);
+ setTypeface(null, Typeface.BOLD);
+ setBackgroundResource(R.drawable.focus_event_rotary_input_background);
+ }
+
+ void updateValue(float value) {
+ removeCallbacks(mUpdateActivityStatusCallback);
+
+ setText(getFormattedValue(value * mScaledVerticalScrollFactor));
+
+ updateActivityStatus(true);
+ postDelayed(mUpdateActivityStatusCallback, ACTIVE_STATUS_DURATION);
+ }
+
+ @VisibleForTesting
+ void updateActivityStatus(boolean active) {
+ if (active) {
+ setTextColor(ACTIVE_TEXT_COLOR);
+ getBackground().setColorFilter(ACTIVE_BACKGROUND_FILTER);
+ } else {
+ setTextColor(INACTIVE_TEXT_COLOR);
+ getBackground().clearColorFilter();
+ }
+ }
+
+ private static String getFormattedValue(float value) {
+ return String.format("%s%.1f", value < 0 ? "-" : "+", Math.abs(value));
+ }
+ }
+
+ /**
+ * Shows a graph with the rotary input values as a function of time.
+ * The graph gets reset if no action is received for a certain amount of time.
+ */
+ @VisibleForTesting
+ static class RotaryInputGraphView extends View {
+
+ private static final int FRAME_COLOR = 0xbf741b47;
+ private static final int FRAME_WIDTH_SP = 2;
+ private static final int FRAME_BORDER_GAP_SP = 10;
+ private static final int FRAME_TEXT_SIZE_SP = 10;
+ private static final int FRAME_TEXT_OFFSET_SP = 2;
+ private static final int GRAPH_COLOR = 0xffff00ff;
+ private static final int GRAPH_LINE_WIDTH_SP = 1;
+ private static final int GRAPH_POINT_RADIUS_SP = 4;
+ private static final long MAX_SHOWN_TIME_INTERVAL = TimeUnit.SECONDS.toMillis(5);
+ private static final float DEFAULT_FRAME_CENTER_POSITION = 0;
+ private static final int MAX_GRAPH_VALUES_SIZE = 400;
+ /** Maximum time between values so that they are considered part of the same gesture. */
+ private static final long MAX_GESTURE_TIME = TimeUnit.SECONDS.toMillis(1);
+
+ private final DisplayMetrics mDm;
+ /**
+ * Distance in position units (amount scrolled in display pixels) from the center to the
+ * top/bottom frame lines.
+ */
+ private final float mFrameCenterToBorderDistance;
+ private final float mScaledVerticalScrollFactor;
+ private final Locale mDefaultLocale;
+ private final Paint mFramePaint = new Paint();
+ private final Paint mFrameTextPaint = new Paint();
+ private final Paint mGraphLinePaint = new Paint();
+ private final Paint mGraphPointPaint = new Paint();
+
+ private final CyclicBuffer mGraphValues = new CyclicBuffer(MAX_GRAPH_VALUES_SIZE);
+ /** Position at which graph values are placed at the center of the graph. */
+ private float mFrameCenterPosition = DEFAULT_FRAME_CENTER_POSITION;
+
+ @VisibleForTesting
+ RotaryInputGraphView(Context c) {
+ super(c);
+
+ mDm = mContext.getResources().getDisplayMetrics();
+ // This makes the center-to-border distance equivalent to the display height, meaning
+ // that the total height of the graph is equivalent to 2x the display height.
+ mFrameCenterToBorderDistance = mDm.heightPixels;
+ mScaledVerticalScrollFactor = ViewConfiguration.get(c).getScaledVerticalScrollFactor();
+ mDefaultLocale = Locale.getDefault();
+
+ mFramePaint.setColor(FRAME_COLOR);
+ mFramePaint.setStrokeWidth(applyDimensionSp(FRAME_WIDTH_SP, mDm));
+
+ mFrameTextPaint.setColor(GRAPH_COLOR);
+ mFrameTextPaint.setTextSize(applyDimensionSp(FRAME_TEXT_SIZE_SP, mDm));
+
+ mGraphLinePaint.setColor(GRAPH_COLOR);
+ mGraphLinePaint.setStrokeWidth(applyDimensionSp(GRAPH_LINE_WIDTH_SP, mDm));
+ mGraphLinePaint.setStrokeCap(Paint.Cap.ROUND);
+ mGraphLinePaint.setStrokeJoin(Paint.Join.ROUND);
+
+ mGraphPointPaint.setColor(GRAPH_COLOR);
+ mGraphPointPaint.setStrokeWidth(applyDimensionSp(GRAPH_POINT_RADIUS_SP, mDm));
+ mGraphPointPaint.setStrokeCap(Paint.Cap.ROUND);
+ mGraphPointPaint.setStrokeJoin(Paint.Join.ROUND);
+ }
+
+ /**
+ * Reads new scroll axis value and updates the list accordingly. Old positions are
+ * kept at the front (what you would get with getFirst), while the recent positions are
+ * kept at the back (what you would get with getLast). Also updates the frame center
+ * position to handle out-of-bounds cases.
+ */
+ void addValue(float scrollAxisValue, long eventTime) {
+ // Remove values that are too old.
+ while (mGraphValues.getSize() > 0
+ && (eventTime - mGraphValues.getFirst().mTime) > MAX_SHOWN_TIME_INTERVAL) {
+ mGraphValues.removeFirst();
+ }
+
+ // If there are no recent values, reset the frame center.
+ if (mGraphValues.getSize() == 0) {
+ mFrameCenterPosition = DEFAULT_FRAME_CENTER_POSITION;
+ }
+
+ // Handle new value. We multiply the scroll axis value by the scaled scroll factor to
+ // get the amount of pixels to be scrolled. We also compute the accumulated position
+ // by adding the current value to the last one (if not empty).
+ final float displacement = scrollAxisValue * mScaledVerticalScrollFactor;
+ final float prevPos = (mGraphValues.getSize() == 0 ? 0 : mGraphValues.getLast().mPos);
+ final float pos = prevPos + displacement;
+
+ mGraphValues.add(pos, eventTime);
+
+ // The difference between the distance of the most recent position from the center
+ // frame (pos - mFrameCenterPosition) and the maximum allowed distance from the center
+ // frame (mFrameCenterToBorderDistance).
+ final float verticalDiff = Math.abs(pos - mFrameCenterPosition)
+ - mFrameCenterToBorderDistance;
+ // If needed, translate frame.
+ if (verticalDiff > 0) {
+ final int sign = pos - mFrameCenterPosition < 0 ? -1 : 1;
+ // Here, we update the center frame position by the exact amount needed for us to
+ // stay within the maximum allowed distance from the center frame.
+ mFrameCenterPosition += sign * verticalDiff;
+ }
+
+ // Redraw canvas.
+ invalidate();
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ super.onDraw(canvas);
+
+ // Note: vertical coordinates in Canvas go from top to bottom,
+ // that is bottomY > middleY > topY.
+ final int verticalMargin = applyDimensionSp(FRAME_BORDER_GAP_SP, mDm);
+ final int topY = verticalMargin;
+ final int bottomY = getHeight() - verticalMargin;
+ final int middleY = (topY + bottomY) / 2;
+
+ // Note: horizontal coordinates in Canvas go from left to right,
+ // that is rightX > leftX.
+ final int leftX = 0;
+ final int rightX = getWidth();
+
+ // Draw the frame, which includes 3 lines that show the maximum,
+ // minimum and middle positions of the graph.
+ canvas.drawLine(leftX, topY, rightX, topY, mFramePaint);
+ canvas.drawLine(leftX, middleY, rightX, middleY, mFramePaint);
+ canvas.drawLine(leftX, bottomY, rightX, bottomY, mFramePaint);
+
+ // Draw the position that each frame line corresponds to.
+ final int frameTextOffset = applyDimensionSp(FRAME_TEXT_OFFSET_SP, mDm);
+ canvas.drawText(
+ String.format(mDefaultLocale, "%.1f",
+ mFrameCenterPosition + mFrameCenterToBorderDistance),
+ leftX,
+ topY - frameTextOffset, mFrameTextPaint
+ );
+ canvas.drawText(
+ String.format(mDefaultLocale, "%.1f", mFrameCenterPosition),
+ leftX,
+ middleY - frameTextOffset, mFrameTextPaint
+ );
+ canvas.drawText(
+ String.format(mDefaultLocale, "%.1f",
+ mFrameCenterPosition - mFrameCenterToBorderDistance),
+ leftX,
+ bottomY - frameTextOffset, mFrameTextPaint
+ );
+
+ // If there are no graph values to be drawn, stop here.
+ if (mGraphValues.getSize() == 0) {
+ return;
+ }
+
+ // Draw the graph using the times and positions.
+ // We start at the most recent value (which should be drawn at the right) and move
+ // to the older values (which should be drawn to the left of more recent ones). Negative
+ // indices are handled by circuling back to the end of the buffer.
+ final long mostRecentTime = mGraphValues.getLast().mTime;
+ float prevCoordX = 0;
+ float prevCoordY = 0;
+ float prevAge = 0;
+ for (Iterator<GraphValue> iter = mGraphValues.reverseIterator(); iter.hasNext();) {
+ final GraphValue value = iter.next();
+
+ final int age = (int) (mostRecentTime - value.mTime);
+ final float pos = value.mPos;
+
+ // We get the horizontal coordinate in time units from left to right with
+ // (MAX_SHOWN_TIME_INTERVAL - age). Then, we rescale it to match the canvas
+ // units by dividing it by the time-domain length (MAX_SHOWN_TIME_INTERVAL)
+ // and by multiplying it by the canvas length (rightX - leftX). Finally, we
+ // offset the coordinate by adding it to leftX.
+ final float coordX = leftX + ((float) (MAX_SHOWN_TIME_INTERVAL - age)
+ / MAX_SHOWN_TIME_INTERVAL) * (rightX - leftX);
+
+ // We get the vertical coordinate in position units from middle to top with
+ // (pos - mFrameCenterPosition). Then, we rescale it to match the canvas
+ // units by dividing it by half of the position-domain length
+ // (mFrameCenterToBorderDistance) and by multiplying it by half of the canvas
+ // length (middleY - topY). Finally, we offset the coordinate by subtracting
+ // it from middleY (we can't "add" here because the coordinate grows from top
+ // to bottom).
+ final float coordY = middleY - ((pos - mFrameCenterPosition)
+ / mFrameCenterToBorderDistance) * (middleY - topY);
+
+ // Draw a point for this value.
+ canvas.drawPoint(coordX, coordY, mGraphPointPaint);
+
+ // If this value is part of the same gesture as the previous one, draw a line
+ // between them. We ignore the first value (with age = 0).
+ if (age != 0 && (age - prevAge) <= MAX_GESTURE_TIME) {
+ canvas.drawLine(prevCoordX, prevCoordY, coordX, coordY, mGraphLinePaint);
+ }
+
+ prevCoordX = coordX;
+ prevCoordY = coordY;
+ prevAge = age;
+ }
+ }
+
+ @VisibleForTesting
+ float getFrameCenterPosition() {
+ return mFrameCenterPosition;
+ }
+
+ /**
+ * Holds data needed to draw each entry in the graph.
+ */
+ private static class GraphValue {
+ /** Position. */
+ float mPos;
+ /** Time when this value was added. */
+ long mTime;
+
+ GraphValue(float pos, long time) {
+ this.mPos = pos;
+ this.mTime = time;
+ }
+ }
+
+ /**
+ * Holds the graph values as a cyclic buffer. It has a fixed capacity, and it replaces the
+ * old values with new ones to avoid creating new objects.
+ */
+ private static class CyclicBuffer {
+ private final GraphValue[] mValues;
+ private final int mCapacity;
+ private int mSize = 0;
+ private int mLastIndex = 0;
+
+ // The iteration index and counter are here to make it easier to reset them.
+ /** Determines the value currently pointed by the iterator. */
+ private int mIteratorIndex;
+ /** Counts how many values have been iterated through. */
+ private int mIteratorCount;
+
+ /** Used traverse the values in reverse order. */
+ private final Iterator<GraphValue> mReverseIterator = new Iterator<GraphValue>() {
+ @Override
+ public boolean hasNext() {
+ return mIteratorCount <= mSize;
+ }
+
+ @Override
+ public GraphValue next() {
+ // Returns the value currently pointed by the iterator and moves the iterator to
+ // the previous one.
+ mIteratorCount++;
+ return mValues[(mIteratorIndex-- + mCapacity) % mCapacity];
+ }
+ };
+
+ CyclicBuffer(int capacity) {
+ mCapacity = capacity;
+ mValues = new GraphValue[capacity];
+ }
+
+ /**
+ * Add new graph value. If there is an existing object, we replace its data with the
+ * new one. With this, we re-use old objects instead of creating new ones.
+ */
+ void add(float pos, long time) {
+ mLastIndex = (mLastIndex + 1) % mCapacity;
+ if (mValues[mLastIndex] == null) {
+ mValues[mLastIndex] = new GraphValue(pos, time);
+ } else {
+ final GraphValue oldValue = mValues[mLastIndex];
+ oldValue.mPos = pos;
+ oldValue.mTime = time;
+ }
+
+ // If needed, account for new value in the buffer size.
+ if (mSize != mCapacity) {
+ mSize++;
+ }
+ }
+
+ int getSize() {
+ return mSize;
+ }
+
+ GraphValue getFirst() {
+ final int distanceBetweenLastAndFirst = (mCapacity - mSize) + 1;
+ final int firstIndex = (mLastIndex + distanceBetweenLastAndFirst) % mCapacity;
+ return mValues[firstIndex];
+ }
+
+ GraphValue getLast() {
+ return mValues[mLastIndex];
+ }
+
+ void removeFirst() {
+ mSize--;
+ }
+
+ /** Returns an iterator pointing at the last value. */
+ Iterator<GraphValue> reverseIterator() {
+ mIteratorIndex = mLastIndex;
+ mIteratorCount = 1;
+ return mReverseIterator;
+ }
+ }
+ }
}
diff --git a/services/core/java/com/android/server/input/GestureMonitorSpyWindow.java b/services/core/java/com/android/server/input/GestureMonitorSpyWindow.java
index d238dae..2ede56d 100644
--- a/services/core/java/com/android/server/input/GestureMonitorSpyWindow.java
+++ b/services/core/java/com/android/server/input/GestureMonitorSpyWindow.java
@@ -67,7 +67,7 @@
final SurfaceControl.Transaction t = new SurfaceControl.Transaction();
t.setInputWindowInfo(mInputSurface, mWindowHandle);
- t.setLayer(mInputSurface, Integer.MAX_VALUE);
+ t.setLayer(mInputSurface, InputManagerService.INPUT_OVERLAY_LAYER_GESTURE_MONITOR);
t.setPosition(mInputSurface, 0, 0);
t.setCrop(mInputSurface, null /* crop to parent surface */);
t.show(mInputSurface);
diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java
index 6241ebb..62660c4 100644
--- a/services/core/java/com/android/server/input/InputManagerService.java
+++ b/services/core/java/com/android/server/input/InputManagerService.java
@@ -381,6 +381,17 @@
public static final int SW_CAMERA_LENS_COVER_BIT = 1 << SW_CAMERA_LENS_COVER;
public static final int SW_MUTE_DEVICE_BIT = 1 << SW_MUTE_DEVICE;
+ // The following are layer numbers used for z-ordering the input overlay layers on the display.
+ // This is used for ordering layers inside {@code DisplayContent#getInputOverlayLayer()}.
+ //
+ // The layer where gesture monitors are added.
+ public static final int INPUT_OVERLAY_LAYER_GESTURE_MONITOR = 1;
+ // Place the handwriting layer above gesture monitors so that styluses cannot trigger
+ // system gestures (e.g. navigation bar, edge-back, etc) while there is an active
+ // handwriting session.
+ public static final int INPUT_OVERLAY_LAYER_HANDWRITING_SURFACE = 2;
+
+
private final String mVelocityTrackerStrategy;
/** Whether to use the dev/input/event or uevent subsystem for the audio jack. */
@@ -390,6 +401,8 @@
@GuardedBy("mFocusEventDebugViewLock")
@Nullable
private FocusEventDebugView mFocusEventDebugView;
+ private boolean mShowKeyPresses = false;
+ private boolean mShowRotaryInput = false;
/** Point of injection for test dependencies. */
@VisibleForTesting
@@ -2476,7 +2489,7 @@
private int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags) {
synchronized (mFocusEventDebugViewLock) {
if (mFocusEventDebugView != null) {
- mFocusEventDebugView.reportEvent(event);
+ mFocusEventDebugView.reportKeyEvent(event);
}
}
return mWindowManagerCallbacks.interceptKeyBeforeQueueing(event, policyFlags);
@@ -3396,14 +3409,45 @@
mWindowManagerCallbacks.notifyPointerLocationChanged(enabled);
}
- void updateFocusEventDebugViewEnabled(boolean enabled) {
+ void updateShowKeyPresses(boolean enabled) {
+ if (mShowKeyPresses == enabled) {
+ return;
+ }
+
+ mShowKeyPresses = enabled;
+ updateFocusEventDebugViewEnabled();
+
+ synchronized (mFocusEventDebugViewLock) {
+ if (mFocusEventDebugView != null) {
+ mFocusEventDebugView.updateShowKeyPresses(enabled);
+ }
+ }
+ }
+
+ void updateShowRotaryInput(boolean enabled) {
+ if (mShowRotaryInput == enabled) {
+ return;
+ }
+
+ mShowRotaryInput = enabled;
+ updateFocusEventDebugViewEnabled();
+
+ synchronized (mFocusEventDebugViewLock) {
+ if (mFocusEventDebugView != null) {
+ mFocusEventDebugView.updateShowRotaryInput(enabled);
+ }
+ }
+ }
+
+ private void updateFocusEventDebugViewEnabled() {
+ boolean enabled = mShowKeyPresses || mShowRotaryInput;
FocusEventDebugView view;
synchronized (mFocusEventDebugViewLock) {
if (enabled == (mFocusEventDebugView != null)) {
return;
}
if (enabled) {
- mFocusEventDebugView = new FocusEventDebugView(mContext);
+ mFocusEventDebugView = new FocusEventDebugView(mContext, this);
view = mFocusEventDebugView;
} else {
view = mFocusEventDebugView;
diff --git a/services/core/java/com/android/server/input/InputSettingsObserver.java b/services/core/java/com/android/server/input/InputSettingsObserver.java
index cf7c692..aab491e 100644
--- a/services/core/java/com/android/server/input/InputSettingsObserver.java
+++ b/services/core/java/com/android/server/input/InputSettingsObserver.java
@@ -86,7 +86,9 @@
Map.entry(Settings.Secure.getUriFor(Settings.Secure.KEY_REPEAT_TIMEOUT_MS),
(reason) -> updateKeyRepeatInfo(getLatestLongPressTimeoutValue())),
Map.entry(Settings.Secure.getUriFor(Settings.Secure.KEY_REPEAT_DELAY_MS),
- (reason) -> updateKeyRepeatInfo(getLatestLongPressTimeoutValue())));
+ (reason) -> updateKeyRepeatInfo(getLatestLongPressTimeoutValue())),
+ Map.entry(Settings.System.getUriFor(Settings.System.SHOW_ROTARY_INPUT),
+ (reason) -> updateShowRotaryInput()));
}
/**
@@ -164,8 +166,11 @@
}
private void updateShowKeyPresses() {
- mService.updateFocusEventDebugViewEnabled(
- getBoolean(Settings.System.SHOW_KEY_PRESSES, false));
+ mService.updateShowKeyPresses(getBoolean(Settings.System.SHOW_KEY_PRESSES, false));
+ }
+
+ private void updateShowRotaryInput() {
+ mService.updateShowRotaryInput(getBoolean(Settings.System.SHOW_ROTARY_INPUT, false));
}
private void updateAccessibilityLargePointer() {
diff --git a/services/core/java/com/android/server/inputmethod/HandwritingEventReceiverSurface.java b/services/core/java/com/android/server/inputmethod/HandwritingEventReceiverSurface.java
index 0c889c2..7726f40 100644
--- a/services/core/java/com/android/server/inputmethod/HandwritingEventReceiverSurface.java
+++ b/services/core/java/com/android/server/inputmethod/HandwritingEventReceiverSurface.java
@@ -27,16 +27,13 @@
import android.view.SurfaceControl;
import android.view.WindowManager;
+import com.android.server.input.InputManagerService;
+
final class HandwritingEventReceiverSurface {
public static final String TAG = HandwritingEventReceiverSurface.class.getSimpleName();
static final boolean DEBUG = HandwritingModeController.DEBUG;
- // Place the layer at the highest layer so stylus cannot trigger gesture monitors
- // (e.g. navigation bar, edge-back, etc) while handwriting is ongoing.
- // TODO(b/217538817): Specify the ordering in WM by usage.
- private static final int HANDWRITING_SURFACE_LAYER = Integer.MAX_VALUE;
-
private final InputWindowHandle mWindowHandle;
private final InputChannel mClientChannel;
private final SurfaceControl mInputSurface;
@@ -68,7 +65,7 @@
final SurfaceControl.Transaction t = new SurfaceControl.Transaction();
t.setInputWindowInfo(mInputSurface, mWindowHandle);
- t.setLayer(mInputSurface, HANDWRITING_SURFACE_LAYER);
+ t.setLayer(mInputSurface, InputManagerService.INPUT_OVERLAY_LAYER_HANDWRITING_SURFACE);
t.setPosition(mInputSurface, 0, 0);
t.setCrop(mInputSurface, null /* crop to parent surface */);
t.show(mInputSurface);
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index 2fc4829..1ec8b10 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -3275,15 +3275,18 @@
} else {
// If subtype is null, try to find the most applicable one from
// getCurrentInputMethodSubtype.
+ subtypeId = NOT_A_SUBTYPE_ID;
newSubtype = getCurrentInputMethodSubtypeLocked();
+ if (newSubtype != null) {
+ for (int i = 0; i < subtypeCount; ++i) {
+ if (Objects.equals(newSubtype, info.getSubtypeAt(i))) {
+ subtypeId = i;
+ break;
+ }
+ }
+ }
}
- if (newSubtype == null || oldSubtype == null) {
- Slog.w(TAG, "Illegal subtype state: old subtype = " + oldSubtype
- + ", new subtype = " + newSubtype);
- notifyInputMethodSubtypeChangedLocked(userId, info, null);
- return;
- }
- if (!newSubtype.equals(oldSubtype)) {
+ if (!Objects.equals(newSubtype, oldSubtype)) {
setSelectedInputMethodAndSubtypeLocked(info, subtypeId, true);
IInputMethodInvoker curMethod = getCurMethodLocked();
if (curMethod != null) {
@@ -5959,6 +5962,8 @@
mVisibilityStateComputer.dump(pw);
p.println(" mInFullscreenMode=" + mInFullscreenMode);
p.println(" mSystemReady=" + mSystemReady + " mInteractive=" + mIsInteractive);
+ p.println(" ENABLE_HIDE_IME_CAPTION_BAR="
+ + InputMethodService.ENABLE_HIDE_IME_CAPTION_BAR);
p.println(" mSettingsObserver=" + mSettingsObserver);
p.println(" mStylusIds=" + (mStylusIds != null
? Arrays.toString(mStylusIds.toArray()) : ""));
diff --git a/services/core/java/com/android/server/location/gnss/GnssListenerMultiplexer.java b/services/core/java/com/android/server/location/gnss/GnssListenerMultiplexer.java
index 567d8ac..f21a9fe 100644
--- a/services/core/java/com/android/server/location/gnss/GnssListenerMultiplexer.java
+++ b/services/core/java/com/android/server/location/gnss/GnssListenerMultiplexer.java
@@ -201,10 +201,10 @@
this::onProviderEnabledChanged;
private final SettingsHelper.GlobalSettingChangedListener
mBackgroundThrottlePackageWhitelistChangedListener =
- this::onBackgroundThrottlePackageWhitelistChanged;
+ this::onBackgroundThrottlePackageAllowlistChanged;
private final SettingsHelper.UserSettingChangedListener
mLocationPackageBlacklistChangedListener =
- this::onLocationPackageBlacklistChanged;
+ this::onLocationPackageDenylistChanged;
private final LocationPermissionsHelper.LocationPermissionsListener
mLocationPermissionsListener =
new LocationPermissionsHelper.LocationPermissionsListener() {
@@ -407,11 +407,11 @@
updateRegistrations(registration -> registration.getIdentity().getUserId() == userId);
}
- private void onBackgroundThrottlePackageWhitelistChanged() {
+ private void onBackgroundThrottlePackageAllowlistChanged() {
updateRegistrations(registration -> true);
}
- private void onLocationPackageBlacklistChanged(int userId) {
+ private void onLocationPackageDenylistChanged(int userId) {
updateRegistrations(registration -> registration.getIdentity().getUserId() == userId);
}
diff --git a/services/core/java/com/android/server/location/injector/SettingsHelper.java b/services/core/java/com/android/server/location/injector/SettingsHelper.java
index 490bfe1..32cbff8 100644
--- a/services/core/java/com/android/server/location/injector/SettingsHelper.java
+++ b/services/core/java/com/android/server/location/injector/SettingsHelper.java
@@ -93,37 +93,37 @@
GlobalSettingChangedListener listener);
/**
- * Check if the given package is blacklisted for location access.
+ * Check if the given package is denylisted for location access.
*/
public abstract boolean isLocationPackageBlacklisted(int userId, String packageName);
/**
- * Add a listener for changes to the location package blacklist. Callbacks occur on an
+ * Add a listener for changes to the location package denylist. Callbacks occur on an
* unspecified thread.
*/
public abstract void addOnLocationPackageBlacklistChangedListener(
UserSettingChangedListener listener);
/**
- * Remove a listener for changes to the location package blacklist.
+ * Remove a listener for changes to the location package denylist.
*/
public abstract void removeOnLocationPackageBlacklistChangedListener(
UserSettingChangedListener listener);
/**
- * Retrieve the background throttle package whitelist.
+ * Retrieve the background throttle package allowlist.
*/
public abstract Set<String> getBackgroundThrottlePackageWhitelist();
/**
- * Add a listener for changes to the background throttle package whitelist. Callbacks occur on
+ * Add a listener for changes to the background throttle package allowlist. Callbacks occur on
* an unspecified thread.
*/
public abstract void addOnBackgroundThrottlePackageWhitelistChangedListener(
GlobalSettingChangedListener listener);
/**
- * Remove a listener for changes to the background throttle package whitelist.
+ * Remove a listener for changes to the background throttle package allowlist.
*/
public abstract void removeOnBackgroundThrottlePackageWhitelistChangedListener(
GlobalSettingChangedListener listener);
@@ -134,14 +134,14 @@
public abstract boolean isGnssMeasurementsFullTrackingEnabled();
/**
- * Add a listener for changes to the background throttle package whitelist. Callbacks occur on
+ * Add a listener for changes to the background throttle package allowlist. Callbacks occur on
* an unspecified thread.
*/
public abstract void addOnGnssMeasurementsFullTrackingEnabledChangedListener(
GlobalSettingChangedListener listener);
/**
- * Remove a listener for changes to the background throttle package whitelist.
+ * Remove a listener for changes to the background throttle package allowlist.
*/
public abstract void removeOnGnssMeasurementsFullTrackingEnabledChangedListener(
GlobalSettingChangedListener listener);
@@ -166,14 +166,14 @@
public abstract PackageTagsList getIgnoreSettingsAllowlist();
/**
- * Add a listener for changes to the ignore settings package whitelist. Callbacks occur on an
+ * Add a listener for changes to the ignore settings package allowlist. Callbacks occur on an
* unspecified thread.
*/
public abstract void addIgnoreSettingsAllowlistChangedListener(
GlobalSettingChangedListener listener);
/**
- * Remove a listener for changes to the ignore settings package whitelist.
+ * Remove a listener for changes to the ignore settings package allowlist.
*/
public abstract void removeIgnoreSettingsAllowlistChangedListener(
GlobalSettingChangedListener listener);
diff --git a/services/core/java/com/android/server/location/injector/SystemSettingsHelper.java b/services/core/java/com/android/server/location/injector/SystemSettingsHelper.java
index 777683e..8bb184c 100644
--- a/services/core/java/com/android/server/location/injector/SystemSettingsHelper.java
+++ b/services/core/java/com/android/server/location/injector/SystemSettingsHelper.java
@@ -65,8 +65,8 @@
*/
public class SystemSettingsHelper extends SettingsHelper {
- private static final String LOCATION_PACKAGE_BLACKLIST = "locationPackagePrefixBlacklist";
- private static final String LOCATION_PACKAGE_WHITELIST = "locationPackagePrefixWhitelist";
+ private static final String LOCATION_PACKAGE_DENYLIST = "locationPackagePrefixBlacklist";
+ private static final String LOCATION_PACKAGE_ALLOWLIST = "locationPackagePrefixWhitelist";
private static final long DEFAULT_BACKGROUND_THROTTLE_INTERVAL_MS = 30 * 60 * 1000;
private static final long DEFAULT_BACKGROUND_THROTTLE_PROXIMITY_ALERT_INTERVAL_MS =
@@ -93,9 +93,9 @@
mGnssMeasurementFullTracking = new BooleanGlobalSetting(context,
ENABLE_GNSS_RAW_MEAS_FULL_TRACKING, FgThread.getHandler());
mLocationPackageBlacklist = new StringListCachedSecureSetting(context,
- LOCATION_PACKAGE_BLACKLIST, FgThread.getHandler());
+ LOCATION_PACKAGE_DENYLIST, FgThread.getHandler());
mLocationPackageWhitelist = new StringListCachedSecureSetting(context,
- LOCATION_PACKAGE_WHITELIST, FgThread.getHandler());
+ LOCATION_PACKAGE_ALLOWLIST, FgThread.getHandler());
mBackgroundThrottlePackageWhitelist = new StringSetCachedGlobalSetting(context,
LOCATION_BACKGROUND_THROTTLE_PACKAGE_WHITELIST,
() -> SystemConfig.getInstance().getAllowUnthrottledLocation(),
diff --git a/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java b/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java
index d700c6a..8e9c21f 100644
--- a/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java
+++ b/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java
@@ -77,7 +77,6 @@
import java.util.Objects;
import java.util.Set;
-
/**
* A class that manages a user's synthetic password (SP) ({@link #SyntheticPassword}), along with a
* set of SP protectors that are independent ways that the SP is protected.
@@ -552,22 +551,48 @@
}
}
- private @Nullable IWeaver getWeaverServiceInternal() {
- // Try to get the AIDL service first
+ private @Nullable IWeaver getWeaverAidlService() {
+ final IWeaver aidlWeaver;
try {
- IWeaver aidlWeaver = IWeaver.Stub.asInterface(
- ServiceManager.waitForDeclaredService(IWeaver.DESCRIPTOR + "/default"));
- if (aidlWeaver != null) {
- Slog.i(TAG, "Using AIDL weaver service");
- try {
- aidlWeaver.asBinder().linkToDeath(new WeaverDiedRecipient(), 0);
- } catch (RemoteException e) {
- Slog.w(TAG, "Unable to register Weaver death recipient", e);
- }
- return aidlWeaver;
- }
+ aidlWeaver =
+ IWeaver.Stub.asInterface(
+ ServiceManager.waitForDeclaredService(IWeaver.DESCRIPTOR + "/default"));
} catch (SecurityException e) {
Slog.w(TAG, "Does not have permissions to get AIDL weaver service");
+ return null;
+ }
+ if (aidlWeaver == null) {
+ return null;
+ }
+ final int aidlVersion;
+ try {
+ aidlVersion = aidlWeaver.getInterfaceVersion();
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Cannot get AIDL weaver service version", e);
+ return null;
+ }
+ if (aidlVersion < 2) {
+ Slog.w(TAG,
+ "Ignoring AIDL weaver service v"
+ + aidlVersion
+ + " because only v2 and later are supported");
+ return null;
+ }
+ Slog.i(TAG, "Found AIDL weaver service v" + aidlVersion);
+ return aidlWeaver;
+ }
+
+ private @Nullable IWeaver getWeaverServiceInternal() {
+ // Try to get the AIDL service first
+ IWeaver aidlWeaver = getWeaverAidlService();
+ if (aidlWeaver != null) {
+ Slog.i(TAG, "Using AIDL weaver service");
+ try {
+ aidlWeaver.asBinder().linkToDeath(new WeaverDiedRecipient(), 0);
+ } catch (RemoteException e) {
+ Slog.w(TAG, "Unable to register Weaver death recipient", e);
+ }
+ return aidlWeaver;
}
// If the AIDL service can't be found, look for the HIDL service
diff --git a/services/core/java/com/android/server/media/MediaSessionService.java b/services/core/java/com/android/server/media/MediaSessionService.java
index 3a20cd9..f2242bf 100644
--- a/services/core/java/com/android/server/media/MediaSessionService.java
+++ b/services/core/java/com/android/server/media/MediaSessionService.java
@@ -2188,11 +2188,10 @@
MediaSessionRecordImpl session = isGlobalPriorityActiveLocked() ? mGlobalPrioritySession
: mCurrentFullUserRecord.mPriorityStack.getDefaultVolumeSession();
- boolean preferSuggestedStream = false;
- if (isValidLocalStreamType(suggestedStream)
- && AudioSystem.isStreamActive(suggestedStream, 0)) {
- preferSuggestedStream = true;
- }
+ boolean preferSuggestedStream =
+ isValidLocalStreamType(suggestedStream)
+ && AudioSystem.isStreamActive(suggestedStream, 0);
+
if (session == null || preferSuggestedStream) {
if (DEBUG_KEY_EVENT) {
Log.d(TAG, "Adjusting suggestedStream=" + suggestedStream + " by " + direction
diff --git a/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java b/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java
index e7bd68e..515c7fb 100644
--- a/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java
+++ b/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java
@@ -735,12 +735,9 @@
}
@Override //Binder call
+ @EnforcePermission(MANAGE_MEDIA_PROJECTION)
public void addCallback(final IMediaProjectionWatcherCallback callback) {
- if (mContext.checkCallingPermission(MANAGE_MEDIA_PROJECTION)
- != PackageManager.PERMISSION_GRANTED) {
- throw new SecurityException("Requires MANAGE_MEDIA_PROJECTION in order to add "
- + "projection callbacks");
- }
+ addCallback_enforcePermission();
final long token = Binder.clearCallingIdentity();
try {
MediaProjectionManagerService.this.addCallback(callback);
diff --git a/services/core/java/com/android/server/net/NetworkPolicyLogger.java b/services/core/java/com/android/server/net/NetworkPolicyLogger.java
index dc8fcb0..85731651 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyLogger.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyLogger.java
@@ -338,8 +338,8 @@
return "App idle state of uid " + uid + ": " + idle;
}
- private static String getAppIdleWlChangedLog(int uid, boolean isWhitelisted) {
- return "App idle whitelist state of uid " + uid + ": " + isWhitelisted;
+ private static String getAppIdleWlChangedLog(int uid, boolean isAllowlisted) {
+ return "App idle whitelist state of uid " + uid + ": " + isAllowlisted;
}
private static String getParoleStateChanged(boolean paroleOn) {
@@ -519,14 +519,14 @@
data.timeStamp = System.currentTimeMillis();
}
- public void appIdleWlChanged(int uid, boolean isWhitelisted) {
+ public void appIdleWlChanged(int uid, boolean isAllowlisted) {
final Data data = getNextSlot();
if (data == null) return;
data.reset();
data.type = EVENT_APP_IDLE_WL_CHANGED;
data.ifield1 = uid;
- data.bfield1 = isWhitelisted;
+ data.bfield1 = isAllowlisted;
data.timeStamp = System.currentTimeMillis();
}
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
index fb9bc01..46e7041 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
@@ -365,7 +365,7 @@
private static final String TAG_NETWORK_POLICY = "network-policy";
private static final String TAG_UID_POLICY = "uid-policy";
private static final String TAG_APP_POLICY = "app-policy";
- private static final String TAG_WHITELIST = "whitelist";
+ private static final String TAG_ALLOWLIST = "whitelist";
private static final String TAG_RESTRICT_BACKGROUND = "restrict-background";
private static final String TAG_REVOKED_RESTRICT_BACKGROUND = "revoked-restrict-background";
private static final String TAG_XML_UTILS_INT_ARRAY = "int-array";
@@ -859,7 +859,7 @@
}
@GuardedBy("mUidRulesFirstLock")
- private void updatePowerSaveWhitelistUL() {
+ private void updatePowerSaveAllowlistUL() {
int[] whitelist = mPowerWhitelistManager.getWhitelistedAppIds(/* includingIdle */ false);
mPowerSaveWhitelistExceptIdleAppIds.clear();
for (int uid : whitelist) {
@@ -950,7 +950,7 @@
synchronized (mUidRulesFirstLock) {
synchronized (mNetworkPoliciesSecondLock) {
- updatePowerSaveWhitelistUL();
+ updatePowerSaveAllowlistUL();
mPowerManagerInternal = LocalServices.getService(PowerManagerInternal.class);
mPowerManagerInternal.registerLowPowerModeObserver(
new PowerManagerInternal.LowPowerModeListener() {
@@ -1194,7 +1194,7 @@
public void onReceive(Context context, Intent intent) {
// on background handler thread, and POWER_SAVE_WHITELIST_CHANGED is protected
synchronized (mUidRulesFirstLock) {
- updatePowerSaveWhitelistUL();
+ updatePowerSaveAllowlistUL();
updateRulesForRestrictPowerUL();
updateRulesForAppIdleUL();
}
@@ -2684,7 +2684,7 @@
} else {
Slog.w(TAG, "unable to apply policy to UID " + uid + "; ignoring");
}
- } else if (TAG_WHITELIST.equals(tag)) {
+ } else if (TAG_ALLOWLIST.equals(tag)) {
insideAllowlist = true;
} else if (TAG_RESTRICT_BACKGROUND.equals(tag) && insideAllowlist) {
final int uid = readIntAttribute(in, ATTR_UID);
@@ -2694,7 +2694,7 @@
mRestrictBackgroundAllowlistRevokedUids.put(uid, true);
}
} else if (type == END_TAG) {
- if (TAG_WHITELIST.equals(tag)) {
+ if (TAG_ALLOWLIST.equals(tag)) {
insideAllowlist = false;
}
@@ -2870,7 +2870,7 @@
out.endTag(null, TAG_POLICY_LIST);
// write all allowlists
- out.startTag(null, TAG_WHITELIST);
+ out.startTag(null, TAG_ALLOWLIST);
// revoked restrict background allowlist
int size = mRestrictBackgroundAllowlistRevokedUids.size();
@@ -2881,7 +2881,7 @@
out.endTag(null, TAG_REVOKED_RESTRICT_BACKGROUND);
}
- out.endTag(null, TAG_WHITELIST);
+ out.endTag(null, TAG_ALLOWLIST);
out.endDocument();
@@ -4395,7 +4395,7 @@
void updateRulesForPowerSaveUL() {
Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "updateRulesForPowerSaveUL");
try {
- updateRulesForWhitelistedPowerSaveUL(mRestrictPower, FIREWALL_CHAIN_POWERSAVE,
+ updateRulesForAllowlistedPowerSaveUL(mRestrictPower, FIREWALL_CHAIN_POWERSAVE,
mUidFirewallPowerSaveRules);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_NETWORK);
@@ -4404,14 +4404,14 @@
@GuardedBy("mUidRulesFirstLock")
void updateRuleForRestrictPowerUL(int uid) {
- updateRulesForWhitelistedPowerSaveUL(uid, mRestrictPower, FIREWALL_CHAIN_POWERSAVE);
+ updateRulesForAllowlistedPowerSaveUL(uid, mRestrictPower, FIREWALL_CHAIN_POWERSAVE);
}
@GuardedBy("mUidRulesFirstLock")
void updateRulesForDeviceIdleUL() {
Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "updateRulesForDeviceIdleUL");
try {
- updateRulesForWhitelistedPowerSaveUL(mDeviceIdleMode, FIREWALL_CHAIN_DOZABLE,
+ updateRulesForAllowlistedPowerSaveUL(mDeviceIdleMode, FIREWALL_CHAIN_DOZABLE,
mUidFirewallDozableRules);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_NETWORK);
@@ -4420,26 +4420,26 @@
@GuardedBy("mUidRulesFirstLock")
void updateRuleForDeviceIdleUL(int uid) {
- updateRulesForWhitelistedPowerSaveUL(uid, mDeviceIdleMode, FIREWALL_CHAIN_DOZABLE);
+ updateRulesForAllowlistedPowerSaveUL(uid, mDeviceIdleMode, FIREWALL_CHAIN_DOZABLE);
}
// NOTE: since both fw_dozable and fw_powersave uses the same map
// (mPowerSaveTempWhitelistAppIds) for allowlisting, we can reuse their logic in this method.
@GuardedBy("mUidRulesFirstLock")
- private void updateRulesForWhitelistedPowerSaveUL(boolean enabled, int chain,
+ private void updateRulesForAllowlistedPowerSaveUL(boolean enabled, int chain,
SparseIntArray rules) {
if (enabled) {
- // Sync the whitelists before enabling the chain. We don't care about the rules if
+ // Sync the allowlists before enabling the chain. We don't care about the rules if
// we are disabling the chain.
final SparseIntArray uidRules = rules;
uidRules.clear();
final List<UserInfo> users = mUserManager.getUsers();
for (int ui = users.size() - 1; ui >= 0; ui--) {
UserInfo user = users.get(ui);
- updateRulesForWhitelistedAppIds(uidRules, mPowerSaveTempWhitelistAppIds, user.id);
- updateRulesForWhitelistedAppIds(uidRules, mPowerSaveWhitelistAppIds, user.id);
+ updateRulesForAllowlistedAppIds(uidRules, mPowerSaveTempWhitelistAppIds, user.id);
+ updateRulesForAllowlistedAppIds(uidRules, mPowerSaveWhitelistAppIds, user.id);
if (chain == FIREWALL_CHAIN_POWERSAVE) {
- updateRulesForWhitelistedAppIds(uidRules,
+ updateRulesForAllowlistedAppIds(uidRules,
mPowerSaveWhitelistExceptIdleAppIds, user.id);
}
}
@@ -4454,7 +4454,7 @@
}
}
- private void updateRulesForWhitelistedAppIds(final SparseIntArray uidRules,
+ private void updateRulesForAllowlistedAppIds(final SparseIntArray uidRules,
final SparseBooleanArray whitelistedAppIds, int userId) {
for (int i = whitelistedAppIds.size() - 1; i >= 0; --i) {
if (whitelistedAppIds.valueAt(i)) {
@@ -4515,12 +4515,12 @@
* allowlisted.
*/
@GuardedBy("mUidRulesFirstLock")
- private boolean isWhitelistedFromPowerSaveUL(int uid, boolean deviceIdleMode) {
+ private boolean isAllowlistedFromPowerSaveUL(int uid, boolean deviceIdleMode) {
final int appId = UserHandle.getAppId(uid);
boolean isWhitelisted = mPowerSaveTempWhitelistAppIds.get(appId)
|| mPowerSaveWhitelistAppIds.get(appId);
if (!deviceIdleMode) {
- isWhitelisted = isWhitelisted || isWhitelistedFromPowerSaveExceptIdleUL(uid);
+ isWhitelisted = isWhitelisted || isAllowlistedFromPowerSaveExceptIdleUL(uid);
}
return isWhitelisted;
}
@@ -4530,7 +4530,7 @@
* (eg: Battery Saver and app idle).
*/
@GuardedBy("mUidRulesFirstLock")
- private boolean isWhitelistedFromPowerSaveExceptIdleUL(int uid) {
+ private boolean isAllowlistedFromPowerSaveExceptIdleUL(int uid) {
final int appId = UserHandle.getAppId(uid);
return mPowerSaveWhitelistExceptIdleAppIds.get(appId);
}
@@ -4546,9 +4546,9 @@
// NOTE: since both fw_dozable and fw_powersave uses the same map
// (mPowerSaveTempWhitelistAppIds) for allowlisting, we can reuse their logic in this method.
@GuardedBy("mUidRulesFirstLock")
- private void updateRulesForWhitelistedPowerSaveUL(int uid, boolean enabled, int chain) {
+ private void updateRulesForAllowlistedPowerSaveUL(int uid, boolean enabled, int chain) {
if (enabled) {
- final boolean isWhitelisted = isWhitelistedFromPowerSaveUL(uid,
+ final boolean isWhitelisted = isAllowlistedFromPowerSaveUL(uid,
chain == FIREWALL_CHAIN_DOZABLE);
if (isWhitelisted || isUidForegroundOnRestrictPowerUL(uid)) {
setUidFirewallRuleUL(chain, uid, FIREWALL_RULE_ALLOW);
@@ -4806,7 +4806,7 @@
}
@GuardedBy("mUidRulesFirstLock")
- private void updateRulesForTempWhitelistChangeUL(int appId) {
+ private void updateRulesForTempAllowlistChangeUL(int appId) {
final List<UserInfo> users = mUserManager.getUsers();
final int numUsers = users.size();
for (int i = 0; i < numUsers; i++) {
@@ -5197,7 +5197,7 @@
final boolean isForeground = isUidForegroundOnRestrictPowerUL(uid);
final boolean isTop = isUidTop(uid);
- final boolean isWhitelisted = isWhitelistedFromPowerSaveUL(uid, mDeviceIdleMode);
+ final boolean isWhitelisted = isAllowlistedFromPowerSaveUL(uid, mDeviceIdleMode);
final int oldEffectiveBlockedReasons;
final int newEffectiveBlockedReasons;
@@ -5220,9 +5220,9 @@
newAllowedReasons |= (isSystem(uid) ? ALLOWED_REASON_SYSTEM : 0);
newAllowedReasons |= (isForeground ? ALLOWED_REASON_FOREGROUND : 0);
newAllowedReasons |= (isTop ? ALLOWED_REASON_TOP : 0);
- newAllowedReasons |= (isWhitelistedFromPowerSaveUL(uid, true)
+ newAllowedReasons |= (isAllowlistedFromPowerSaveUL(uid, true)
? ALLOWED_REASON_POWER_SAVE_ALLOWLIST : 0);
- newAllowedReasons |= (isWhitelistedFromPowerSaveExceptIdleUL(uid)
+ newAllowedReasons |= (isAllowlistedFromPowerSaveExceptIdleUL(uid)
? ALLOWED_REASON_POWER_SAVE_EXCEPT_IDLE_ALLOWLIST : 0);
newAllowedReasons |= (uidBlockedState.allowedReasons
& ALLOWED_REASON_RESTRICTED_MODE_PERMISSIONS);
@@ -6137,7 +6137,7 @@
} else {
mPowerSaveTempWhitelistAppIds.delete(appId);
}
- updateRulesForTempWhitelistChangeUL(appId);
+ updateRulesForTempAllowlistChangeUL(appId);
}
}
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerShellCommand.java b/services/core/java/com/android/server/net/NetworkPolicyManagerShellCommand.java
index 47bb8f0..34c8a0d 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerShellCommand.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerShellCommand.java
@@ -154,13 +154,13 @@
}
switch(type) {
case "app-idle-whitelist":
- return listAppIdleWhitelist();
+ return listAppIdleAllowlist();
case "wifi-networks":
return listWifiNetworks();
case "restrict-background-whitelist":
- return listRestrictBackgroundWhitelist();
+ return listRestrictBackgroundAllowlist();
case "restrict-background-blacklist":
- return listRestrictBackgroundBlacklist();
+ return listRestrictBackgroundDenylist();
}
pw.println("Error: unknown list type '" + type + "'");
return -1;
@@ -175,11 +175,11 @@
}
switch(type) {
case "restrict-background-whitelist":
- return addRestrictBackgroundWhitelist();
+ return addRestrictBackgroundAllowlist();
case "restrict-background-blacklist":
- return addRestrictBackgroundBlacklist();
+ return addRestrictBackgroundDenylist();
case "app-idle-whitelist":
- return addAppIdleWhitelist();
+ return addAppIdleAllowlist();
}
pw.println("Error: unknown add type '" + type + "'");
return -1;
@@ -194,11 +194,11 @@
}
switch(type) {
case "restrict-background-whitelist":
- return removeRestrictBackgroundWhitelist();
+ return removeRestrictBackgroundAllowlist();
case "restrict-background-blacklist":
- return removeRestrictBackgroundBlacklist();
+ return removeRestrictBackgroundDenylist();
case "app-idle-whitelist":
- return removeAppIdleWhitelist();
+ return removeAppIdleAllowlist();
}
pw.println("Error: unknown remove type '" + type + "'");
return -1;
@@ -241,17 +241,17 @@
return 0;
}
- private int listRestrictBackgroundWhitelist() throws RemoteException {
+ private int listRestrictBackgroundAllowlist() throws RemoteException {
return listUidPolicies("Restrict background whitelisted UIDs",
POLICY_ALLOW_METERED_BACKGROUND);
}
- private int listRestrictBackgroundBlacklist() throws RemoteException {
+ private int listRestrictBackgroundDenylist() throws RemoteException {
return listUidPolicies("Restrict background blacklisted UIDs",
POLICY_REJECT_METERED_BACKGROUND);
}
- private int listAppIdleWhitelist() throws RemoteException {
+ private int listAppIdleAllowlist() throws RemoteException {
final PrintWriter pw = getOutPrintWriter();
final int[] uids = mInterface.getAppIdleWhitelist();
return listUidList("App Idle whitelisted UIDs", uids);
@@ -311,23 +311,23 @@
return 0;
}
- private int addRestrictBackgroundWhitelist() throws RemoteException {
+ private int addRestrictBackgroundAllowlist() throws RemoteException {
return setUidPolicy(POLICY_ALLOW_METERED_BACKGROUND);
}
- private int removeRestrictBackgroundWhitelist() throws RemoteException {
+ private int removeRestrictBackgroundAllowlist() throws RemoteException {
return resetUidPolicy("not whitelisted", POLICY_ALLOW_METERED_BACKGROUND);
}
- private int addRestrictBackgroundBlacklist() throws RemoteException {
+ private int addRestrictBackgroundDenylist() throws RemoteException {
return setUidPolicy(POLICY_REJECT_METERED_BACKGROUND);
}
- private int removeRestrictBackgroundBlacklist() throws RemoteException {
+ private int removeRestrictBackgroundDenylist() throws RemoteException {
return resetUidPolicy("not blacklisted", POLICY_REJECT_METERED_BACKGROUND);
}
- private int setAppIdleWhitelist(boolean isWhitelisted) {
+ private int setAppIdleAllowlist(boolean isWhitelisted) {
final int uid = getUidFromNextArg();
if (uid < 0) {
return uid;
@@ -336,12 +336,12 @@
return 0;
}
- private int addAppIdleWhitelist() throws RemoteException {
- return setAppIdleWhitelist(true);
+ private int addAppIdleAllowlist() throws RemoteException {
+ return setAppIdleAllowlist(true);
}
- private int removeAppIdleWhitelist() throws RemoteException {
- return setAppIdleWhitelist(false);
+ private int removeAppIdleAllowlist() throws RemoteException {
+ return setAppIdleAllowlist(false);
}
private int listWifiNetworks() {
diff --git a/services/core/java/com/android/server/net/watchlist/OWNERS b/services/core/java/com/android/server/net/watchlist/OWNERS
index a3d4b85..d0c4e55 100644
--- a/services/core/java/com/android/server/net/watchlist/OWNERS
+++ b/services/core/java/com/android/server/net/watchlist/OWNERS
@@ -1,3 +1,2 @@
-rickywai@google.com
alanstokes@google.com
simonjw@google.com
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index e782ea9..6f0a4b4 100755
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1239,7 +1239,9 @@
mNotificationRecordLogger.log(
NotificationRecordLogger.NotificationEvent.fromAction(actionIndex,
generatedByAssistant, action.isContextual()), r);
- EventLogTags.writeNotificationActionClicked(key, actionIndex,
+ EventLogTags.writeNotificationActionClicked(key,
+ action.actionIntent.getTarget().toString(),
+ action.actionIntent.getIntent().toString(), actionIndex,
r.getLifespanMs(now), r.getFreshnessMs(now), r.getExposureMs(now),
nv.rank, nv.count);
nv.recycle();
@@ -1926,6 +1928,7 @@
mConditionProviders.onUserRemoved(userId);
mAssistants.onUserRemoved(userId);
mHistoryManager.onUserRemoved(userId);
+ mPreferencesHelper.syncChannelsBypassingDnd();
handleSavePolicyFile();
} else if (action.equals(Intent.ACTION_USER_UNLOCKED)) {
final int userId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, USER_NULL);
@@ -2377,6 +2380,7 @@
});
mPermissionHelper = permissionHelper;
mNotificationChannelLogger = channelLogger;
+ mUserProfiles.updateCache(getContext());
mPreferencesHelper = new PreferencesHelper(getContext(),
mPackageManagerClient,
mRankingHandler,
@@ -2385,6 +2389,7 @@
mPermissionManager,
mNotificationChannelLogger,
mAppOps,
+ mUserProfiles,
new SysUiStatsEvent.BuilderFactory(),
mShowReviewPermissionsNotification);
mRankingHelper = new RankingHelper(getContext(),
@@ -2440,8 +2445,6 @@
mZenModeHelper.initZenMode();
mInterruptionFilter = mZenModeHelper.getZenModeListenerInterruptionFilter();
- mUserProfiles.updateCache(getContext());
-
if (mPackageManagerClient.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
telephonyManager.listen(new PhoneStateListener() {
@Override
diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java
index b2d3fca..100c638 100644
--- a/services/core/java/com/android/server/notification/NotificationRecord.java
+++ b/services/core/java/com/android/server/notification/NotificationRecord.java
@@ -25,8 +25,6 @@
import static android.service.notification.NotificationListenerService.Ranking.USER_SENTIMENT_POSITIVE;
import android.annotation.Nullable;
-import android.app.ActivityManager;
-import android.app.IActivityManager;
import android.app.KeyguardManager;
import android.app.Notification;
import android.app.NotificationChannel;
@@ -48,6 +46,7 @@
import android.os.Bundle;
import android.os.IBinder;
import android.os.PowerManager;
+import android.os.Trace;
import android.os.UserHandle;
import android.os.VibrationEffect;
import android.provider.Settings;
@@ -98,8 +97,7 @@
// the period after which a notification is updated where it can make sound
private static final int MAX_SOUND_DELAY_MS = 2000;
private final StatusBarNotification sbn;
- IActivityManager mAm;
- UriGrantsManagerInternal mUgmInternal;
+ private final UriGrantsManagerInternal mUgmInternal;
final int mTargetSdkVersion;
final int mOriginalFlags;
private final Context mContext;
@@ -223,7 +221,6 @@
this.sbn = sbn;
mTargetSdkVersion = LocalServices.getService(PackageManagerInternal.class)
.getPackageTargetSdkVersion(sbn.getPackageName());
- mAm = ActivityManager.getService();
mUgmInternal = LocalServices.getService(UriGrantsManagerInternal.class);
mOriginalFlags = sbn.getNotification().flags;
mRankingTimeMs = calculateRankingTimeMs(0L);
@@ -1387,18 +1384,27 @@
* Collect all {@link Uri} that should have permission granted to whoever
* will be rendering it.
*/
- protected void calculateGrantableUris() {
- final Notification notification = getNotification();
- notification.visitUris((uri) -> {
- visitGrantableUri(uri, false, false);
- });
+ private void calculateGrantableUris() {
+ Trace.beginSection("NotificationRecord.calculateGrantableUris");
+ try {
+ // We can't grant URI permissions from system.
+ final int sourceUid = getSbn().getUid();
+ if (sourceUid == android.os.Process.SYSTEM_UID) return;
- if (notification.getChannelId() != null) {
- NotificationChannel channel = getChannel();
- if (channel != null) {
- visitGrantableUri(channel.getSound(), (channel.getUserLockedFields()
- & NotificationChannel.USER_LOCKED_SOUND) != 0, true);
+ final Notification notification = getNotification();
+ notification.visitUris((uri) -> {
+ visitGrantableUri(uri, false, false);
+ });
+
+ if (notification.getChannelId() != null) {
+ NotificationChannel channel = getChannel();
+ if (channel != null) {
+ visitGrantableUri(channel.getSound(), (channel.getUserLockedFields()
+ & NotificationChannel.USER_LOCKED_SOUND) != 0, true);
+ }
}
+ } finally {
+ Trace.endSection();
}
}
@@ -1413,13 +1419,14 @@
private void visitGrantableUri(Uri uri, boolean userOverriddenUri, boolean isSound) {
if (uri == null || !ContentResolver.SCHEME_CONTENT.equals(uri.getScheme())) return;
- // We can't grant Uri permissions from system
- final int sourceUid = getSbn().getUid();
- if (sourceUid == android.os.Process.SYSTEM_UID) return;
+ if (mGrantableUris != null && mGrantableUris.contains(uri)) {
+ return; // already verified this URI
+ }
+ final int sourceUid = getSbn().getUid();
final long ident = Binder.clearCallingIdentity();
try {
- // This will throw SecurityException if caller can't grant
+ // This will throw a SecurityException if the caller can't grant.
mUgmInternal.checkGrantUriPermission(sourceUid, null,
ContentProvider.getUriWithoutUserId(uri),
Intent.FLAG_GRANT_READ_URI_PERMISSION,
diff --git a/services/core/java/com/android/server/notification/PreferencesHelper.java b/services/core/java/com/android/server/notification/PreferencesHelper.java
index 3f799dc..0e37f10 100644
--- a/services/core/java/com/android/server/notification/PreferencesHelper.java
+++ b/services/core/java/com/android/server/notification/PreferencesHelper.java
@@ -38,7 +38,6 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UserIdInt;
-import android.app.ActivityManager;
import android.app.AppOpsManager;
import android.app.Notification;
import android.app.NotificationChannel;
@@ -53,7 +52,6 @@
import android.content.pm.UserInfo;
import android.metrics.LogMaker;
import android.net.Uri;
-import android.os.Binder;
import android.os.Build;
import android.os.Process;
import android.os.UserHandle;
@@ -114,7 +112,6 @@
private static final int XML_VERSION_REVIEW_PERMISSIONS_NOTIFICATION = 4;
@VisibleForTesting
static final int UNKNOWN_UID = UserHandle.USER_NULL;
- private static final String NON_BLOCKABLE_CHANNEL_DELIM = ":";
@VisibleForTesting
static final int NOTIFICATION_CHANNEL_COUNT_LIMIT = 5000;
@@ -196,6 +193,7 @@
private final PermissionManager mPermissionManager;
private final NotificationChannelLogger mNotificationChannelLogger;
private final AppOpsManager mAppOps;
+ private final ManagedServices.UserProfiles mUserProfiles;
private SparseBooleanArray mBadgingEnabled;
private SparseBooleanArray mBubblesEnabled;
@@ -204,14 +202,12 @@
private boolean mIsMediaNotificationFilteringEnabled = DEFAULT_MEDIA_NOTIFICATION_FILTERING;
private boolean mCurrentUserHasChannelsBypassingDnd;
private boolean mHideSilentStatusBarIcons = DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS;
- private boolean mShowReviewPermissionsNotification;
-
- private boolean mAllowInvalidShortcuts = false;
+ private final boolean mShowReviewPermissionsNotification;
public PreferencesHelper(Context context, PackageManager pm, RankingHandler rankingHandler,
ZenModeHelper zenHelper, PermissionHelper permHelper, PermissionManager permManager,
NotificationChannelLogger notificationChannelLogger,
- AppOpsManager appOpsManager,
+ AppOpsManager appOpsManager, ManagedServices.UserProfiles userProfiles,
SysUiStatsEvent.BuilderFactory statsEventBuilderFactory,
boolean showReviewPermissionsNotification) {
mContext = context;
@@ -222,6 +218,7 @@
mPm = pm;
mNotificationChannelLogger = notificationChannelLogger;
mAppOps = appOpsManager;
+ mUserProfiles = userProfiles;
mStatsEventBuilderFactory = statsEventBuilderFactory;
mShowReviewPermissionsNotification = showReviewPermissionsNotification;
@@ -435,7 +432,7 @@
channel.getConversationId() != null &&
channel.getConversationId().contains(
PLACEHOLDER_CONVERSATION_ID);
- return mAllowInvalidShortcuts || (!mAllowInvalidShortcuts && !isInvalidShortcutChannel);
+ return !isInvalidShortcutChannel;
}
private boolean isDeletionOk(NotificationChannel nc) {
@@ -1790,8 +1787,9 @@
* Syncs {@link #mCurrentUserHasChannelsBypassingDnd} with the current user's notification
* policy before updating. Must be called:
* <ul>
- * <li>On system init, after channels and DND configurations are loaded.</li>
- * <li>When the current user changes, after the corresponding DND config is loaded.</li>
+ * <li>On system init, after channels and DND configurations are loaded.
+ * <li>When the current user is switched, after the corresponding DND config is loaded.
+ * <li>If users are removed (the removed user could've been a profile of the current one).
* </ul>
*/
void syncChannelsBypassingDnd() {
@@ -1805,20 +1803,19 @@
/**
* Updates the user's NotificationPolicy based on whether the current userId has channels
* bypassing DND. It should be called whenever a channel is created, updated, or deleted, or
- * when the current user is switched.
+ * when the current user (or its profiles) change.
*/
private void updateCurrentUserHasChannelsBypassingDnd(int callingUid,
boolean fromSystemOrSystemUi) {
ArraySet<Pair<String, Integer>> candidatePkgs = new ArraySet<>();
- final int currentUserId = getCurrentUser();
+ final IntArray currentUserIds = mUserProfiles.getCurrentProfileIds();
synchronized (mPackagePreferences) {
final int numPackagePreferences = mPackagePreferences.size();
for (int i = 0; i < numPackagePreferences; i++) {
final PackagePreferences r = mPackagePreferences.valueAt(i);
- // Package isn't associated with the current userId
- if (currentUserId != UserHandle.getUserId(r.uid)) {
- continue;
+ if (!currentUserIds.contains(UserHandle.getUserId(r.uid))) {
+ continue; // Package isn't associated with any profile of the current userId.
}
for (NotificationChannel channel : r.channels.values()) {
@@ -1842,13 +1839,6 @@
}
}
- private int getCurrentUser() {
- final long identity = Binder.clearCallingIdentity();
- int currentUserId = ActivityManager.getCurrentUser();
- Binder.restoreCallingIdentity(identity);
- return currentUserId;
- }
-
private boolean channelIsLiveLocked(PackagePreferences pkgPref, NotificationChannel channel) {
// Channel is in a group that's blocked
if (isGroupBlocked(pkgPref.pkg, pkgPref.uid, channel.getGroup())) {
diff --git a/services/core/java/com/android/server/notification/flags.aconfig b/services/core/java/com/android/server/notification/flags.aconfig
index c0bc6d1..1908e4d 100644
--- a/services/core/java/com/android/server/notification/flags.aconfig
+++ b/services/core/java/com/android/server/notification/flags.aconfig
@@ -5,4 +5,11 @@
namespace: "systemui"
description: "This flag controls removing expired notification bitmaps"
bug: "290381858"
-}
\ No newline at end of file
+}
+
+flag {
+ name: "polite_notifications"
+ namespace: "systemui"
+ description: "This flag controls the polite notification feature"
+ bug: "270456865"
+}
diff --git a/services/core/java/com/android/server/pm/Android.bp b/services/core/java/com/android/server/pm/Android.bp
new file mode 100644
index 0000000..89c0124
--- /dev/null
+++ b/services/core/java/com/android/server/pm/Android.bp
@@ -0,0 +1,12 @@
+aconfig_declarations {
+ name: "pm_flags",
+ package: "com.android.server.pm",
+ srcs: [
+ "*.aconfig",
+ ],
+}
+
+java_aconfig_library {
+ name: "pm_flags_lib",
+ aconfig_declarations: "pm_flags",
+}
diff --git a/services/core/java/com/android/server/pm/Computer.java b/services/core/java/com/android/server/pm/Computer.java
index 6e75605..f987629 100644
--- a/services/core/java/com/android/server/pm/Computer.java
+++ b/services/core/java/com/android/server/pm/Computer.java
@@ -487,6 +487,8 @@
boolean isPackageSuspendedForUser(@NonNull String packageName, @UserIdInt int userId);
+ boolean isPackageQuarantinedForUser(@NonNull String packageName, @UserIdInt int userId);
+
boolean isSuspendingAnyPackages(@NonNull String suspendingPackage, @UserIdInt int userId);
@NonNull
diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java
index 5b05b48..1cfc7d7 100644
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
@@ -522,6 +522,7 @@
comp != null || pkgName != null /*onlyExposedExplicitly*/,
isImplicitImageCaptureIntentAndNotSetByDpc(intent, userId, resolvedType,
flags));
+
List<ResolveInfo> list = Collections.emptyList();
boolean skipPostResolution = false;
if (comp != null) {
@@ -643,6 +644,12 @@
final String instantAppPkgName = getInstantAppPackageName(callingUid);
flags = updateFlagsForResolve(flags, userId, callingUid, includeInstantApps,
false /* isImplicitImageCaptureIntentAndNotSetByDpc */);
+
+ // Only if the query is coming from the system process,
+ // it should be allowed to match quarantined components
+ if (callingUid != Process.SYSTEM_UID) {
+ flags |= PackageManager.FILTER_OUT_QUARANTINED_COMPONENTS;
+ }
Intent originalIntent = null;
ComponentName comp = intent.getComponent();
if (comp == null) {
@@ -4031,6 +4038,9 @@
flags = updateFlagsForComponent(flags, userId);
enforceCrossUserPermission(callingUid, userId, false /* requireFullPermission */,
false /* checkShell */, "get provider info");
+ if (callingUid != Process.SYSTEM_UID) {
+ flags |= PackageManager.FILTER_OUT_QUARANTINED_COMPONENTS;
+ }
ParsedProvider p = mComponentResolver.getProvider(component);
if (DEBUG_PACKAGE_INFO) Log.v(
TAG, "getProviderInfo " + component + ": " + p);
@@ -4660,6 +4670,9 @@
int callingUid) {
if (!mUserManager.exists(userId)) return null;
flags = updateFlagsForComponent(flags, userId);
+ if (callingUid != Process.SYSTEM_UID) {
+ flags |= PackageManager.FILTER_OUT_QUARANTINED_COMPONENTS;
+ }
final ProviderInfo providerInfo = mComponentResolver.queryProvider(this, name, flags,
userId);
boolean checkedGrants = false;
@@ -4772,6 +4785,13 @@
false /* checkShell */, "queryContentProviders");
if (!mUserManager.exists(userId)) return ParceledListSlice.emptyList();
flags = updateFlagsForComponent(flags, userId);
+
+ // Only if the service query is coming from the system process,
+ // it should be allowed to match quarantined components
+ if (callingUid != Process.SYSTEM_UID) {
+ flags |= PackageManager.FILTER_OUT_QUARANTINED_COMPONENTS;
+ }
+
ArrayList<ProviderInfo> finalList = null;
final List<ProviderInfo> matchList = mComponentResolver.queryProviders(this, processName,
metaDataKey, uid, flags, userId);
@@ -4905,8 +4925,8 @@
}
}
- @Override
- public boolean isPackageSuspendedForUser(@NonNull String packageName, int userId) {
+ private PackageUserStateInternal getUserStageOrDefaultForUser(@NonNull String packageName,
+ int userId) {
final int callingUid = Binder.getCallingUid();
enforceCrossUserPermission(callingUid, userId, true /* requireFullPermission */,
false /* checkShell */, "isPackageSuspendedForUser for user " + userId);
@@ -4914,7 +4934,17 @@
if (ps == null || shouldFilterApplicationIncludingUninstalled(ps, callingUid, userId)) {
throw new IllegalArgumentException("Unknown target package: " + packageName);
}
- return ps.getUserStateOrDefault(userId).isSuspended();
+ return ps.getUserStateOrDefault(userId);
+ }
+
+ @Override
+ public boolean isPackageSuspendedForUser(@NonNull String packageName, int userId) {
+ return getUserStageOrDefaultForUser(packageName, userId).isSuspended();
+ }
+
+ @Override
+ public boolean isPackageQuarantinedForUser(@NonNull String packageName, @UserIdInt int userId) {
+ return getUserStageOrDefaultForUser(packageName, userId).isQuarantined();
}
@Override
diff --git a/services/core/java/com/android/server/pm/DeletePackageHelper.java b/services/core/java/com/android/server/pm/DeletePackageHelper.java
index b5ec136..66a1703 100644
--- a/services/core/java/com/android/server/pm/DeletePackageHelper.java
+++ b/services/core/java/com/android/server/pm/DeletePackageHelper.java
@@ -459,8 +459,8 @@
// Do not uninstall the APK if an app should be cached
boolean keepUninstalledPackage =
mPm.shouldKeepUninstalledPackageLPr(packageName);
- if (ps.isAnyInstalled(
- mUserManagerInternal.getUserIds()) || keepUninstalledPackage) {
+ if (ps.isInstalledOrHasDataOnAnyOtherUser(
+ mUserManagerInternal.getUserIds(), userId) || keepUninstalledPackage) {
// Other users still have this package installed, so all
// we need to do is clear this user's data and save that
// it is uninstalled.
@@ -555,6 +555,7 @@
if ((flags & PackageManager.DELETE_KEEP_DATA) == 0) {
mAppDataHelper.destroyAppDataLIF(pkg, nextUserId,
FLAG_STORAGE_DE | FLAG_STORAGE_CE | FLAG_STORAGE_EXTERNAL);
+ ps.setCeDataInode(-1, nextUserId);
}
mAppDataHelper.clearKeystoreData(nextUserId, ps.getAppId());
preferredActivityHelper.clearPackagePreferredActivities(ps.getPackageName(),
@@ -615,7 +616,9 @@
Slog.d(TAG, "Marking package:" + ps.getPackageName()
+ " uninstalled for user:" + nextUserId);
}
- ps.setUserState(nextUserId, 0, COMPONENT_ENABLED_STATE_DEFAULT,
+ ps.setUserState(nextUserId,
+ ps.getCeDataInode(nextUserId),
+ COMPONENT_ENABLED_STATE_DEFAULT,
false /*installed*/,
true /*stopped*/,
true /*notLaunched*/,
diff --git a/services/core/java/com/android/server/pm/IPackageManagerBase.java b/services/core/java/com/android/server/pm/IPackageManagerBase.java
index fd47846..76203ac 100644
--- a/services/core/java/com/android/server/pm/IPackageManagerBase.java
+++ b/services/core/java/com/android/server/pm/IPackageManagerBase.java
@@ -955,6 +955,13 @@
@Override
@Deprecated
+ public final boolean isPackageQuarantinedForUser(@NonNull String packageName,
+ @UserIdInt int userId) {
+ return snapshot().isPackageQuarantinedForUser(packageName, userId);
+ }
+
+ @Override
+ @Deprecated
public final boolean isSafeMode() {
// allow instant applications
return mService.getSafeMode();
diff --git a/services/core/java/com/android/server/pm/InstantAppResolverConnection.java b/services/core/java/com/android/server/pm/InstantAppResolverConnection.java
index b4c40e6..c477751 100644
--- a/services/core/java/com/android/server/pm/InstantAppResolverConnection.java
+++ b/services/core/java/com/android/server/pm/InstantAppResolverConnection.java
@@ -280,6 +280,11 @@
} catch (NoSuchElementException ignore) { }
}
mRemoteInstance = null;
+
+ try {
+ mContext.unbindService(mServiceConnection);
+ } catch (Exception ignored) {
+ }
}
/**
diff --git a/services/core/java/com/android/server/pm/MovePackageHelper.java b/services/core/java/com/android/server/pm/MovePackageHelper.java
index 1a5591c..01c2734 100644
--- a/services/core/java/com/android/server/pm/MovePackageHelper.java
+++ b/services/core/java/com/android/server/pm/MovePackageHelper.java
@@ -49,8 +49,8 @@
import android.os.RemoteException;
import android.os.UserHandle;
import android.os.storage.StorageManager;
+import android.os.storage.StorageManagerInternal;
import android.os.storage.VolumeInfo;
-import android.text.TextUtils;
import android.util.MathUtils;
import android.util.Slog;
import android.util.SparseIntArray;
@@ -64,6 +64,7 @@
import com.android.server.pm.pkg.PackageStateUtils;
import java.io.File;
+import java.util.ArrayList;
import java.util.Objects;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -220,9 +221,7 @@
}
try {
- for (int index = 0; index < installedUserIds.length; index++) {
- prepareUserDataForVolumeIfRequired(volumeUuid, installedUserIds[index], storage);
- }
+ prepareUserStorageForMove(currentVolumeUuid, volumeUuid, installedUserIds);
} catch (RuntimeException e) {
freezer.close();
throw new PackageManagerException(MOVE_FAILED_INTERNAL_ERROR,
@@ -376,27 +375,20 @@
return true;
}
- private void prepareUserDataForVolumeIfRequired(String volumeUuid, int userId,
- StorageManager storageManager) {
- if (TextUtils.isEmpty(volumeUuid)
- || doesDataDirectoryExistForUser(volumeUuid, userId)) {
- return;
- }
+ private void prepareUserStorageForMove(String fromVolumeUuid, String toVolumeUuid,
+ int[] userIds) {
if (DEBUG_INSTALL) {
- Slog.d(TAG, "Preparing user directories for user u" + userId + " for UUID "
- + volumeUuid);
+ Slog.d(TAG, "Preparing user directories before moving app, from UUID " + fromVolumeUuid
+ + " to UUID " + toVolumeUuid);
}
- final UserInfo user = mPm.mUserManager.getUserInfo(userId);
- if (user == null) return;
- // This call is same as StorageEventHelper#loadPrivatePackagesInner which prepares
- // the storage before reconciling apps
- storageManager.prepareUserStorage(volumeUuid, user.id, user.serialNumber,
- StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE);
- }
-
- private boolean doesDataDirectoryExistForUser(String uuid, int userId) {
- final File userDirectoryFile = Environment.getDataUserCeDirectory(uuid, userId);
- return userDirectoryFile != null && userDirectoryFile.exists();
+ final StorageManagerInternal smInternal =
+ mPm.mInjector.getLocalService(StorageManagerInternal.class);
+ final ArrayList<UserInfo> users = new ArrayList<>();
+ for (int userId : userIds) {
+ final UserInfo user = mPm.mUserManager.getUserInfo(userId);
+ users.add(user);
+ }
+ smInternal.prepareUserStorageForMove(fromVolumeUuid, toVolumeUuid, users);
}
public static class MoveCallbacks extends Handler {
diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java
index 303f321..6270655 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerSession.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java
@@ -68,6 +68,7 @@
import android.app.admin.DevicePolicyManagerInternal;
import android.app.compat.CompatChanges;
import android.compat.annotation.ChangeId;
+import android.compat.annotation.Disabled;
import android.compat.annotation.EnabledSince;
import android.content.ComponentName;
import android.content.Context;
@@ -312,6 +313,19 @@
private static final long SILENT_INSTALL_ALLOWED = 265131695L;
/**
+ * The system supports pre-approval and update ownership features from
+ * {@link Build.VERSION_CODES#UPSIDE_DOWN_CAKE API 34}. The change id is used to make sure
+ * the system includes the fix of pre-approval with update ownership case. When checking the
+ * change id, if it is disabled, it means the build includes the fix. The more detail is on
+ * b/293644536.
+ * See {@link PackageInstaller.SessionParams#setRequestUpdateOwnership(boolean)} and
+ * {@link #requestUserPreapproval(PreapprovalDetails, IntentSender)} for more details.
+ */
+ @Disabled
+ @ChangeId
+ private static final long PRE_APPROVAL_WITH_UPDATE_OWNERSHIP_FIX = 293644536L;
+
+ /**
* The default value of {@link #mValidatedTargetSdk} is {@link Integer#MAX_VALUE}. If {@link
* #mValidatedTargetSdk} is compared with {@link Build.VERSION_CODES#S} before getting the
* target sdk version from a validated apk in {@link #validateApkInstallLocked()}, the compared
@@ -927,16 +941,27 @@
if (mPermissionsManuallyAccepted) {
return USER_ACTION_NOT_NEEDED;
}
- packageName = mPackageName;
+ // For pre-pappvoal case, the mPackageName would be null.
+ if (mPackageName != null) {
+ packageName = mPackageName;
+ } else if (mPreapprovalRequested.get() && mPreapprovalDetails != null) {
+ packageName = mPreapprovalDetails.getPackageName();
+ } else {
+ packageName = null;
+ }
hasDeviceAdminReceiver = mHasDeviceAdminReceiver;
}
- final boolean forcePermissionPrompt =
+ // For the below cases, force user action prompt
+ // 1. installFlags includes INSTALL_FORCE_PERMISSION_PROMPT
+ // 2. params.requireUserAction is USER_ACTION_REQUIRED
+ final boolean forceUserActionPrompt =
(params.installFlags & PackageManager.INSTALL_FORCE_PERMISSION_PROMPT) != 0
|| params.requireUserAction == SessionParams.USER_ACTION_REQUIRED;
- if (forcePermissionPrompt) {
- return USER_ACTION_REQUIRED;
- }
+ final int userActionNotTypicallyNeededResponse = forceUserActionPrompt
+ ? USER_ACTION_REQUIRED
+ : USER_ACTION_NOT_NEEDED;
+
// It is safe to access mInstallerUid and mInstallSource without lock
// because they are immutable after sealing.
final Computer snapshot = mPm.snapshotComputer();
@@ -990,7 +1015,7 @@
|| isInstallerDeviceOwnerOrAffiliatedProfileOwner();
if (noUserActionNecessary) {
- return USER_ACTION_NOT_NEEDED;
+ return userActionNotTypicallyNeededResponse;
}
if (isUpdateOwnershipEnforcementEnabled
@@ -1003,7 +1028,7 @@
}
if (isPermissionGranted) {
- return USER_ACTION_NOT_NEEDED;
+ return userActionNotTypicallyNeededResponse;
}
if (snapshot.isInstallDisabledForPackage(getInstallerPackageName(), mInstallerUid,
diff --git a/services/core/java/com/android/server/pm/PackageManagerInternalBase.java b/services/core/java/com/android/server/pm/PackageManagerInternalBase.java
index 82587c5..651845e 100644
--- a/services/core/java/com/android/server/pm/PackageManagerInternalBase.java
+++ b/services/core/java/com/android/server/pm/PackageManagerInternalBase.java
@@ -746,10 +746,16 @@
}
@Override
- public void notifyComponentUsed(@NonNull String packageName,
- @UserIdInt int userId, @NonNull String recentCallingPackage) {
+ public void notifyComponentUsed(@NonNull String packageName, @UserIdInt int userId,
+ @NonNull String recentCallingPackage, @NonNull String debugInfo) {
mService.notifyComponentUsed(snapshot(), packageName, userId,
- recentCallingPackage);
+ recentCallingPackage, debugInfo);
+ }
+
+ @Override
+ public boolean isPackageQuarantined(@NonNull String packageName,
+ @UserIdInt int userId) {
+ return snapshot().isPackageQuarantinedForUser(packageName, userId);
}
@NonNull
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 6bcfcfe..c63d8be 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -2892,13 +2892,10 @@
private void notifyPackageUseInternal(String packageName, int reason) {
long time = System.currentTimeMillis();
- synchronized (mLock) {
- final PackageSetting pkgSetting = mSettings.getPackageLPr(packageName);
- if (pkgSetting == null) {
- return;
- }
- pkgSetting.getPkgState().setLastPackageUsageTimeInMills(reason, time);
- }
+ this.commitPackageStateMutation(null, mutator -> {
+ final PackageStateWrite state = mutator.forPackage(packageName);
+ state.setLastPackageUsageTime(reason, time);
+ });
}
/*package*/ DexManager getDexManager() {
@@ -4583,7 +4580,18 @@
}
void notifyComponentUsed(@NonNull Computer snapshot, @NonNull String packageName,
- @UserIdInt int userId, @NonNull String recentCallingPackage) {
+ @UserIdInt int userId, @NonNull String recentCallingPackage,
+ @NonNull String debugInfo) {
+ synchronized (mLock) {
+ final PackageUserStateInternal userState = mSettings.getPackageLPr(
+ packageName).getUserStateOrDefault(userId);
+ if (userState.isQuarantined()) {
+ Slog.i(TAG,
+ "Component is quarantined+suspended but being used: "
+ + packageName + " by " + recentCallingPackage + ", debugInfo: "
+ + debugInfo);
+ }
+ }
PackageManagerService.this
.setPackageStoppedState(snapshot, packageName, false /* stopped */,
userId);
@@ -6120,14 +6128,16 @@
@Override
public String[] setPackagesSuspendedAsUser(String[] packageNames, boolean suspended,
PersistableBundle appExtras, PersistableBundle launcherExtras,
- SuspendDialogInfo dialogInfo, String callingPackage, int userId) {
+ SuspendDialogInfo dialogInfo, int flags, String callingPackage, int userId) {
final int callingUid = Binder.getCallingUid();
final Computer snapshot = snapshotComputer();
enforceCanSetPackagesSuspendedAsUser(snapshot, callingPackage, callingUid, userId,
"setPackagesSuspendedAsUser");
+ boolean quarantined = ((flags & PackageManager.FLAG_SUSPEND_QUARANTINED) != 0)
+ && Flags.quarantinedEnabled();
return mSuspendPackageHelper.setPackagesSuspended(snapshot, packageNames, suspended,
appExtras, launcherExtras, dialogInfo, callingPackage, userId, callingUid,
- false /* forQuietMode */);
+ false /* forQuietMode */, quarantined);
}
@Override
@@ -6668,9 +6678,7 @@
@Override
public void notifyPackageUse(String packageName, int reason) {
- synchronized (mLock) {
- PackageManagerService.this.notifyPackageUseInternal(packageName, reason);
- }
+ PackageManagerService.this.notifyPackageUseInternal(packageName, reason);
}
@Nullable
diff --git a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
index ce0e7ad..8bdbe04 100644
--- a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
+++ b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
@@ -226,6 +226,8 @@
return runPath();
case "dump":
return runDump();
+ case "dump-package":
+ return runDumpPackage();
case "list":
return runList();
case "gc":
@@ -288,9 +290,11 @@
case "unhide":
return runSetHiddenSetting(false);
case "suspend":
- return runSuspend(true);
+ return runSuspend(true, 0);
+ case "suspend-quarantine":
+ return runSuspend(true, PackageManager.FLAG_SUSPEND_QUARANTINED);
case "unsuspend":
- return runSuspend(false);
+ return runSuspend(false, 0);
case "set-distracting-restriction":
return runSetDistractingRestriction();
case "get-distracting-restriction":
@@ -976,6 +980,7 @@
boolean listInstaller = false;
boolean showUid = false;
boolean showVersionCode = false;
+ boolean listQuarantinedOnly = false;
boolean listApexOnly = false;
boolean showStopped = false;
int uid = -1;
@@ -1006,6 +1011,9 @@
case "-s":
listSystem = true;
break;
+ case "-q":
+ listQuarantinedOnly = true;
+ break;
case "-U":
showUid = true;
break;
@@ -1091,6 +1099,10 @@
|| (listApexOnly && !isApex)) {
continue;
}
+ if (listQuarantinedOnly && !mInterface.isPackageQuarantinedForUser(info.packageName,
+ translatedUserId)) {
+ continue;
+ }
String name = null;
if (showSdks) {
@@ -2644,7 +2656,7 @@
}
}
- private int runSuspend(boolean suspendedState) {
+ private int runSuspend(boolean suspendedState, int flags) {
final PrintWriter pw = getOutPrintWriter();
int userId = UserHandle.USER_SYSTEM;
String dialogMessage = null;
@@ -2712,7 +2724,7 @@
mInterface.setPackagesSuspendedAsUser(packageNames.toArray(new String[] {}),
suspendedState, ((appExtras.size() > 0) ? appExtras : null),
((launcherExtras.size() > 0) ? launcherExtras : null),
- info, callingPackage, translatedUserId);
+ info, flags, callingPackage, translatedUserId);
for (int i = 0; i < packageNames.size(); i++) {
final String packageName = packageNames.get(i);
pw.println("Package " + packageName + " new suspended state: "
@@ -3596,6 +3608,23 @@
return 0;
}
+ private int runDumpPackage() {
+ String pkg = getNextArg();
+ if (pkg == null) {
+ getErrPrintWriter().println("Error: no package specified");
+ return 1;
+ }
+ try {
+ ((IBinder) mInterface).dump(getOutFileDescriptor(), new String[]{pkg});
+ } catch (Throwable e) {
+ PrintWriter pw = getErrPrintWriter();
+ pw.println("Failure dumping service:");
+ e.printStackTrace(pw);
+ pw.flush();
+ }
+ return 0;
+ }
+
private int runSetHarmfulAppWarning() throws RemoteException {
int userId = UserHandle.USER_CURRENT;
@@ -4280,6 +4309,9 @@
pw.println(" dump PACKAGE");
pw.println(" Print various system state associated with the given PACKAGE.");
pw.println("");
+ pw.println(" dump-package PACKAGE");
+ pw.println(" Print package manager state associated with the given PACKAGE.");
+ pw.println("");
pw.println(" has-feature FEATURE_NAME [version]");
pw.println(" Prints true and returns exit status 0 when system has a FEATURE_NAME,");
pw.println(" otherwise prints false and returns exit status 1");
@@ -4297,7 +4329,7 @@
pw.println(" Options:");
pw.println(" -v: shows the location of the library in the device's filesystem");
pw.println("");
- pw.println(" list packages [-f] [-d] [-e] [-s] [-3] [-i] [-l] [-u] [-U] ");
+ pw.println(" list packages [-f] [-d] [-e] [-s] [-q] [-3] [-i] [-l] [-u] [-U] ");
pw.println(" [--show-versioncode] [--apex-only] [--factory-only]");
pw.println(" [--uid UID] [--user USER_ID] [FILTER]");
pw.println(" Prints all packages; optionally only those whose name contains");
@@ -4307,6 +4339,7 @@
pw.println(" -d: filter to only show disabled packages");
pw.println(" -e: filter to only show enabled packages");
pw.println(" -s: filter to only show system packages");
+ pw.println(" -q: filter to only show quarantined packages");
pw.println(" -3: filter to only show third party packages");
pw.println(" -i: see the installer for the packages");
pw.println(" -l: ignored (used for compatibility with older releases)");
diff --git a/services/core/java/com/android/server/pm/PackageMetrics.java b/services/core/java/com/android/server/pm/PackageMetrics.java
index 80d6ebb..2d58fe5 100644
--- a/services/core/java/com/android/server/pm/PackageMetrics.java
+++ b/services/core/java/com/android/server/pm/PackageMetrics.java
@@ -34,11 +34,13 @@
import java.io.IOException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicLong;
-import java.util.stream.Stream;
/**
* Metrics class for reporting stats to logging infrastructures like statsd
@@ -155,10 +157,27 @@
private long getApksSize(File apkDir) {
// TODO(b/249294752): also count apk sizes for failed installs
final AtomicLong apksSize = new AtomicLong();
- try (Stream<Path> walkStream = Files.walk(apkDir.toPath())) {
- walkStream.filter(p -> p.toFile().isFile()
- && ApkLiteParseUtils.isApkFile(p.toFile())).forEach(
- f -> apksSize.addAndGet(f.toFile().length()));
+ try {
+ Files.walkFileTree(apkDir.toPath(), new SimpleFileVisitor<>() {
+ @Override
+ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs)
+ throws IOException {
+ if (dir.equals(apkDir.toPath())) {
+ return FileVisitResult.CONTINUE;
+ } else {
+ return FileVisitResult.SKIP_SUBTREE;
+ }
+ }
+
+ @Override
+ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
+ throws IOException {
+ if (file.toFile().isFile() && ApkLiteParseUtils.isApkFile(file.toFile())) {
+ apksSize.addAndGet(file.toFile().length());
+ }
+ return FileVisitResult.CONTINUE;
+ }
+ });
} catch (IOException e) {
// ignore
}
diff --git a/services/core/java/com/android/server/pm/PackageSetting.java b/services/core/java/com/android/server/pm/PackageSetting.java
index dee31ec..7cac3e1 100644
--- a/services/core/java/com/android/server/pm/PackageSetting.java
+++ b/services/core/java/com/android/server/pm/PackageSetting.java
@@ -809,9 +809,16 @@
return changed;
}
- boolean isAnyInstalled(int[] users) {
- for (int user: users) {
- if (readUserState(user).isInstalled()) {
+ boolean isInstalledOrHasDataOnAnyOtherUser(int[] allUsers, int currentUser) {
+ for (int user: allUsers) {
+ if (user == currentUser) {
+ continue;
+ }
+ final PackageUserStateInternal userState = readUserState(user);
+ if (userState.isInstalled()) {
+ return true;
+ }
+ if (userState.getCeDataInode() > 0) {
return true;
}
}
@@ -937,8 +944,8 @@
otherState.isHidden(), otherState.getDistractionFlags(),
otherState.getSuspendParams() == null
? null : otherState.getSuspendParams().untrackedStorage(),
- otherState.isInstantApp(),
- otherState.isVirtualPreload(), otherState.getLastDisableAppCaller(),
+ otherState.isInstantApp(), otherState.isVirtualPreload(),
+ otherState.getLastDisableAppCaller(),
otherState.getEnabledComponentsNoCopy() == null
? null : otherState.getEnabledComponentsNoCopy().untrackedStorage(),
otherState.getDisabledComponentsNoCopy() == null
diff --git a/services/core/java/com/android/server/pm/ResolveIntentHelper.java b/services/core/java/com/android/server/pm/ResolveIntentHelper.java
index 7ed10a4..160b2aa 100644
--- a/services/core/java/com/android/server/pm/ResolveIntentHelper.java
+++ b/services/core/java/com/android/server/pm/ResolveIntentHelper.java
@@ -516,6 +516,13 @@
@PackageManager.ResolveInfoFlagsBits long flags, int userId) {
if (!mUserManager.exists(userId)) return Collections.emptyList();
final int callingUid = Binder.getCallingUid();
+
+ // Only if the service query is coming from the system process,
+ // it should be allowed to match quarantined components
+ if (callingUid != Process.SYSTEM_UID) {
+ flags |= PackageManager.FILTER_OUT_QUARANTINED_COMPONENTS;
+ }
+
final String instantAppPkgName = computer.getInstantAppPackageName(callingUid);
flags = computer.updateFlagsForResolve(flags, userId, callingUid, false /*includeInstantApps*/,
false /* isImplicitImageCaptureIntentAndNotSetByDpc */);
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java
index c6135e0..b6da462 100644
--- a/services/core/java/com/android/server/pm/Settings.java
+++ b/services/core/java/com/android/server/pm/Settings.java
@@ -1918,9 +1918,9 @@
ArraySet<String> enabledComponents = null;
ArraySet<String> disabledComponents = null;
- PersistableBundle suspendedAppExtras = null;
- PersistableBundle suspendedLauncherExtras = null;
SuspendDialogInfo oldSuspendDialogInfo = null;
+ PersistableBundle oldSuspendedAppExtras = null;
+ PersistableBundle oldSuspendedLauncherExtras = null;
ArchiveState archiveState = null;
int packageDepth = parser.getDepth();
@@ -1939,16 +1939,17 @@
case TAG_DISABLED_COMPONENTS:
disabledComponents = readComponentsLPr(parser);
break;
- case TAG_SUSPENDED_APP_EXTRAS:
- suspendedAppExtras = PersistableBundle.restoreFromXml(parser);
- break;
- case TAG_SUSPENDED_LAUNCHER_EXTRAS:
- suspendedLauncherExtras = PersistableBundle.restoreFromXml(
- parser);
- break;
case TAG_SUSPENDED_DIALOG_INFO:
oldSuspendDialogInfo = SuspendDialogInfo.restoreFromXml(parser);
break;
+ case TAG_SUSPENDED_APP_EXTRAS:
+ oldSuspendedAppExtras = PersistableBundle.restoreFromXml(
+ parser);
+ break;
+ case TAG_SUSPENDED_LAUNCHER_EXTRAS:
+ oldSuspendedLauncherExtras = PersistableBundle.restoreFromXml(
+ parser);
+ break;
case TAG_SUSPEND_PARAMS:
final String suspendingPackage = parser.getAttributeValue(null,
ATTR_SUSPENDING_PACKAGE);
@@ -1979,8 +1980,9 @@
if (suspended && suspendParamsMap == null) {
final SuspendParams suspendParams = new SuspendParams(
oldSuspendDialogInfo,
- suspendedAppExtras,
- suspendedLauncherExtras);
+ oldSuspendedAppExtras,
+ oldSuspendedLauncherExtras,
+ false /* quarantined */);
suspendParamsMap = new ArrayMap<>();
suspendParamsMap.put(oldSuspendingPackage, suspendParams);
}
@@ -1989,13 +1991,12 @@
setBlockUninstallLPw(userId, name, true);
}
ps.setUserState(userId, ceDataInode, enabled, installed, stopped,
- notLaunched,
- hidden, distractionFlags, suspendParamsMap, instantApp,
- virtualPreload,
- enabledCaller, enabledComponents, disabledComponents, installReason,
- uninstallReason, harmfulAppWarning, splashScreenTheme,
- firstInstallTime != 0 ? firstInstallTime :
- origFirstInstallTimes.getOrDefault(name, 0L),
+ notLaunched, hidden, distractionFlags, suspendParamsMap, instantApp,
+ virtualPreload, enabledCaller, enabledComponents,
+ disabledComponents, installReason, uninstallReason,
+ harmfulAppWarning, splashScreenTheme,
+ firstInstallTime != 0 ? firstInstallTime
+ : origFirstInstallTimes.getOrDefault(name, 0L),
minAspectRatio, archiveState);
mDomainVerificationManager.setLegacyUserState(name, userId, verifState);
@@ -4824,6 +4825,7 @@
pw.print(userState.isNotLaunched() ? "l" : "L");
pw.print(userState.isInstantApp() ? "IA" : "ia");
pw.print(userState.isVirtualPreload() ? "VPI" : "vpi");
+ pw.print(userState.isQuarantined() ? "Q" : "q");
String harmfulAppWarning = userState.getHarmfulAppWarning();
pw.print(harmfulAppWarning != null ? "HA" : "ha");
pw.print(",");
@@ -5185,6 +5187,8 @@
pw.print(userState.isInstantApp());
pw.print(" virtual=");
pw.println(userState.isVirtualPreload());
+ pw.print(" quarantined=");
+ pw.print(userState.isQuarantined());
pw.print(" installReason=");
pw.println(userState.getInstallReason());
@@ -5207,6 +5211,8 @@
if (params != null) {
pw.print(" dialogInfo=");
pw.print(params.getDialogInfo());
+ pw.print(" quarantined=");
+ pw.println(params.isQuarantined());
}
pw.println();
}
diff --git a/services/core/java/com/android/server/pm/SuspendPackageHelper.java b/services/core/java/com/android/server/pm/SuspendPackageHelper.java
index 94e09f1..ddb045d 100644
--- a/services/core/java/com/android/server/pm/SuspendPackageHelper.java
+++ b/services/core/java/com/android/server/pm/SuspendPackageHelper.java
@@ -115,17 +115,18 @@
boolean suspended, @Nullable PersistableBundle appExtras,
@Nullable PersistableBundle launcherExtras, @Nullable SuspendDialogInfo dialogInfo,
@NonNull String callingPackage, @UserIdInt int userId, int callingUid,
- boolean forQuietMode) {
+ boolean forQuietMode, boolean quarantined) {
if (ArrayUtils.isEmpty(packageNames)) {
return packageNames;
}
- if (suspended && !forQuietMode && !isSuspendAllowedForUser(snapshot, userId, callingUid)) {
+ if (suspended && !quarantined && !forQuietMode && !isSuspendAllowedForUser(snapshot, userId,
+ callingUid)) {
Slog.w(TAG, "Cannot suspend due to restrictions on user " + userId);
return packageNames;
}
final SuspendParams newSuspendParams =
- new SuspendParams(dialogInfo, appExtras, launcherExtras);
+ new SuspendParams(dialogInfo, appExtras, launcherExtras, quarantined);
final List<String> unmodifiablePackages = new ArrayList<>(packageNames.length);
@@ -160,7 +161,6 @@
final WatchedArrayMap<String, SuspendParams> suspendParamsMap =
packageState.getUserStateOrDefault(userId).getSuspendParams();
-
SuspendParams oldSuspendParams = suspendParamsMap == null
? null : suspendParamsMap.get(packageName);
boolean changed = !Objects.equals(oldSuspendParams, newSuspendParams);
@@ -213,14 +213,15 @@
sendPackagesSuspendedForUser(
suspended ? Intent.ACTION_PACKAGES_SUSPENDED
: Intent.ACTION_PACKAGES_UNSUSPENDED,
- changedPackages, notifyUids.toArray(), userId);
+ changedPackages, notifyUids.toArray(), quarantined, userId);
sendMyPackageSuspendedOrUnsuspended(changedPackages, suspended, userId);
mPm.scheduleWritePackageRestrictions(userId);
}
// Send the suspension changed broadcast to ensure suspension state is not stale.
if (!changedPackagesList.isEmpty()) {
sendPackagesSuspendedForUser(Intent.ACTION_PACKAGES_SUSPENSION_CHANGED,
- changedPackagesList.toArray(new String[0]), changedUids.toArray(), userId);
+ changedPackagesList.toArray(new String[0]), changedUids.toArray(), quarantined,
+ userId);
}
return unmodifiablePackages.toArray(new String[0]);
}
@@ -354,7 +355,7 @@
new String[unsuspendedPackages.size()]);
sendMyPackageSuspendedOrUnsuspended(packageArray, false, userId);
sendPackagesSuspendedForUser(Intent.ACTION_PACKAGES_UNSUSPENDED,
- packageArray, unsuspendedUids.toArray(), userId);
+ packageArray, unsuspendedUids.toArray(), false, userId);
}
}
@@ -618,11 +619,14 @@
*/
@VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
void sendPackagesSuspendedForUser(@NonNull String intent, @NonNull String[] pkgList,
- @NonNull int[] uidList, int userId) {
+ @NonNull int[] uidList, boolean quarantined, int userId) {
final Handler handler = mInjector.getHandler();
final Bundle extras = new Bundle(3);
extras.putStringArray(Intent.EXTRA_CHANGED_PACKAGE_LIST, pkgList);
extras.putIntArray(Intent.EXTRA_CHANGED_UID_LIST, uidList);
+ if (quarantined) {
+ extras.putBoolean(Intent.EXTRA_QUARANTINED, true);
+ }
final int flags = Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND;
final Bundle options = new BroadcastOptions()
.setDeferralPolicy(BroadcastOptions.DEFERRAL_POLICY_UNTIL_ACTIVE)
@@ -672,7 +676,7 @@
snapshot, toSuspend.toArray(new String[0]), suspend,
null /* appExtras */, null /* launcherExtras */, null /* dialogInfo */,
PackageManagerService.PLATFORM_PACKAGE_NAME, userId, Process.SYSTEM_UID,
- false /* forQuietMode */)));
+ false /* forQuietMode */, false /* quarantined */)));
}
return unsuspendable.toArray(String[]::new);
}
@@ -716,7 +720,7 @@
setPackagesSuspended(snapshot, toSuspend.toArray(new String[0]),
suspend, null /* appExtras */, null /* launcherExtras */, null /* dialogInfo */,
PackageManagerService.PLATFORM_PACKAGE_NAME, userId, Process.SYSTEM_UID,
- true /* forQuietMode */);
+ true /* forQuietMode */, false /* quarantined */);
}
private Set<String> packagesToSuspendInQuietMode(Computer snapshot, int userId) {
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
index 385dfcb8..f2797eb 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
@@ -4907,6 +4907,11 @@
USER_OPERATION_ERROR_UNKNOWN);
}
}
+ if (isMainUser && getMainUserIdUnchecked() != UserHandle.USER_NULL) {
+ throwCheckedUserOperationException(
+ "Cannot add user with FLAG_MAIN as main user already exists.",
+ UserManager.USER_OPERATION_ERROR_MAX_USERS);
+ }
if (!preCreate && !canAddMoreUsersOfType(userTypeDetails)) {
throwCheckedUserOperationException(
"Cannot add more users of type " + userType
diff --git a/services/core/java/com/android/server/pm/flags.aconfig b/services/core/java/com/android/server/pm/flags.aconfig
new file mode 100644
index 0000000..368a843
--- /dev/null
+++ b/services/core/java/com/android/server/pm/flags.aconfig
@@ -0,0 +1,8 @@
+package: "com.android.server.pm"
+
+flag {
+ name: "quarantined_enabled"
+ namespace: "package_manager_service"
+ description: "Feature flag for Quarantined state"
+ bug: "269127435"
+}
diff --git a/services/core/java/com/android/server/pm/parsing/PackageInfoUtils.java b/services/core/java/com/android/server/pm/parsing/PackageInfoUtils.java
index 94e9599..27812df 100644
--- a/services/core/java/com/android/server/pm/parsing/PackageInfoUtils.java
+++ b/services/core/java/com/android/server/pm/parsing/PackageInfoUtils.java
@@ -379,7 +379,10 @@
| flag(state.isVirtualPreload(), ApplicationInfo.PRIVATE_FLAG_VIRTUAL_PRELOAD)
| flag(state.isHidden(), ApplicationInfo.PRIVATE_FLAG_HIDDEN);
- if (state.getEnabledState() == PackageManager.COMPONENT_ENABLED_STATE_ENABLED) {
+ if ((flags & PackageManager.FILTER_OUT_QUARANTINED_COMPONENTS) != 0
+ && state.isQuarantined()) {
+ ai.enabled = false;
+ } else if (state.getEnabledState() == PackageManager.COMPONENT_ENABLED_STATE_ENABLED) {
ai.enabled = true;
} else if (state.getEnabledState()
== PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED) {
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
index b01a89e..7897195 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
@@ -72,6 +72,7 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.Preconditions;
+import com.android.internal.util.function.QuadFunction;
import com.android.internal.util.function.TriFunction;
import com.android.server.LocalServices;
import com.android.server.pm.UserManagerInternal;
@@ -93,7 +94,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.BiFunction;
/**
* Manages all permissions and handles permissions related tasks.
@@ -233,11 +233,11 @@
}
if (checkPermissionDelegate == null) {
- return mPermissionManagerServiceImpl.checkPermission(
- packageName, permissionName, userId);
+ return mPermissionManagerServiceImpl.checkPermission(packageName, permissionName,
+ deviceId, userId);
}
- return checkPermissionDelegate.checkPermission(packageName, permissionName, userId,
- mPermissionManagerServiceImpl::checkPermission);
+ return checkPermissionDelegate.checkPermission(packageName, permissionName,
+ deviceId, userId, mPermissionManagerServiceImpl::checkPermission);
}
@Override
@@ -254,10 +254,10 @@
}
if (checkPermissionDelegate == null) {
- return mPermissionManagerServiceImpl.checkUidPermission(uid, permissionName);
+ return mPermissionManagerServiceImpl.checkUidPermission(uid, permissionName, deviceId);
}
return checkPermissionDelegate.checkUidPermission(uid, permissionName,
- mPermissionManagerServiceImpl::checkUidPermission);
+ deviceId, mPermissionManagerServiceImpl::checkUidPermission);
}
@Override
@@ -511,14 +511,14 @@
public int getPermissionFlags(String packageName, String permissionName, int deviceId,
int userId) {
return mPermissionManagerServiceImpl
- .getPermissionFlags(packageName, permissionName, userId);
+ .getPermissionFlags(packageName, permissionName, deviceId, userId);
}
@Override
public void updatePermissionFlags(String packageName, String permissionName, int flagMask,
int flagValues, boolean checkAdjustPolicyFlagPermission, int deviceId, int userId) {
mPermissionManagerServiceImpl.updatePermissionFlags(packageName, permissionName, flagMask,
- flagValues, checkAdjustPolicyFlagPermission, userId);
+ flagValues, checkAdjustPolicyFlagPermission, deviceId, userId);
}
@Override
@@ -560,14 +560,15 @@
@Override
public void grantRuntimePermission(String packageName, String permissionName, int deviceId,
int userId) {
- mPermissionManagerServiceImpl.grantRuntimePermission(packageName, permissionName, userId);
+ mPermissionManagerServiceImpl.grantRuntimePermission(packageName, permissionName,
+ deviceId, userId);
}
@Override
public void revokeRuntimePermission(String packageName, String permissionName, int deviceId,
int userId, String reason) {
mPermissionManagerServiceImpl.revokeRuntimePermission(packageName, permissionName,
- userId, reason);
+ deviceId, userId, reason);
}
@Override
@@ -580,14 +581,14 @@
public boolean shouldShowRequestPermissionRationale(String packageName, String permissionName,
int deviceId, int userId) {
return mPermissionManagerServiceImpl.shouldShowRequestPermissionRationale(packageName,
- permissionName, userId);
+ permissionName, deviceId, userId);
}
@Override
public boolean isPermissionRevokedByPolicy(String packageName, String permissionName,
int deviceId, int userId) {
- return mPermissionManagerServiceImpl
- .isPermissionRevokedByPolicy(packageName, permissionName, userId);
+ return mPermissionManagerServiceImpl.isPermissionRevokedByPolicy(packageName,
+ permissionName, deviceId, userId);
}
@Override
@@ -868,6 +869,7 @@
*
* @param packageName the name of the package to be checked
* @param permissionName the name of the permission to be checked
+ * @param deviceId The device ID
* @param userId the user ID
* @param superImpl the original implementation that can be delegated to
* @return {@link android.content.pm.PackageManager#PERMISSION_GRANTED} if the package has
@@ -876,20 +878,21 @@
* @see android.content.pm.PackageManager#checkPermission(String, String)
*/
int checkPermission(@NonNull String packageName, @NonNull String permissionName,
- @UserIdInt int userId,
- @NonNull TriFunction<String, String, Integer, Integer> superImpl);
+ int deviceId, @UserIdInt int userId,
+ @NonNull QuadFunction<String, String, Integer, Integer, Integer> superImpl);
/**
* Check whether the given UID has been granted the specified permission.
*
* @param uid the UID to be checked
* @param permissionName the name of the permission to be checked
+ * @param deviceId The device ID
* @param superImpl the original implementation that can be delegated to
* @return {@link android.content.pm.PackageManager#PERMISSION_GRANTED} if the package has
* the permission, or {@link android.content.pm.PackageManager#PERMISSION_DENIED} otherwise
*/
- int checkUidPermission(int uid, @NonNull String permissionName,
- BiFunction<Integer, String, Integer> superImpl);
+ int checkUidPermission(int uid, @NonNull String permissionName, int deviceId,
+ TriFunction<Integer, String, Integer, Integer> superImpl);
/**
* @return list of delegated permissions
@@ -918,31 +921,32 @@
@Override
public int checkPermission(@NonNull String packageName, @NonNull String permissionName,
- int userId, @NonNull TriFunction<String, String, Integer, Integer> superImpl) {
+ int deviceId, int userId,
+ @NonNull QuadFunction<String, String, Integer, Integer, Integer> superImpl) {
if (mDelegatedPackageName.equals(packageName)
&& isDelegatedPermission(permissionName)) {
final long identity = Binder.clearCallingIdentity();
try {
- return superImpl.apply("com.android.shell", permissionName, userId);
+ return superImpl.apply("com.android.shell", permissionName, deviceId, userId);
} finally {
Binder.restoreCallingIdentity(identity);
}
}
- return superImpl.apply(packageName, permissionName, userId);
+ return superImpl.apply(packageName, permissionName, deviceId, userId);
}
@Override
- public int checkUidPermission(int uid, @NonNull String permissionName,
- @NonNull BiFunction<Integer, String, Integer> superImpl) {
+ public int checkUidPermission(int uid, @NonNull String permissionName, int deviceId,
+ @NonNull TriFunction<Integer, String, Integer, Integer> superImpl) {
if (uid == mDelegatedUid && isDelegatedPermission(permissionName)) {
final long identity = Binder.clearCallingIdentity();
try {
- return superImpl.apply(Process.SHELL_UID, permissionName);
+ return superImpl.apply(Process.SHELL_UID, permissionName, deviceId);
} finally {
Binder.restoreCallingIdentity(identity);
}
}
- return superImpl.apply(uid, permissionName);
+ return superImpl.apply(uid, permissionName, deviceId);
}
@Override
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
index 4353c57..6764e08 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
@@ -681,7 +681,7 @@
}
@Override
- public int getPermissionFlags(String packageName, String permName, int userId) {
+ public int getPermissionFlags(String packageName, String permName, int deviceId, int userId) {
final int callingUid = Binder.getCallingUid();
return getPermissionFlagsInternal(packageName, permName, callingUid, userId);
}
@@ -724,7 +724,7 @@
@Override
public void updatePermissionFlags(String packageName, String permName, int flagMask,
- int flagValues, boolean checkAdjustPolicyFlagPermission, int userId) {
+ int flagValues, boolean checkAdjustPolicyFlagPermission, int deviceId, int userId) {
final int callingUid = Binder.getCallingUid();
boolean overridePolicy = false;
@@ -908,8 +908,12 @@
}
}
+ private int checkPermission(String pkgName, String permName, int userId) {
+ return checkPermission(pkgName, permName, Context.DEVICE_ID_DEFAULT, userId);
+ }
+
@Override
- public int checkPermission(String pkgName, String permName, int userId) {
+ public int checkPermission(String pkgName, String permName, int deviceId, int userId) {
if (!mUserManagerInt.exists(userId)) {
return PackageManager.PERMISSION_DENIED;
}
@@ -975,8 +979,12 @@
return true;
}
+ private int checkUidPermission(int uid, String permName) {
+ return checkUidPermission(uid, permName, Context.DEVICE_ID_DEFAULT);
+ }
+
@Override
- public int checkUidPermission(int uid, String permName) {
+ public int checkUidPermission(int uid, String permName, int deviceId) {
final int userId = UserHandle.getUserId(uid);
if (!mUserManagerInt.exists(userId)) {
return PackageManager.PERMISSION_DENIED;
@@ -1295,7 +1303,8 @@
}
@Override
- public void grantRuntimePermission(String packageName, String permName, final int userId) {
+ public void grantRuntimePermission(String packageName, String permName, int deviceId,
+ int userId) {
final int callingUid = Binder.getCallingUid();
final boolean overridePolicy =
checkUidPermission(callingUid, ADJUST_RUNTIME_PERMISSIONS_POLICY)
@@ -1468,11 +1477,11 @@
}
@Override
- public void revokeRuntimePermission(String packageName, String permName, int userId,
- String reason) {
+ public void revokeRuntimePermission(String packageName, String permName, int deviceId,
+ int userId, String reason) {
final int callingUid = Binder.getCallingUid();
final boolean overridePolicy =
- checkUidPermission(callingUid, ADJUST_RUNTIME_PERMISSIONS_POLICY)
+ checkUidPermission(callingUid, ADJUST_RUNTIME_PERMISSIONS_POLICY, deviceId)
== PackageManager.PERMISSION_GRANTED;
revokeRuntimePermissionInternal(packageName, permName, overridePolicy, callingUid, userId,
@@ -1859,7 +1868,7 @@
@Override
public boolean shouldShowRequestPermissionRationale(String packageName, String permName,
- @UserIdInt int userId) {
+ int deviceId, @UserIdInt int userId) {
final int callingUid = Binder.getCallingUid();
if (UserHandle.getCallingUserId() != userId) {
mContext.enforceCallingPermission(
@@ -1922,7 +1931,8 @@
}
@Override
- public boolean isPermissionRevokedByPolicy(String packageName, String permName, int userId) {
+ public boolean isPermissionRevokedByPolicy(String packageName, String permName, int deviceId,
+ int userId) {
if (UserHandle.getCallingUserId() != userId) {
mContext.enforceCallingPermission(
android.Manifest.permission.INTERACT_ACROSS_USERS_FULL,
@@ -2059,8 +2069,8 @@
continue;
}
boolean isSystemOrPolicyFixed = (getPermissionFlags(newPackage.getPackageName(),
- permInfo.name, userId) & (FLAG_PERMISSION_SYSTEM_FIXED
- | FLAG_PERMISSION_POLICY_FIXED)) != 0;
+ permInfo.name, Context.DEVICE_ID_DEFAULT, userId) & (
+ FLAG_PERMISSION_SYSTEM_FIXED | FLAG_PERMISSION_POLICY_FIXED)) != 0;
if (isSystemOrPolicyFixed) {
continue;
}
@@ -2226,7 +2236,8 @@
for (final int userId : userIds) {
final int permissionState = checkPermission(packageName, permName,
userId);
- final int flags = getPermissionFlags(packageName, permName, userId);
+ final int flags = getPermissionFlags(packageName, permName,
+ Context.DEVICE_ID_DEFAULT, userId);
final int flagMask = FLAG_PERMISSION_SYSTEM_FIXED
| FLAG_PERMISSION_POLICY_FIXED
| FLAG_PERMISSION_GRANTED_BY_DEFAULT
@@ -5122,8 +5133,7 @@
@NonNull
@Override
- public Set<String> getGrantedPermissions(@NonNull String packageName,
- @UserIdInt int userId) {
+ public Set<String> getGrantedPermissions(@NonNull String packageName, @UserIdInt int userId) {
Objects.requireNonNull(packageName, "packageName");
Preconditions.checkArgumentNonNegative(userId, "userId");
return getGrantedPermissionsInternal(packageName, userId);
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceInterface.java b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceInterface.java
index 128f847..2d824aa 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceInterface.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceInterface.java
@@ -25,7 +25,6 @@
import android.content.pm.PermissionInfo;
import android.content.pm.permission.SplitPermissionInfoParcelable;
import android.permission.IOnPermissionsChangeListener;
-import android.permission.PermissionManager;
import android.permission.PermissionManagerInternal;
import com.android.server.pm.pkg.AndroidPackage;
@@ -137,14 +136,16 @@
void removePermission(String permName);
/**
- * Gets the state flags associated with a permission.
+ * Gets the permission state flags associated with a permission.
*
* @param packageName the package name for which to get the flags
* @param permName the permission for which to get the flags
+ * @param deviceId The device for which to get the flags
* @param userId the user for which to get permission flags
* @return the permission flags
*/
- int getPermissionFlags(String packageName, String permName, int userId);
+ int getPermissionFlags(String packageName, String permName, int deviceId,
+ @UserIdInt int userId);
/**
* Updates the flags associated with a permission by replacing the flags in the specified mask
@@ -154,10 +155,11 @@
* @param permName The permission for which to update the flags
* @param flagMask The flags which to replace
* @param flagValues The flags with which to replace
+ * @param deviceId The device for which to update the permission flags
* @param userId The user for which to update the permission flags
*/
- void updatePermissionFlags(String packageName, String permName, int flagMask,
- int flagValues, boolean checkAdjustPolicyFlagPermission, int userId);
+ void updatePermissionFlags(String packageName, String permName, int flagMask, int flagValues,
+ boolean checkAdjustPolicyFlagPermission, int deviceId, @UserIdInt int userId);
/**
* Update the permission flags for all packages and runtime permissions of a user in order
@@ -291,11 +293,13 @@
*
* @param packageName the package to which to grant the permission
* @param permName the permission name to grant
+ * @param deviceId the device for which to grant the permission
* @param userId the user for which to grant the permission
*
- * @see #revokeRuntimePermission(String, String, android.os.UserHandle, String)
+ * @see #revokeRuntimePermission(String, String, int, int, String)
*/
- void grantRuntimePermission(String packageName, String permName, int userId);
+ void grantRuntimePermission(String packageName, String permName, int deviceId,
+ @UserIdInt int userId);
/**
* Revoke a runtime permission that was previously granted by
@@ -310,13 +314,14 @@
*
* @param packageName the package from which to revoke the permission
* @param permName the permission name to revoke
+ * @param deviceId the device for which to revoke the permission
* @param userId the user for which to revoke the permission
* @param reason the reason for the revoke, or {@code null} for unspecified
*
- * @see #grantRuntimePermission(String, String, android.os.UserHandle)
+ * @see #grantRuntimePermission(String, String, int, int)
*/
- void revokeRuntimePermission(String packageName, String permName, int userId,
- String reason);
+ void revokeRuntimePermission(String packageName, String permName, int deviceId,
+ @UserIdInt int userId, String reason);
/**
* Revoke the POST_NOTIFICATIONS permission, without killing the app. This method must ONLY BE
@@ -333,24 +338,29 @@
* does not clearly communicate to the user what would be the benefit from grating this
* permission.
*
+ * @param packageName the package name
* @param permName a permission your app wants to request
+ * @param deviceId the device for which to check the permission
+ * @param userId the user for which to check the permission
* @return whether you can show permission rationale UI
*/
boolean shouldShowRequestPermissionRationale(String packageName, String permName,
- @UserIdInt int userId);
+ int deviceId, @UserIdInt int userId);
/**
- * Checks whether a particular permissions has been revoked for a package by policy. Typically
+ * Checks whether a particular permission has been revoked for a package by policy. Typically,
* the device owner or the profile owner may apply such a policy. The user cannot grant policy
* revoked permissions, hence the only way for an app to get such a permission is by a policy
* change.
*
* @param packageName the name of the package you are checking against
* @param permName the name of the permission you are checking for
- *
+ * @param deviceId the device for which you are checking the permission
+ * @param userId the device for which you are checking the permission
* @return whether the permission is restricted by policy
*/
- boolean isPermissionRevokedByPolicy(String packageName, String permName, int userId);
+ boolean isPermissionRevokedByPolicy(String packageName, String permName, int deviceId,
+ @UserIdInt int userId);
/**
* Get set of permissions that have been split into more granular or dependent permissions.
@@ -373,14 +383,25 @@
List<SplitPermissionInfoParcelable> getSplitPermissions();
/**
- * TODO:theianchen add doc describing this is the old checkPermissionImpl
+ * Check whether a permission is granted or not to a package.
+ *
+ * @param pkgName package name
+ * @param permName permission name
+ * @param deviceId device ID
+ * @param userId user ID
+ * @return permission result {@link PackageManager.PermissionResult}
*/
- int checkPermission(String pkgName, String permName, int userId);
+ int checkPermission(String pkgName, String permName, int deviceId, @UserIdInt int userId);
/**
- * TODO:theianchen add doc describing this is the old checkUidPermissionImpl
+ * Check whether a permission is granted or not to an UID.
+ *
+ * @param uid UID
+ * @param permName permission name
+ * @param deviceId device ID
+ * @return permission result {@link PackageManager.PermissionResult}
*/
- int checkUidPermission(int uid, String permName);
+ int checkUidPermission(int uid, String permName, int deviceId);
/**
* Get all the package names requesting app op permissions.
@@ -400,15 +421,11 @@
@UserIdInt int userId);
/**
- * Reset the runtime permission state changes for a package.
+ * Reset the runtime permission state changes for a package for all devices.
*
* TODO(zhanghai): Turn this into package change callback?
- *
- * @param pkg the package
- * @param userId the user ID
*/
- void resetRuntimePermissions(@NonNull AndroidPackage pkg,
- @UserIdInt int userId);
+ void resetRuntimePermissions(@NonNull AndroidPackage pkg, @UserIdInt int userId);
/**
* Reset the runtime permission state changes for all packages in a user.
@@ -449,8 +466,8 @@
/**
* Get all the permissions granted to a package.
*
- * @param packageName the name of the package
- * @param userId the user ID
+ * @param packageName package name
+ * @param userId user ID
* @return the names of the granted permissions
*/
@NonNull
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceLoggingDecorator.java b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceLoggingDecorator.java
index 7f98e21..dacb8c6 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceLoggingDecorator.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceLoggingDecorator.java
@@ -120,21 +120,21 @@
}
@Override
- public int getPermissionFlags(String packageName, String permName, int userId) {
+ public int getPermissionFlags(String packageName, String permName, int deviceId, int userId) {
Log.i(LOG_TAG, "getPermissionFlags(packageName = " + packageName + ", permName = "
- + permName + ", userId = " + userId + ")");
- return mService.getPermissionFlags(packageName, permName, userId);
+ + permName + ", deviceId = " + deviceId + ", userId = " + userId + ")");
+ return mService.getPermissionFlags(packageName, permName, deviceId, userId);
}
@Override
public void updatePermissionFlags(String packageName, String permName, int flagMask,
- int flagValues, boolean checkAdjustPolicyFlagPermission, int userId) {
+ int flagValues, boolean checkAdjustPolicyFlagPermission, int deviceId, int userId) {
Log.i(LOG_TAG, "updatePermissionFlags(packageName = " + packageName + ", permName = "
+ permName + ", flagMask = " + flagMask + ", flagValues = " + flagValues
+ ", checkAdjustPolicyFlagPermission = " + checkAdjustPolicyFlagPermission
- + ", userId = " + userId + ")");
+ + ", deviceId = " + deviceId + ", userId = " + userId + ")");
mService.updatePermissionFlags(packageName, permName, flagMask, flagValues,
- checkAdjustPolicyFlagPermission, userId);
+ checkAdjustPolicyFlagPermission, deviceId, userId);
}
@Override
@@ -182,18 +182,20 @@
}
@Override
- public void grantRuntimePermission(String packageName, String permName, int userId) {
+ public void grantRuntimePermission(String packageName, String permName, int deviceId,
+ int userId) {
Log.i(LOG_TAG, "grantRuntimePermission(packageName = " + packageName + ", permName = "
- + permName + ", userId = " + userId + ")");
- mService.grantRuntimePermission(packageName, permName, userId);
+ + permName + ", deviceId = " + deviceId + ", userId = " + userId + ")");
+ mService.grantRuntimePermission(packageName, permName, deviceId, userId);
}
@Override
- public void revokeRuntimePermission(String packageName, String permName, int userId,
- String reason) {
+ public void revokeRuntimePermission(String packageName, String permName, int deviceId,
+ int userId, String reason) {
Log.i(LOG_TAG, "revokeRuntimePermission(packageName = " + packageName + ", permName = "
- + permName + ", userId = " + userId + ", reason = " + reason + ")");
- mService.revokeRuntimePermission(packageName, permName, userId, reason);
+ + permName + ", deviceId = " + deviceId + ", userId = " + userId
+ + ", reason = " + reason + ")");
+ mService.revokeRuntimePermission(packageName, permName, deviceId, userId, reason);
}
@Override
@@ -205,17 +207,20 @@
@Override
public boolean shouldShowRequestPermissionRationale(String packageName, String permName,
- int userId) {
+ int deviceId, int userId) {
Log.i(LOG_TAG, "shouldShowRequestPermissionRationale(packageName = " + packageName
- + ", permName = " + permName + ", userId = " + userId + ")");
- return mService.shouldShowRequestPermissionRationale(packageName, permName, userId);
+ + ", permName = " + permName + ", deviceId = " + deviceId
+ + ", userId = " + userId + ")");
+ return mService.shouldShowRequestPermissionRationale(packageName, permName, deviceId,
+ userId);
}
@Override
- public boolean isPermissionRevokedByPolicy(String packageName, String permName, int userId) {
+ public boolean isPermissionRevokedByPolicy(String packageName, String permName, int deviceId,
+ int userId) {
Log.i(LOG_TAG, "isPermissionRevokedByPolicy(packageName = " + packageName + ", permName = "
- + permName + ", userId = " + userId + ")");
- return mService.isPermissionRevokedByPolicy(packageName, permName, userId);
+ + permName + ", deviceId = " + deviceId + ", userId = " + userId + ")");
+ return mService.isPermissionRevokedByPolicy(packageName, permName, deviceId, userId);
}
@Override
@@ -225,16 +230,17 @@
}
@Override
- public int checkPermission(String pkgName, String permName, int userId) {
+ public int checkPermission(String pkgName, String permName, int deviceId, int userId) {
Log.i(LOG_TAG, "checkPermission(pkgName = " + pkgName + ", permName = " + permName
- + ", userId = " + userId + ")");
- return mService.checkPermission(pkgName, permName, userId);
+ + ", deviceId = " + deviceId + ", userId = " + userId + ")");
+ return mService.checkPermission(pkgName, permName, deviceId, userId);
}
@Override
- public int checkUidPermission(int uid, String permName) {
- Log.i(LOG_TAG, "checkUidPermission(uid = " + uid + ", permName = " + permName + ")");
- return mService.checkUidPermission(uid, permName);
+ public int checkUidPermission(int uid, String permName, int deviceId) {
+ Log.i(LOG_TAG, "checkUidPermission(uid = " + uid + ", permName = " + permName
+ + ", deviceId = " + deviceId + ")");
+ return mService.checkUidPermission(uid, permName, deviceId);
}
@Override
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceTestingShim.java b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceTestingShim.java
index d4c6d42..35d165b 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceTestingShim.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceTestingShim.java
@@ -153,9 +153,10 @@
}
@Override
- public int getPermissionFlags(String packageName, String permName, int userId) {
- int oldVal = mOldImplementation.getPermissionFlags(packageName, permName, userId);
- int newVal = mNewImplementation.getPermissionFlags(packageName, permName, userId);
+ public int getPermissionFlags(String packageName, String permName, int deviceId,
+ @UserIdInt int userId) {
+ int oldVal = mOldImplementation.getPermissionFlags(packageName, permName, deviceId, userId);
+ int newVal = mNewImplementation.getPermissionFlags(packageName, permName, deviceId, userId);
if (!Objects.equals(oldVal, newVal)) {
signalImplDifference("getPermissionFlags");
@@ -165,11 +166,12 @@
@Override
public void updatePermissionFlags(String packageName, String permName, int flagMask,
- int flagValues, boolean checkAdjustPolicyFlagPermission, int userId) {
+ int flagValues, boolean checkAdjustPolicyFlagPermission, int deviceId,
+ @UserIdInt int userId) {
mOldImplementation.updatePermissionFlags(packageName, permName, flagMask, flagValues,
- checkAdjustPolicyFlagPermission, userId);
+ checkAdjustPolicyFlagPermission, deviceId, userId);
mNewImplementation.updatePermissionFlags(packageName, permName, flagMask, flagValues,
- checkAdjustPolicyFlagPermission, userId);
+ checkAdjustPolicyFlagPermission, deviceId, userId);
}
@Override
@@ -234,16 +236,17 @@
}
@Override
- public void grantRuntimePermission(String packageName, String permName, int userId) {
- mOldImplementation.grantRuntimePermission(packageName, permName, userId);
- mNewImplementation.grantRuntimePermission(packageName, permName, userId);
+ public void grantRuntimePermission(String packageName, String permName, int deviceId,
+ @UserIdInt int userId) {
+ mOldImplementation.grantRuntimePermission(packageName, permName, deviceId, userId);
+ mNewImplementation.grantRuntimePermission(packageName, permName, deviceId, userId);
}
@Override
- public void revokeRuntimePermission(String packageName, String permName, int userId,
- String reason) {
- mOldImplementation.grantRuntimePermission(packageName, permName, userId);
- mNewImplementation.grantRuntimePermission(packageName, permName, userId);
+ public void revokeRuntimePermission(String packageName, String permName, int deviceId,
+ @UserIdInt int userId, String reason) {
+ mOldImplementation.revokeRuntimePermission(packageName, permName, deviceId, userId, reason);
+ mNewImplementation.revokeRuntimePermission(packageName, permName, deviceId, userId, reason);
}
@Override
@@ -255,11 +258,11 @@
@Override
public boolean shouldShowRequestPermissionRationale(String packageName, String permName,
- int userId) {
- boolean oldVal = mOldImplementation
- .shouldShowRequestPermissionRationale(packageName, permName, userId);
- boolean newVal = mNewImplementation
- .shouldShowRequestPermissionRationale(packageName, permName, userId);
+ int deviceId, @UserIdInt int userId) {
+ boolean oldVal = mOldImplementation.shouldShowRequestPermissionRationale(packageName,
+ permName, deviceId, userId);
+ boolean newVal = mNewImplementation.shouldShowRequestPermissionRationale(packageName,
+ permName, deviceId, userId);
if (!Objects.equals(oldVal, newVal)) {
signalImplDifference("shouldShowRequestPermissionRationale");
@@ -268,11 +271,12 @@
}
@Override
- public boolean isPermissionRevokedByPolicy(String packageName, String permName, int userId) {
- boolean oldVal = mOldImplementation
- .isPermissionRevokedByPolicy(packageName, permName, userId);
+ public boolean isPermissionRevokedByPolicy(String packageName, String permName, int deviceId,
+ @UserIdInt int userId) {
+ boolean oldVal = mOldImplementation.isPermissionRevokedByPolicy(packageName, permName,
+ deviceId, userId);
boolean newVal = mNewImplementation.isPermissionRevokedByPolicy(packageName, permName,
- userId);
+ deviceId, userId);
if (!Objects.equals(oldVal, newVal)) {
signalImplDifference("isPermissionRevokedByPolicy");
@@ -292,9 +296,9 @@
}
@Override
- public int checkPermission(String pkgName, String permName, int userId) {
- int oldVal = mOldImplementation.checkPermission(pkgName, permName, userId);
- int newVal = mNewImplementation.checkPermission(pkgName, permName, userId);
+ public int checkPermission(String pkgName, String permName, int deviceId, int userId) {
+ int oldVal = mOldImplementation.checkPermission(pkgName, permName, deviceId, userId);
+ int newVal = mNewImplementation.checkPermission(pkgName, permName, deviceId, userId);
if (!Objects.equals(oldVal, newVal)) {
signalImplDifference("checkPermission");
@@ -303,9 +307,9 @@
}
@Override
- public int checkUidPermission(int uid, String permName) {
- int oldVal = mOldImplementation.checkUidPermission(uid, permName);
- int newVal = mNewImplementation.checkUidPermission(uid, permName);
+ public int checkUidPermission(int uid, String permName, int deviceId) {
+ int oldVal = mOldImplementation.checkUidPermission(uid, permName, deviceId);
+ int newVal = mNewImplementation.checkUidPermission(uid, permName, deviceId);
if (!Objects.equals(oldVal, newVal)) {
signalImplDifference("checkUidPermission");
@@ -372,7 +376,7 @@
@NonNull
@Override
- public Set<String> getGrantedPermissions(@NonNull String packageName, int userId) {
+ public Set<String> getGrantedPermissions(@NonNull String packageName, @UserIdInt int userId) {
Set<String> oldVal = mOldImplementation.getGrantedPermissions(packageName, userId);
Set<String> newVal = mNewImplementation.getGrantedPermissions(packageName, userId);
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceTracingDecorator.java b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceTracingDecorator.java
index 4e72fae..cbeede0 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceTracingDecorator.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceTracingDecorator.java
@@ -158,10 +158,10 @@
}
@Override
- public int getPermissionFlags(String packageName, String permName, int userId) {
+ public int getPermissionFlags(String packageName, String permName, int deviceId, int userId) {
Trace.traceBegin(TRACE_TAG, "TaggedTracingPermissionManagerServiceImpl#getPermissionFlags");
try {
- return mService.getPermissionFlags(packageName, permName, userId);
+ return mService.getPermissionFlags(packageName, permName, deviceId, userId);
} finally {
Trace.traceEnd(TRACE_TAG);
}
@@ -169,12 +169,12 @@
@Override
public void updatePermissionFlags(String packageName, String permName, int flagMask,
- int flagValues, boolean checkAdjustPolicyFlagPermission, int userId) {
+ int flagValues, boolean checkAdjustPolicyFlagPermission, int deviceId, int userId) {
Trace.traceBegin(TRACE_TAG,
"TaggedTracingPermissionManagerServiceImpl#updatePermissionFlags");
try {
mService.updatePermissionFlags(packageName, permName, flagMask, flagValues,
- checkAdjustPolicyFlagPermission, userId);
+ checkAdjustPolicyFlagPermission, deviceId, userId);
} finally {
Trace.traceEnd(TRACE_TAG);
}
@@ -253,23 +253,24 @@
}
@Override
- public void grantRuntimePermission(String packageName, String permName, int userId) {
+ public void grantRuntimePermission(String packageName, String permName, int deviceId,
+ int userId) {
Trace.traceBegin(TRACE_TAG,
"TaggedTracingPermissionManagerServiceImpl#grantRuntimePermission");
try {
- mService.grantRuntimePermission(packageName, permName, userId);
+ mService.grantRuntimePermission(packageName, permName, deviceId, userId);
} finally {
Trace.traceEnd(TRACE_TAG);
}
}
@Override
- public void revokeRuntimePermission(String packageName, String permName, int userId,
- String reason) {
+ public void revokeRuntimePermission(String packageName, String permName, int deviceId,
+ int userId, String reason) {
Trace.traceBegin(TRACE_TAG,
"TaggedTracingPermissionManagerServiceImpl#revokeRuntimePermission");
try {
- mService.revokeRuntimePermission(packageName, permName, userId, reason);
+ mService.revokeRuntimePermission(packageName, permName, deviceId, userId, reason);
} finally {
Trace.traceEnd(TRACE_TAG);
}
@@ -288,22 +289,24 @@
@Override
public boolean shouldShowRequestPermissionRationale(String packageName, String permName,
- int userId) {
+ int deviceId, int userId) {
Trace.traceBegin(TRACE_TAG,
"TaggedTracingPermissionManagerServiceImpl#shouldShowRequestPermissionRationale");
try {
- return mService.shouldShowRequestPermissionRationale(packageName, permName, userId);
+ return mService.shouldShowRequestPermissionRationale(
+ packageName, permName, deviceId, userId);
} finally {
Trace.traceEnd(TRACE_TAG);
}
}
@Override
- public boolean isPermissionRevokedByPolicy(String packageName, String permName, int userId) {
+ public boolean isPermissionRevokedByPolicy(String packageName, String permName, int deviceId,
+ int userId) {
Trace.traceBegin(TRACE_TAG,
"TaggedTracingPermissionManagerServiceImpl#isPermissionRevokedByPolicy");
try {
- return mService.isPermissionRevokedByPolicy(packageName, permName, userId);
+ return mService.isPermissionRevokedByPolicy(packageName, permName, deviceId, userId);
} finally {
Trace.traceEnd(TRACE_TAG);
}
@@ -321,20 +324,20 @@
}
@Override
- public int checkPermission(String pkgName, String permName, int userId) {
+ public int checkPermission(String pkgName, String permName, int deviceId, int userId) {
Trace.traceBegin(TRACE_TAG, "TaggedTracingPermissionManagerServiceImpl#checkPermission");
try {
- return mService.checkPermission(pkgName, permName, userId);
+ return mService.checkPermission(pkgName, permName, deviceId, userId);
} finally {
Trace.traceEnd(TRACE_TAG);
}
}
@Override
- public int checkUidPermission(int uid, String permName) {
+ public int checkUidPermission(int uid, String permName, int deviceId) {
Trace.traceBegin(TRACE_TAG, "TaggedTracingPermissionManagerServiceImpl#checkUidPermission");
try {
- return mService.checkUidPermission(uid, permName);
+ return mService.checkUidPermission(uid, permName, deviceId);
} finally {
Trace.traceEnd(TRACE_TAG);
}
diff --git a/services/core/java/com/android/server/pm/pkg/PackageUserState.java b/services/core/java/com/android/server/pm/pkg/PackageUserState.java
index 81915b4..7bc518c 100644
--- a/services/core/java/com/android/server/pm/pkg/PackageUserState.java
+++ b/services/core/java/com/android/server/pm/pkg/PackageUserState.java
@@ -209,6 +209,13 @@
boolean isVirtualPreload();
/**
+ * @return whether the package is quarantined in order to minimize ad-spam and pop ups
+ * when-not-in-use.
+ * @hide
+ */
+ boolean isQuarantined();
+
+ /**
* The "package:type/entry" form of the theme resource ID previously set as the splash screen.
*
* @hide
@@ -225,6 +232,7 @@
*/
@PackageManager.UserMinAspectRatio
int getMinAspectRatio();
+
/**
* Information about the archived state of an app. Set only if an app is archived.
*
@@ -233,4 +241,5 @@
@Immutable.Ignore
@Nullable
ArchiveState getArchiveState();
+
}
diff --git a/services/core/java/com/android/server/pm/pkg/PackageUserStateDefault.java b/services/core/java/com/android/server/pm/pkg/PackageUserStateDefault.java
index cce18a8..3534d75 100644
--- a/services/core/java/com/android/server/pm/pkg/PackageUserStateDefault.java
+++ b/services/core/java/com/android/server/pm/pkg/PackageUserStateDefault.java
@@ -129,6 +129,11 @@
return false;
}
+ @Override
+ public boolean isQuarantined() {
+ return false;
+ }
+
@Nullable
@Override
public String getSplashScreenTheme() {
diff --git a/services/core/java/com/android/server/pm/pkg/PackageUserStateImpl.java b/services/core/java/com/android/server/pm/pkg/PackageUserStateImpl.java
index d8c8af6..2349fbf 100644
--- a/services/core/java/com/android/server/pm/pkg/PackageUserStateImpl.java
+++ b/services/core/java/com/android/server/pm/pkg/PackageUserStateImpl.java
@@ -670,6 +670,21 @@
return getBoolean(Booleans.VIRTUAL_PRELOADED);
}
+ @Override
+ public boolean isQuarantined() {
+ if (!isSuspended()) {
+ return false;
+ }
+ final var suspendParams = mSuspendParams;
+ for (int i = 0, size = suspendParams.size(); i < size; i++) {
+ final SuspendParams params = suspendParams.valueAt(i);
+ if (params.isQuarantined()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
@@ -879,7 +894,7 @@
}
@DataClass.Generated(
- time = 1691186062924L,
+ time = 1691601685901L,
codegenVersion = "1.0.23",
sourceFile = "frameworks/base/services/core/java/com/android/server/pm/pkg/PackageUserStateImpl.java",
inputSignatures = "private int mBooleans\nprotected @android.annotation.Nullable com.android.server.utils.WatchedArraySet<java.lang.String> mDisabledComponentsWatched\nprotected @android.annotation.Nullable com.android.server.utils.WatchedArraySet<java.lang.String> mEnabledComponentsWatched\nprivate long mCeDataInode\nprivate int mDistractionFlags\nprivate @android.content.pm.PackageManager.EnabledState int mEnabledState\nprivate @android.content.pm.PackageManager.InstallReason int mInstallReason\nprivate @android.content.pm.PackageManager.UninstallReason int mUninstallReason\nprivate @android.annotation.Nullable java.lang.String mHarmfulAppWarning\nprivate @android.annotation.Nullable java.lang.String mLastDisableAppCaller\nprivate @android.annotation.Nullable android.content.pm.overlay.OverlayPaths mOverlayPaths\nprotected @android.annotation.Nullable com.android.server.utils.WatchedArrayMap<java.lang.String,android.content.pm.overlay.OverlayPaths> mSharedLibraryOverlayPaths\nprivate @android.annotation.Nullable java.lang.String mSplashScreenTheme\nprivate @android.content.pm.PackageManager.UserMinAspectRatio int mMinAspectRatio\nprivate @android.annotation.Nullable com.android.server.utils.WatchedArrayMap<java.lang.String,com.android.server.pm.pkg.SuspendParams> mSuspendParams\nprivate @android.annotation.Nullable com.android.server.utils.WatchedArrayMap<android.content.ComponentName,android.util.Pair<java.lang.String,java.lang.Integer>> mComponentLabelIconOverrideMap\nprivate @android.annotation.CurrentTimeMillisLong long mFirstInstallTimeMillis\nprivate @android.annotation.Nullable com.android.server.utils.Watchable mWatchable\nprivate @android.annotation.Nullable com.android.server.pm.pkg.ArchiveState mArchiveState\nfinal @android.annotation.NonNull com.android.server.utils.SnapshotCache<com.android.server.pm.pkg.PackageUserStateImpl> mSnapshot\nprivate void setBoolean(int,boolean)\nprivate boolean getBoolean(int)\nprivate com.android.server.utils.SnapshotCache<com.android.server.pm.pkg.PackageUserStateImpl> makeCache()\nprivate void onChanged()\npublic @android.annotation.NonNull @java.lang.Override com.android.server.pm.pkg.PackageUserStateImpl snapshot()\npublic @android.annotation.Nullable boolean setOverlayPaths(android.content.pm.overlay.OverlayPaths)\npublic boolean setSharedLibraryOverlayPaths(java.lang.String,android.content.pm.overlay.OverlayPaths)\npublic @android.annotation.Nullable @java.lang.Override com.android.server.utils.WatchedArraySet<java.lang.String> getDisabledComponentsNoCopy()\npublic @android.annotation.Nullable @java.lang.Override com.android.server.utils.WatchedArraySet<java.lang.String> getEnabledComponentsNoCopy()\npublic @android.annotation.NonNull @java.lang.Override android.util.ArraySet<java.lang.String> getDisabledComponents()\npublic @android.annotation.NonNull @java.lang.Override android.util.ArraySet<java.lang.String> getEnabledComponents()\npublic @java.lang.Override boolean isComponentEnabled(java.lang.String)\npublic @java.lang.Override boolean isComponentDisabled(java.lang.String)\npublic @java.lang.Override android.content.pm.overlay.OverlayPaths getAllOverlayPaths()\npublic @com.android.internal.annotations.VisibleForTesting boolean overrideLabelAndIcon(android.content.ComponentName,java.lang.String,java.lang.Integer)\npublic void resetOverrideComponentLabelIcon()\npublic @android.annotation.Nullable android.util.Pair<java.lang.String,java.lang.Integer> getOverrideLabelIconForComponent(android.content.ComponentName)\npublic @java.lang.Override boolean isSuspended()\npublic com.android.server.pm.pkg.PackageUserStateImpl putSuspendParams(java.lang.String,com.android.server.pm.pkg.SuspendParams)\npublic com.android.server.pm.pkg.PackageUserStateImpl removeSuspension(java.lang.String)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setDisabledComponents(android.util.ArraySet<java.lang.String>)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setEnabledComponents(android.util.ArraySet<java.lang.String>)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setEnabledComponents(com.android.server.utils.WatchedArraySet<java.lang.String>)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setDisabledComponents(com.android.server.utils.WatchedArraySet<java.lang.String>)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setCeDataInode(long)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setInstalled(boolean)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setStopped(boolean)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setNotLaunched(boolean)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setHidden(boolean)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setDistractionFlags(int)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setInstantApp(boolean)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setVirtualPreload(boolean)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setEnabledState(int)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setInstallReason(int)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setUninstallReason(int)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setHarmfulAppWarning(java.lang.String)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setLastDisableAppCaller(java.lang.String)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setSharedLibraryOverlayPaths(android.util.ArrayMap<java.lang.String,android.content.pm.overlay.OverlayPaths>)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setSplashScreenTheme(java.lang.String)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setMinAspectRatio(int)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setSuspendParams(android.util.ArrayMap<java.lang.String,com.android.server.pm.pkg.SuspendParams>)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setComponentLabelIconOverrideMap(android.util.ArrayMap<android.content.ComponentName,android.util.Pair<java.lang.String,java.lang.Integer>>)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setFirstInstallTimeMillis(long)\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setArchiveState(com.android.server.pm.pkg.ArchiveState)\npublic @android.annotation.NonNull @java.lang.Override java.util.Map<java.lang.String,android.content.pm.overlay.OverlayPaths> getSharedLibraryOverlayPaths()\npublic @android.annotation.NonNull com.android.server.pm.pkg.PackageUserStateImpl setWatchable(com.android.server.utils.Watchable)\nprivate boolean watchableEquals(com.android.server.utils.Watchable)\nprivate int watchableHashCode()\nprivate boolean snapshotEquals(com.android.server.utils.SnapshotCache<com.android.server.pm.pkg.PackageUserStateImpl>)\nprivate int snapshotHashCode()\npublic @java.lang.Override boolean isInstalled()\npublic @java.lang.Override boolean isStopped()\npublic @java.lang.Override boolean isNotLaunched()\npublic @java.lang.Override boolean isHidden()\npublic @java.lang.Override boolean isInstantApp()\npublic @java.lang.Override boolean isVirtualPreload()\nclass PackageUserStateImpl extends com.android.server.utils.WatchableImpl implements [com.android.server.pm.pkg.PackageUserStateInternal, com.android.server.utils.Snappable]\nprivate static final int INSTALLED\nprivate static final int STOPPED\nprivate static final int NOT_LAUNCHED\nprivate static final int HIDDEN\nprivate static final int INSTANT_APP\nprivate static final int VIRTUAL_PRELOADED\nclass Booleans extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genConstructor=false, genBuilder=false, genEqualsHashCode=true)")
diff --git a/services/core/java/com/android/server/pm/pkg/PackageUserStateUtils.java b/services/core/java/com/android/server/pm/pkg/PackageUserStateUtils.java
index 15e3d0c..e342453 100644
--- a/services/core/java/com/android/server/pm/pkg/PackageUserStateUtils.java
+++ b/services/core/java/com/android/server/pm/pkg/PackageUserStateUtils.java
@@ -16,6 +16,7 @@
package com.android.server.pm.pkg;
+import static android.content.pm.PackageManager.FILTER_OUT_QUARANTINED_COMPONENTS;
import static android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS;
import static android.content.pm.PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS;
@@ -122,6 +123,10 @@
return true;
}
+ if ((flags & FILTER_OUT_QUARANTINED_COMPONENTS) != 0 && state.isQuarantined()) {
+ return false;
+ }
+
// First check if the overall package is disabled; if the package is
// enabled then fall through to check specific component
switch (state.getEnabledState()) {
diff --git a/services/core/java/com/android/server/pm/pkg/SuspendParams.java b/services/core/java/com/android/server/pm/pkg/SuspendParams.java
index dc48a33..4e08106 100644
--- a/services/core/java/com/android/server/pm/pkg/SuspendParams.java
+++ b/services/core/java/com/android/server/pm/pkg/SuspendParams.java
@@ -24,6 +24,7 @@
import com.android.modules.utils.TypedXmlPullParser;
import com.android.modules.utils.TypedXmlSerializer;
+import com.android.server.pm.Flags;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -42,16 +43,25 @@
private static final String TAG_DIALOG_INFO = "dialog-info";
private static final String TAG_APP_EXTRAS = "app-extras";
private static final String TAG_LAUNCHER_EXTRAS = "launcher-extras";
+ private static final String ATTR_QUARANTINED = "quarantined";
- private final SuspendDialogInfo dialogInfo;
- private final PersistableBundle appExtras;
- private final PersistableBundle launcherExtras;
+ private final SuspendDialogInfo mDialogInfo;
+ private final PersistableBundle mAppExtras;
+ private final PersistableBundle mLauncherExtras;
+
+ private final boolean mQuarantined;
public SuspendParams(SuspendDialogInfo dialogInfo, PersistableBundle appExtras,
PersistableBundle launcherExtras) {
- this.dialogInfo = dialogInfo;
- this.appExtras = appExtras;
- this.launcherExtras = launcherExtras;
+ this(dialogInfo, appExtras, launcherExtras, false /* quarantined */);
+ }
+
+ public SuspendParams(SuspendDialogInfo dialogInfo, PersistableBundle appExtras,
+ PersistableBundle launcherExtras, boolean quarantined) {
+ this.mDialogInfo = dialogInfo;
+ this.mAppExtras = appExtras;
+ this.mLauncherExtras = launcherExtras;
+ this.mQuarantined = quarantined;
}
@Override
@@ -63,13 +73,16 @@
return false;
}
final SuspendParams other = (SuspendParams) obj;
- if (!Objects.equals(dialogInfo, other.dialogInfo)) {
+ if (!Objects.equals(mDialogInfo, other.mDialogInfo)) {
return false;
}
- if (!BaseBundle.kindofEquals(appExtras, other.appExtras)) {
+ if (!BaseBundle.kindofEquals(mAppExtras, other.mAppExtras)) {
return false;
}
- if (!BaseBundle.kindofEquals(launcherExtras, other.launcherExtras)) {
+ if (!BaseBundle.kindofEquals(mLauncherExtras, other.mLauncherExtras)) {
+ return false;
+ }
+ if (mQuarantined != other.mQuarantined) {
return false;
}
return true;
@@ -77,9 +90,10 @@
@Override
public int hashCode() {
- int hashCode = Objects.hashCode(dialogInfo);
- hashCode = 31 * hashCode + ((appExtras != null) ? appExtras.size() : 0);
- hashCode = 31 * hashCode + ((launcherExtras != null) ? launcherExtras.size() : 0);
+ int hashCode = Objects.hashCode(mDialogInfo);
+ hashCode = 31 * hashCode + ((mAppExtras != null) ? mAppExtras.size() : 0);
+ hashCode = 31 * hashCode + ((mLauncherExtras != null) ? mLauncherExtras.size() : 0);
+ hashCode = 31 * hashCode + Boolean.hashCode(mQuarantined);
return hashCode;
}
@@ -89,25 +103,26 @@
* @param out the {@link XmlSerializer} object
*/
public void saveToXml(TypedXmlSerializer out) throws IOException {
- if (dialogInfo != null) {
+ out.attributeBoolean(null, ATTR_QUARANTINED, mQuarantined);
+ if (mDialogInfo != null) {
out.startTag(null, TAG_DIALOG_INFO);
- dialogInfo.saveToXml(out);
+ mDialogInfo.saveToXml(out);
out.endTag(null, TAG_DIALOG_INFO);
}
- if (appExtras != null) {
+ if (mAppExtras != null) {
out.startTag(null, TAG_APP_EXTRAS);
try {
- appExtras.saveToXml(out);
+ mAppExtras.saveToXml(out);
} catch (XmlPullParserException e) {
Slog.e(LOG_TAG, "Exception while trying to write appExtras."
+ " Will be lost on reboot", e);
}
out.endTag(null, TAG_APP_EXTRAS);
}
- if (launcherExtras != null) {
+ if (mLauncherExtras != null) {
out.startTag(null, TAG_LAUNCHER_EXTRAS);
try {
- launcherExtras.saveToXml(out);
+ mLauncherExtras.saveToXml(out);
} catch (XmlPullParserException e) {
Slog.e(LOG_TAG, "Exception while trying to write launcherExtras."
+ " Will be lost on reboot", e);
@@ -127,6 +142,9 @@
PersistableBundle readAppExtras = null;
PersistableBundle readLauncherExtras = null;
+ final boolean quarantined = in.getAttributeBoolean(null, ATTR_QUARANTINED, false)
+ && Flags.quarantinedEnabled();
+
final int currentDepth = in.getDepth();
int type;
try {
@@ -157,18 +175,22 @@
Slog.e(LOG_TAG, "Exception while trying to parse SuspendParams,"
+ " some fields may default", e);
}
- return new SuspendParams(readDialogInfo, readAppExtras, readLauncherExtras);
+ return new SuspendParams(readDialogInfo, readAppExtras, readLauncherExtras, quarantined);
}
public SuspendDialogInfo getDialogInfo() {
- return dialogInfo;
+ return mDialogInfo;
}
public PersistableBundle getAppExtras() {
- return appExtras;
+ return mAppExtras;
}
public PersistableBundle getLauncherExtras() {
- return launcherExtras;
+ return mLauncherExtras;
+ }
+
+ public boolean isQuarantined() {
+ return mQuarantined;
}
}
diff --git a/services/core/java/com/android/server/pm/pkg/parsing/ParsingPackageUtils.java b/services/core/java/com/android/server/pm/pkg/parsing/ParsingPackageUtils.java
index e2cb87e..dc022f7 100644
--- a/services/core/java/com/android/server/pm/pkg/parsing/ParsingPackageUtils.java
+++ b/services/core/java/com/android/server/pm/pkg/parsing/ParsingPackageUtils.java
@@ -3055,7 +3055,7 @@
*
* TODO(b/155513789): Remove this in favor of collecting certificates during the original parse
* call if requested. Leaving this as an optional method for the caller means we have to
- * construct a dummy ParseInput.
+ * construct a placeholder ParseInput.
*/
@CheckResult
public static ParseResult<SigningDetails> getSigningDetails(ParseInput input,
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index db17edd..b3aa09b 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -626,9 +626,16 @@
private boolean mAllowTheaterModeWakeFromLidSwitch;
private boolean mAllowTheaterModeWakeFromWakeGesture;
- // Whether to support long press from power button in non-interactive mode
+ // If true, the power button long press behavior will be invoked even if the default display is
+ // non-interactive. If false, the power button long press behavior will be skipped if the
+ // default display is non-interactive.
private boolean mSupportLongPressPowerWhenNonInteractive;
+ // If true, the power button short press behavior will be always invoked as long as the default
+ // display is on, even if the display is not interactive. If false, the power button short press
+ // behavior will be skipped if the default display is non-interactive.
+ private boolean mSupportShortPressPowerWhenDefaultDisplayOn;
+
// Whether to go to sleep entering theater mode from power button
private boolean mGoToSleepOnButtonPressTheaterMode;
@@ -1045,7 +1052,7 @@
}
}
- private void powerPress(long eventTime, int count, boolean beganFromNonInteractive) {
+ private void powerPress(long eventTime, int count) {
// SideFPS still needs to know about suppressed power buttons, in case it needs to block
// an auth attempt.
if (count == 1) {
@@ -1059,9 +1066,16 @@
final boolean interactive = mDefaultDisplayPolicy.isAwake();
- Slog.d(TAG, "powerPress: eventTime=" + eventTime + " interactive=" + interactive
- + " count=" + count + " beganFromNonInteractive=" + beganFromNonInteractive
- + " mShortPressOnPowerBehavior=" + mShortPressOnPowerBehavior);
+ Slog.d(
+ TAG,
+ "powerPress: eventTime="
+ + eventTime
+ + " interactive="
+ + interactive
+ + " count="
+ + count
+ + " mShortPressOnPowerBehavior="
+ + mShortPressOnPowerBehavior);
if (count == 2) {
powerMultiPressAction(eventTime, interactive, mDoublePressOnPowerBehavior);
@@ -1069,12 +1083,7 @@
powerMultiPressAction(eventTime, interactive, mTriplePressOnPowerBehavior);
} else if (count > 3 && count <= getMaxMultiPressPowerCount()) {
Slog.d(TAG, "No behavior defined for power press count " + count);
- } else if (count == 1 && interactive && !beganFromNonInteractive) {
- if (mSideFpsEventHandler.shouldConsumeSinglePress(eventTime)) {
- Slog.i(TAG, "Suppressing power key because the user is interacting with the "
- + "fingerprint sensor");
- return;
- }
+ } else if (count == 1 && shouldHandleShortPressPowerAction(interactive, eventTime)) {
switch (mShortPressOnPowerBehavior) {
case SHORT_PRESS_POWER_NOTHING:
break;
@@ -1122,6 +1131,44 @@
}
}
+ private boolean shouldHandleShortPressPowerAction(boolean interactive, long eventTime) {
+ if (mSupportShortPressPowerWhenDefaultDisplayOn) {
+ final boolean defaultDisplayOn = Display.isOnState(mDefaultDisplay.getState());
+ final boolean beganFromDefaultDisplayOn =
+ mSingleKeyGestureDetector.beganFromDefaultDisplayOn();
+ if (!defaultDisplayOn || !beganFromDefaultDisplayOn) {
+ Slog.v(
+ TAG,
+ "Ignoring short press of power button because the default display is not"
+ + " on. defaultDisplayOn="
+ + defaultDisplayOn
+ + ", beganFromDefaultDisplayOn="
+ + beganFromDefaultDisplayOn);
+ return false;
+ }
+ return true;
+ }
+ final boolean beganFromNonInteractive = mSingleKeyGestureDetector.beganFromNonInteractive();
+ if (!interactive || beganFromNonInteractive) {
+ Slog.v(
+ TAG,
+ "Ignoring short press of power button because the device is not interactive."
+ + " interactive="
+ + interactive
+ + ", beganFromNonInteractive="
+ + beganFromNonInteractive);
+ return false;
+ }
+ if (mSideFpsEventHandler.shouldConsumeSinglePress(eventTime)) {
+ Slog.i(
+ TAG,
+ "Suppressing power key because the user is interacting with the "
+ + "fingerprint sensor");
+ return false;
+ }
+ return true;
+ }
+
/**
* Attempt to dream from a power button press.
*
@@ -2277,6 +2324,11 @@
mSupportLongPressPowerWhenNonInteractive = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_supportLongPressPowerWhenNonInteractive);
+ mSupportShortPressPowerWhenDefaultDisplayOn =
+ mContext.getResources()
+ .getBoolean(
+ com.android.internal.R.bool
+ .config_supportShortPressPowerWhenDefaultDisplayOn);
mLongPressOnBackBehavior = mContext.getResources().getInteger(
com.android.internal.R.integer.config_longPressOnBackBehavior);
@@ -2567,8 +2619,7 @@
@Override
void onPress(long downTime) {
- powerPress(downTime, 1 /*count*/,
- mSingleKeyGestureDetector.beganFromNonInteractive());
+ powerPress(downTime, 1 /*count*/);
}
@Override
@@ -2599,7 +2650,7 @@
@Override
void onMultiPress(long downTime, int count) {
- powerPress(downTime, count, mSingleKeyGestureDetector.beganFromNonInteractive());
+ powerPress(downTime, count);
}
}
@@ -4349,10 +4400,11 @@
// This could prevent some wrong state in multi-displays environment,
// the default display may turned off but interactive is true.
- final boolean isDefaultDisplayOn = mDefaultDisplayPolicy.isAwake();
- final boolean interactiveAndOn = interactive && isDefaultDisplayOn;
+ final boolean isDefaultDisplayOn = Display.isOnState(mDefaultDisplay.getState());
+ final boolean isDefaultDisplayAwake = mDefaultDisplayPolicy.isAwake();
+ final boolean interactiveAndAwake = interactive && isDefaultDisplayAwake;
if ((event.getFlags() & KeyEvent.FLAG_FALLBACK) == 0) {
- handleKeyGesture(event, interactiveAndOn);
+ handleKeyGesture(event, interactiveAndAwake, isDefaultDisplayOn);
}
// Enable haptics if down and virtual key without multiple repetitions. If this is a hard
@@ -4505,7 +4557,7 @@
result &= ~ACTION_PASS_TO_USER;
isWakeKey = false; // wake-up will be handled separately
if (down) {
- interceptPowerKeyDown(event, interactiveAndOn);
+ interceptPowerKeyDown(event, interactiveAndAwake);
} else {
interceptPowerKeyUp(event, canceled);
}
@@ -4721,7 +4773,7 @@
return result;
}
- private void handleKeyGesture(KeyEvent event, boolean interactive) {
+ private void handleKeyGesture(KeyEvent event, boolean interactive, boolean defaultDisplayOn) {
if (mKeyCombinationManager.interceptKey(event, interactive)) {
// handled by combo keys manager.
mSingleKeyGestureDetector.reset();
@@ -4737,7 +4789,7 @@
}
}
- mSingleKeyGestureDetector.interceptKey(event, interactive);
+ mSingleKeyGestureDetector.interceptKey(event, interactive, defaultDisplayOn);
}
// The camera gesture will be detected by GestureLauncherService.
@@ -6193,6 +6245,9 @@
pw.print("mTriplePressOnPowerBehavior=");
pw.println(multiPressOnPowerBehaviorToString(mTriplePressOnPowerBehavior));
pw.print(prefix);
+ pw.print("mSupportShortPressPowerWhenDefaultDisplayOn=");
+ pw.println(mSupportShortPressPowerWhenDefaultDisplayOn);
+ pw.print(prefix);
pw.print("mPowerVolUpBehavior=");
pw.println(powerVolumeUpBehaviorToString(mPowerVolUpBehavior));
pw.print(prefix);
diff --git a/services/core/java/com/android/server/policy/SingleKeyGestureDetector.java b/services/core/java/com/android/server/policy/SingleKeyGestureDetector.java
index b999bbb3..5fc0637 100644
--- a/services/core/java/com/android/server/policy/SingleKeyGestureDetector.java
+++ b/services/core/java/com/android/server/policy/SingleKeyGestureDetector.java
@@ -43,6 +43,7 @@
private int mKeyPressCounter;
private boolean mBeganFromNonInteractive = false;
+ private boolean mBeganFromDefaultDisplayOn = false;
private final ArrayList<SingleKeyRule> mRules = new ArrayList();
private SingleKeyRule mActiveRule = null;
@@ -194,11 +195,12 @@
mRules.remove(rule);
}
- void interceptKey(KeyEvent event, boolean interactive) {
+ void interceptKey(KeyEvent event, boolean interactive, boolean defaultDisplayOn) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
- // Store the non interactive state when first down.
+ // Store the non interactive state and display on state when first down.
if (mDownKeyCode == KeyEvent.KEYCODE_UNKNOWN || mDownKeyCode != event.getKeyCode()) {
mBeganFromNonInteractive = !interactive;
+ mBeganFromDefaultDisplayOn = defaultDisplayOn;
}
interceptKeyDown(event);
} else {
@@ -388,6 +390,10 @@
return mBeganFromNonInteractive;
}
+ boolean beganFromDefaultDisplayOn() {
+ return mBeganFromDefaultDisplayOn;
+ }
+
void dump(String prefix, PrintWriter pw) {
pw.println(prefix + "SingleKey rules:");
for (SingleKeyRule rule : mRules) {
diff --git a/services/core/java/com/android/server/power/hint/HintManagerService.java b/services/core/java/com/android/server/power/hint/HintManagerService.java
index 33bed3d..577468b 100644
--- a/services/core/java/com/android/server/power/hint/HintManagerService.java
+++ b/services/core/java/com/android/server/power/hint/HintManagerService.java
@@ -56,6 +56,7 @@
public final class HintManagerService extends SystemService {
private static final String TAG = "HintManagerService";
private static final boolean DEBUG = false;
+ private static final int MAX_HINT_SESSION_COUNT_PER_UID = 20;
@VisibleForTesting final long mHintSessionPreferredRate;
// Multi-level map storing all active AppHintSessions.
@@ -367,6 +368,23 @@
+ " not be empty.");
final int callingUid = Binder.getCallingUid();
+ if (callingUid != Process.SYSTEM_UID) {
+ int sessionCount = 0;
+ synchronized (mLock) {
+ ArrayMap<IBinder, ArraySet<AppHintSession>> tokenMap =
+ mActiveSessions.get(callingUid);
+ if (tokenMap != null) {
+ for (ArraySet<AppHintSession> arr : tokenMap.values()) {
+ sessionCount += arr.size();
+ }
+ }
+ }
+ if (sessionCount >= MAX_HINT_SESSION_COUNT_PER_UID) {
+ throw new IllegalStateException(
+ "Max session count limit reached: " + sessionCount);
+ }
+ }
+
final int callingTgid = Process.getThreadGroupLeader(Binder.getCallingPid());
final long identity = Binder.clearCallingIdentity();
try {
diff --git a/services/core/java/com/android/server/power/stats/AggregatedPowerStats.java b/services/core/java/com/android/server/power/stats/AggregatedPowerStats.java
new file mode 100644
index 0000000..6cc9d0a
--- /dev/null
+++ b/services/core/java/com/android/server/power/stats/AggregatedPowerStats.java
@@ -0,0 +1,147 @@
+/*
+ * 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.server.power.stats;
+
+import android.annotation.CurrentTimeMillisLong;
+import android.annotation.DurationMillisLong;
+import android.os.UserHandle;
+import android.text.format.DateFormat;
+import android.util.IndentingPrintWriter;
+
+import com.android.internal.os.PowerStats;
+
+import java.io.PrintWriter;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * This class represents aggregated power stats for a variety of power components (CPU, WiFi,
+ * etc) covering a specific period of power usage history.
+ */
+class AggregatedPowerStats {
+ private final PowerComponentAggregatedPowerStats[] mPowerComponentStats;
+
+ @CurrentTimeMillisLong
+ private long mStartTime;
+
+ @DurationMillisLong
+ private long mDurationMs;
+
+ AggregatedPowerStats(PowerComponentAggregatedPowerStats... powerComponentAggregatedPowerStats) {
+ this.mPowerComponentStats = powerComponentAggregatedPowerStats;
+ }
+
+ void setStartTime(@CurrentTimeMillisLong long startTime) {
+ mStartTime = startTime;
+ }
+
+ @CurrentTimeMillisLong
+ public long getStartTime() {
+ return mStartTime;
+ }
+
+ void setDuration(long durationMs) {
+ mDurationMs = durationMs;
+ }
+
+ @DurationMillisLong
+ public long getDuration() {
+ return mDurationMs;
+ }
+
+ PowerComponentAggregatedPowerStats getPowerComponentStats(int powerComponentId) {
+ for (PowerComponentAggregatedPowerStats stats : mPowerComponentStats) {
+ if (stats.powerComponentId == powerComponentId) {
+ return stats;
+ }
+ }
+ return null;
+ }
+
+ void setDeviceState(@PowerStatsAggregator.TrackedState int stateId, int state, long time) {
+ for (PowerComponentAggregatedPowerStats stats : mPowerComponentStats) {
+ stats.setState(stateId, state, time);
+ }
+ }
+
+ void setUidState(int uid, @PowerStatsAggregator.TrackedState int stateId, int state,
+ long time) {
+ for (PowerComponentAggregatedPowerStats stats : mPowerComponentStats) {
+ stats.setUidState(uid, stateId, state, time);
+ }
+ }
+
+ boolean isCompatible(PowerStats powerStats) {
+ int powerComponentId = powerStats.descriptor.powerComponentId;
+ for (PowerComponentAggregatedPowerStats stats : mPowerComponentStats) {
+ if (stats.powerComponentId == powerComponentId && !stats.isCompatible(powerStats)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ void addPowerStats(PowerStats powerStats, long time) {
+ int powerComponentId = powerStats.descriptor.powerComponentId;
+ for (PowerComponentAggregatedPowerStats stats : mPowerComponentStats) {
+ if (stats.powerComponentId == powerComponentId) {
+ stats.addPowerStats(powerStats, time);
+ }
+ }
+ }
+
+ void reset() {
+ mStartTime = 0;
+ mDurationMs = 0;
+ for (PowerComponentAggregatedPowerStats stats : mPowerComponentStats) {
+ stats.reset();
+ }
+ }
+
+ void dump(PrintWriter pw) {
+ IndentingPrintWriter ipw = new IndentingPrintWriter(pw);
+ ipw.print("Start time: ");
+ ipw.print(DateFormat.format("yyyy-MM-dd-HH-mm-ss", mStartTime));
+ ipw.print(" duration: ");
+ ipw.print(mDurationMs);
+ ipw.println();
+
+ ipw.println("Device");
+ ipw.increaseIndent();
+ for (PowerComponentAggregatedPowerStats stats : mPowerComponentStats) {
+ stats.dumpDevice(ipw);
+ }
+ ipw.decreaseIndent();
+
+ Set<Integer> uids = new HashSet<>();
+ for (PowerComponentAggregatedPowerStats stats : mPowerComponentStats) {
+ stats.collectUids(uids);
+ }
+
+ Integer[] allUids = uids.toArray(new Integer[uids.size()]);
+ Arrays.sort(allUids);
+ for (int uid : allUids) {
+ ipw.println(UserHandle.formatUid(uid));
+ ipw.increaseIndent();
+ for (PowerComponentAggregatedPowerStats stats : mPowerComponentStats) {
+ stats.dumpUid(ipw, uid);
+ }
+ ipw.decreaseIndent();
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java b/services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java
index d5fd017..f9d57e4 100644
--- a/services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java
+++ b/services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java
@@ -342,20 +342,24 @@
@Override
public Future<?> scheduleCleanupDueToRemovedUser(int userId) {
synchronized (BatteryExternalStatsWorker.this) {
- // Initial quick clean-up after a user removal
- mExecutorService.schedule(() -> {
- synchronized (mStats) {
- mStats.clearRemovedUserUidsLocked(userId);
- }
- }, UID_QUICK_REMOVAL_AFTER_USER_REMOVAL_DELAY_MILLIS, TimeUnit.MILLISECONDS);
+ try {
+ // Initial quick clean-up after a user removal
+ mExecutorService.schedule(() -> {
+ synchronized (mStats) {
+ mStats.clearRemovedUserUidsLocked(userId);
+ }
+ }, UID_QUICK_REMOVAL_AFTER_USER_REMOVAL_DELAY_MILLIS, TimeUnit.MILLISECONDS);
- // Final clean-up after a user removal, to take care of UIDs that were running longer
- // than expected
- return mExecutorService.schedule(() -> {
- synchronized (mStats) {
- mStats.clearRemovedUserUidsLocked(userId);
- }
- }, UID_FINAL_REMOVAL_AFTER_USER_REMOVAL_DELAY_MILLIS, TimeUnit.MILLISECONDS);
+ // Final clean-up after a user removal, to take care of UIDs that were running
+ // longer than expected
+ return mExecutorService.schedule(() -> {
+ synchronized (mStats) {
+ mStats.clearRemovedUserUidsLocked(userId);
+ }
+ }, UID_FINAL_REMOVAL_AFTER_USER_REMOVAL_DELAY_MILLIS, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException e) {
+ return CompletableFuture.failedFuture(e);
+ }
}
}
@@ -386,7 +390,11 @@
}
}
- return mExecutorService.schedule(syncRunnable, delayMillis, TimeUnit.MILLISECONDS);
+ try {
+ return mExecutorService.schedule(syncRunnable, delayMillis, TimeUnit.MILLISECONDS);
+ } catch (RejectedExecutionException e) {
+ return CompletableFuture.failedFuture(e);
+ }
}
public synchronized Future<?> scheduleWrite() {
@@ -397,7 +405,11 @@
scheduleSyncLocked("write", UPDATE_ALL);
// Since we use a single threaded executor, we can assume the next scheduled task's
// Future finishes after the sync.
- return mExecutorService.submit(mWriteTask);
+ try {
+ return mExecutorService.submit(mWriteTask);
+ } catch (RejectedExecutionException e) {
+ return CompletableFuture.failedFuture(e);
+ }
}
/**
@@ -425,7 +437,11 @@
if (mCurrentFuture == null) {
mUpdateFlags = flags;
mCurrentReason = reason;
- mCurrentFuture = mExecutorService.submit(mSyncTask);
+ try {
+ mCurrentFuture = mExecutorService.submit(mSyncTask);
+ } catch (RejectedExecutionException e) {
+ return CompletableFuture.failedFuture(e);
+ }
}
mUpdateFlags |= flags;
return mCurrentFuture;
@@ -683,12 +699,6 @@
BatteryStats.HistoryItem.EVENT_COLLECT_EXTERNAL_STATS,
reason, 0);
- if (energyConsumerDeltas != null && !energyConsumerDeltas.isEmpty()
- && mStats.isUsageHistoryEnabled()) {
- mStats.recordEnergyConsumerDetailsLocked(elapsedRealtime, uptime,
- mEnergyConsumerSnapshot.getEnergyConsumerDetails(energyConsumerDeltas));
- }
-
if ((updateFlags & UPDATE_CPU) != 0) {
if (useLatestStates) {
onBattery = mStats.isOnBatteryLocked();
diff --git a/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java b/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java
index cf4e845..613f189 100644
--- a/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java
+++ b/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java
@@ -125,6 +125,7 @@
import com.android.internal.os.LongArrayMultiStateCounter;
import com.android.internal.os.LongMultiStateCounter;
import com.android.internal.os.PowerProfile;
+import com.android.internal.os.PowerStats;
import com.android.internal.os.RailStats;
import com.android.internal.os.RpmStats;
import com.android.internal.power.EnergyConsumerStats;
@@ -135,6 +136,7 @@
import com.android.modules.utils.TypedXmlPullParser;
import com.android.modules.utils.TypedXmlSerializer;
import com.android.net.module.util.NetworkCapabilitiesUtils;
+import com.android.server.power.optimization.Flags;
import com.android.server.power.stats.SystemServerCpuThreadReader.SystemServiceCpuThreadTimes;
import libcore.util.EmptyArray;
@@ -280,7 +282,8 @@
= new KernelMemoryBandwidthStats();
private final LongSparseArray<SamplingTimer> mKernelMemoryStats = new LongSparseArray<>();
private int[] mCpuPowerBracketMap;
- private final CpuUsageDetails mCpuUsageDetails = new CpuUsageDetails();
+ private final CpuPowerStatsCollector mCpuPowerStatsCollector;
+ private final PowerStatsAggregator mPowerStatsAggregator;
public LongSparseArray<SamplingTimer> getKernelMemoryStats() {
return mKernelMemoryStats;
@@ -439,6 +442,7 @@
static final int RESET_ON_UNPLUG_AFTER_SIGNIFICANT_CHARGE_FLAG = 1 << 1;
private final int mFlags;
+ private final long mPowerStatsThrottlePeriodCpu;
private BatteryStatsConfig(Builder builder) {
int flags = 0;
@@ -449,6 +453,7 @@
flags |= RESET_ON_UNPLUG_AFTER_SIGNIFICANT_CHARGE_FLAG;
}
mFlags = flags;
+ mPowerStatsThrottlePeriodCpu = builder.mPowerStatsThrottlePeriodCpu;
}
/**
@@ -469,15 +474,22 @@
== RESET_ON_UNPLUG_AFTER_SIGNIFICANT_CHARGE_FLAG;
}
+ long getPowerStatsThrottlePeriodCpu() {
+ return mPowerStatsThrottlePeriodCpu;
+ }
+
/**
* Builder for BatteryStatsConfig
*/
public static class Builder {
private boolean mResetOnUnplugHighBatteryLevel;
private boolean mResetOnUnplugAfterSignificantCharge;
+ private long mPowerStatsThrottlePeriodCpu;
+
public Builder() {
mResetOnUnplugHighBatteryLevel = true;
mResetOnUnplugAfterSignificantCharge = true;
+ mPowerStatsThrottlePeriodCpu = 60000;
}
/**
@@ -504,8 +516,16 @@
mResetOnUnplugAfterSignificantCharge = reset;
return this;
}
- }
+ /**
+ * Sets the minimum amount of time (in millis) to wait between passes
+ * of CPU power stats collection.
+ */
+ public Builder setPowerStatsThrottlePeriodCpu(long periodMs) {
+ mPowerStatsThrottlePeriodCpu = periodMs;
+ return this;
+ }
+ }
}
private final PlatformIdleStateCallback mPlatformIdleStateCallback;
@@ -595,15 +615,8 @@
LongArrayMultiStateCounter onBatteryScreenOffCounter =
u.getProcStateScreenOffTimeCounter(elapsedRealtimeMs).getCounter();
- if (isUsageHistoryEnabled()) {
- LongArrayMultiStateCounter.LongArrayContainer deltaContainer =
- getCpuTimeInFreqContainer();
- mKernelSingleUidTimeReader.addDelta(uid, onBatteryCounter, elapsedRealtimeMs,
- deltaContainer);
- recordCpuUsage(uid, deltaContainer, elapsedRealtimeMs, uptimeMs);
- } else {
- mKernelSingleUidTimeReader.addDelta(uid, onBatteryCounter, elapsedRealtimeMs);
- }
+
+ mKernelSingleUidTimeReader.addDelta(uid, onBatteryCounter, elapsedRealtimeMs);
mKernelSingleUidTimeReader.addDelta(uid, onBatteryScreenOffCounter, elapsedRealtimeMs);
if (u.mChildUids != null) {
@@ -617,25 +630,12 @@
mKernelSingleUidTimeReader.addDelta(u.mChildUids.keyAt(j),
cpuTimeInFreqCounter, elapsedRealtimeMs, deltaContainer);
onBatteryCounter.addCounts(deltaContainer);
- if (isUsageHistoryEnabled()) {
- recordCpuUsage(uid, deltaContainer, elapsedRealtimeMs, uptimeMs);
- }
onBatteryScreenOffCounter.addCounts(deltaContainer);
}
}
}
}
- private void recordCpuUsage(int uid, LongArrayMultiStateCounter.LongArrayContainer cpuUsage,
- long elapsedRealtimeMs, long uptimeMs) {
- if (!cpuUsage.combineValues(mCpuUsageDetails.cpuUsageMs, mCpuPowerBracketMap)) {
- return;
- }
-
- mCpuUsageDetails.uid = uid;
- mHistory.recordCpuUsage(elapsedRealtimeMs, uptimeMs, mCpuUsageDetails);
- }
-
/**
* Removes kernel CPU stats for removed UIDs, in the order they were added to the
* mPendingRemovedUids queue.
@@ -656,6 +656,10 @@
*/
@SuppressWarnings("GuardedBy") // errorprone false positive on getProcStateTimeCounter
public void updateCpuTimesForAllUids() {
+ if (mCpuPowerStatsCollector != null) {
+ mCpuPowerStatsCollector.schedule();
+ }
+
synchronized (BatteryStatsImpl.this) {
if (!trackPerProcStateCpuTimes()) {
return;
@@ -687,16 +691,8 @@
u.getProcStateScreenOffTimeCounter(elapsedRealtimeMs).getCounter();
if (uid == parentUid || Process.isSdkSandboxUid(uid)) {
- if (isUsageHistoryEnabled()) {
- LongArrayMultiStateCounter.LongArrayContainer deltaContainer =
- getCpuTimeInFreqContainer();
- mKernelSingleUidTimeReader.addDelta(parentUid, onBatteryCounter,
- elapsedRealtimeMs, deltaContainer);
- recordCpuUsage(parentUid, deltaContainer, elapsedRealtimeMs, uptimeMs);
- } else {
- mKernelSingleUidTimeReader.addDelta(parentUid, onBatteryCounter,
- elapsedRealtimeMs);
- }
+ mKernelSingleUidTimeReader.addDelta(parentUid, onBatteryCounter,
+ elapsedRealtimeMs);
mKernelSingleUidTimeReader.addDelta(parentUid, onBatteryScreenOffCounter,
elapsedRealtimeMs);
} else {
@@ -709,9 +705,6 @@
mKernelSingleUidTimeReader.addDelta(uid, counter, elapsedRealtimeMs,
deltaContainer);
onBatteryCounter.addCounts(deltaContainer);
- if (isUsageHistoryEnabled()) {
- recordCpuUsage(uid, deltaContainer, elapsedRealtimeMs, uptimeMs);
- }
onBatteryScreenOffCounter.addCounts(deltaContainer);
}
}
@@ -842,6 +835,8 @@
private final HistoryEventTracker mActiveEvents = new HistoryEventTracker();
private final HistoryStepDetailsCalculatorImpl mStepDetailsCalculator =
new HistoryStepDetailsCalculatorImpl();
+ private final PowerStats.DescriptorRegistry mPowerStatsDescriptorRegistry =
+ new PowerStats.DescriptorRegistry();
private boolean mHaveBatteryLevel = false;
private boolean mBatteryPluggedIn;
@@ -1556,7 +1551,7 @@
@VisibleForTesting
@GuardedBy("this")
- protected BatteryStatsConfig mBatteryStatsConfig = new BatteryStatsConfig.Builder().build();
+ protected BatteryStatsConfig mBatteryStatsConfig;
@GuardedBy("this")
private AlarmManager mAlarmManager = null;
@@ -1733,6 +1728,7 @@
public BatteryStatsImpl(Clock clock, File historyDirectory) {
init(clock);
+ mBatteryStatsConfig = new BatteryStatsConfig.Builder().build();
mHandler = null;
mConstants = new Constants(mHandler);
mStartClockTimeMs = clock.currentTimeMillis();
@@ -1751,6 +1747,8 @@
mPlatformIdleStateCallback = null;
mEnergyConsumerRetriever = null;
mUserInfoProvider = null;
+ mCpuPowerStatsCollector = null;
+ mPowerStatsAggregator = null;
}
private void init(Clock clock) {
@@ -4383,6 +4381,12 @@
public void noteCurrentTimeChangedLocked(long currentTimeMs,
long elapsedRealtimeMs, long uptimeMs) {
mHistory.recordCurrentTimeChange(elapsedRealtimeMs, uptimeMs, currentTimeMs);
+ adjustStartClockTime(currentTimeMs);
+ }
+
+ private void adjustStartClockTime(long currentTimeMs) {
+ mStartClockTimeMs =
+ currentTimeMs - (mClock.elapsedRealtime() - (mRealtimeStartUs / 1000));
}
@GuardedBy("this")
@@ -7654,18 +7658,6 @@
return names;
}
- /**
- * Adds energy consumer delta to battery history.
- */
- @GuardedBy("this")
- public void recordEnergyConsumerDetailsLocked(long elapsedRealtimeMs,
- long uptimeMs, EnergyConsumerDetails energyConsumerDetails) {
- if (isUsageHistoryEnabled()) {
- mHistory.recordEnergyConsumerDetails(elapsedRealtimeMs, uptimeMs,
- energyConsumerDetails);
- }
- }
-
@GuardedBy("this")
@Override public long getStartClockTime() {
final long currentTimeMs = mClock.currentTimeMillis();
@@ -7676,9 +7668,8 @@
// the previous time was completely bogus. So we are going to figure out a
// new time based on how much time has elapsed since we started counting.
mHistory.recordCurrentTimeChange(mClock.elapsedRealtime(), mClock.uptimeMillis(),
- currentTimeMs
- );
- return currentTimeMs - (mClock.elapsedRealtime() - (mRealtimeStartUs / 1000));
+ currentTimeMs);
+ adjustStartClockTime(currentTimeMs);
}
return mStartClockTimeMs;
}
@@ -10569,6 +10560,10 @@
final int batteryConsumerProcessState =
mapUidProcessStateToBatteryConsumerProcessState(uidRunningState);
+ if (mBsi.mSystemReady && Flags.streamlinedBatteryStats()) {
+ mBsi.mHistory.recordProcessStateChange(elapsedRealtimeMs, uptimeMs, mUid,
+ batteryConsumerProcessState);
+ }
getCpuActiveTimeCounter().setState(batteryConsumerProcessState, elapsedRealtimeMs);
getMobileRadioActiveTimeCounter()
@@ -10911,21 +10906,23 @@
return mTmpCpuTimeInFreq;
}
- public BatteryStatsImpl(@Nullable File systemDir, @NonNull Handler handler,
- @Nullable PlatformIdleStateCallback cb, @Nullable EnergyStatsRetriever energyStatsCb,
- @NonNull UserInfoProvider userInfoProvider, @NonNull PowerProfile powerProfile,
- @NonNull CpuScalingPolicies cpuScalingPolicies) {
- this(Clock.SYSTEM_CLOCK, systemDir, handler, cb, energyStatsCb, userInfoProvider,
- powerProfile, cpuScalingPolicies);
- }
-
- private BatteryStatsImpl(@NonNull Clock clock, @Nullable File systemDir,
+ public BatteryStatsImpl(@NonNull BatteryStatsConfig config, @Nullable File systemDir,
@NonNull Handler handler, @Nullable PlatformIdleStateCallback cb,
@Nullable EnergyStatsRetriever energyStatsCb,
@NonNull UserInfoProvider userInfoProvider, @NonNull PowerProfile powerProfile,
@NonNull CpuScalingPolicies cpuScalingPolicies) {
+ this(config, Clock.SYSTEM_CLOCK, systemDir, handler, cb, energyStatsCb, userInfoProvider,
+ powerProfile, cpuScalingPolicies);
+ }
+
+ private BatteryStatsImpl(@NonNull BatteryStatsConfig config, @NonNull Clock clock,
+ @Nullable File systemDir, @NonNull Handler handler,
+ @Nullable PlatformIdleStateCallback cb, @Nullable EnergyStatsRetriever energyStatsCb,
+ @NonNull UserInfoProvider userInfoProvider, @NonNull PowerProfile powerProfile,
+ @NonNull CpuScalingPolicies cpuScalingPolicies) {
init(clock);
+ mBatteryStatsConfig = config;
mHandler = new MyHandler(handler.getLooper());
mConstants = new Constants(mHandler);
@@ -10947,6 +10944,23 @@
mHistory = new BatteryStatsHistory(systemDir, mConstants.MAX_HISTORY_FILES,
mConstants.MAX_HISTORY_BUFFER, mStepDetailsCalculator, mClock);
}
+
+ mCpuPowerStatsCollector = new CpuPowerStatsCollector(mCpuScalingPolicies, mPowerProfile,
+ mHandler, mBatteryStatsConfig.getPowerStatsThrottlePeriodCpu());
+ mCpuPowerStatsCollector.addConsumer(this::recordPowerStats);
+
+ PowerStatsAggregator.Builder builder = new PowerStatsAggregator.Builder(mHistory);
+ builder.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_CPU)
+ .trackDeviceStates(
+ PowerStatsAggregator.STATE_POWER,
+ PowerStatsAggregator.STATE_SCREEN)
+ .trackUidStates(
+ PowerStatsAggregator.STATE_POWER,
+ PowerStatsAggregator.STATE_SCREEN,
+ PowerStatsAggregator.STATE_PROCESS_STATE);
+
+ mPowerStatsAggregator = builder.build();
+
mStartCount++;
initTimersAndCounters();
mOnBattery = mOnBatteryInternal = false;
@@ -10965,6 +10979,14 @@
FrameworkStatsLog.write(FrameworkStatsLog.DEVICE_IDLE_MODE_STATE_CHANGED, mDeviceIdleMode);
}
+ private void recordPowerStats(PowerStats stats) {
+ if (stats.durationMs > 0) {
+ synchronized (this) {
+ mHistory.recordPowerStats(mClock.elapsedRealtime(), mClock.uptimeMillis(), stats);
+ }
+ }
+ }
+
@VisibleForTesting
protected void initTimersAndCounters() {
mScreenOnTimer = new StopwatchTimer(mClock, null, -1, null, mOnBatteryTimeBase);
@@ -11074,14 +11096,6 @@
}
}
- int cpuPowerBracketCount = mPowerProfile.getCpuPowerBracketCount();
- mCpuUsageDetails.cpuBracketDescriptions = new String[cpuPowerBracketCount];
- mCpuUsageDetails.cpuUsageMs = new long[cpuPowerBracketCount];
- for (int i = 0; i < cpuPowerBracketCount; i++) {
- mCpuUsageDetails.cpuBracketDescriptions[i] =
- mPowerProfile.getCpuPowerBracketDescription(mCpuScalingPolicies, i);
- }
-
if (mEstimatedBatteryCapacityMah == -1) {
// Initialize the estimated battery capacity to a known preset one.
mEstimatedBatteryCapacityMah = (int) mPowerProfile.getBatteryCapacity();
@@ -11095,15 +11109,6 @@
}
/**
- * Injects BatteryStatsConfig
- */
- public void setBatteryStatsConfig(BatteryStatsConfig config) {
- synchronized (this) {
- mBatteryStatsConfig = config;
- }
- }
-
- /**
* Starts tracking CPU time-in-state for threads of the system server process,
* keeping a separate account of threads receiving incoming binder calls.
*/
@@ -11466,8 +11471,9 @@
* Creates an iterator for battery stats history.
*/
@Override
- public BatteryStatsHistoryIterator iterateBatteryStatsHistory() {
- return mHistory.copy().iterate();
+ public BatteryStatsHistoryIterator iterateBatteryStatsHistory(long startTimeMs,
+ long endTimeMs) {
+ return mHistory.copy().iterate(startTimeMs, endTimeMs);
}
@Override
@@ -14197,6 +14203,9 @@
if (mCpuUidFreqTimeReader != null) {
mCpuUidFreqTimeReader.onSystemReady();
}
+ if (mCpuPowerStatsCollector != null) {
+ mCpuPowerStatsCollector.onSystemReady();
+ }
mSystemReady = true;
}
@@ -15213,11 +15222,6 @@
}
@GuardedBy("this")
- boolean isUsageHistoryEnabled() {
- return mConstants.RECORD_USAGE_HISTORY;
- }
-
- @GuardedBy("this")
public void systemServicesReady(Context context) {
mConstants.startObserving(context.getContentResolver());
registerUsbStateReceiver(context);
@@ -15328,8 +15332,6 @@
public static final String KEY_MAX_HISTORY_BUFFER_KB = "max_history_buffer_kb";
public static final String KEY_BATTERY_CHARGED_DELAY_MS =
"battery_charged_delay_ms";
- public static final String KEY_RECORD_USAGE_HISTORY =
- "record_usage_history";
public static final String KEY_PER_UID_MODEM_POWER_MODEL =
"per_uid_modem_power_model";
public static final String KEY_PHONE_ON_EXTERNAL_STATS_COLLECTION =
@@ -15380,7 +15382,6 @@
private static final int DEFAULT_MAX_HISTORY_FILES_LOW_RAM_DEVICE = 64;
private static final int DEFAULT_MAX_HISTORY_BUFFER_LOW_RAM_DEVICE_KB = 64; /*Kilo Bytes*/
private static final int DEFAULT_BATTERY_CHARGED_DELAY_MS = 900000; /* 15 min */
- private static final boolean DEFAULT_RECORD_USAGE_HISTORY = false;
@PerUidModemPowerModel
private static final int DEFAULT_PER_UID_MODEM_MODEL =
PER_UID_MODEM_POWER_MODEL_MODEM_ACTIVITY_INFO_RX_TX;
@@ -15402,7 +15403,6 @@
public int MAX_HISTORY_FILES;
public int MAX_HISTORY_BUFFER; /*Bytes*/
public int BATTERY_CHARGED_DELAY_MS = DEFAULT_BATTERY_CHARGED_DELAY_MS;
- public boolean RECORD_USAGE_HISTORY = DEFAULT_RECORD_USAGE_HISTORY;
public int PER_UID_MODEM_MODEL = DEFAULT_PER_UID_MODEM_MODEL;
public boolean PHONE_ON_EXTERNAL_STATS_COLLECTION =
DEFAULT_PHONE_ON_EXTERNAL_STATS_COLLECTION;
@@ -15483,8 +15483,6 @@
DEFAULT_MAX_HISTORY_BUFFER_LOW_RAM_DEVICE_KB
: DEFAULT_MAX_HISTORY_BUFFER_KB)
* 1024;
- RECORD_USAGE_HISTORY = mParser.getBoolean(
- KEY_RECORD_USAGE_HISTORY, DEFAULT_RECORD_USAGE_HISTORY);
final String perUidModemModel = mParser.getString(KEY_PER_UID_MODEM_POWER_MODEL,
"");
PER_UID_MODEM_MODEL = getPerUidModemModel(perUidModemModel);
@@ -15562,8 +15560,6 @@
pw.println(MAX_HISTORY_BUFFER/1024);
pw.print(KEY_BATTERY_CHARGED_DELAY_MS); pw.print("=");
pw.println(BATTERY_CHARGED_DELAY_MS);
- pw.print(KEY_RECORD_USAGE_HISTORY); pw.print("=");
- pw.println(RECORD_USAGE_HISTORY);
pw.print(KEY_PER_UID_MODEM_POWER_MODEL); pw.print("=");
pw.println(getPerUidModemModelName(PER_UID_MODEM_MODEL));
pw.print(KEY_PHONE_ON_EXTERNAL_STATS_COLLECTION); pw.print("=");
@@ -15705,6 +15701,21 @@
iPw.decreaseIndent();
}
+ /**
+ * Grabs one sample of PowerStats and prints it.
+ */
+ public void dumpStatsSample(PrintWriter pw) {
+ mCpuPowerStatsCollector.collectAndDump(pw);
+ }
+
+ /**
+ * Aggregates power stats between the specified times and prints them.
+ */
+ public void dumpAggregatedStats(PrintWriter pw, long startTimeMs, long endTimeMs) {
+ mPowerStatsAggregator.aggregateBatteryStats(startTimeMs, endTimeMs,
+ stats-> stats.dump(pw));
+ }
+
private final Runnable mWriteAsyncRunnable = () -> {
synchronized (BatteryStatsImpl.this) {
writeSyncLocked();
diff --git a/services/core/java/com/android/server/power/stats/CpuAggregatedPowerStats.java b/services/core/java/com/android/server/power/stats/CpuAggregatedPowerStats.java
new file mode 100644
index 0000000..5b3fe06
--- /dev/null
+++ b/services/core/java/com/android/server/power/stats/CpuAggregatedPowerStats.java
@@ -0,0 +1,29 @@
+/*
+ * 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.server.power.stats;
+
+import android.os.BatteryConsumer;
+
+import com.android.internal.os.MultiStateStats;
+
+class CpuAggregatedPowerStats extends PowerComponentAggregatedPowerStats {
+
+ CpuAggregatedPowerStats(MultiStateStats.States[] deviceStates,
+ MultiStateStats.States[] uidStates) {
+ super(BatteryConsumer.POWER_COMPONENT_CPU, deviceStates, uidStates);
+ }
+}
diff --git a/services/core/java/com/android/server/power/stats/CpuPowerStatsCollector.java b/services/core/java/com/android/server/power/stats/CpuPowerStatsCollector.java
new file mode 100644
index 0000000..376ca89
--- /dev/null
+++ b/services/core/java/com/android/server/power/stats/CpuPowerStatsCollector.java
@@ -0,0 +1,140 @@
+/*
+ * 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.server.power.stats;
+
+import android.os.BatteryConsumer;
+import android.os.Handler;
+import android.os.PersistableBundle;
+import android.util.SparseArray;
+
+import com.android.internal.annotations.Keep;
+import com.android.internal.annotations.VisibleForNative;
+import com.android.internal.os.Clock;
+import com.android.internal.os.CpuScalingPolicies;
+import com.android.internal.os.PowerProfile;
+import com.android.internal.os.PowerStats;
+import com.android.server.power.optimization.Flags;
+
+/**
+ * Collects snapshots of power-related system statistics.
+ * <p>
+ * The class is intended to be used in a serialized fashion using the handler supplied in the
+ * constructor. Thus the object is not thread-safe except where noted.
+ */
+public class CpuPowerStatsCollector extends PowerStatsCollector {
+ private static final long NANOS_PER_MILLIS = 1000000;
+
+ private final KernelCpuStatsReader mKernelCpuStatsReader;
+ private final int[] mScalingStepToPowerBracketMap;
+ private final long[] mTempUidStats;
+ private final SparseArray<UidStats> mUidStats = new SparseArray<>();
+ private final int mUidStatsSize;
+ // Reusable instance
+ private final PowerStats mCpuPowerStats;
+ private long mLastUpdateTimestampNanos;
+
+ public CpuPowerStatsCollector(CpuScalingPolicies cpuScalingPolicies, PowerProfile powerProfile,
+ Handler handler, long throttlePeriodMs) {
+ this(cpuScalingPolicies, powerProfile, handler, new KernelCpuStatsReader(),
+ throttlePeriodMs, Clock.SYSTEM_CLOCK);
+ }
+
+ public CpuPowerStatsCollector(CpuScalingPolicies cpuScalingPolicies, PowerProfile powerProfile,
+ Handler handler, KernelCpuStatsReader kernelCpuStatsReader,
+ long throttlePeriodMs, Clock clock) {
+ super(handler, throttlePeriodMs, clock);
+ mKernelCpuStatsReader = kernelCpuStatsReader;
+
+ int scalingStepCount = cpuScalingPolicies.getScalingStepCount();
+ mScalingStepToPowerBracketMap = new int[scalingStepCount];
+ int index = 0;
+ for (int policy : cpuScalingPolicies.getPolicies()) {
+ int[] frequencies = cpuScalingPolicies.getFrequencies(policy);
+ for (int step = 0; step < frequencies.length; step++) {
+ int bracket = powerProfile.getCpuPowerBracketForScalingStep(policy, step);
+ mScalingStepToPowerBracketMap[index++] = bracket;
+ }
+ }
+ mUidStatsSize = powerProfile.getCpuPowerBracketCount();
+ mTempUidStats = new long[mUidStatsSize];
+
+ mCpuPowerStats = new PowerStats(
+ new PowerStats.Descriptor(BatteryConsumer.POWER_COMPONENT_CPU, 0, mUidStatsSize,
+ new PersistableBundle()));
+ }
+
+ /**
+ * Initializes the collector during the boot sequence.
+ */
+ public void onSystemReady() {
+ setEnabled(Flags.streamlinedBatteryStats());
+ }
+
+ @Override
+ protected PowerStats collectStats() {
+ mCpuPowerStats.uidStats.clear();
+ long newTimestampNanos = mKernelCpuStatsReader.nativeReadCpuStats(
+ this::processUidStats, mScalingStepToPowerBracketMap, mLastUpdateTimestampNanos,
+ mTempUidStats);
+ mCpuPowerStats.durationMs =
+ (newTimestampNanos - mLastUpdateTimestampNanos) / NANOS_PER_MILLIS;
+ mLastUpdateTimestampNanos = newTimestampNanos;
+ return mCpuPowerStats;
+ }
+
+ @VisibleForNative
+ interface KernelCpuStatsCallback {
+ @Keep // Called from native
+ void processUidStats(int uid, long[] stats);
+ }
+
+ private void processUidStats(int uid, long[] stats) {
+ UidStats uidStats = mUidStats.get(uid);
+ if (uidStats == null) {
+ uidStats = new UidStats();
+ uidStats.stats = new long[mUidStatsSize];
+ uidStats.delta = new long[mUidStatsSize];
+ mUidStats.put(uid, uidStats);
+ }
+
+ boolean nonzero = false;
+ for (int i = mUidStatsSize - 1; i >= 0; i--) {
+ long delta = uidStats.delta[i] = stats[i] - uidStats.stats[i];
+ if (delta != 0) {
+ nonzero = true;
+ }
+ uidStats.stats[i] = stats[i];
+ }
+ if (nonzero) {
+ mCpuPowerStats.uidStats.put(uid, uidStats.delta);
+ }
+ }
+
+ /**
+ * Native class that retrieves CPU stats from the kernel.
+ */
+ public static class KernelCpuStatsReader {
+ protected native long nativeReadCpuStats(KernelCpuStatsCallback callback,
+ int[] scalingStepToPowerBracketMap, long lastUpdateTimestampNanos,
+ long[] tempForUidStats);
+ }
+
+ private static class UidStats {
+ public long[] stats;
+ public long[] delta;
+ }
+}
diff --git a/services/core/java/com/android/server/power/stats/EnergyConsumerSnapshot.java b/services/core/java/com/android/server/power/stats/EnergyConsumerSnapshot.java
index 939a08b..7f50ae0 100644
--- a/services/core/java/com/android/server/power/stats/EnergyConsumerSnapshot.java
+++ b/services/core/java/com/android/server/power/stats/EnergyConsumerSnapshot.java
@@ -23,7 +23,6 @@
import android.hardware.power.stats.EnergyConsumerAttribution;
import android.hardware.power.stats.EnergyConsumerResult;
import android.hardware.power.stats.EnergyConsumerType;
-import android.os.BatteryStats.EnergyConsumerDetails;
import android.util.Slog;
import android.util.SparseArray;
import android.util.SparseIntArray;
@@ -85,8 +84,6 @@
*/
private final SparseArray<SparseLongArray> mAttributionSnapshots;
- private EnergyConsumerDetails mEnergyConsumerDetails;
-
/**
* Constructor that initializes to the given id->EnergyConsumer map, indicating which consumers
* exist and what their details are.
@@ -423,122 +420,4 @@
// since the last snapshot. Round off to the nearest whole long.
return (deltaEnergyUJ * MILLIVOLTS_PER_VOLT + (avgVoltageMV / 2)) / avgVoltageMV;
}
-
- /**
- * Converts the EnergyConsumerDeltaData object to EnergyConsumerDetails, which can
- * be saved in battery history.
- */
- EnergyConsumerDetails getEnergyConsumerDetails(
- EnergyConsumerDeltaData delta) {
- if (mEnergyConsumerDetails == null) {
- mEnergyConsumerDetails = createEnergyConsumerDetails();
- }
-
- final long[] chargeUC = mEnergyConsumerDetails.chargeUC;
- for (int i = 0; i < mEnergyConsumerDetails.consumers.length; i++) {
- EnergyConsumerDetails.EnergyConsumer energyConsumer =
- mEnergyConsumerDetails.consumers[i];
- switch (energyConsumer.type) {
- case EnergyConsumerType.BLUETOOTH:
- chargeUC[i] = delta.bluetoothChargeUC;
- break;
- case EnergyConsumerType.CPU_CLUSTER:
- if (delta.cpuClusterChargeUC != null) {
- chargeUC[i] = delta.cpuClusterChargeUC[energyConsumer.ordinal];
- } else {
- chargeUC[i] = UNAVAILABLE;
- }
- break;
- case EnergyConsumerType.DISPLAY:
- if (delta.displayChargeUC != null) {
- chargeUC[i] = delta.displayChargeUC[energyConsumer.ordinal];
- } else {
- chargeUC[i] = UNAVAILABLE;
- }
- break;
- case EnergyConsumerType.GNSS:
- chargeUC[i] = delta.gnssChargeUC;
- break;
- case EnergyConsumerType.MOBILE_RADIO:
- chargeUC[i] = delta.mobileRadioChargeUC;
- break;
- case EnergyConsumerType.WIFI:
- chargeUC[i] = delta.wifiChargeUC;
- break;
- case EnergyConsumerType.CAMERA:
- chargeUC[i] = delta.cameraChargeUC;
- break;
- case EnergyConsumerType.OTHER:
- if (delta.otherTotalChargeUC != null) {
- chargeUC[i] = delta.otherTotalChargeUC[energyConsumer.ordinal];
- } else {
- chargeUC[i] = UNAVAILABLE;
- }
- break;
- default:
- chargeUC[i] = UNAVAILABLE;
- break;
- }
- }
- return mEnergyConsumerDetails;
- }
-
- private EnergyConsumerDetails createEnergyConsumerDetails() {
- EnergyConsumerDetails details = new EnergyConsumerDetails();
- details.consumers =
- new EnergyConsumerDetails.EnergyConsumer[mEnergyConsumers.size()];
- for (int i = 0; i < mEnergyConsumers.size(); i++) {
- EnergyConsumer energyConsumer = mEnergyConsumers.valueAt(i);
- EnergyConsumerDetails.EnergyConsumer consumer =
- new EnergyConsumerDetails.EnergyConsumer();
- consumer.type = energyConsumer.type;
- consumer.ordinal = energyConsumer.ordinal;
- switch (consumer.type) {
- case EnergyConsumerType.BLUETOOTH:
- consumer.name = "BLUETOOTH";
- break;
- case EnergyConsumerType.CPU_CLUSTER:
- consumer.name = "CPU";
- break;
- case EnergyConsumerType.DISPLAY:
- consumer.name = "DISPLAY";
- break;
- case EnergyConsumerType.GNSS:
- consumer.name = "GNSS";
- break;
- case EnergyConsumerType.MOBILE_RADIO:
- consumer.name = "MOBILE_RADIO";
- break;
- case EnergyConsumerType.WIFI:
- consumer.name = "WIFI";
- break;
- case EnergyConsumerType.OTHER:
- consumer.name = sanitizeCustomBucketName(energyConsumer.name);
- break;
- default:
- consumer.name = "UNKNOWN";
- break;
- }
- if (consumer.type != EnergyConsumerType.OTHER) {
- boolean hasOrdinal = consumer.ordinal != 0;
- if (!hasOrdinal) {
- // See if any other EnergyConsumer of the same type has an ordinal
- for (int j = 0; j < mEnergyConsumers.size(); j++) {
- EnergyConsumer aConsumer = mEnergyConsumers.valueAt(j);
- if (aConsumer.type == consumer.type && aConsumer.ordinal != 0) {
- hasOrdinal = true;
- break;
- }
- }
- }
- if (hasOrdinal) {
- consumer.name = consumer.name + "/" + energyConsumer.ordinal;
- }
- }
- details.consumers[i] = consumer;
- }
-
- details.chargeUC = new long[details.consumers.length];
- return details;
- }
}
diff --git a/services/core/java/com/android/server/power/stats/PowerComponentAggregatedPowerStats.java b/services/core/java/com/android/server/power/stats/PowerComponentAggregatedPowerStats.java
new file mode 100644
index 0000000..686268f
--- /dev/null
+++ b/services/core/java/com/android/server/power/stats/PowerComponentAggregatedPowerStats.java
@@ -0,0 +1,232 @@
+/*
+ * 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.server.power.stats;
+
+import android.util.IndentingPrintWriter;
+import android.util.SparseArray;
+
+import com.android.internal.os.MultiStateStats;
+import com.android.internal.os.PowerStats;
+
+import java.util.Collection;
+
+/**
+ * Aggregated power stats for a specific power component (e.g. CPU, WiFi, etc). This class
+ * treats stats as arrays of nonspecific longs. Subclasses contain specific logic to interpret those
+ * longs and use them for calculations such as power attribution. They may use meta-data supplied
+ * as part of the {@link PowerStats.Descriptor}.
+ */
+class PowerComponentAggregatedPowerStats {
+ public final int powerComponentId;
+ private final MultiStateStats.States[] mDeviceStateConfig;
+ private final MultiStateStats.States[] mUidStateConfig;
+ private final int[] mDeviceStates;
+ private final long[] mDeviceStateTimestamps;
+
+ private MultiStateStats.Factory mStatsFactory;
+ private MultiStateStats.Factory mUidStatsFactory;
+ private PowerStats.Descriptor mPowerStatsDescriptor;
+ private MultiStateStats mDeviceStats;
+ private final SparseArray<UidStats> mUidStats = new SparseArray<>();
+
+ private static class UidStats {
+ public int[] states;
+ public long[] stateTimestampMs;
+ public MultiStateStats stats;
+ }
+
+ PowerComponentAggregatedPowerStats(int powerComponentId,
+ MultiStateStats.States[] deviceStates,
+ MultiStateStats.States[] uidStates) {
+ this.powerComponentId = powerComponentId;
+ mDeviceStateConfig = deviceStates;
+ mUidStateConfig = uidStates;
+ mDeviceStates = new int[mDeviceStateConfig.length];
+ mDeviceStateTimestamps = new long[mDeviceStateConfig.length];
+ }
+
+ void setState(@PowerStatsAggregator.TrackedState int stateId, int state, long time) {
+ mDeviceStates[stateId] = state;
+ mDeviceStateTimestamps[stateId] = time;
+
+ if (mDeviceStateConfig[stateId].isTracked()) {
+ if (mDeviceStats != null || createDeviceStats()) {
+ mDeviceStats.setState(stateId, state, time);
+ }
+ }
+
+ if (mUidStateConfig[stateId].isTracked()) {
+ for (int i = mUidStats.size() - 1; i >= 0; i--) {
+ PowerComponentAggregatedPowerStats.UidStats uidStats = mUidStats.valueAt(i);
+ if (uidStats.stats != null || createUidStats(uidStats)) {
+ uidStats.stats.setState(stateId, state, time);
+ }
+ }
+ }
+ }
+
+ void setUidState(int uid, @PowerStatsAggregator.TrackedState int stateId, int state,
+ long time) {
+ if (!mUidStateConfig[stateId].isTracked()) {
+ return;
+ }
+
+ UidStats uidStats = getUidStats(uid);
+ uidStats.states[stateId] = state;
+ uidStats.stateTimestampMs[stateId] = time;
+
+ if (uidStats.stats != null || createUidStats(uidStats)) {
+ uidStats.stats.setState(stateId, state, time);
+ }
+ }
+
+ boolean isCompatible(PowerStats powerStats) {
+ return mPowerStatsDescriptor == null || mPowerStatsDescriptor.equals(powerStats.descriptor);
+ }
+
+ void addPowerStats(PowerStats powerStats, long timestampMs) {
+ mPowerStatsDescriptor = powerStats.descriptor;
+
+ if (mDeviceStats == null) {
+ if (mStatsFactory == null) {
+ mStatsFactory = new MultiStateStats.Factory(
+ mPowerStatsDescriptor.statsArrayLength, mDeviceStateConfig);
+ mUidStatsFactory = new MultiStateStats.Factory(
+ mPowerStatsDescriptor.uidStatsArrayLength, mUidStateConfig);
+ }
+
+ createDeviceStats();
+ }
+
+ mDeviceStats.increment(powerStats.stats, timestampMs);
+
+ for (int i = powerStats.uidStats.size() - 1; i >= 0; i--) {
+ int uid = powerStats.uidStats.keyAt(i);
+ PowerComponentAggregatedPowerStats.UidStats uidStats = getUidStats(uid);
+ if (uidStats.stats == null) {
+ createUidStats(uidStats);
+ }
+ uidStats.stats.increment(powerStats.uidStats.valueAt(i), timestampMs);
+ }
+ }
+
+ void reset() {
+ mPowerStatsDescriptor = null;
+ mStatsFactory = null;
+ mUidStatsFactory = null;
+ mDeviceStats = null;
+ for (int i = mUidStats.size() - 1; i >= 0; i--) {
+ mUidStats.valueAt(i).stats = null;
+ }
+ }
+
+ private UidStats getUidStats(int uid) {
+ // TODO(b/292247660): map isolated and sandbox UIDs
+ UidStats uidStats = mUidStats.get(uid);
+ if (uidStats == null) {
+ uidStats = new UidStats();
+ uidStats.states = new int[mUidStateConfig.length];
+ uidStats.stateTimestampMs = new long[mUidStateConfig.length];
+ mUidStats.put(uid, uidStats);
+ }
+ return uidStats;
+ }
+
+ void collectUids(Collection<Integer> uids) {
+ for (int i = mUidStats.size() - 1; i >= 0; i--) {
+ if (mUidStats.valueAt(i).stats != null) {
+ uids.add(mUidStats.keyAt(i));
+ }
+ }
+ }
+
+ boolean getDeviceStats(long[] outValues, int[] deviceStates) {
+ if (deviceStates.length != mDeviceStateConfig.length) {
+ throw new IllegalArgumentException(
+ "Invalid number of tracked states: " + deviceStates.length
+ + " expected: " + mDeviceStateConfig.length);
+ }
+ if (mDeviceStats != null) {
+ mDeviceStats.getStats(outValues, deviceStates);
+ return true;
+ }
+ return false;
+ }
+
+ boolean getUidStats(long[] outValues, int uid, int[] uidStates) {
+ if (uidStates.length != mUidStateConfig.length) {
+ throw new IllegalArgumentException(
+ "Invalid number of tracked states: " + uidStates.length
+ + " expected: " + mUidStateConfig.length);
+ }
+ UidStats uidStats = mUidStats.get(uid);
+ if (uidStats != null && uidStats.stats != null) {
+ uidStats.stats.getStats(outValues, uidStates);
+ return true;
+ }
+ return false;
+ }
+
+ private boolean createDeviceStats() {
+ if (mStatsFactory == null) {
+ return false;
+ }
+
+ mDeviceStats = mStatsFactory.create();
+ for (int stateId = 0; stateId < mDeviceStateConfig.length; stateId++) {
+ mDeviceStats.setState(stateId, mDeviceStates[stateId],
+ mDeviceStateTimestamps[stateId]);
+ }
+ return true;
+ }
+
+ private boolean createUidStats(UidStats uidStats) {
+ if (mUidStatsFactory == null) {
+ return false;
+ }
+
+ uidStats.stats = mUidStatsFactory.create();
+ for (int stateId = 0; stateId < mDeviceStateConfig.length; stateId++) {
+ uidStats.stats.setState(stateId, mDeviceStates[stateId],
+ mDeviceStateTimestamps[stateId]);
+ }
+ for (int stateId = mDeviceStateConfig.length; stateId < mUidStateConfig.length; stateId++) {
+ uidStats.stats.setState(stateId, uidStats.states[stateId],
+ uidStats.stateTimestampMs[stateId]);
+ }
+ return true;
+ }
+
+ void dumpDevice(IndentingPrintWriter ipw) {
+ if (mDeviceStats != null) {
+ ipw.println(mPowerStatsDescriptor.name);
+ ipw.increaseIndent();
+ mDeviceStats.dump(ipw);
+ ipw.decreaseIndent();
+ }
+ }
+
+ void dumpUid(IndentingPrintWriter ipw, int uid) {
+ UidStats uidStats = mUidStats.get(uid);
+ if (uidStats != null && uidStats.stats != null) {
+ ipw.println(mPowerStatsDescriptor.name);
+ ipw.increaseIndent();
+ uidStats.stats.dump(ipw);
+ ipw.decreaseIndent();
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/power/stats/PowerStatsAggregator.java b/services/core/java/com/android/server/power/stats/PowerStatsAggregator.java
new file mode 100644
index 0000000..6a1c1da
--- /dev/null
+++ b/services/core/java/com/android/server/power/stats/PowerStatsAggregator.java
@@ -0,0 +1,226 @@
+/*
+ * 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.server.power.stats;
+
+import android.annotation.IntDef;
+import android.os.BatteryConsumer;
+import android.os.BatteryStats;
+
+import com.android.internal.os.BatteryStatsHistory;
+import com.android.internal.os.BatteryStatsHistoryIterator;
+import com.android.internal.os.MultiStateStats;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.Consumer;
+
+class PowerStatsAggregator {
+ public static final int STATE_POWER = 0;
+ public static final int STATE_SCREEN = 1;
+ public static final int STATE_PROCESS_STATE = 2;
+
+ @IntDef({
+ STATE_POWER,
+ STATE_SCREEN,
+ STATE_PROCESS_STATE,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface TrackedState {
+ }
+
+ static final int POWER_STATE_BATTERY = 0;
+ static final int POWER_STATE_OTHER = 1; // Plugged in, or on wireless charger, etc.
+ static final String[] STATE_LABELS_POWER = {"pwr-battery", "pwr-other"};
+
+ static final int SCREEN_STATE_ON = 0;
+ static final int SCREEN_STATE_OTHER = 1; // Off, doze etc
+ static final String[] STATE_LABELS_SCREEN = {"scr-on", "scr-other"};
+
+ static final String[] STATE_LABELS_PROCESS_STATE;
+
+ static {
+ String[] procStateLabels = new String[BatteryConsumer.PROCESS_STATE_COUNT];
+ for (int i = 0; i < BatteryConsumer.PROCESS_STATE_COUNT; i++) {
+ procStateLabels[i] = BatteryConsumer.processStateToString(i);
+ }
+ STATE_LABELS_PROCESS_STATE = procStateLabels;
+ }
+
+ private final BatteryStatsHistory mHistory;
+ private final AggregatedPowerStats mStats;
+
+ private PowerStatsAggregator(BatteryStatsHistory history,
+ AggregatedPowerStats aggregatedPowerStats) {
+ mHistory = history;
+ mStats = aggregatedPowerStats;
+ }
+
+ /**
+ * Iterates of the battery history and aggregates power stats between the specified times.
+ * The start and end are specified in the battery-stats monotonic time, which is the
+ * adjusted elapsed time found in HistoryItem.time.
+ * <p>
+ * The aggregated stats are sent to the consumer. One aggregation pass may produce
+ * multiple sets of aggregated stats if there was an incompatible change that occurred in the
+ * middle of the recorded battery history.
+ * <p>
+ * Note: the AggregatedPowerStats object is reused, so the consumer should fully consume
+ * the stats in the <code>accept</code> method and never cache it.
+ */
+ void aggregateBatteryStats(long startTimeMs, long endTimeMs,
+ Consumer<AggregatedPowerStats> consumer) {
+ mStats.reset();
+
+ int currentBatteryState = POWER_STATE_BATTERY;
+ int currentScreenState = SCREEN_STATE_OTHER;
+ long baseTime = -1;
+ long lastTime = 0;
+ try (BatteryStatsHistoryIterator iterator =
+ mHistory.copy().iterate(startTimeMs, endTimeMs)) {
+ while (iterator.hasNext()) {
+ BatteryStats.HistoryItem item = iterator.next();
+
+ if (baseTime < 0) {
+ mStats.setStartTime(item.currentTime);
+ baseTime = item.time;
+ }
+
+ lastTime = item.time;
+
+ int batteryState =
+ (item.states & BatteryStats.HistoryItem.STATE_BATTERY_PLUGGED_FLAG) != 0
+ ? POWER_STATE_OTHER : POWER_STATE_BATTERY;
+ if (batteryState != currentBatteryState) {
+ mStats.setDeviceState(STATE_POWER, batteryState, item.time);
+ currentBatteryState = batteryState;
+ }
+
+ int screenState =
+ (item.states & BatteryStats.HistoryItem.STATE_SCREEN_ON_FLAG) != 0
+ ? SCREEN_STATE_ON : SCREEN_STATE_OTHER;
+ if (screenState != currentScreenState) {
+ mStats.setDeviceState(STATE_SCREEN, screenState, item.time);
+ currentScreenState = screenState;
+ }
+
+ if (item.processStateChange != null) {
+ mStats.setUidState(item.processStateChange.uid, STATE_PROCESS_STATE,
+ item.processStateChange.processState, item.time);
+ }
+
+ if (item.powerStats != null) {
+ if (!mStats.isCompatible(item.powerStats)) {
+ mStats.setDuration(lastTime - baseTime);
+ consumer.accept(mStats);
+ mStats.reset();
+ mStats.setStartTime(item.currentTime);
+ baseTime = lastTime = item.time;
+ }
+ mStats.addPowerStats(item.powerStats, item.time);
+ }
+ }
+ }
+ mStats.setDuration(lastTime - baseTime);
+ consumer.accept(mStats);
+ }
+
+ static class Builder {
+ static class PowerComponentAggregateStatsBuilder {
+ private final int mPowerComponentId;
+ private @TrackedState int[] mTrackedDeviceStates;
+ private @TrackedState int[] mTrackedUidStates;
+
+ PowerComponentAggregateStatsBuilder(int powerComponentId) {
+ this.mPowerComponentId = powerComponentId;
+ }
+
+ public PowerComponentAggregateStatsBuilder trackDeviceStates(
+ @TrackedState int... states) {
+ mTrackedDeviceStates = states;
+ return this;
+ }
+
+ public PowerComponentAggregateStatsBuilder trackUidStates(@TrackedState int... states) {
+ mTrackedUidStates = states;
+ return this;
+ }
+
+ private PowerComponentAggregatedPowerStats build() {
+ MultiStateStats.States[] deviceStates = new MultiStateStats.States[]{
+ new MultiStateStats.States(isTracked(mTrackedDeviceStates, STATE_POWER),
+ PowerStatsAggregator.STATE_LABELS_POWER),
+ new MultiStateStats.States(isTracked(mTrackedDeviceStates, STATE_SCREEN),
+ PowerStatsAggregator.STATE_LABELS_SCREEN),
+ };
+
+ MultiStateStats.States[] uidStates = new MultiStateStats.States[]{
+ new MultiStateStats.States(isTracked(mTrackedUidStates, STATE_POWER),
+ PowerStatsAggregator.STATE_LABELS_POWER),
+ new MultiStateStats.States(isTracked(mTrackedUidStates, STATE_SCREEN),
+ PowerStatsAggregator.STATE_LABELS_SCREEN),
+ new MultiStateStats.States(
+ isTracked(mTrackedUidStates, STATE_PROCESS_STATE),
+ PowerStatsAggregator.STATE_LABELS_PROCESS_STATE),
+ };
+
+ switch (mPowerComponentId) {
+ case BatteryConsumer.POWER_COMPONENT_CPU:
+ return new CpuAggregatedPowerStats(deviceStates, uidStates);
+ default:
+ return new PowerComponentAggregatedPowerStats(mPowerComponentId,
+ deviceStates, uidStates);
+ }
+ }
+
+ private boolean isTracked(int[] trackedStates, int state) {
+ if (trackedStates == null) {
+ return false;
+ }
+
+ for (int trackedState : trackedStates) {
+ if (trackedState == state) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ private final BatteryStatsHistory mHistory;
+ private final List<PowerComponentAggregateStatsBuilder> mPowerComponents =
+ new ArrayList<>();
+
+ Builder(BatteryStatsHistory history) {
+ mHistory = history;
+ }
+
+ PowerComponentAggregateStatsBuilder trackPowerComponent(int powerComponentId) {
+ PowerComponentAggregateStatsBuilder builder = new PowerComponentAggregateStatsBuilder(
+ powerComponentId);
+ mPowerComponents.add(builder);
+ return builder;
+ }
+
+ PowerStatsAggregator build() {
+ return new PowerStatsAggregator(mHistory, new AggregatedPowerStats(
+ mPowerComponents.stream()
+ .map(PowerComponentAggregateStatsBuilder::build)
+ .toArray(PowerComponentAggregatedPowerStats[]::new)));
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/power/stats/PowerStatsCollector.java b/services/core/java/com/android/server/power/stats/PowerStatsCollector.java
new file mode 100644
index 0000000..b49c89f
--- /dev/null
+++ b/services/core/java/com/android/server/power/stats/PowerStatsCollector.java
@@ -0,0 +1,183 @@
+/*
+ * 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.server.power.stats;
+
+import android.os.ConditionVariable;
+import android.os.Handler;
+import android.util.FastImmutableArraySet;
+import android.util.IndentingPrintWriter;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.internal.os.Clock;
+import com.android.internal.os.PowerStats;
+
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.function.Consumer;
+import java.util.stream.Stream;
+
+/**
+ * Collects snapshots of power-related system statistics.
+ * <p>
+ * Instances of this class are intended to be used in a serialized fashion using
+ * the handler supplied in the constructor. Thus these objects are not thread-safe
+ * except where noted.
+ */
+public abstract class PowerStatsCollector {
+ private final Handler mHandler;
+ private final Clock mClock;
+ private final long mThrottlePeriodMs;
+ private final Runnable mCollectAndDeliverStats = this::collectAndDeliverStats;
+ private boolean mEnabled;
+ private long mLastScheduledUpdateMs = -1;
+
+ @GuardedBy("this")
+ @SuppressWarnings("unchecked")
+ private volatile FastImmutableArraySet<Consumer<PowerStats>> mConsumerList =
+ new FastImmutableArraySet<Consumer<PowerStats>>(new Consumer[0]);
+
+ public PowerStatsCollector(Handler handler, long throttlePeriodMs, Clock clock) {
+ mHandler = handler;
+ mThrottlePeriodMs = throttlePeriodMs;
+ mClock = clock;
+ }
+
+ /**
+ * Adds a consumer that will receive a callback every time a snapshot of stats is collected.
+ * The method is thread safe.
+ */
+ @SuppressWarnings("unchecked")
+ public void addConsumer(Consumer<PowerStats> consumer) {
+ synchronized (this) {
+ mConsumerList = new FastImmutableArraySet<Consumer<PowerStats>>(
+ Stream.concat(mConsumerList.stream(), Stream.of(consumer))
+ .toArray(Consumer[]::new));
+ }
+ }
+
+ /**
+ * Removes a consumer.
+ * The method is thread safe.
+ */
+ @SuppressWarnings("unchecked")
+ public void removeConsumer(Consumer<PowerStats> consumer) {
+ synchronized (this) {
+ mConsumerList = new FastImmutableArraySet<Consumer<PowerStats>>(
+ mConsumerList.stream().filter(c -> c != consumer)
+ .toArray(Consumer[]::new));
+ }
+ }
+
+ /**
+ * Should be called at most once, before the first invocation of {@link #schedule} or
+ * {@link #forceSchedule}
+ */
+ public void setEnabled(boolean enabled) {
+ mEnabled = enabled;
+ }
+
+ /**
+ * Returns true if the collector is enabled.
+ */
+ public boolean isEnabled() {
+ return mEnabled;
+ }
+
+ @SuppressWarnings("GuardedBy") // Field is volatile
+ private void collectAndDeliverStats() {
+ PowerStats stats = collectStats();
+ for (Consumer<PowerStats> consumer : mConsumerList) {
+ consumer.accept(stats);
+ }
+ }
+
+ /**
+ * Schedules a stats snapshot collection, throttled in accordance with the
+ * {@link #mThrottlePeriodMs} parameter.
+ */
+ public boolean schedule() {
+ if (!mEnabled) {
+ return false;
+ }
+
+ long uptimeMillis = mClock.uptimeMillis();
+ if (uptimeMillis - mLastScheduledUpdateMs < mThrottlePeriodMs
+ && mLastScheduledUpdateMs >= 0) {
+ return false;
+ }
+ mLastScheduledUpdateMs = uptimeMillis;
+ mHandler.post(mCollectAndDeliverStats);
+ return true;
+ }
+
+ /**
+ * Schedules an immediate snapshot collection, foregoing throttling.
+ */
+ public boolean forceSchedule() {
+ if (!mEnabled) {
+ return false;
+ }
+
+ mHandler.removeCallbacks(mCollectAndDeliverStats);
+ mHandler.postAtFrontOfQueue(mCollectAndDeliverStats);
+ return true;
+ }
+
+ protected abstract PowerStats collectStats();
+
+ /**
+ * Collects a fresh stats snapshot and prints it to the supplied printer.
+ */
+ public void collectAndDump(PrintWriter pw) {
+ if (Thread.currentThread() == mHandler.getLooper().getThread()) {
+ throw new RuntimeException(
+ "Calling this method from the handler thread would cause a deadlock");
+ }
+
+ IndentingPrintWriter out = new IndentingPrintWriter(pw);
+ out.print(getClass().getSimpleName());
+ if (!isEnabled()) {
+ out.println(": disabled");
+ return;
+ }
+ out.println();
+
+ ArrayList<PowerStats> collected = new ArrayList<>();
+ Consumer<PowerStats> consumer = collected::add;
+ addConsumer(consumer);
+
+ try {
+ if (forceSchedule()) {
+ awaitCompletion();
+ }
+ } finally {
+ removeConsumer(consumer);
+ }
+
+ out.increaseIndent();
+ for (PowerStats stats : collected) {
+ stats.dump(out);
+ }
+ out.decreaseIndent();
+ }
+
+ private void awaitCompletion() {
+ ConditionVariable done = new ConditionVariable();
+ mHandler.post(done::open);
+ done.block();
+ }
+}
diff --git a/services/core/java/com/android/server/rollback/RollbackPackageHealthObserver.java b/services/core/java/com/android/server/rollback/RollbackPackageHealthObserver.java
index 0ca5603..2007079 100644
--- a/services/core/java/com/android/server/rollback/RollbackPackageHealthObserver.java
+++ b/services/core/java/com/android/server/rollback/RollbackPackageHealthObserver.java
@@ -121,7 +121,7 @@
impact = PackageHealthObserverImpact.USER_IMPACT_LEVEL_30;
} else if (getAvailableRollback(failedPackage) != null) {
// Rollback is available, we may get a callback into #execute
- impact = PackageHealthObserverImpact.USER_IMPACT_LEVEL_60;
+ impact = PackageHealthObserverImpact.USER_IMPACT_LEVEL_30;
} else if (anyRollbackAvailable) {
// If any rollbacks are available, we will commit them
impact = PackageHealthObserverImpact.USER_IMPACT_LEVEL_70;
diff --git a/services/core/java/com/android/server/security/rkp/RemoteProvisioningService.java b/services/core/java/com/android/server/security/rkp/RemoteProvisioningService.java
index 2bd7383..1c5838c 100644
--- a/services/core/java/com/android/server/security/rkp/RemoteProvisioningService.java
+++ b/services/core/java/com/android/server/security/rkp/RemoteProvisioningService.java
@@ -105,14 +105,27 @@
@Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (!DumpUtils.checkDumpPermission(getContext(), TAG, pw)) return;
- new RemoteProvisioningShellCommand().dump(pw);
+ final int callerUid = Binder.getCallingUidOrThrow();
+ final long callingIdentity = Binder.clearCallingIdentity();
+ try {
+ new RemoteProvisioningShellCommand(getContext(), callerUid).dump(pw);
+ } finally {
+ Binder.restoreCallingIdentity(callingIdentity);
+ }
}
@Override
public int handleShellCommand(ParcelFileDescriptor in, ParcelFileDescriptor out,
ParcelFileDescriptor err, String[] args) {
- return new RemoteProvisioningShellCommand().exec(this, in.getFileDescriptor(),
- out.getFileDescriptor(), err.getFileDescriptor(), args);
+ final int callerUid = Binder.getCallingUidOrThrow();
+ final long callingIdentity = Binder.clearCallingIdentity();
+ try {
+ return new RemoteProvisioningShellCommand(getContext(), callerUid).exec(this,
+ in.getFileDescriptor(), out.getFileDescriptor(), err.getFileDescriptor(),
+ args);
+ } finally {
+ Binder.restoreCallingIdentity(callingIdentity);
+ }
}
}
}
diff --git a/services/core/java/com/android/server/security/rkp/RemoteProvisioningShellCommand.java b/services/core/java/com/android/server/security/rkp/RemoteProvisioningShellCommand.java
index 187b939..4a6d746 100644
--- a/services/core/java/com/android/server/security/rkp/RemoteProvisioningShellCommand.java
+++ b/services/core/java/com/android/server/security/rkp/RemoteProvisioningShellCommand.java
@@ -16,22 +16,30 @@
package com.android.server.security.rkp;
+import android.content.Context;
import android.hardware.security.keymint.DeviceInfo;
import android.hardware.security.keymint.IRemotelyProvisionedComponent;
import android.hardware.security.keymint.MacedPublicKey;
import android.hardware.security.keymint.ProtectedData;
import android.hardware.security.keymint.RpcHardwareInfo;
+import android.os.CancellationSignal;
+import android.os.OutcomeReceiver;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ShellCommand;
+import android.security.rkp.service.RegistrationProxy;
+import android.security.rkp.service.RemotelyProvisionedKey;
import android.util.IndentingPrintWriter;
-import com.android.internal.annotations.VisibleForTesting;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.time.Duration;
import java.util.Base64;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Executor;
import co.nstant.in.cbor.CborDecoder;
import co.nstant.in.cbor.CborEncoder;
@@ -54,16 +62,17 @@
+ "csr [--challenge CHALLENGE] NAME\n"
+ " Generate and print a base64-encoded CSR from the named\n"
+ " IRemotelyProvisionedComponent. A base64-encoded challenge can be provided,\n"
- + " or else it defaults to an empty challenge.\n";
+ + " or else it defaults to an empty challenge.\n"
+ + "certify NAME\n"
+ + " Output the PEM-encoded certificate chain provisioned for the named\n"
+ + " IRemotelyProvisionedComponent.\n";
- @VisibleForTesting
static final String EEK_ED25519_BASE64 = "goRDoQEnoFgqpAEBAycgBiFYIJm57t1e5FL2hcZMYtw+YatXSH11N"
+ "ymtdoAy0rPLY1jZWEAeIghLpLekyNdOAw7+uK8UTKc7b6XN3Np5xitk/pk5r3bngPpmAIUNB5gqrJFcpyUUS"
+ "QY0dcqKJ3rZ41pJ6wIDhEOhASegWE6lAQECWCDQrsEVyirPc65rzMvRlh1l6LHd10oaN7lDOpfVmd+YCAM4G"
+ "CAEIVggvoXnRsSjQlpA2TY6phXQLFh+PdwzAjLS/F4ehyVfcmBYQJvPkOIuS6vRGLEOjl0gJ0uEWP78MpB+c"
+ "gWDvNeCvvpkeC1UEEvAMb9r6B414vAtzmwvT/L1T6XUg62WovGHWAQ=";
- @VisibleForTesting
static final String EEK_P256_BASE64 = "goRDoQEmoFhNpQECAyYgASFYIPcUituX9MxT79JkEcTjdR9mH6RxDGzP"
+ "+glGgHSHVPKtIlggXn9b9uzk9hnM/xM3/Q+hyJPbGAZ2xF3m12p3hsMtr49YQC+XjkL7vgctlUeFR5NAsB/U"
+ "m0ekxESp8qEHhxDHn8sR9L+f6Dvg5zRMFfx7w34zBfTRNDztAgRgehXgedOK/ySEQ6EBJqBYcaYBAgJYIDVz"
@@ -74,14 +83,20 @@
private static final int ERROR = -1;
private static final int SUCCESS = 0;
+ private static final Duration BIND_TIMEOUT = Duration.ofSeconds(10);
+ private static final int KEY_ID = 452436;
+
+ private final Context mContext;
+ private final int mCallerUid;
private final Injector mInjector;
- RemoteProvisioningShellCommand() {
- this(new Injector());
+ RemoteProvisioningShellCommand(Context context, int callerUid) {
+ this(context, callerUid, new Injector());
}
- @VisibleForTesting
- RemoteProvisioningShellCommand(Injector injector) {
+ RemoteProvisioningShellCommand(Context context, int callerUid, Injector injector) {
+ mContext = context;
+ mCallerUid = callerUid;
mInjector = injector;
}
@@ -102,6 +117,8 @@
return list();
case "csr":
return csr();
+ case "certify":
+ return certify();
default:
return handleDefaultCommands(cmd);
}
@@ -232,7 +249,45 @@
return new CborDecoder(bais).decodeNext();
}
- @VisibleForTesting
+ private int certify() throws Exception {
+ String name = getNextArgRequired();
+
+ Executor executor = mContext.getMainExecutor();
+ CancellationSignal cancellationSignal = new CancellationSignal();
+ OutcomeFuture<RemotelyProvisionedKey> key = new OutcomeFuture<>();
+ mInjector.getRegistrationProxy(mContext, mCallerUid, name, executor)
+ .getKeyAsync(KEY_ID, cancellationSignal, executor, key);
+ byte[] encodedCertChain = key.join().getEncodedCertChain();
+ ByteArrayInputStream is = new ByteArrayInputStream(encodedCertChain);
+ PrintWriter pw = getOutPrintWriter();
+ for (Certificate cert : CertificateFactory.getInstance("X.509").generateCertificates(is)) {
+ String encoded = Base64.getEncoder().encodeToString(cert.getEncoded());
+ pw.println("-----BEGIN CERTIFICATE-----");
+ pw.println(encoded.replaceAll("(.{64})", "$1\n").stripTrailing());
+ pw.println("-----END CERTIFICATE-----");
+ }
+ return SUCCESS;
+ }
+
+ /** Treat an OutcomeReceiver as a future for use in synchronous code. */
+ private static class OutcomeFuture<T> implements OutcomeReceiver<T, Exception> {
+ private CompletableFuture<T> mFuture = new CompletableFuture<>();
+
+ @Override
+ public void onResult(T result) {
+ mFuture.complete(result);
+ }
+
+ @Override
+ public void onError(Exception e) {
+ mFuture.completeExceptionally(e);
+ }
+
+ public T join() {
+ return mFuture.join();
+ }
+ }
+
static class Injector {
String[] getIrpcNames() {
return ServiceManager.getDeclaredInstances(IRemotelyProvisionedComponent.DESCRIPTOR);
@@ -248,5 +303,14 @@
}
return binder;
}
+
+ RegistrationProxy getRegistrationProxy(
+ Context context, int callerUid, String name, Executor executor) {
+ String irpc = IRemotelyProvisionedComponent.DESCRIPTOR + "/" + name;
+ OutcomeFuture<RegistrationProxy> registration = new OutcomeFuture<>();
+ RegistrationProxy.createAsync(
+ context, callerUid, irpc, BIND_TIMEOUT, executor, registration);
+ return registration.join();
+ }
}
}
diff --git a/services/core/java/com/android/server/sensorprivacy/SensorPrivacyService.java b/services/core/java/com/android/server/sensorprivacy/SensorPrivacyService.java
index 76126df..8780991 100644
--- a/services/core/java/com/android/server/sensorprivacy/SensorPrivacyService.java
+++ b/services/core/java/com/android/server/sensorprivacy/SensorPrivacyService.java
@@ -27,6 +27,7 @@
import static android.app.AppOpsManager.OP_PHONE_CALL_MICROPHONE;
import static android.app.AppOpsManager.OP_RECEIVE_AMBIENT_TRIGGER_AUDIO;
import static android.app.AppOpsManager.OP_RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO;
+import static android.app.AppOpsManager.OP_RECEIVE_SANDBOX_TRIGGER_AUDIO;
import static android.app.AppOpsManager.OP_RECORD_AUDIO;
import static android.content.Intent.EXTRA_PACKAGE_NAME;
import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
@@ -1125,6 +1126,8 @@
case MICROPHONE:
mAppOpsManagerInternal.setGlobalRestriction(OP_RECORD_AUDIO, enabled,
mAppOpsRestrictionToken);
+ mAppOpsManagerInternal.setGlobalRestriction(
+ OP_RECEIVE_SANDBOX_TRIGGER_AUDIO, enabled, mAppOpsRestrictionToken);
mAppOpsManagerInternal.setGlobalRestriction(OP_PHONE_CALL_MICROPHONE, enabled,
mAppOpsRestrictionToken);
// We don't show the dialog for RECEIVE_SOUNDTRIGGER_AUDIO, but still want to
diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java
index cb09aef..ffe0010 100644
--- a/services/core/java/com/android/server/tv/TvInputManagerService.java
+++ b/services/core/java/com/android/server/tv/TvInputManagerService.java
@@ -155,12 +155,12 @@
// ID of the current user.
@GuardedBy("mLock")
private int mCurrentUserId = UserHandle.USER_SYSTEM;
+ // ID of the current on-screen input.
@GuardedBy("mLock")
- // ID of the current input displayed on the screen.
- private String mCurrentInputId = null;
+ private String mOnScreenInputId = null;
+ // SessionState of the currently active on-screen TIS session.
@GuardedBy("mLock")
- // SessionState of the currently active TIS session.
- private SessionState mCurrentSessionState = null;
+ private SessionState mOnScreenSessionState = null;
// IDs of the running profiles. Their parent user ID should be mCurrentUserId.
@GuardedBy("mLock")
private final Set<Integer> mRunningProfiles = new HashSet<>();
@@ -879,12 +879,12 @@
sessionState.session = null;
}
}
- if (mCurrentSessionState == sessionState) {
+ if (mOnScreenSessionState == sessionState) {
// only log when releasing the current on-screen session
logExternalInputEvent(FrameworkStatsLog.EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__RELEASED,
- mCurrentInputId, sessionState);
- mCurrentInputId = null;
- mCurrentSessionState = null;
+ mOnScreenInputId, sessionState);
+ mOnScreenInputId = null;
+ mOnScreenSessionState = null;
}
removeSessionStateLocked(sessionToken, userId);
return sessionState;
@@ -1079,7 +1079,7 @@
if (currentCecTvInputInfoUpdated) {
logExternalInputEvent(
FrameworkStatsLog.EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__DEVICE_INFO_UPDATED,
- mCurrentInputId, mCurrentSessionState);
+ mOnScreenInputId, mOnScreenSessionState);
}
int n = userState.mCallbacks.beginBroadcast();
@@ -1096,14 +1096,14 @@
@GuardedBy("mLock")
private boolean isCurrentCecTvInputInfoUpdate(UserState userState, TvInputInfo newInputInfo) {
if (newInputInfo == null || newInputInfo.getId() == null
- || !newInputInfo.getId().equals(mCurrentInputId)) {
+ || !newInputInfo.getId().equals(mOnScreenInputId)) {
return false;
}
if (newInputInfo.getHdmiDeviceInfo() == null
|| !newInputInfo.getHdmiDeviceInfo().isCecDevice()) {
return false;
}
- TvInputState inputState = userState.inputMap.get(mCurrentInputId);
+ TvInputState inputState = userState.inputMap.get(mOnScreenInputId);
if (inputState == null || inputState.info == null) {
return false;
}
@@ -1133,21 +1133,21 @@
return;
}
if (oldState != state) {
- if (inputId.equals(mCurrentInputId)) {
+ if (inputId.equals(mOnScreenInputId)) {
logExternalInputEvent(
FrameworkStatsLog
.EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__CONNECTION_STATE_CHANGED,
- mCurrentInputId, mCurrentSessionState);
- } else if (mCurrentInputId != null) {
- TvInputInfo currentInputInfo = userState.inputMap.get(mCurrentInputId).info;
+ mOnScreenInputId, mOnScreenSessionState);
+ } else if (mOnScreenInputId != null) {
+ TvInputInfo currentInputInfo = userState.inputMap.get(mOnScreenInputId).info;
if (currentInputInfo != null && currentInputInfo.getHdmiDeviceInfo() != null
&& inputId.equals(currentInputInfo.getParentId())) {
logExternalInputEvent(
FrameworkStatsLog
.EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__CONNECTION_STATE_CHANGED,
- inputId, mCurrentSessionState);
+ inputId, mOnScreenSessionState);
if (state == INPUT_STATE_CONNECTED_STANDBY) {
- mCurrentInputId = currentInputInfo.getParentId();
+ mOnScreenInputId = currentInputInfo.getParentId();
}
}
}
@@ -1814,19 +1814,22 @@
UserState userState = getOrCreateUserStateLocked(resolvedUserId);
SessionState sessionState = getSessionStateLocked(sessionToken, callingUid,
userState);
- if (mCurrentInputId == null
- || !mCurrentInputId.equals(sessionState.inputId)) {
- mCurrentInputId = sessionState.inputId;
- logExternalInputEvent(
- FrameworkStatsLog.EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__TUNED,
- sessionState.inputId, sessionState);
- }
if (!sessionState.isCurrent
|| !Objects.equals(sessionState.currentChannel, channelUri)) {
sessionState.isCurrent = true;
sessionState.currentChannel = channelUri;
- mCurrentSessionState = sessionState;
notifyCurrentChannelInfosUpdatedLocked(userState);
+ if (!sessionState.isRecordingSession) {
+ if (mOnScreenInputId == null
+ || !TextUtils.equals(mOnScreenInputId, sessionState.inputId)) {
+ logExternalInputEvent(
+ FrameworkStatsLog
+ .EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__TUNED,
+ sessionState.inputId, sessionState);
+ }
+ mOnScreenInputId = sessionState.inputId;
+ mOnScreenSessionState = sessionState;
+ }
}
if (TvContract.isChannelUriForPassthroughInput(channelUri)) {
// Do not log the watch history for passthrough inputs.
@@ -3055,10 +3058,10 @@
TvInputInfo tvInputInfo = tvInputState.info;
int inputState = tvInputState.state;
int inputType = tvInputInfo.getType();
- // For non-CEC input, the value of vendorId is 0.
- int vendorId = 0;
- // For non-HDMI input, the value of hdmiPort is 0.
- int hdmiPort = 0;
+ // For non-CEC input, the value of vendorId is 0xFFFFFF (16777215 in decimal).
+ int vendorId = 16777215;
+ // For non-HDMI input, the value of hdmiPort is -1.
+ int hdmiPort = -1;
String tifSessionId = sessionState.sessionId;
if (tvInputInfo.getType() == TvInputInfo.TYPE_HDMI) {
@@ -3436,21 +3439,21 @@
synchronized (mLock) {
mTvInputHardwareManager.addHdmiInput(id, inputInfo);
addHardwareInputLocked(inputInfo);
- if (mCurrentInputId != null && mCurrentSessionState != null) {
- if (TextUtils.equals(mCurrentInputId, inputInfo.getParentId())) {
+ if (mOnScreenInputId != null && mOnScreenSessionState != null) {
+ if (TextUtils.equals(mOnScreenInputId, inputInfo.getParentId())) {
// catch the use case when a CEC device is plugged in an HDMI port,
// and TV app does not explicitly call tune() to the added CEC input.
logExternalInputEvent(
FrameworkStatsLog.EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__TUNED,
- inputInfo.getId(), mCurrentSessionState);
- mCurrentInputId = inputInfo.getId();
- } else if (TextUtils.equals(mCurrentInputId, inputInfo.getId())) {
+ inputInfo.getId(), mOnScreenSessionState);
+ mOnScreenInputId = inputInfo.getId();
+ } else if (TextUtils.equals(mOnScreenInputId, inputInfo.getId())) {
// catch the use case when a CEC device disconnects itself
// and reconnects to update info.
logExternalInputEvent(
FrameworkStatsLog
.EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__DEVICE_INFO_UPDATED,
- mCurrentInputId, mCurrentSessionState);
+ mOnScreenInputId, mOnScreenSessionState);
}
}
}
@@ -3555,9 +3558,17 @@
UserState userState = getOrCreateUserStateLocked(mSessionState.userId);
mSessionState.isCurrent = true;
mSessionState.currentChannel = channelUri;
- mCurrentSessionState = mSessionState;
- mCurrentInputId = mSessionState.inputId;
notifyCurrentChannelInfosUpdatedLocked(userState);
+ if (!mSessionState.isRecordingSession) {
+ if (mOnScreenInputId == null
+ || !TextUtils.equals(mOnScreenInputId, mSessionState.inputId)) {
+ logExternalInputEvent(
+ FrameworkStatsLog.EXTERNAL_TV_INPUT_EVENT__EVENT_TYPE__TUNED,
+ mSessionState.inputId, mSessionState);
+ }
+ mOnScreenInputId = mSessionState.inputId;
+ mOnScreenSessionState = mSessionState;
+ }
}
} catch (RemoteException e) {
Slog.e(TAG, "error in onChannelRetuned", e);
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
index ddc0519..aaf48fb 100644
--- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -2000,12 +2000,7 @@
WallpaperData wallpaper, IRemoteCallback reply, ServiceInfo serviceInfo) {
if (serviceInfo == null) {
- if (wallpaper.mWhich == (FLAG_LOCK | FLAG_SYSTEM)) {
- clearWallpaperLocked(FLAG_SYSTEM, wallpaper.userId, null);
- clearWallpaperLocked(FLAG_LOCK, wallpaper.userId, reply);
- } else {
- clearWallpaperLocked(wallpaper.mWhich, wallpaper.userId, reply);
- }
+ clearWallpaperLocked(wallpaper.mWhich, wallpaper.userId, reply);
return;
}
Slog.w(TAG, "Wallpaper isn't direct boot aware; using fallback until unlocked");
@@ -2037,7 +2032,7 @@
WallpaperData data = null;
synchronized (mLock) {
if (mIsLockscreenLiveWallpaperEnabled) {
- clearWallpaperLocked(callingPackage, which, userId);
+ clearWallpaperLocked(callingPackage, which, userId, null);
} else {
clearWallpaperLocked(which, userId, null);
}
@@ -2057,7 +2052,8 @@
}
}
- private void clearWallpaperLocked(String callingPackage, int which, int userId) {
+ private void clearWallpaperLocked(String callingPackage, int which, int userId,
+ IRemoteCallback reply) {
// Might need to bring it in the first time to establish our rewrite
if (!mWallpaperMap.contains(userId)) {
@@ -2111,8 +2107,14 @@
withCleanCallingIdentity(() -> clearWallpaperComponentLocked(wallpaper));
}
- // TODO(b/266818039) remove this version of the method
private void clearWallpaperLocked(int which, int userId, IRemoteCallback reply) {
+
+ if (mIsLockscreenLiveWallpaperEnabled) {
+ String callingPackage = mPackageManagerInternal.getNameForUid(getCallingUid());
+ clearWallpaperLocked(callingPackage, which, userId, reply);
+ return;
+ }
+
if (which != FLAG_SYSTEM && which != FLAG_LOCK) {
throw new IllegalArgumentException("Must specify exactly one kind of wallpaper to clear");
}
@@ -3284,15 +3286,21 @@
boolean setWallpaperComponent(ComponentName name, String callingPackage,
@SetWallpaperFlags int which, int userId) {
if (mIsLockscreenLiveWallpaperEnabled) {
- return setWallpaperComponentInternal(name, callingPackage, which, userId);
+ return setWallpaperComponentInternal(name, callingPackage, which, userId, null);
} else {
setWallpaperComponentInternalLegacy(name, callingPackage, which, userId);
return true;
}
}
+ private boolean setWallpaperComponent(ComponentName name, @SetWallpaperFlags int which,
+ int userId) {
+ String callingPackage = mPackageManagerInternal.getNameForUid(getCallingUid());
+ return setWallpaperComponentInternal(name, callingPackage, which, userId, null);
+ }
+
private boolean setWallpaperComponentInternal(ComponentName name, String callingPackage,
- @SetWallpaperFlags int which, int userIdIn) {
+ @SetWallpaperFlags int which, int userIdIn, IRemoteCallback reply) {
if (DEBUG) {
Slog.v(TAG, "Setting new live wallpaper: which=" + which + ", component: " + name);
}
@@ -3341,6 +3349,7 @@
Slog.d(TAG, "publish system wallpaper changed!");
}
liveSync.complete();
+ if (reply != null) reply.sendResult(null);
}
};
diff --git a/services/core/java/com/android/server/wm/AccessibilityWindowsPopulator.java b/services/core/java/com/android/server/wm/AccessibilityWindowsPopulator.java
index 70f2007..cdd1a269 100644
--- a/services/core/java/com/android/server/wm/AccessibilityWindowsPopulator.java
+++ b/services/core/java/com/android/server/wm/AccessibilityWindowsPopulator.java
@@ -161,9 +161,7 @@
final boolean visible = (window.inputConfig & InputConfig.NOT_VISIBLE) == 0;
final boolean isNotClone = (window.inputConfig & InputConfig.CLONE) == 0;
final boolean hasTouchableRegion = !window.touchableRegion.isEmpty();
- final boolean hasNonEmptyFrame =
- (window.frameBottom != window.frameTop) && (window.frameLeft
- != window.frameRight);
+ final boolean hasNonEmptyFrame = !window.frame.isEmpty();
if (visible && isNotClone && hasTouchableRegion && hasNonEmptyFrame) {
tempVisibleWindows.add(window);
}
@@ -694,9 +692,7 @@
instance.mIgnoreDuetoRecentsAnimation = windowState != null && controller != null
&& controller.shouldIgnoreForAccessibility(windowState);
- final Rect windowFrame = new Rect(inputWindowHandle.frameLeft,
- inputWindowHandle.frameTop, inputWindowHandle.frameRight,
- inputWindowHandle.frameBottom);
+ final Rect windowFrame = new Rect(inputWindowHandle.frame);
getTouchableRegionInWindow(instance.mShouldMagnify, inputWindowHandle.touchableRegion,
instance.mTouchableRegionInWindow, windowFrame, magnificationInverseMatrix,
displayMatrix);
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 3125518..64c7c6f 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -224,6 +224,9 @@
import static com.android.server.wm.IdentifierProto.USER_ID;
import static com.android.server.wm.LetterboxConfiguration.DEFAULT_LETTERBOX_ASPECT_RATIO_FOR_MULTI_WINDOW;
import static com.android.server.wm.LetterboxConfiguration.MIN_FIXED_ORIENTATION_LETTERBOX_ASPECT_RATIO;
+import static com.android.server.wm.StartingData.AFTER_TRANSACTION_COPY_TO_CLIENT;
+import static com.android.server.wm.StartingData.AFTER_TRANSACTION_IDLE;
+import static com.android.server.wm.StartingData.AFTER_TRANSACTION_REMOVE_DIRECTLY;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_PREDICT_BACK;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_RECENTS;
@@ -2690,6 +2693,11 @@
if (isTransferringSplashScreen()) {
return true;
}
+ // Only do transfer after transaction has done when starting window exist.
+ if (mStartingData != null && mStartingData.mWaitForSyncTransactionCommit) {
+ mStartingData.mRemoveAfterTransaction = AFTER_TRANSACTION_COPY_TO_CLIENT;
+ return true;
+ }
requestCopySplashScreen();
return isTransferringSplashScreen();
}
@@ -2850,11 +2858,14 @@
if (mStartingData == null) {
return;
}
- mStartingData.mWaitForSyncTransactionCommit = false;
- if (mStartingData.mRemoveAfterTransaction) {
- mStartingData.mRemoveAfterTransaction = false;
- removeStartingWindowAnimation(mStartingData.mPrepareRemoveAnimation);
+ final StartingData lastData = mStartingData;
+ lastData.mWaitForSyncTransactionCommit = false;
+ if (lastData.mRemoveAfterTransaction == AFTER_TRANSACTION_REMOVE_DIRECTLY) {
+ removeStartingWindowAnimation(lastData.mPrepareRemoveAnimation);
+ } else if (lastData.mRemoveAfterTransaction == AFTER_TRANSACTION_COPY_TO_CLIENT) {
+ removeStartingWindow();
}
+ lastData.mRemoveAfterTransaction = AFTER_TRANSACTION_IDLE;
}
void removeStartingWindowAnimation(boolean prepareAnimation) {
@@ -2881,7 +2892,7 @@
if (mStartingData != null) {
if (mStartingData.mWaitForSyncTransactionCommit
|| mTransitionController.inCollectingTransition(startingWindow)) {
- mStartingData.mRemoveAfterTransaction = true;
+ mStartingData.mRemoveAfterTransaction = AFTER_TRANSACTION_REMOVE_DIRECTLY;
mStartingData.mPrepareRemoveAnimation = prepareAnimation;
return;
}
@@ -4370,7 +4381,6 @@
// Reset the last saved PiP snap fraction on removal.
mDisplayContent.mPinnedTaskController.onActivityHidden(mActivityComponent);
mDisplayContent.onRunningActivityChanged();
- mWmService.mEmbeddedWindowController.onActivityRemoved(this);
mRemovingFromDisplay = false;
}
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 6c848d1..fb62412 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -2606,9 +2606,6 @@
final int callingUid = Binder.getCallingUid();
final long ident = Binder.clearCallingIdentity();
try {
- // When a task is locked, dismiss the root pinned task if it exists
- mRootWindowContainer.removeRootTasksInWindowingModes(WINDOWING_MODE_PINNED);
-
getLockTaskController().startLockTaskMode(task, isSystemCaller, callingUid);
} finally {
Binder.restoreCallingIdentity(ident);
diff --git a/services/core/java/com/android/server/wm/AsyncRotationController.java b/services/core/java/com/android/server/wm/AsyncRotationController.java
index 2eceecc..0250475 100644
--- a/services/core/java/com/android/server/wm/AsyncRotationController.java
+++ b/services/core/java/com/android/server/wm/AsyncRotationController.java
@@ -172,10 +172,9 @@
if (recents != null && recents.isNavigationBarAttachedToApp()) {
return;
}
- } else if (navigationBarCanMove || mTransitionOp == OP_CHANGE_MAY_SEAMLESS) {
+ } else if (navigationBarCanMove || mTransitionOp == OP_CHANGE_MAY_SEAMLESS
+ || mDisplayContent.mTransitionController.mNavigationBarAttachedToApp) {
action = Operation.ACTION_SEAMLESS;
- } else if (mDisplayContent.mTransitionController.mNavigationBarAttachedToApp) {
- return;
}
mTargetWindowTokens.put(w.mToken, new Operation(action));
return;
@@ -294,6 +293,11 @@
finishOp(mTargetWindowTokens.keyAt(i));
}
mTargetWindowTokens.clear();
+ onAllCompleted();
+ }
+
+ private void onAllCompleted() {
+ if (DEBUG) Slog.d(TAG, "onAllCompleted");
if (mTimeoutRunnable != null) {
mService.mH.removeCallbacks(mTimeoutRunnable);
}
@@ -333,7 +337,7 @@
if (DEBUG) Slog.d(TAG, "Complete directly " + token.getTopChild());
finishOp(token);
if (mTargetWindowTokens.isEmpty()) {
- if (mTimeoutRunnable != null) mService.mH.removeCallbacks(mTimeoutRunnable);
+ onAllCompleted();
return true;
}
}
@@ -411,14 +415,18 @@
if (mDisplayContent.mInputMethodWindow == null) return;
final WindowToken imeWindowToken = mDisplayContent.mInputMethodWindow.mToken;
if (isTargetToken(imeWindowToken)) return;
+ hideImmediately(imeWindowToken, Operation.ACTION_TOGGLE_IME);
+ if (DEBUG) Slog.d(TAG, "hideImeImmediately " + imeWindowToken.getTopChild());
+ }
+
+ private void hideImmediately(WindowToken token, @Operation.Action int action) {
final boolean original = mHideImmediately;
mHideImmediately = true;
- final Operation op = new Operation(Operation.ACTION_TOGGLE_IME);
- mTargetWindowTokens.put(imeWindowToken, op);
- fadeWindowToken(false /* show */, imeWindowToken, ANIMATION_TYPE_TOKEN_TRANSFORM);
- op.mLeash = imeWindowToken.getAnimationLeash();
+ final Operation op = new Operation(action);
+ mTargetWindowTokens.put(token, op);
+ fadeWindowToken(false /* show */, token, ANIMATION_TYPE_TOKEN_TRANSFORM);
+ op.mLeash = token.getAnimationLeash();
mHideImmediately = original;
- if (DEBUG) Slog.d(TAG, "hideImeImmediately " + imeWindowToken.getTopChild());
}
/** Returns {@code true} if the window will rotate independently. */
@@ -428,11 +436,20 @@
|| isTargetToken(w.mToken);
}
- /** Returns {@code true} if the controller will run fade animations on the window. */
+ /**
+ * Returns {@code true} if the rotation transition appearance of the window is currently
+ * managed by this controller.
+ */
boolean isTargetToken(WindowToken token) {
return mTargetWindowTokens.containsKey(token);
}
+ /** Returns {@code true} if the controller will run fade animations on the window. */
+ boolean hasFadeOperation(WindowToken token) {
+ final Operation op = mTargetWindowTokens.get(token);
+ return op != null && op.mAction == Operation.ACTION_FADE;
+ }
+
/**
* Whether the insets animation leash should use previous position when running fade animation
* or seamless transformation in a rotated display.
@@ -564,7 +581,18 @@
return false;
}
final Operation op = mTargetWindowTokens.get(w.mToken);
- if (op == null) return false;
+ if (op == null) {
+ // If a window becomes visible after the rotation transition is requested but before
+ // the transition is ready, hide it by an animation leash so it won't be flickering
+ // by drawing the rotated content before applying projection transaction of display.
+ // And it will fade in after the display transition is finished.
+ if (mTransitionOp == OP_APP_SWITCH && !mIsStartTransactionCommitted
+ && canBeAsync(w.mToken)) {
+ hideImmediately(w.mToken, Operation.ACTION_FADE);
+ if (DEBUG) Slog.d(TAG, "Hide on finishDrawing " + w.mToken.getTopChild());
+ }
+ return false;
+ }
if (DEBUG) Slog.d(TAG, "handleFinishDrawing " + w);
if (postDrawTransaction == null || !mIsSyncDrawRequested
|| canDrawBeforeStartTransaction(op)) {
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 5c82dba..59677f4 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -327,6 +327,12 @@
*/
private SurfaceControl mOverlayLayer;
+ /**
+ * A SurfaceControl that contains input overlays used for cases where we need to receive input
+ * over the entire display.
+ */
+ private SurfaceControl mInputOverlayLayer;
+
/** A surfaceControl specifically for accessibility overlays. */
private SurfaceControl mA11yOverlayLayer;
@@ -1327,6 +1333,12 @@
transaction.reparent(mOverlayLayer, mSurfaceControl);
}
+ if (mInputOverlayLayer == null) {
+ mInputOverlayLayer = b.setName("Input Overlays").setParent(mSurfaceControl).build();
+ } else {
+ transaction.reparent(mInputOverlayLayer, mSurfaceControl);
+ }
+
if (mA11yOverlayLayer == null) {
mA11yOverlayLayer =
b.setName("Accessibility Overlays").setParent(mSurfaceControl).build();
@@ -1340,7 +1352,9 @@
.show(mSurfaceControl)
.setLayer(mOverlayLayer, Integer.MAX_VALUE)
.show(mOverlayLayer)
- .setLayer(mA11yOverlayLayer, Integer.MAX_VALUE - 1)
+ .setLayer(mInputOverlayLayer, Integer.MAX_VALUE - 1)
+ .show(mInputOverlayLayer)
+ .setLayer(mA11yOverlayLayer, Integer.MAX_VALUE - 2)
.show(mA11yOverlayLayer);
}
@@ -3351,6 +3365,7 @@
// -> this DisplayContent.
setRemoteInsetsController(null);
mOverlayLayer.release();
+ mInputOverlayLayer.release();
mA11yOverlayLayer.release();
mWindowingLayer.release();
mInputMonitor.onDisplayRemoved();
@@ -5704,6 +5719,10 @@
return mOverlayLayer;
}
+ SurfaceControl getInputOverlayLayer() {
+ return mInputOverlayLayer;
+ }
+
SurfaceControl getA11yOverlayLayer() {
return mA11yOverlayLayer;
}
@@ -7060,6 +7079,7 @@
new Transaction().reparent(sc, getSurfaceControl())
.reparent(mWindowingLayer, null)
.reparent(mOverlayLayer, null)
+ .reparent(mInputOverlayLayer, null)
.reparent(mA11yOverlayLayer, null)
.apply();
}
diff --git a/services/core/java/com/android/server/wm/EmbeddedWindowController.java b/services/core/java/com/android/server/wm/EmbeddedWindowController.java
index 98027bb..c9bae12 100644
--- a/services/core/java/com/android/server/wm/EmbeddedWindowController.java
+++ b/services/core/java/com/android/server/wm/EmbeddedWindowController.java
@@ -135,19 +135,6 @@
return mWindowsByWindowToken.get(windowToken);
}
- void onActivityRemoved(ActivityRecord activityRecord) {
- for (int i = mWindows.size() - 1; i >= 0; i--) {
- final EmbeddedWindow window = mWindows.valueAt(i);
- if (window.mHostActivityRecord == activityRecord) {
- final WindowProcessController processController =
- mAtmService.getProcessController(window.mOwnerPid, window.mOwnerUid);
- if (processController != null) {
- processController.removeHostActivity(activityRecord);
- }
- }
- }
- }
-
static class EmbeddedWindow implements InputTarget {
final IWindow mClient;
@Nullable final WindowState mHostWindowState;
@@ -230,6 +217,13 @@
mInputChannel.dispose();
mInputChannel = null;
}
+ if (mHostActivityRecord != null) {
+ final WindowProcessController wpc =
+ mWmService.mAtmService.getProcessController(mOwnerPid, mOwnerUid);
+ if (wpc != null) {
+ wpc.removeHostActivity(mHostActivityRecord);
+ }
+ }
}
@Override
diff --git a/services/core/java/com/android/server/wm/InputManagerCallback.java b/services/core/java/com/android/server/wm/InputManagerCallback.java
index 73fdfe0..8cf4713 100644
--- a/services/core/java/com/android/server/wm/InputManagerCallback.java
+++ b/services/core/java/com/android/server/wm/InputManagerCallback.java
@@ -275,11 +275,17 @@
+ " - DisplayContent not found.");
return null;
}
+ final SurfaceControl inputOverlay = dc.getInputOverlayLayer();
+ if (inputOverlay == null) {
+ Slog.e(TAG, "Failed to create a gesture monitor on display: " + displayId
+ + " - Input overlay layer is not initialized.");
+ return null;
+ }
return mService.makeSurfaceBuilder(dc.getSession())
.setContainerLayer()
.setName(name)
.setCallsite("createSurfaceForGestureMonitor")
- .setParent(dc.getSurfaceControl())
+ .setParent(inputOverlay)
.build();
}
}
diff --git a/services/core/java/com/android/server/wm/InputWindowHandleWrapper.java b/services/core/java/com/android/server/wm/InputWindowHandleWrapper.java
index 3d4e0eb..64b7a60 100644
--- a/services/core/java/com/android/server/wm/InputWindowHandleWrapper.java
+++ b/services/core/java/com/android/server/wm/InputWindowHandleWrapper.java
@@ -227,18 +227,6 @@
mChanged = true;
}
- void setFrame(int left, int top, int right, int bottom) {
- if (mHandle.frameLeft == left && mHandle.frameTop == top && mHandle.frameRight == right
- && mHandle.frameBottom == bottom) {
- return;
- }
- mHandle.frameLeft = left;
- mHandle.frameTop = top;
- mHandle.frameRight = right;
- mHandle.frameBottom = bottom;
- mChanged = true;
- }
-
void setSurfaceInset(int inset) {
if (mHandle.surfaceInset == inset) {
return;
diff --git a/services/core/java/com/android/server/wm/LetterboxUiController.java b/services/core/java/com/android/server/wm/LetterboxUiController.java
index ba242ec..01786be 100644
--- a/services/core/java/com/android/server/wm/LetterboxUiController.java
+++ b/services/core/java/com/android/server/wm/LetterboxUiController.java
@@ -969,8 +969,10 @@
final Rect innerFrame = hasInheritedLetterboxBehavior()
? mActivityRecord.getBounds() : w.getFrame();
mLetterbox.layout(spaceToFill, innerFrame, mTmpPoint);
- // We need to notify Shell that letterbox position has changed.
- mActivityRecord.getTask().dispatchTaskInfoChangedIfNeeded(true /* force */);
+ if (mDoubleTapEvent) {
+ // We need to notify Shell that letterbox position has changed.
+ mActivityRecord.getTask().dispatchTaskInfoChangedIfNeeded(true /* force */);
+ }
} else if (mLetterbox != null) {
mLetterbox.hide();
}
@@ -1242,6 +1244,7 @@
? LETTERBOX_POSITION_CHANGED__POSITION_CHANGE__CENTER_TO_LEFT
: LETTERBOX_POSITION_CHANGED__POSITION_CHANGE__RIGHT_TO_CENTER;
logLetterboxPositionChange(changeToLog);
+ mDoubleTapEvent = true;
} else if (mLetterbox.getInnerFrame().right < x) {
// Moving to the next stop on the right side of the app window: left > center > right.
mLetterboxConfiguration.movePositionForHorizontalReachabilityToNextRightStop(
@@ -1252,8 +1255,8 @@
? LETTERBOX_POSITION_CHANGED__POSITION_CHANGE__CENTER_TO_RIGHT
: LETTERBOX_POSITION_CHANGED__POSITION_CHANGE__LEFT_TO_CENTER;
logLetterboxPositionChange(changeToLog);
+ mDoubleTapEvent = true;
}
- mDoubleTapEvent = true;
// TODO(197549949): Add animation for transition.
mActivityRecord.recomputeConfiguration();
}
@@ -1281,6 +1284,7 @@
? LETTERBOX_POSITION_CHANGED__POSITION_CHANGE__CENTER_TO_TOP
: LETTERBOX_POSITION_CHANGED__POSITION_CHANGE__BOTTOM_TO_CENTER;
logLetterboxPositionChange(changeToLog);
+ mDoubleTapEvent = true;
} else if (mLetterbox.getInnerFrame().bottom < y) {
// Moving to the next stop on the bottom side of the app window: top > center > bottom.
mLetterboxConfiguration.movePositionForVerticalReachabilityToNextBottomStop(
@@ -1291,8 +1295,8 @@
? LETTERBOX_POSITION_CHANGED__POSITION_CHANGE__CENTER_TO_BOTTOM
: LETTERBOX_POSITION_CHANGED__POSITION_CHANGE__TOP_TO_CENTER;
logLetterboxPositionChange(changeToLog);
+ mDoubleTapEvent = true;
}
- mDoubleTapEvent = true;
// TODO(197549949): Add animation for transition.
mActivityRecord.recomputeConfiguration();
}
diff --git a/services/core/java/com/android/server/wm/LockTaskController.java b/services/core/java/com/android/server/wm/LockTaskController.java
index 0c98fb5..0f9998c 100644
--- a/services/core/java/com/android/server/wm/LockTaskController.java
+++ b/services/core/java/com/android/server/wm/LockTaskController.java
@@ -19,6 +19,7 @@
import static android.app.ActivityManager.LOCK_TASK_MODE_LOCKED;
import static android.app.ActivityManager.LOCK_TASK_MODE_NONE;
import static android.app.ActivityManager.LOCK_TASK_MODE_PINNED;
+import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.Context.DEVICE_POLICY_SERVICE;
import static android.content.Context.STATUS_BAR_SERVICE;
@@ -669,6 +670,9 @@
}
}
+ // When a task is locked, dismiss the root pinned task if it exists
+ mSupervisor.mRootWindowContainer.removeRootTasksInWindowingModes(WINDOWING_MODE_PINNED);
+
// System can only initiate screen pinning, not full lock task mode
ProtoLog.w(WM_DEBUG_LOCKTASK, "%s", isSystemCaller ? "Locking pinned" : "Locking fully");
setLockTaskMode(task, isSystemCaller ? LOCK_TASK_MODE_PINNED : LOCK_TASK_MODE_LOCKED,
diff --git a/services/core/java/com/android/server/wm/NavBarFadeAnimationController.java b/services/core/java/com/android/server/wm/NavBarFadeAnimationController.java
index 2e5474e..79b26d2 100644
--- a/services/core/java/com/android/server/wm/NavBarFadeAnimationController.java
+++ b/services/core/java/com/android/server/wm/NavBarFadeAnimationController.java
@@ -86,7 +86,7 @@
ANIMATION_TYPE_TOKEN_TRANSFORM);
if (controller == null) {
fadeAnim.run();
- } else if (!controller.isTargetToken(mNavigationBar.mToken)) {
+ } else if (!controller.hasFadeOperation(mNavigationBar.mToken)) {
// If fade rotation animation is running and the nav bar is not controlled by it:
// - For fade-in animation, defer the animation until fade rotation animation finishes.
// - For fade-out animation, just play the animation.
diff --git a/services/core/java/com/android/server/wm/OWNERS b/services/core/java/com/android/server/wm/OWNERS
index 0af9fe9..26abe51 100644
--- a/services/core/java/com/android/server/wm/OWNERS
+++ b/services/core/java/com/android/server/wm/OWNERS
@@ -18,4 +18,4 @@
yunfanc@google.com
per-file BackgroundActivityStartController.java = set noparent
-per-file BackgroundActivityStartController.java = brufino@google.com, ogunwale@google.com, louischang@google.com, lus@google.com, rickywai@google.com
+per-file BackgroundActivityStartController.java = brufino@google.com, ogunwale@google.com, louischang@google.com, lus@google.com
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java
index 2378469..def32a1 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimationController.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java
@@ -40,6 +40,7 @@
import android.graphics.Rect;
import android.hardware.HardwareBuffer;
import android.os.Binder;
+import android.os.Bundle;
import android.os.IBinder.DeathRecipient;
import android.os.RemoteException;
import android.os.SystemClock;
@@ -546,7 +547,7 @@
contentInsets = mTmpRect;
}
mRunner.onAnimationStart(mController, appTargets, wallpaperTargets, contentInsets,
- null);
+ null, new Bundle());
ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS,
"startAnimation(): Notify animation start: %s",
mPendingAnimations.stream()
diff --git a/services/core/java/com/android/server/wm/StartingData.java b/services/core/java/com/android/server/wm/StartingData.java
index 34806bd..a23547e 100644
--- a/services/core/java/com/android/server/wm/StartingData.java
+++ b/services/core/java/com/android/server/wm/StartingData.java
@@ -16,6 +16,8 @@
package com.android.server.wm;
+import android.annotation.IntDef;
+
import com.android.server.wm.StartingSurfaceController.StartingSurface;
/**
@@ -23,6 +25,20 @@
*/
public abstract class StartingData {
+ /** Nothing need to do after transaction */
+ static final int AFTER_TRANSACTION_IDLE = 0;
+ /** Remove the starting window directly after transaction done. */
+ static final int AFTER_TRANSACTION_REMOVE_DIRECTLY = 1;
+ /** Do copy splash screen to client after transaction done. */
+ static final int AFTER_TRANSACTION_COPY_TO_CLIENT = 2;
+
+ @IntDef(prefix = { "AFTER_TRANSACTION" }, value = {
+ AFTER_TRANSACTION_IDLE,
+ AFTER_TRANSACTION_REMOVE_DIRECTLY,
+ AFTER_TRANSACTION_COPY_TO_CLIENT,
+ })
+ @interface AfterTransaction {}
+
protected final WindowManagerService mService;
protected final int mTypeParams;
@@ -60,7 +76,7 @@
* This starting window should be removed after applying the start transaction of transition,
* which ensures the app window has shown.
*/
- boolean mRemoveAfterTransaction;
+ @AfterTransaction int mRemoveAfterTransaction;
/** Whether to prepare the removal animation. */
boolean mPrepareRemoveAnimation;
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 69eddb9..f9bbc68 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -725,7 +725,7 @@
} catch (RemoteException e) {
}
}
- if (autoRemoveFromRecents(oldParent.asTaskFragment()) || isVoiceSession) {
+ if (shouldAutoRemoveFromRecents(oldParent.asTaskFragment()) || isVoiceSession) {
// Task creator asked to remove this when done, or this task was a voice
// interaction, so it should not remain on the recent tasks list.
mTaskSupervisor.mRecentTasks.remove(this);
@@ -1558,12 +1558,14 @@
return count > 0;
}
- private boolean autoRemoveFromRecents(TaskFragment oldParentFragment) {
+ private boolean shouldAutoRemoveFromRecents(TaskFragment oldParentFragment) {
// We will automatically remove the task either if it has explicitly asked for
// this, or it is empty and has never contained an activity that got shown to
- // the user, or it was being embedded in another Task.
- return autoRemoveRecents || (!hasChild() && !getHasBeenVisible()
- || (oldParentFragment != null && oldParentFragment.isEmbedded()));
+ // the user, or it was being embedded in another Task, or the display policy
+ // doesn't allow recents,
+ return autoRemoveRecents || (!hasChild() && !getHasBeenVisible())
+ || (oldParentFragment != null && oldParentFragment.isEmbedded())
+ || (mDisplayContent != null && !mDisplayContent.canShowTasksInHostDeviceRecents());
}
private void clearPinnedTaskIfNeed() {
@@ -3459,6 +3461,8 @@
info.topActivityLetterboxHorizontalPosition = TaskInfo.PROPERTY_VALUE_UNSET;
info.topActivityLetterboxWidth = TaskInfo.PROPERTY_VALUE_UNSET;
info.topActivityLetterboxHeight = TaskInfo.PROPERTY_VALUE_UNSET;
+ info.isUserFullscreenOverrideEnabled = top != null
+ && top.mLetterboxUiController.shouldApplyUserFullscreenOverride();
info.isFromLetterboxDoubleTap = top != null && top.mLetterboxUiController.isFromDoubleTap();
if (info.isLetterboxDoubleTapEnabled) {
info.topActivityLetterboxWidth = top.getBounds().width();
diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java
index d8cc8d3..6dc896a 100644
--- a/services/core/java/com/android/server/wm/TaskFragment.java
+++ b/services/core/java/com/android/server/wm/TaskFragment.java
@@ -1175,7 +1175,7 @@
}
final boolean resumeTopActivity(ActivityRecord prev, ActivityOptions options,
- boolean deferPause) {
+ boolean skipPause) {
ActivityRecord next = topRunningActivity(true /* focusableOnly */);
if (next == null || !next.canResumeByCompat()) {
return false;
@@ -1183,11 +1183,9 @@
next.delayedResume = false;
- // If we are currently pausing an activity, then don't do anything until that is done.
- final boolean allPausedComplete = mRootWindowContainer.allPausedActivitiesComplete();
- if (!allPausedComplete) {
- ProtoLog.v(WM_DEBUG_STATES,
- "resumeTopActivity: Skip resume: some activity pausing.");
+ if (!skipPause && !mRootWindowContainer.allPausedActivitiesComplete()) {
+ // If we aren't skipping pause, then we have to wait for currently pausing activities.
+ ProtoLog.v(WM_DEBUG_STATES, "resumeTopActivity: Skip resume: some activity pausing.");
return false;
}
@@ -1251,7 +1249,7 @@
lastResumed = lastFocusedRootTask.getTopResumedActivity();
}
- boolean pausing = !deferPause && taskDisplayArea.pauseBackTasks(next);
+ boolean pausing = !skipPause && taskDisplayArea.pauseBackTasks(next);
if (mResumedActivity != null) {
ProtoLog.d(WM_DEBUG_STATES, "resumeTopActivity: Pausing %s", mResumedActivity);
pausing |= startPausing(mTaskSupervisor.mUserLeaving, false /* uiSleeping */,
@@ -1329,7 +1327,7 @@
.notifyBeforePackageUnstopped(next.packageName);
mAtmService.getPackageManagerInternalLocked().notifyComponentUsed(
next.packageName, next.mUserId,
- next.packageName); /* TODO: Verify if correct userid */
+ next.packageName, next.toString()); /* TODO: Verify if correct userid */
} catch (IllegalArgumentException e) {
Slog.w(TAG, "Failed trying to unstop package "
+ next.packageName + ": " + e);
diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java
index 1566bb2c..e9af42b 100644
--- a/services/core/java/com/android/server/wm/Transition.java
+++ b/services/core/java/com/android/server/wm/Transition.java
@@ -1930,11 +1930,6 @@
break;
}
- final AsyncRotationController asyncRotationController = dc.getAsyncRotationController();
- if (asyncRotationController != null) {
- asyncRotationController.accept(navWindow);
- }
-
if (animate) {
final NavBarFadeAnimationController controller =
new NavBarFadeAnimationController(dc);
diff --git a/services/core/java/com/android/server/wm/TransitionController.java b/services/core/java/com/android/server/wm/TransitionController.java
index 6432ff0..6ede345 100644
--- a/services/core/java/com/android/server/wm/TransitionController.java
+++ b/services/core/java/com/android/server/wm/TransitionController.java
@@ -1124,14 +1124,15 @@
+ "track #%d", transition.getSyncId(), track);
}
}
- if (sync) {
+ transition.mAnimationTrack = track;
+ info.setTrack(track);
+ mTrackCount = Math.max(mTrackCount, track + 1);
+ if (sync && mTrackCount > 1) {
+ // If there are >1 tracks, mark as sync so that all tracks finish.
info.setFlags(info.getFlags() | TransitionInfo.FLAG_SYNC);
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS, "Marking #%d animation as SYNC.",
transition.getSyncId());
}
- transition.mAnimationTrack = track;
- info.setTrack(track);
- mTrackCount = Math.max(mTrackCount, track + 1);
}
void updateAnimatingState(SurfaceControl.Transaction t) {
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 03efb1b..439b719 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -8338,12 +8338,18 @@
+ displayId + " - DisplayContent not found.");
return null;
}
- //TODO (b/210039666): Use a method like add/removeDisplayOverlay if available.
+ final SurfaceControl inputOverlay = dc.getInputOverlayLayer();
+ if (inputOverlay == null) {
+ Slog.e(TAG, "Failed to create a gesture monitor on display: " + displayId
+ + " - Input overlay layer is not initialized.");
+ return null;
+ }
+ // TODO(b/210039666): Use a method like add/removeDisplayOverlay if available.
return makeSurfaceBuilder(dc.getSession())
.setContainerLayer()
.setName("IME Handwriting Surface")
.setCallsite("getHandwritingSurfaceForDisplay")
- .setParent(dc.getSurfaceControl())
+ .setParent(inputOverlay)
.build();
}
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 5a45fe1..a172d99 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -30,7 +30,6 @@
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.SurfaceControl.Transaction;
import static android.view.SurfaceControl.getGlobalTransaction;
-import static android.view.ViewRootImpl.LOCAL_LAYOUT;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_CONTENT;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_FRAME;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION;
@@ -1446,9 +1445,7 @@
}
final boolean dragResizingChanged = !mDragResizingChangeReported && isDragResizeChanged();
-
- final boolean attachedFrameChanged = LOCAL_LAYOUT
- && mLayoutAttached && getParentWindow().frameChanged();
+ final boolean attachedFrameChanged = mLayoutAttached && getParentWindow().frameChanged();
if (DEBUG) {
Slog.v(TAG_WM, "Resizing " + this + ": configChanged=" + configChanged
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
index 405b133..2f150a1 100644
--- a/services/core/jni/Android.bp
+++ b/services/core/jni/Android.bp
@@ -50,6 +50,7 @@
"com_android_server_locksettings_SyntheticPasswordManager.cpp",
"com_android_server_power_PowerManagerService.cpp",
"com_android_server_powerstats_PowerStatsService.cpp",
+ "com_android_server_power_stats_CpuPowerStatsCollector.cpp",
"com_android_server_hint_HintManagerService.cpp",
"com_android_server_SerialService.cpp",
"com_android_server_soundtrigger_middleware_AudioSessionProviderImpl.cpp",
@@ -144,6 +145,7 @@
"libsensorservicehidl",
"libsensorserviceaidl",
"libgui",
+ "libtimeinstate",
"libtimestats_atoms_proto",
"libusbhost",
"libtinyalsa",
diff --git a/services/core/jni/OWNERS b/services/core/jni/OWNERS
index d9acf41..7e8ce60 100644
--- a/services/core/jni/OWNERS
+++ b/services/core/jni/OWNERS
@@ -23,6 +23,7 @@
per-file com_android_server_pm_* = file:/services/core/java/com/android/server/pm/OWNERS
per-file com_android_server_power_* = file:/services/core/java/com/android/server/power/OWNERS
per-file com_android_server_powerstats_* = file:/services/core/java/com/android/server/powerstats/OWNERS
+per-file com_android_server_power_stats_* = file:/BATTERY_STATS_OWNERS
per-file com_android_server_security_* = file:/core/java/android/security/OWNERS
per-file com_android_server_tv_* = file:/media/java/android/media/tv/OWNERS
per-file com_android_server_vibrator_* = file:/services/core/java/com/android/server/vibrator/OWNERS
diff --git a/services/core/jni/com_android_server_am_CachedAppOptimizer.cpp b/services/core/jni/com_android_server_am_CachedAppOptimizer.cpp
index cfc63f0..7b08413 100644
--- a/services/core/jni/com_android_server_am_CachedAppOptimizer.cpp
+++ b/services/core/jni/com_android_server_am_CachedAppOptimizer.cpp
@@ -54,6 +54,9 @@
using android::meminfo::ProcMemInfo;
using namespace android::meminfo;
+static const size_t kPageSize = getpagesize();
+static const size_t kPageMask = ~(kPageSize - 1);
+
#define COMPACT_ACTION_FILE_FLAG 1
#define COMPACT_ACTION_ANON_FLAG 2
@@ -64,7 +67,7 @@
#define ASYNC_RECEIVED_WHILE_FROZEN (2)
#define TXNS_PENDING_WHILE_FROZEN (4)
-#define MAX_RW_COUNT (INT_MAX & PAGE_MASK)
+#define MAX_RW_COUNT (INT_MAX & kPageMask)
// Defines the maximum amount of VMAs we can send per process_madvise syscall.
// Currently this is set to UIO_MAXIOV which is the maximum segments allowed by
@@ -233,7 +236,6 @@
// process_madvise on failure
int madviseVmasFromBatch(unique_fd& pidfd, VmaBatch& batch, int madviseType,
uint64_t* outBytesProcessed) {
- static const size_t kPageSize = getpagesize();
if (batch.totalVmas == 0 || batch.totalBytes == 0) {
// No VMAs in Batch, skip.
*outBytesProcessed = 0;
diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp
index 7c8c558..5ab8d36 100644
--- a/services/core/jni/com_android_server_input_InputManagerService.cpp
+++ b/services/core/jni/com_android_server_input_InputManagerService.cpp
@@ -400,7 +400,7 @@
PointerCaptureRequest pointerCaptureRequest{};
// Sprite controller singleton, created on first use.
- sp<SpriteController> spriteController{};
+ std::shared_ptr<SpriteController> spriteController{};
// Pointer controller singleton, created and destroyed as needed.
std::weak_ptr<PointerController> pointerController{};
@@ -709,7 +709,7 @@
if (controller == nullptr) {
ensureSpriteControllerLocked();
- controller = PointerController::create(this, mLooper, mLocked.spriteController);
+ controller = PointerController::create(this, mLooper, *mLocked.spriteController);
mLocked.pointerController = controller;
updateInactivityTimeoutLocked();
}
@@ -738,16 +738,21 @@
}
void NativeInputManager::ensureSpriteControllerLocked() REQUIRES(mLock) {
- if (mLocked.spriteController == nullptr) {
- JNIEnv* env = jniEnv();
- jint layer = env->CallIntMethod(mServiceObj, gServiceClassInfo.getPointerLayer);
- if (checkAndClearExceptionFromCallback(env, "getPointerLayer")) {
- layer = -1;
- }
- mLocked.spriteController = new SpriteController(mLooper, layer, [this](int displayId) {
- return getParentSurfaceForPointers(displayId);
- });
+ if (mLocked.spriteController) {
+ return;
}
+ JNIEnv* env = jniEnv();
+ jint layer = env->CallIntMethod(mServiceObj, gServiceClassInfo.getPointerLayer);
+ if (checkAndClearExceptionFromCallback(env, "getPointerLayer")) {
+ layer = -1;
+ }
+ mLocked.spriteController =
+ std::make_shared<SpriteController>(mLooper, layer, [this](int displayId) {
+ return getParentSurfaceForPointers(displayId);
+ });
+ // The SpriteController needs to be shared pointer because the handler callback needs to hold
+ // a weak reference so that we can avoid racy conditions when the controller is being destroyed.
+ mLocked.spriteController->setHandlerController(mLocked.spriteController);
}
void NativeInputManager::notifyInputDevicesChanged(const std::vector<InputDeviceInfo>& inputDevices) {
diff --git a/services/core/jni/com_android_server_power_stats_CpuPowerStatsCollector.cpp b/services/core/jni/com_android_server_power_stats_CpuPowerStatsCollector.cpp
new file mode 100644
index 0000000..a6084ea
--- /dev/null
+++ b/services/core/jni/com_android_server_power_stats_CpuPowerStatsCollector.cpp
@@ -0,0 +1,135 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "CpuPowerStatsCollector"
+
+#include <cputimeinstate.h>
+#include <log/log.h>
+#include <nativehelper/ScopedPrimitiveArray.h>
+
+#include "core_jni_helpers.h"
+
+#define EXCEPTION (-1)
+
+namespace android {
+
+#define JAVA_CLASS_CPU_POWER_STATS_COLLECTOR "com/android/server/power/stats/CpuPowerStatsCollector"
+#define JAVA_CLASS_KERNEL_CPU_STATS_READER \
+ JAVA_CLASS_CPU_POWER_STATS_COLLECTOR "$KernelCpuStatsReader"
+#define JAVA_CLASS_KERNEL_CPU_STATS_CALLBACK \
+ JAVA_CLASS_CPU_POWER_STATS_COLLECTOR "$KernelCpuStatsCallback"
+
+static constexpr uint64_t NSEC_PER_MSEC = 1000000;
+
+static int extractUidStats(JNIEnv *env, std::vector<std::vector<uint64_t>> ×,
+ ScopedIntArrayRO &scopedScalingStepToPowerBracketMap,
+ jlongArray tempForUidStats);
+
+static bool initialized = false;
+static jclass class_KernelCpuStatsCallback;
+static jmethodID method_KernelCpuStatsCallback_processUidStats;
+
+static int init(JNIEnv *env) {
+ jclass temp = env->FindClass(JAVA_CLASS_KERNEL_CPU_STATS_CALLBACK);
+ class_KernelCpuStatsCallback = (jclass)env->NewGlobalRef(temp);
+ if (!class_KernelCpuStatsCallback) {
+ jniThrowExceptionFmt(env, "java/lang/ClassNotFoundException",
+ "Class not found: " JAVA_CLASS_KERNEL_CPU_STATS_CALLBACK);
+ return EXCEPTION;
+ }
+ method_KernelCpuStatsCallback_processUidStats =
+ env->GetMethodID(class_KernelCpuStatsCallback, "processUidStats", "(I[J)V");
+ if (!method_KernelCpuStatsCallback_processUidStats) {
+ jniThrowExceptionFmt(env, "java/lang/NoSuchMethodException",
+ "Method not found: " JAVA_CLASS_KERNEL_CPU_STATS_CALLBACK
+ ".processUidStats");
+ return EXCEPTION;
+ }
+ initialized = true;
+ return OK;
+}
+
+static jlong nativeReadCpuStats(JNIEnv *env, [[maybe_unused]] jobject zis, jobject callback,
+ jintArray scalingStepToPowerBracketMap,
+ jlong lastUpdateTimestampNanos, jlongArray tempForUidStats) {
+ if (!initialized) {
+ if (init(env) == EXCEPTION) {
+ return 0L;
+ }
+ }
+
+ uint64_t newLastUpdate = lastUpdateTimestampNanos;
+ auto data = android::bpf::getUidsUpdatedCpuFreqTimes(&newLastUpdate);
+ if (!data.has_value()) return lastUpdateTimestampNanos;
+
+ ScopedIntArrayRO scopedScalingStepToPowerBracketMap(env, scalingStepToPowerBracketMap);
+
+ for (auto &[uid, times] : *data) {
+ int status =
+ extractUidStats(env, times, scopedScalingStepToPowerBracketMap, tempForUidStats);
+ if (status == EXCEPTION) {
+ return 0L;
+ }
+ env->CallVoidMethod(callback, method_KernelCpuStatsCallback_processUidStats, (jint)uid,
+ tempForUidStats);
+ }
+ return newLastUpdate;
+}
+
+static int extractUidStats(JNIEnv *env, std::vector<std::vector<uint64_t>> ×,
+ ScopedIntArrayRO &scopedScalingStepToPowerBracketMap,
+ jlongArray tempForUidStats) {
+ ScopedLongArrayRW scopedTempForStats(env, tempForUidStats);
+ uint64_t *arrayForStats = reinterpret_cast<uint64_t *>(scopedTempForStats.get());
+ const uint8_t statsSize = scopedTempForStats.size();
+ memset(arrayForStats, 0, statsSize * sizeof(uint64_t));
+ const uint8_t scalingStepCount = scopedScalingStepToPowerBracketMap.size();
+
+ uint32_t scalingStep = 0;
+ for (const auto &subVec : times) {
+ for (uint32_t i = 0; i < subVec.size(); ++i) {
+ if (scalingStep >= scalingStepCount) {
+ jniThrowExceptionFmt(env, "java/lang/IndexOutOfBoundsException",
+ "scalingStepToPowerBracketMap is too short, "
+ "size=%u, scalingStep=%u",
+ scalingStepCount, scalingStep);
+ return EXCEPTION;
+ }
+ uint32_t bucket = scopedScalingStepToPowerBracketMap[scalingStep];
+ if (bucket >= statsSize) {
+ jniThrowExceptionFmt(env, "java/lang/IndexOutOfBoundsException",
+ "UidStats array is too short, length=%u, bucket[%u]=%u",
+ statsSize, scalingStep, bucket);
+ return EXCEPTION;
+ }
+ arrayForStats[bucket] += subVec[i] / NSEC_PER_MSEC;
+ scalingStep++;
+ }
+ }
+ return OK;
+}
+
+static const JNINativeMethod method_table[] = {
+ {"nativeReadCpuStats", "(L" JAVA_CLASS_KERNEL_CPU_STATS_CALLBACK ";[IJ[J)J",
+ (void *)nativeReadCpuStats},
+};
+
+int register_android_server_power_stats_CpuPowerStatsCollector(JNIEnv *env) {
+ return jniRegisterNativeMethods(env, JAVA_CLASS_KERNEL_CPU_STATS_READER, method_table,
+ NELEM(method_table));
+}
+
+} // namespace android
diff --git a/services/core/jni/onload.cpp b/services/core/jni/onload.cpp
index 290ad8d..97d7be6 100644
--- a/services/core/jni/onload.cpp
+++ b/services/core/jni/onload.cpp
@@ -30,6 +30,7 @@
int register_android_server_LightsService(JNIEnv* env);
int register_android_server_PowerManagerService(JNIEnv* env);
int register_android_server_PowerStatsService(JNIEnv* env);
+int register_android_server_power_stats_CpuPowerStatsCollector(JNIEnv* env);
int register_android_server_HintManagerService(JNIEnv* env);
int register_android_server_storage_AppFuse(JNIEnv* env);
int register_android_server_SerialService(JNIEnv* env);
@@ -85,6 +86,7 @@
register_android_server_broadcastradio_Tuner(vm, env);
register_android_server_PowerManagerService(env);
register_android_server_PowerStatsService(env);
+ register_android_server_power_stats_CpuPowerStatsCollector(env);
register_android_server_HintManagerService(env);
register_android_server_SerialService(env);
register_android_server_InputManager(env);
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index b3fa782..af1bac8 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -11004,25 +11004,18 @@
}
}
- private void dumpPerUserData(IndentingPrintWriter pw) {
+ private void dumpPersonalAppInfoForSystemUserNoLock(IndentingPrintWriter pw) {
+ wtfIfInLock();
+ PersonalAppsSuspensionHelper.forUser(mContext, UserHandle.USER_SYSTEM).dump(pw);
+ }
+
+ private void dumpPerUserPolicyData(IndentingPrintWriter pw) {
int userCount = mUserData.size();
for (int i = 0; i < userCount; i++) {
int userId = mUserData.keyAt(i);
DevicePolicyData policy = getUserData(userId);
policy.dump(pw);
pw.println();
-
- if (userId == UserHandle.USER_SYSTEM) {
- pw.increaseIndent();
- PersonalAppsSuspensionHelper.forUser(mContext, userId).dump(pw);
- pw.decreaseIndent();
- pw.println();
- } else {
- // pm.getUnsuspendablePackages() will fail if it's called for a different user;
- // as this dump is mostly useful for system user anyways, we can just ignore the
- // others (rather than changing the permission check in the PM method)
- Slogf.d(LOG_TAG, "skipping PersonalAppsSuspensionHelper.dump() for user " + userId);
- }
}
}
@@ -11040,7 +11033,7 @@
pw.println();
mDeviceAdminServiceController.dump(pw);
pw.println();
- dumpPerUserData(pw);
+ dumpPerUserPolicyData(pw);
pw.println();
mConstants.dump(pw);
pw.println();
@@ -11067,6 +11060,7 @@
mStateCache.dump(pw);
pw.println();
}
+ dumpPersonalAppInfoForSystemUserNoLock(pw);
synchronized (mSubscriptionsChangedListenerLock) {
pw.println("Subscription changed listener : " + mSubscriptionsChangedListener);
diff --git a/services/permission/java/com/android/server/permission/access/AccessPolicy.kt b/services/permission/java/com/android/server/permission/access/AccessPolicy.kt
index 17474fb..6a349e2 100644
--- a/services/permission/java/com/android/server/permission/access/AccessPolicy.kt
+++ b/services/permission/java/com/android/server/permission/access/AccessPolicy.kt
@@ -26,6 +26,7 @@
import com.android.server.permission.access.immutable.* // ktlint-disable no-wildcard-imports
import com.android.server.permission.access.immutable.IndexedMap
import com.android.server.permission.access.permission.AppIdPermissionPolicy
+import com.android.server.permission.access.permission.DevicePermissionPolicy
import com.android.server.permission.access.util.attributeInt
import com.android.server.permission.access.util.attributeInterned
import com.android.server.permission.access.util.forEachTag
@@ -46,6 +47,7 @@
getOrPut(policy.subjectScheme) { MutableIndexedMap() }[policy.objectScheme] = policy
}
addPolicy(AppIdPermissionPolicy())
+ addPolicy(DevicePermissionPolicy())
addPolicy(AppIdAppOpPolicy())
addPolicy(PackageAppOpPolicy())
} as IndexedMap<String, IndexedMap<String, SchemePolicy>>
diff --git a/services/permission/java/com/android/server/permission/access/AccessState.kt b/services/permission/java/com/android/server/permission/access/AccessState.kt
index 4ec32ea..94c878a 100644
--- a/services/permission/java/com/android/server/permission/access/AccessState.kt
+++ b/services/permission/java/com/android/server/permission/access/AccessState.kt
@@ -329,6 +329,18 @@
private typealias AppIdPermissionFlagsReference =
MutableReference<AppIdPermissionFlags, MutableAppIdPermissionFlags>
+
+typealias DevicePermissionFlags =
+ IndexedReferenceMap<String, IndexedMap<String, Int>, MutableIndexedMap<String, Int>>
+typealias MutableDevicePermissionFlags =
+ MutableIndexedReferenceMap<String, IndexedMap<String, Int>, MutableIndexedMap<String, Int>>
+typealias AppIdDevicePermissionFlags =
+ IntReferenceMap<DevicePermissionFlags, MutableDevicePermissionFlags>
+typealias MutableAppIdDevicePermissionFlags =
+ MutableIntReferenceMap<DevicePermissionFlags, MutableDevicePermissionFlags>
+private typealias AppIdDevicePermissionFlagsReference =
+ MutableReference<AppIdDevicePermissionFlags, MutableAppIdDevicePermissionFlags>
+
typealias AppIdAppOpModes =
IntReferenceMap<IndexedMap<String, Int>, MutableIndexedMap<String, Int>>
typealias MutableAppIdAppOpModes =
@@ -346,6 +358,7 @@
sealed class UserState(
internal val packageVersionsReference: PackageVersionsReference,
internal val appIdPermissionFlagsReference: AppIdPermissionFlagsReference,
+ internal val appIdDevicePermissionFlagsReference: AppIdDevicePermissionFlagsReference,
internal val appIdAppOpModesReference: AppIdAppOpModesReference,
internal val packageAppOpModesReference: PackageAppOpModesReference,
defaultPermissionGrantFingerprint: String?,
@@ -357,6 +370,9 @@
val appIdPermissionFlags: AppIdPermissionFlags
get() = appIdPermissionFlagsReference.get()
+ val appIdDevicePermissionFlags: AppIdDevicePermissionFlags
+ get() = appIdDevicePermissionFlagsReference.get()
+
val appIdAppOpModes: AppIdAppOpModes
get() = appIdAppOpModesReference.get()
@@ -375,6 +391,7 @@
class MutableUserState private constructor(
packageVersionsReference: PackageVersionsReference,
appIdPermissionFlagsReference: AppIdPermissionFlagsReference,
+ appIdDevicePermissionFlagsReference: AppIdDevicePermissionFlagsReference,
appIdAppOpModesReference: AppIdAppOpModesReference,
packageAppOpModesReference: PackageAppOpModesReference,
defaultPermissionGrantFingerprint: String?,
@@ -382,6 +399,7 @@
) : UserState(
packageVersionsReference,
appIdPermissionFlagsReference,
+ appIdDevicePermissionFlagsReference,
appIdAppOpModesReference,
packageAppOpModesReference,
defaultPermissionGrantFingerprint,
@@ -390,6 +408,7 @@
constructor() : this(
PackageVersionsReference(MutableIndexedMap<String, Int>()),
AppIdPermissionFlagsReference(MutableAppIdPermissionFlags()),
+ AppIdDevicePermissionFlagsReference(MutableAppIdDevicePermissionFlags()),
AppIdAppOpModesReference(MutableAppIdAppOpModes()),
PackageAppOpModesReference(MutablePackageAppOpModes()),
null,
@@ -399,6 +418,7 @@
internal constructor(userState: UserState) : this(
userState.packageVersionsReference.toImmutable(),
userState.appIdPermissionFlagsReference.toImmutable(),
+ userState.appIdDevicePermissionFlagsReference.toImmutable(),
userState.appIdAppOpModesReference.toImmutable(),
userState.packageAppOpModesReference.toImmutable(),
userState.defaultPermissionGrantFingerprint,
@@ -410,6 +430,9 @@
fun mutateAppIdPermissionFlags(): MutableAppIdPermissionFlags =
appIdPermissionFlagsReference.mutate()
+ fun mutateAppIdDevicePermissionFlags(): MutableAppIdDevicePermissionFlags =
+ appIdDevicePermissionFlagsReference.mutate()
+
fun mutateAppIdAppOpModes(): MutableAppIdAppOpModes = appIdAppOpModesReference.mutate()
fun mutatePackageAppOpModes(): MutablePackageAppOpModes = packageAppOpModesReference.mutate()
diff --git a/services/permission/java/com/android/server/permission/access/AccessUri.kt b/services/permission/java/com/android/server/permission/access/AccessUri.kt
index d1abc04..1d46ca7 100644
--- a/services/permission/java/com/android/server/permission/access/AccessUri.kt
+++ b/services/permission/java/com/android/server/permission/access/AccessUri.kt
@@ -65,6 +65,17 @@
}
}
+data class DevicePermissionUri(
+ val permissionName: String,
+ val deviceId: Int
+) : AccessUri(SCHEME) {
+ override fun toString(): String = "$scheme:///$permissionName/$deviceId"
+
+ companion object {
+ const val SCHEME = "device-permission"
+ }
+}
+
data class UidUri(
val uid: Int
) : AccessUri(SCHEME) {
diff --git a/services/permission/java/com/android/server/permission/access/immutable/IntMapExtensions.kt b/services/permission/java/com/android/server/permission/access/immutable/IntMapExtensions.kt
index ed7f0af..9aa0a41 100644
--- a/services/permission/java/com/android/server/permission/access/immutable/IntMapExtensions.kt
+++ b/services/permission/java/com/android/server/permission/access/immutable/IntMapExtensions.kt
@@ -77,7 +77,7 @@
}
operator fun <T> MutableIntMap<T>.minusAssign(key: Int) {
- array.remove(key)
+ array.remove(key).also { array.gc() }
}
fun <T> MutableIntMap<T>.putWithDefault(key: Int, value: T, defaultValue: T): T {
diff --git a/services/permission/java/com/android/server/permission/access/immutable/IntReferenceMapExtensions.kt b/services/permission/java/com/android/server/permission/access/immutable/IntReferenceMapExtensions.kt
index b4de5d1..1ed4f8a 100644
--- a/services/permission/java/com/android/server/permission/access/immutable/IntReferenceMapExtensions.kt
+++ b/services/permission/java/com/android/server/permission/access/immutable/IntReferenceMapExtensions.kt
@@ -77,7 +77,7 @@
}
operator fun <I : Immutable<M>, M : I> MutableIntReferenceMap<I, M>.minusAssign(key: Int) {
- array.remove(key)
+ array.remove(key).also { array.gc() }
}
operator fun <I : Immutable<M>, M : I> MutableIntReferenceMap<I, M>.set(key: Int, value: M) {
diff --git a/services/permission/java/com/android/server/permission/access/permission/DevicePermissionPersistence.kt b/services/permission/java/com/android/server/permission/access/permission/DevicePermissionPersistence.kt
new file mode 100644
index 0000000..37a4a90
--- /dev/null
+++ b/services/permission/java/com/android/server/permission/access/permission/DevicePermissionPersistence.kt
@@ -0,0 +1,169 @@
+/*
+ * 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.server.permission.access.permission
+
+import android.util.Slog
+import com.android.modules.utils.BinaryXmlPullParser
+import com.android.modules.utils.BinaryXmlSerializer
+import com.android.server.permission.access.AccessState
+import com.android.server.permission.access.DevicePermissionFlags
+import com.android.server.permission.access.MutableAccessState
+import com.android.server.permission.access.MutableAppIdDevicePermissionFlags
+import com.android.server.permission.access.MutableDevicePermissionFlags
+import com.android.server.permission.access.WriteMode
+import com.android.server.permission.access.immutable.IndexedMap
+import com.android.server.permission.access.immutable.MutableIndexedMap
+import com.android.server.permission.access.immutable.forEachIndexed
+import com.android.server.permission.access.immutable.forEachReversedIndexed
+import com.android.server.permission.access.immutable.set
+import com.android.server.permission.access.util.andInv
+import com.android.server.permission.access.util.attributeInt
+import com.android.server.permission.access.util.attributeInterned
+import com.android.server.permission.access.util.forEachTag
+import com.android.server.permission.access.util.getAttributeIntOrThrow
+import com.android.server.permission.access.util.getAttributeValueOrThrow
+import com.android.server.permission.access.util.hasBits
+import com.android.server.permission.access.util.tag
+import com.android.server.permission.access.util.tagName
+
+class DevicePermissionPersistence {
+ fun BinaryXmlPullParser.parseUserState(state: MutableAccessState, userId: Int) {
+ when (tagName) {
+ TAG_APP_ID_DEVICE_PERMISSIONS -> parseAppIdDevicePermissions(state, userId)
+ else -> {}
+ }
+ }
+
+ private fun BinaryXmlPullParser.parseAppIdDevicePermissions(
+ state: MutableAccessState,
+ userId: Int
+ ) {
+ val userState = state.mutateUserState(userId, WriteMode.NONE)!!
+ val appIdDevicePermissionFlags = userState.mutateAppIdDevicePermissionFlags()
+ forEachTag {
+ when (tagName) {
+ TAG_APP_ID -> parseAppId(appIdDevicePermissionFlags)
+ else -> Slog.w(LOG_TAG, "Ignoring unknown tag $name when parsing permission state")
+ }
+ }
+
+ appIdDevicePermissionFlags.forEachReversedIndexed { appIdIndex, appId, _ ->
+ if (appId !in state.externalState.appIdPackageNames) {
+ Slog.w(LOG_TAG, "Dropping unknown app ID $appId when parsing permission state")
+ appIdDevicePermissionFlags.removeAt(appIdIndex)
+ userState.requestWriteMode(WriteMode.ASYNCHRONOUS)
+ }
+ }
+ }
+
+ private fun BinaryXmlPullParser.parseAppId(
+ appIdPermissionFlags: MutableAppIdDevicePermissionFlags
+ ) {
+ val appId = getAttributeIntOrThrow(ATTR_ID)
+ val devicePermissionFlags = MutableDevicePermissionFlags()
+ appIdPermissionFlags[appId] = devicePermissionFlags
+ forEachTag {
+ when (tagName) {
+ TAG_DEVICE -> parseDevice(devicePermissionFlags)
+ else -> {
+ Slog.w(LOG_TAG, "Ignoring unknown tag $name when parsing permission state")
+ }
+ }
+ }
+ }
+
+ private fun BinaryXmlPullParser.parseDevice(
+ deviceIdPermissionFlags: MutableDevicePermissionFlags
+ ) {
+ val deviceId = getAttributeValueOrThrow(ATTR_ID)
+ val permissionFlags = MutableIndexedMap<String, Int>()
+ deviceIdPermissionFlags.put(deviceId, permissionFlags)
+ forEachTag {
+ when (tagName) {
+ TAG_PERMISSION -> parsePermission(permissionFlags)
+ else -> Slog.w(LOG_TAG, "Ignoring unknown tag $name when parsing permission state")
+ }
+ }
+ }
+
+ private fun BinaryXmlPullParser.parsePermission(
+ permissionFlags: MutableIndexedMap<String, Int>
+ ) {
+ val name = getAttributeValueOrThrow(ATTR_NAME).intern()
+ val flags = getAttributeIntOrThrow(ATTR_FLAGS)
+ permissionFlags[name] = flags
+ }
+
+ fun BinaryXmlSerializer.serializeUserState(state: AccessState, userId: Int) {
+ val appIdDevicePermissionFlags = state.userStates[userId]!!.appIdDevicePermissionFlags
+ tag(TAG_APP_ID_DEVICE_PERMISSIONS) {
+ appIdDevicePermissionFlags.forEachIndexed { _, appId, devicePermissionFlags ->
+ serializeAppId(appId, devicePermissionFlags)
+ }
+ }
+ }
+
+ private fun BinaryXmlSerializer.serializeAppId(
+ appId: Int,
+ devicePermissionFlags: DevicePermissionFlags
+ ) {
+ tag(TAG_APP_ID) {
+ attributeInt(ATTR_ID, appId)
+ devicePermissionFlags.forEachIndexed { _, deviceId, permissionFlags ->
+ serializeDevice(deviceId, permissionFlags)
+ }
+ }
+ }
+
+ private fun BinaryXmlSerializer.serializeDevice(
+ deviceId: String,
+ permissionFlags: IndexedMap<String, Int>
+ ) {
+ tag(TAG_DEVICE) {
+ attributeInterned(ATTR_ID, deviceId)
+ permissionFlags.forEachIndexed { _, name, flags ->
+ serializePermission(name, flags)
+ }
+ }
+ }
+
+ private fun BinaryXmlSerializer.serializePermission(name: String, flags: Int) {
+ tag(TAG_PERMISSION) {
+ attributeInterned(ATTR_NAME, name)
+ // Never serialize one-time permissions as granted.
+ val serializedFlags = if (flags.hasBits(PermissionFlags.ONE_TIME)) {
+ flags andInv PermissionFlags.RUNTIME_GRANTED
+ } else {
+ flags
+ }
+ attributeInt(ATTR_FLAGS, serializedFlags)
+ }
+ }
+
+ companion object {
+ private val LOG_TAG = DevicePermissionPersistence::class.java.simpleName
+
+ private const val TAG_APP_ID_DEVICE_PERMISSIONS = "app-id-device-permissions"
+ private const val TAG_APP_ID = "app-id"
+ private const val TAG_DEVICE = "device"
+ private const val TAG_PERMISSION = "permission"
+
+ private const val ATTR_ID = "id"
+ private const val ATTR_NAME = "name"
+ private const val ATTR_FLAGS = "flags"
+ }
+}
\ No newline at end of file
diff --git a/services/permission/java/com/android/server/permission/access/permission/DevicePermissionPolicy.kt b/services/permission/java/com/android/server/permission/access/permission/DevicePermissionPolicy.kt
new file mode 100644
index 0000000..c0d7546
--- /dev/null
+++ b/services/permission/java/com/android/server/permission/access/permission/DevicePermissionPolicy.kt
@@ -0,0 +1,276 @@
+/*
+ * 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.server.permission.access.permission
+
+import android.util.Slog
+import com.android.modules.utils.BinaryXmlPullParser
+import com.android.modules.utils.BinaryXmlSerializer
+import com.android.server.permission.access.AccessState
+import com.android.server.permission.access.DevicePermissionUri
+import com.android.server.permission.access.GetStateScope
+import com.android.server.permission.access.MutableAccessState
+import com.android.server.permission.access.MutateStateScope
+import com.android.server.permission.access.SchemePolicy
+import com.android.server.permission.access.UidUri
+import com.android.server.permission.access.collection.* // ktlint-disable no-wildcard-imports
+import com.android.server.permission.access.immutable.* // ktlint-disable no-wildcard-imports
+import com.android.server.permission.access.util.andInv
+import com.android.server.pm.pkg.PackageState
+
+class DevicePermissionPolicy : SchemePolicy() {
+ private val persistence = DevicePermissionPersistence()
+
+ @Volatile
+ private var listeners: IndexedListSet<OnDevicePermissionFlagsChangedListener> =
+ MutableIndexedListSet()
+ private val listenersLock = Any()
+
+ override val subjectScheme: String
+ get() = UidUri.SCHEME
+
+ override val objectScheme: String
+ get() = DevicePermissionUri.SCHEME
+
+ override fun GetStateScope.onStateMutated() {
+ listeners.forEachIndexed { _, it -> it.onStateMutated() }
+ }
+
+ override fun MutateStateScope.onAppIdRemoved(appId: Int) {
+ newState.userStates.forEachIndexed { userStateIndex, _, userState ->
+ if (appId in userState.appIdDevicePermissionFlags) {
+ newState.mutateUserStateAt(userStateIndex)
+ .mutateAppIdDevicePermissionFlags() -= appId
+ }
+ }
+ }
+
+ override fun MutateStateScope.onStorageVolumeMounted(
+ volumeUuid: String?,
+ packageNames: List<String>,
+ isSystemUpdated: Boolean
+ ) {
+ packageNames.forEachIndexed { _, packageName ->
+ val packageState = newState.externalState.packageStates[packageName]!!
+ trimPermissionStates(packageState.appId)
+ }
+ }
+
+ override fun MutateStateScope.onPackageAdded(packageState: PackageState) {
+ trimPermissionStates(packageState.appId)
+ }
+
+ override fun MutateStateScope.onPackageRemoved(packageName: String, appId: Int) {
+ if (appId in newState.externalState.appIdPackageNames) {
+ trimPermissionStates(appId)
+ }
+ }
+
+ override fun MutateStateScope.onPackageUninstalled(
+ packageName: String,
+ appId: Int,
+ userId: Int
+ ) {
+ resetPermissionStates(packageName, userId)
+ }
+
+ private fun MutateStateScope.resetPermissionStates(packageName: String, userId: Int) {
+ // It's okay to skip resetting permissions for packages that are removed,
+ // because their states will be trimmed in onPackageRemoved()/onAppIdRemoved()
+ val packageState = newState.externalState.packageStates[packageName] ?: return
+ val androidPackage = packageState.androidPackage ?: return
+ val appId = packageState.appId
+ val appIdPermissionFlags = newState.userStates[userId]!!.appIdDevicePermissionFlags
+ androidPackage.requestedPermissions.forEach { permissionName ->
+ val isRequestedByOtherPackages = anyPackageInAppId(appId) {
+ it.packageName != packageName &&
+ permissionName in it.androidPackage!!.requestedPermissions
+ }
+ if (isRequestedByOtherPackages) {
+ return@forEach
+ }
+ appIdPermissionFlags[appId]?.forEachIndexed { _, deviceId, _ ->
+ setPermissionFlags(appId, deviceId, userId, permissionName, 0)
+ }
+ }
+ }
+
+ private fun MutateStateScope.trimPermissionStates(appId: Int) {
+ val requestedPermissions = MutableIndexedSet<String>()
+ forEachPackageInAppId(appId) {
+ requestedPermissions += it.androidPackage!!.requestedPermissions
+ }
+ newState.userStates.forEachIndexed { _, userId, userState ->
+ userState.appIdDevicePermissionFlags[appId]?.forEachReversedIndexed {
+ _, deviceId, permissionFlags ->
+ permissionFlags.forEachReversedIndexed { _, permissionName, _ ->
+ if (permissionName !in requestedPermissions) {
+ setPermissionFlags(appId, deviceId, userId, permissionName, 0)
+ }
+ }
+ }
+ }
+ }
+
+ private inline fun MutateStateScope.anyPackageInAppId(
+ appId: Int,
+ state: AccessState = newState,
+ predicate: (PackageState) -> Boolean
+ ): Boolean {
+ val packageNames = state.externalState.appIdPackageNames[appId]!!
+ return packageNames.anyIndexed { _, packageName ->
+ val packageState = state.externalState.packageStates[packageName]!!
+ packageState.androidPackage != null && predicate(packageState)
+ }
+ }
+
+ private inline fun MutateStateScope.forEachPackageInAppId(
+ appId: Int,
+ state: AccessState = newState,
+ action: (PackageState) -> Unit
+ ) {
+ val packageNames = state.externalState.appIdPackageNames[appId]!!
+ packageNames.forEachIndexed { _, packageName ->
+ val packageState = state.externalState.packageStates[packageName]!!
+ if (packageState.androidPackage != null) {
+ action(packageState)
+ }
+ }
+ }
+
+ override fun BinaryXmlPullParser.parseUserState(state: MutableAccessState, userId: Int) {
+ with(persistence) { this@parseUserState.parseUserState(state, userId) }
+ }
+
+ override fun BinaryXmlSerializer.serializeUserState(state: AccessState, userId: Int) {
+ with(persistence) { this@serializeUserState.serializeUserState(state, userId) }
+ }
+
+ fun GetStateScope.getPermissionFlags(
+ appId: Int,
+ deviceId: String,
+ userId: Int,
+ permissionName: String
+ ): Int =
+ state.userStates[userId]?.appIdDevicePermissionFlags?.get(appId)?.get(deviceId)
+ ?.getWithDefault(permissionName, 0) ?: 0
+
+ fun MutateStateScope.setPermissionFlags(
+ appId: Int,
+ deviceId: String,
+ userId: Int,
+ permissionName: String,
+ flags: Int
+ ): Boolean =
+ updatePermissionFlags(
+ appId, deviceId, userId, permissionName, PermissionFlags.MASK_ALL, flags
+ )
+
+ private fun MutateStateScope.updatePermissionFlags(
+ appId: Int,
+ deviceId: String,
+ userId: Int,
+ permissionName: String,
+ flagMask: Int,
+ flagValues: Int
+ ): Boolean {
+ if (!isDeviceAwarePermission(permissionName)) {
+ Slog.w(LOG_TAG, "$permissionName is not a device aware permission.")
+ return false
+ }
+ val oldFlags = newState.userStates[userId]!!.appIdDevicePermissionFlags[appId]
+ ?.get(deviceId).getWithDefault(permissionName, 0)
+ val newFlags = (oldFlags andInv flagMask) or (flagValues and flagMask)
+ if (oldFlags == newFlags) {
+ return false
+ }
+ val appIdDevicePermissionFlags =
+ newState.mutateUserState(userId)!!.mutateAppIdDevicePermissionFlags()
+ val devicePermissionFlags = appIdDevicePermissionFlags.mutateOrPut(appId) {
+ MutableIndexedReferenceMap()
+ }
+ val permissionFlags = devicePermissionFlags.mutateOrPut(deviceId) { MutableIndexedMap() }
+ permissionFlags.putWithDefault(permissionName, newFlags, 0)
+ if (permissionFlags.isEmpty()) {
+ devicePermissionFlags -= deviceId
+ if (devicePermissionFlags.isEmpty()) {
+ appIdDevicePermissionFlags -= appId
+ }
+ }
+ listeners.forEachIndexed { _, it ->
+ it.onDevicePermissionFlagsChanged(
+ appId, userId, deviceId, permissionName, oldFlags, newFlags
+ )
+ }
+ return true
+ }
+
+ fun addOnPermissionFlagsChangedListener(listener: OnDevicePermissionFlagsChangedListener) {
+ synchronized(listenersLock) {
+ listeners = listeners + listener
+ }
+ }
+
+ fun removeOnPermissionFlagsChangedListener(listener: OnDevicePermissionFlagsChangedListener) {
+ synchronized(listenersLock) {
+ listeners = listeners - listener
+ }
+ }
+
+ private fun isDeviceAwarePermission(permissionName: String): Boolean =
+ DEVICE_SUPPORTED_PERMISSIONS.contains(permissionName)
+
+ companion object {
+ private val LOG_TAG = DevicePermissionPolicy::class.java.simpleName
+
+ /**
+ * These permissions are supported for virtual devices.
+ */
+ private val DEVICE_SUPPORTED_PERMISSIONS = indexedSetOf(
+ android.Manifest.permission.CAMERA,
+ android.Manifest.permission.RECORD_AUDIO
+ )
+ }
+
+ /**
+ * TODO: b/289355341 - implement listener for permission changes
+ * Listener for permission flags changes.
+ */
+ abstract class OnDevicePermissionFlagsChangedListener {
+ /**
+ * Called when a permission flags change has been made to the upcoming new state.
+ *
+ * Implementations should keep this method fast to avoid stalling the locked state mutation,
+ * and only call external code after [onStateMutated] when the new state has actually become
+ * the current state visible to external code.
+ */
+ abstract fun onDevicePermissionFlagsChanged(
+ appId: Int,
+ userId: Int,
+ deviceId: String,
+ permissionName: String,
+ oldFlags: Int,
+ newFlags: Int
+ )
+
+ /**
+ * Called when the upcoming new state has become the current state.
+ *
+ * Implementations should keep this method fast to avoid stalling the locked state mutation.
+ */
+ abstract fun onStateMutated()
+ }
+}
\ No newline at end of file
diff --git a/services/permission/java/com/android/server/permission/access/permission/PermissionService.kt b/services/permission/java/com/android/server/permission/access/permission/PermissionService.kt
index edacf188..9a19c2d 100644
--- a/services/permission/java/com/android/server/permission/access/permission/PermissionService.kt
+++ b/services/permission/java/com/android/server/permission/access/permission/PermissionService.kt
@@ -64,9 +64,11 @@
import com.android.server.PermissionThread
import com.android.server.ServiceThread
import com.android.server.SystemConfig
+import com.android.server.companion.virtual.VirtualDeviceManagerInternal
import com.android.server.permission.access.AccessCheckingService
import com.android.server.permission.access.AccessState
import com.android.server.permission.access.AppOpUri
+import com.android.server.permission.access.DevicePermissionUri
import com.android.server.permission.access.GetStateScope
import com.android.server.permission.access.MutateStateScope
import com.android.server.permission.access.PermissionUri
@@ -110,6 +112,9 @@
private val policy =
service.getSchemePolicy(UidUri.SCHEME, PermissionUri.SCHEME) as AppIdPermissionPolicy
+ private val devicePolicy =
+ service.getSchemePolicy(UidUri.SCHEME, DevicePermissionUri.SCHEME) as DevicePermissionPolicy
+
private val context = service.context
private lateinit var metricsLogger: MetricsLogger
private lateinit var packageManagerInternal: PackageManagerInternal
@@ -130,6 +135,8 @@
@GuardedBy("storageVolumeLock")
private val storageVolumePackageNames = ArrayMap<String?, MutableList<String>>()
+ private var virtualDeviceManagerInternal: VirtualDeviceManagerInternal? = null
+
private lateinit var permissionControllerManager: PermissionControllerManager
/**
@@ -152,7 +159,6 @@
systemConfig = SystemConfig.getInstance()
userManagerInternal = LocalServices.getService(UserManagerInternal::class.java)
userManagerService = UserManagerService.getInstance()
-
// The package info cache is the cache for package and permission information.
// Disable the package info and package permission caches locally but leave the
// checkPermission cache active.
@@ -460,7 +466,7 @@
return size
}
- override fun checkUidPermission(uid: Int, permissionName: String): Int {
+ override fun checkUidPermission(uid: Int, permissionName: String, deviceId: Int): Int {
val userId = UserHandle.getUserId(uid)
if (!userManagerInternal.exists(userId)) {
return PackageManager.PERMISSION_DENIED
@@ -482,7 +488,7 @@
return PackageManager.PERMISSION_DENIED
}
val isPermissionGranted = service.getState {
- isPermissionGranted(packageState, userId, permissionName)
+ isPermissionGranted(packageState, userId, permissionName, deviceId)
}
return if (isPermissionGranted) {
PackageManager.PERMISSION_GRANTED
@@ -515,7 +521,12 @@
return false
}
- override fun checkPermission(packageName: String, permissionName: String, userId: Int): Int {
+ override fun checkPermission(
+ packageName: String,
+ permissionName: String,
+ deviceId: Int,
+ userId: Int
+ ): Int {
if (!userManagerInternal.exists(userId)) {
return PackageManager.PERMISSION_DENIED
}
@@ -524,7 +535,7 @@
.use { it.getPackageState(packageName) } ?: return PackageManager.PERMISSION_DENIED
val isPermissionGranted = service.getState {
- isPermissionGranted(packageState, userId, permissionName)
+ isPermissionGranted(packageState, userId, permissionName, deviceId)
}
return if (isPermissionGranted) {
PackageManager.PERMISSION_GRANTED
@@ -542,19 +553,21 @@
private fun GetStateScope.isPermissionGranted(
packageState: PackageState,
userId: Int,
- permissionName: String
+ permissionName: String,
+ deviceId: Int
): Boolean {
val appId = packageState.appId
// Note that instant apps can't have shared UIDs, so we only need to check the current
// package state.
val isInstantApp = packageState.getUserStateOrDefault(userId).isInstantApp
- if (isSinglePermissionGranted(appId, userId, isInstantApp, permissionName)) {
+ if (isSinglePermissionGranted(appId, userId, isInstantApp, permissionName, deviceId)) {
return true
}
val fullerPermissionName = FULLER_PERMISSIONS[permissionName]
if (fullerPermissionName != null &&
- isSinglePermissionGranted(appId, userId, isInstantApp, fullerPermissionName)) {
+ isSinglePermissionGranted(appId, userId, isInstantApp, fullerPermissionName, deviceId)
+ ) {
return true
}
@@ -568,9 +581,10 @@
appId: Int,
userId: Int,
isInstantApp: Boolean,
- permissionName: String
+ permissionName: String,
+ deviceId: Int,
): Boolean {
- val flags = with(policy) { getPermissionFlags(appId, userId, permissionName) }
+ val flags = getPermissionFlagsWithPolicy(appId, userId, permissionName, deviceId)
if (!PermissionFlags.isPermissionGranted(flags)) {
return false
}
@@ -601,7 +615,8 @@
?: return emptySet()
return permissionFlags.mapNotNullIndexedTo(ArraySet()) { _, permissionName, _ ->
- if (isPermissionGranted(packageState, userId, permissionName)) {
+ if (isPermissionGranted(
+ packageState, userId, permissionName, Context.DEVICE_ID_DEFAULT)) {
permissionName
} else {
null
@@ -640,18 +655,26 @@
}
}
- override fun grantRuntimePermission(packageName: String, permissionName: String, userId: Int) {
- setRuntimePermissionGranted(packageName, userId, permissionName, isGranted = true)
+ override fun grantRuntimePermission(
+ packageName: String,
+ permissionName: String,
+ deviceId: Int,
+ userId: Int
+ ) {
+ setRuntimePermissionGranted(
+ packageName, userId, permissionName, deviceId, isGranted = true
+ )
}
override fun revokeRuntimePermission(
packageName: String,
permissionName: String,
+ deviceId: Int,
userId: Int,
reason: String?
) {
setRuntimePermissionGranted(
- packageName, userId, permissionName, isGranted = false, revokeReason = reason
+ packageName, userId, permissionName, deviceId, isGranted = false, revokeReason = reason
)
}
@@ -660,8 +683,8 @@
userId: Int
) {
setRuntimePermissionGranted(
- packageName, userId, Manifest.permission.POST_NOTIFICATIONS, isGranted = false,
- skipKillUid = true
+ packageName, userId, Manifest.permission.POST_NOTIFICATIONS, Context.DEVICE_ID_DEFAULT,
+ isGranted = false, skipKillUid = true
)
}
@@ -673,6 +696,7 @@
packageName: String,
userId: Int,
permissionName: String,
+ deviceId: Int,
isGranted: Boolean,
skipKillUid: Boolean = false,
revokeReason: String? = null
@@ -748,7 +772,7 @@
}
setRuntimePermissionGranted(
- packageState, userId, permissionName, isGranted, canManageRolePermission,
+ packageState, userId, permissionName, deviceId, isGranted, canManageRolePermission,
overridePolicyFixed, reportError = true, methodName
)
}
@@ -782,14 +806,16 @@
if (permissionState ==
PackageInstaller.SessionParams.PERMISSION_STATE_GRANTED) {
setRuntimePermissionGranted(
- packageState, userId, permissionName, isGranted = true,
- canManageRolePermission = false, overridePolicyFixed = false,
- reportError = false, "setRequestedPermissionStates"
+ packageState, userId, permissionName, Context.DEVICE_ID_DEFAULT,
+ isGranted = true, canManageRolePermission = false,
+ overridePolicyFixed = false, reportError = false,
+ "setRequestedPermissionStates"
)
updatePermissionFlags(
packageState.appId, userId, permissionName,
+ Context.DEVICE_ID_DEFAULT,
PackageManager.FLAG_PERMISSION_REVIEW_REQUIRED or
- PackageManager.FLAG_PERMISSION_REVOKED_COMPAT, 0,
+ PackageManager.FLAG_PERMISSION_REVOKED_COMPAT, 0,
canUpdateSystemFlags = false,
reportErrorForUnknownPermission = false,
isPermissionRequested = true, "setRequestedPermissionStates",
@@ -816,6 +842,7 @@
packageState: PackageState,
userId: Int,
permissionName: String,
+ deviceId: Int,
isGranted: Boolean,
canManageRolePermission: Boolean,
overridePolicyFixed: Boolean,
@@ -871,7 +898,7 @@
}
val appId = packageState.appId
- val oldFlags = with(policy) { getPermissionFlags(appId, userId, permissionName) }
+ val oldFlags = getPermissionFlagsWithPolicy(appId, userId, permissionName, deviceId)
if (permissionName !in androidPackage.requestedPermissions && oldFlags == 0) {
if (reportError) {
@@ -934,7 +961,7 @@
return
}
- with(policy) { setPermissionFlags(appId, userId, permissionName, newFlags) }
+ setPermissionFlagsWithPolicy(appId, userId, permissionName, deviceId, newFlags)
if (permission.isRuntime) {
val action = if (isGranted) {
@@ -963,7 +990,12 @@
with(appOpPolicy) { setAppOpMode(packageState.appId, userId, appOpName, mode) }
}
- override fun getPermissionFlags(packageName: String, permissionName: String, userId: Int): Int {
+ override fun getPermissionFlags(
+ packageName: String,
+ permissionName: String,
+ deviceId: Int,
+ userId: Int,
+ ): Int {
if (!userManagerInternal.exists(userId)) {
Slog.w(LOG_TAG, "getPermissionFlags: Unknown user $userId")
return 0
@@ -994,7 +1026,8 @@
}
val flags =
- with(policy) { getPermissionFlags(packageState.appId, userId, permissionName) }
+ getPermissionFlagsWithPolicy(packageState.appId, userId, permissionName, deviceId)
+
return PermissionFlags.toApiFlags(flags)
}
}
@@ -1002,6 +1035,7 @@
override fun isPermissionRevokedByPolicy(
packageName: String,
permissionName: String,
+ deviceId: Int,
userId: Int
): Boolean {
if (!userManagerInternal.exists(userId)) {
@@ -1018,13 +1052,13 @@
.use { it.getPackageState(packageName) } ?: return false
service.getState {
- if (isPermissionGranted(packageState, userId, permissionName)) {
+ if (isPermissionGranted(packageState, userId, permissionName, deviceId)) {
return false
}
- val flags = with(policy) {
- getPermissionFlags(packageState.appId, userId, permissionName)
- }
+ val flags =
+ getPermissionFlagsWithPolicy(packageState.appId, userId, permissionName, deviceId)
+
return flags.hasBits(PermissionFlags.POLICY_FIXED)
}
}
@@ -1046,7 +1080,8 @@
override fun shouldShowRequestPermissionRationale(
packageName: String,
permissionName: String,
- userId: Int
+ deviceId: Int,
+ userId: Int,
): Boolean {
if (!userManagerInternal.exists(userId)) {
Slog.w(LOG_TAG, "shouldShowRequestPermissionRationale: Unknown user $userId")
@@ -1068,11 +1103,11 @@
val flags: Int
service.getState {
- if (isPermissionGranted(packageState, userId, permissionName)) {
+ if (isPermissionGranted(packageState, userId, permissionName, deviceId)) {
return false
}
- flags = with(policy) { getPermissionFlags(appId, userId, permissionName) }
+ flags = getPermissionFlagsWithPolicy(appId, userId, permissionName, deviceId)
}
if (flags.hasAnyBit(UNREQUESTABLE_MASK)) {
return false
@@ -1104,6 +1139,7 @@
flagMask: Int,
flagValues: Int,
enforceAdjustPolicyPermission: Boolean,
+ deviceId: Int,
userId: Int
) {
val callingUid = Binder.getCallingUid()
@@ -1199,7 +1235,7 @@
val appId = packageState.appId
service.mutateState {
updatePermissionFlags(
- appId, userId, permissionName, flagMask, flagValues, canUpdateSystemFlags,
+ appId, userId, permissionName, deviceId, flagMask, flagValues, canUpdateSystemFlags,
reportErrorForUnknownPermission = true, isPermissionRequested,
"updatePermissionFlags", packageName
)
@@ -1248,8 +1284,9 @@
val androidPackage = packageState.androidPackage ?: return@forEach
androidPackage.requestedPermissions.forEach { permissionName ->
updatePermissionFlags(
- packageState.appId, userId, permissionName, flagMask, flagValues,
- canUpdateSystemFlags, reportErrorForUnknownPermission = false,
+ packageState.appId, userId, permissionName, Context.DEVICE_ID_DEFAULT,
+ flagMask, flagValues, canUpdateSystemFlags,
+ reportErrorForUnknownPermission = false,
isPermissionRequested = true, "updatePermissionFlagsForAllApps", packageName
)
}
@@ -1264,6 +1301,7 @@
appId: Int,
userId: Int,
permissionName: String,
+ deviceId: Int,
flagMask: Int,
flagValues: Int,
canUpdateSystemFlags: Boolean,
@@ -1298,7 +1336,7 @@
return
}
- val oldFlags = with(policy) { getPermissionFlags(appId, userId, permissionName) }
+ val oldFlags = getPermissionFlagsWithPolicy(appId, userId, permissionName, deviceId)
if (!isPermissionRequested && oldFlags == 0) {
Slog.w(
LOG_TAG, "$methodName: Permission $permissionName isn't requested by package" +
@@ -1308,7 +1346,7 @@
}
val newFlags = PermissionFlags.updateFlags(permission, oldFlags, flagMask, flagValues)
- with(policy) { setPermissionFlags(appId, userId, permissionName, newFlags) }
+ setPermissionFlagsWithPolicy(appId, userId, permissionName, deviceId, newFlags)
}
override fun getAllowlistedRestrictedPermissions(
@@ -1365,6 +1403,63 @@
)
}
+ private fun GetStateScope.getPermissionFlagsWithPolicy(
+ appId: Int,
+ userId: Int,
+ permissionName: String,
+ deviceId: Int,
+ ): Int {
+ return if (deviceId == Context.DEVICE_ID_DEFAULT) {
+ with(policy) { getPermissionFlags(appId, userId, permissionName) }
+ } else {
+ val virtualDeviceManagerInternal = virtualDeviceManagerInternal
+ if (virtualDeviceManagerInternal == null) {
+ Slog.e(LOG_TAG, "Virtual device manager service is not available.")
+ return 0
+ }
+ val persistentDeviceId =
+ virtualDeviceManagerInternal.getPersistentIdForDevice(deviceId)
+ if (persistentDeviceId != null) {
+ with(devicePolicy) {
+ getPermissionFlags(appId, persistentDeviceId, userId, permissionName)
+ }
+ } else {
+ Slog.e(LOG_TAG, "Invalid device ID $deviceId.")
+ 0
+ }
+ }
+ }
+
+ private fun MutateStateScope.setPermissionFlagsWithPolicy(
+ appId: Int,
+ userId: Int,
+ permissionName: String,
+ deviceId: Int,
+ flags: Int
+ ): Boolean {
+ return if (deviceId == Context.DEVICE_ID_DEFAULT) {
+ with(policy) {
+ setPermissionFlags(appId, userId, permissionName, flags)
+ }
+ } else {
+ val virtualDeviceManagerInternal = virtualDeviceManagerInternal
+ if (virtualDeviceManagerInternal == null) {
+ Slog.e(LOG_TAG, "Virtual device manager service is not available.")
+ return false
+ }
+ val persistentDeviceId =
+ virtualDeviceManagerInternal.getPersistentIdForDevice(deviceId)
+ if (persistentDeviceId != null) {
+ with(devicePolicy) {
+ setPermissionFlags(appId, persistentDeviceId, userId, permissionName, flags)
+ }
+ } else {
+ Slog.e(LOG_TAG, "Invalid device ID $deviceId.")
+ false
+ }
+ }
+ }
+
/**
* This method does not enforce checks on the caller, should only be called after
* required checks.
@@ -1539,8 +1634,7 @@
) {
service.mutateState {
with(policy) {
- val permissionsFlags =
- getUidPermissionFlags(appId, userId) ?: return@mutateState
+ val permissionsFlags = getUidPermissionFlags(appId, userId) ?: return@mutateState
val permissions = getPermissions()
androidPackage.requestedPermissions.forEachIndexed { _, requestedPermission ->
@@ -1661,8 +1755,6 @@
)
}
-
-
override fun getAppOpPermissionPackages(permissionName: String): Array<String> {
requireNotNull(permissionName) { "permissionName cannot be null" }
val packageNames = ArraySet<String>()
@@ -1879,7 +1971,7 @@
println("Permissions:")
withIndent {
userState.appIdPermissionFlags[appId]?.forEachIndexed {
- _, permissionName, flags ->
+ _, permissionName, flags ->
val isGranted = PermissionFlags.isPermissionGranted(flags)
println(
"$permissionName: granted=$isGranted, flags=" +
@@ -1888,6 +1980,20 @@
}
}
+ userState.appIdDevicePermissionFlags[appId]?.forEachIndexed {
+ _, deviceId, devicePermissionFlags ->
+ println("Permissions (Device $deviceId):")
+ withIndent {
+ devicePermissionFlags.forEachIndexed { _, permissionName, flags ->
+ val isGranted = PermissionFlags.isPermissionGranted(flags)
+ println(
+ "$permissionName: granted=$isGranted, flags=" +
+ PermissionFlags.toString(flags)
+ )
+ }
+ }
+ }
+
println("App ops:")
withIndent {
userState.appIdAppOpModes[appId]?.forEachIndexed {_, appOpName, appOpMode ->
@@ -2003,6 +2109,8 @@
override fun onSystemReady() {
service.onSystemReady()
+ virtualDeviceManagerInternal =
+ LocalServices.getService(VirtualDeviceManagerInternal::class.java)
permissionControllerManager = PermissionControllerManager(
context, PermissionThread.getHandler()
)
@@ -2412,7 +2520,7 @@
}
private fun isAppBackupAndRestoreRunning(uid: Int): Boolean {
- if (checkUidPermission(uid, Manifest.permission.BACKUP) !=
+ if (checkUidPermission(uid, Manifest.permission.BACKUP, Context.DEVICE_ID_DEFAULT) !=
PackageManager.PERMISSION_GRANTED) {
return false
}
diff --git a/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupReporterTest.java b/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupReporterTest.java
index 14b4dc3..2db2438 100644
--- a/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupReporterTest.java
+++ b/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupReporterTest.java
@@ -27,6 +27,7 @@
import android.util.Log;
import com.android.server.backup.UserBackupManagerService;
+import com.android.server.backup.utils.BackupManagerMonitorEventSender;
import com.android.server.testing.shadows.ShadowEventLog;
import com.android.server.testing.shadows.ShadowSlog;
@@ -46,10 +47,13 @@
@Mock private IBackupManagerMonitor mMonitor;
private KeyValueBackupReporter mReporter;
+ private BackupManagerMonitorEventSender mBackupManagerMonitorEventSender;
@Before
public void setUp() {
- mReporter = new KeyValueBackupReporter(mBackupManagerService, mObserver, mMonitor);
+ mBackupManagerMonitorEventSender = new BackupManagerMonitorEventSender(mMonitor);
+ mReporter = new KeyValueBackupReporter(
+ mBackupManagerService, mObserver, mBackupManagerMonitorEventSender);
}
@Test
diff --git a/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupTaskTest.java b/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupTaskTest.java
index bfbc0f5..7349c14 100644
--- a/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupTaskTest.java
+++ b/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupTaskTest.java
@@ -122,6 +122,7 @@
import com.android.server.backup.testing.TransportTestUtils;
import com.android.server.backup.testing.TransportTestUtils.TransportMock;
import com.android.server.backup.utils.BackupEligibilityRules;
+import com.android.server.backup.utils.BackupManagerMonitorEventSender;
import com.android.server.testing.shadows.FrameworkShadowLooper;
import com.android.server.testing.shadows.ShadowApplicationPackageManager;
import com.android.server.testing.shadows.ShadowBackupDataInput;
@@ -260,7 +261,8 @@
mBackupHandler = mBackupManagerService.getBackupHandler();
mShadowBackupLooper = shadowOf(mBackupHandler.getLooper());
ShadowEventLog.setUp();
- mReporter = spy(new KeyValueBackupReporter(mBackupManagerService, mObserver, mMonitor));
+ mReporter = spy(new KeyValueBackupReporter(mBackupManagerService, mObserver,
+ new BackupManagerMonitorEventSender(mMonitor)));
when(mPackageManagerInternal.getApplicationEnabledState(any(), anyInt()))
.thenReturn(PackageManager.COMPONENT_ENABLED_STATE_ENABLED);
diff --git a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageManagerTests.java b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageManagerTests.java
index 74dc853..7552800 100644
--- a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageManagerTests.java
+++ b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageManagerTests.java
@@ -56,7 +56,7 @@
import android.os.RemoteException;
import android.os.StatFs;
import android.os.SystemClock;
-import android.platform.test.annotations.Presubmit;
+import android.platform.test.annotations.Postsubmit;
import android.provider.DeviceConfig;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
@@ -93,7 +93,7 @@
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.TimeUnit;
-@Presubmit
+@Postsubmit
public class PackageManagerTests extends AndroidTestCase {
private static final boolean localLOGV = true;
diff --git a/services/tests/RemoteProvisioningServiceTests/src/com/android/server/security/rkp/RemoteProvisioningShellCommandTest.java b/services/tests/RemoteProvisioningServiceTests/src/com/android/server/security/rkp/RemoteProvisioningShellCommandTest.java
index 2d93120..007c0db 100644
--- a/services/tests/RemoteProvisioningServiceTests/src/com/android/server/security/rkp/RemoteProvisioningShellCommandTest.java
+++ b/services/tests/RemoteProvisioningServiceTests/src/com/android/server/security/rkp/RemoteProvisioningShellCommandTest.java
@@ -21,12 +21,14 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.content.Context;
import android.hardware.security.keymint.DeviceInfo;
import android.hardware.security.keymint.IRemotelyProvisionedComponent;
import android.hardware.security.keymint.MacedPublicKey;
@@ -34,28 +36,35 @@
import android.hardware.security.keymint.RpcHardwareInfo;
import android.os.Binder;
import android.os.FileUtils;
+import android.os.OutcomeReceiver;
+import android.os.Process;
+import android.security.rkp.service.RegistrationProxy;
+import android.security.rkp.service.RemotelyProvisionedKey;
+import androidx.test.core.app.ApplicationProvider;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.util.Arrays;
import java.util.Base64;
import java.util.Map;
+import java.util.concurrent.Executor;
@RunWith(AndroidJUnit4.class)
public class RemoteProvisioningShellCommandTest {
+ private Context mContext;
+
private static class Injector extends RemoteProvisioningShellCommand.Injector {
- private final Map<String, IRemotelyProvisionedComponent> mIrpcs;
-
- Injector(Map irpcs) {
- mIrpcs = irpcs;
- }
+ Map<String, IRemotelyProvisionedComponent> mIrpcs;
+ Map<String, RegistrationProxy> mRegistrationProxies;
@Override
String[] getIrpcNames() {
@@ -70,6 +79,12 @@
}
return irpc;
}
+
+ @Override
+ RegistrationProxy getRegistrationProxy(
+ Context context, int callerUid, String name, Executor executor) {
+ return mRegistrationProxies.get(name);
+ }
}
private static class CommandResult {
@@ -111,10 +126,17 @@
code, FileUtils.readTextFile(out, 0, null), FileUtils.readTextFile(err, 0, null));
}
+ @Before
+ public void setUp() {
+ mContext = ApplicationProvider.getApplicationContext();
+ }
+
@Test
public void list_zeroInstances() throws Exception {
+ Injector injector = new Injector();
+ injector.mIrpcs = Map.of();
RemoteProvisioningShellCommand cmd = new RemoteProvisioningShellCommand(
- new Injector(Map.of()));
+ mContext, Process.SHELL_UID, injector);
CommandResult res = exec(cmd, new String[] {"list"});
assertThat(res.getErr()).isEmpty();
assertThat(res.getCode()).isEqualTo(0);
@@ -124,8 +146,10 @@
@Test
public void list_oneInstances() throws Exception {
+ Injector injector = new Injector();
+ injector.mIrpcs = Map.of("default", mock(IRemotelyProvisionedComponent.class));
RemoteProvisioningShellCommand cmd = new RemoteProvisioningShellCommand(
- new Injector(Map.of("default", mock(IRemotelyProvisionedComponent.class))));
+ mContext, Process.SHELL_UID, injector);
CommandResult res = exec(cmd, new String[] {"list"});
assertThat(res.getErr()).isEmpty();
assertThat(res.getCode()).isEqualTo(0);
@@ -134,10 +158,12 @@
@Test
public void list_twoInstances() throws Exception {
+ Injector injector = new Injector();
+ injector.mIrpcs = Map.of(
+ "default", mock(IRemotelyProvisionedComponent.class),
+ "strongbox", mock(IRemotelyProvisionedComponent.class));
RemoteProvisioningShellCommand cmd = new RemoteProvisioningShellCommand(
- new Injector(Map.of(
- "default", mock(IRemotelyProvisionedComponent.class),
- "strongbox", mock(IRemotelyProvisionedComponent.class))));
+ mContext, Process.SHELL_UID, injector);
CommandResult res = exec(cmd, new String[] {"list"});
assertThat(res.getErr()).isEmpty();
assertThat(res.getCode()).isEqualTo(0);
@@ -158,8 +184,10 @@
}).when(defaultMock).generateCertificateRequest(
anyBoolean(), any(), any(), any(), any(), any());
+ Injector injector = new Injector();
+ injector.mIrpcs = Map.of("default", defaultMock);
RemoteProvisioningShellCommand cmd = new RemoteProvisioningShellCommand(
- new Injector(Map.of("default", defaultMock)));
+ mContext, Process.SHELL_UID, injector);
CommandResult res = exec(cmd, new String[] {
"csr", "--challenge", "dGVzdHRlc3R0ZXN0dGVzdA==", "default"});
verify(defaultMock).generateCertificateRequest(
@@ -189,8 +217,10 @@
}).when(defaultMock).generateCertificateRequest(
anyBoolean(), any(), any(), any(), any(), any());
+ Injector injector = new Injector();
+ injector.mIrpcs = Map.of("default", defaultMock);
RemoteProvisioningShellCommand cmd = new RemoteProvisioningShellCommand(
- new Injector(Map.of("default", defaultMock)));
+ mContext, Process.SHELL_UID, injector);
CommandResult res = exec(cmd, new String[] {
"csr", "--challenge", "dGVzdHRlc3R0ZXN0dGVzdA==", "default"});
verify(defaultMock).generateCertificateRequest(
@@ -215,8 +245,10 @@
when(defaultMock.generateCertificateRequestV2(any(), any()))
.thenReturn(new byte[] {0x68, 0x65, 0x6c, 0x6c, 0x6f});
+ Injector injector = new Injector();
+ injector.mIrpcs = Map.of("default", defaultMock);
RemoteProvisioningShellCommand cmd = new RemoteProvisioningShellCommand(
- new Injector(Map.of("default", defaultMock)));
+ mContext, Process.SHELL_UID, injector);
CommandResult res = exec(cmd, new String[] {"csr", "default"});
verify(defaultMock).generateCertificateRequestV2(new MacedPublicKey[0], new byte[0]);
assertThat(res.getErr()).isEmpty();
@@ -233,8 +265,10 @@
when(defaultMock.generateCertificateRequestV2(any(), any()))
.thenReturn(new byte[] {0x68, 0x69});
+ Injector injector = new Injector();
+ injector.mIrpcs = Map.of("default", defaultMock);
RemoteProvisioningShellCommand cmd = new RemoteProvisioningShellCommand(
- new Injector(Map.of("default", defaultMock)));
+ mContext, Process.SHELL_UID, injector);
CommandResult res = exec(cmd, new String[] {"csr", "--challenge", "dHJpYWw=", "default"});
verify(defaultMock).generateCertificateRequestV2(
new MacedPublicKey[0], new byte[] {0x74, 0x72, 0x69, 0x61, 0x6c});
@@ -242,4 +276,82 @@
assertThat(res.getCode()).isEqualTo(0);
assertThat(res.getOut()).isEqualTo("aGk=\n");
}
+
+ @Test
+ public void certify_sameOrderAsReceived() throws Exception {
+ String cert1 = "MIIBqDCCAU2gAwIBAgIUI3FFU7xZno/2Xf/wZzKKquP0ov0wCgYIKoZIzj0EAwIw\n"
+ + "KTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQ0wCwYDVQQKDARUZXN0MB4XDTIz\n"
+ + "MDgyMjE5MzgxMFoXDTMzMDgxOTE5MzgxMFowKTELMAkGA1UEBhMCVVMxCzAJBgNV\n"
+ + "BAgMAkNBMQ0wCwYDVQQKDARUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE\n"
+ + "czOpG6NKOdDjV/yrKjuy0q0jEJvsVLGgTeY+vyKRBJS59OhyRWG6n3aza21bNg5d\n"
+ + "WE9ruz+bcT0IP4kDbiS0y6NTMFEwHQYDVR0OBBYEFHYfJxCUipNI7qRqvczcWsOb\n"
+ + "FIDPMB8GA1UdIwQYMBaAFHYfJxCUipNI7qRqvczcWsObFIDPMA8GA1UdEwEB/wQF\n"
+ + "MAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhAKm/kpJwlnWkjoLCAddBiSnxbT4EfJIK\n"
+ + "H0j58tg5VazHAiEAnS/kRzU9AbstOZyD7el/ws3gLXkbUNey3pLFutBWsSU=\n";
+ String cert2 = "MIIBpjCCAU2gAwIBAgIUdSzfZzeGr+h70JPO7Sxwdkw99iMwCgYIKoZIzj0EAwIw\n"
+ + "KTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQ0wCwYDVQQKDARUZXN0MB4XDTIz\n"
+ + "MDgyMjIwMTcyMFoXDTMzMDgxOTIwMTcyMFowKTELMAkGA1UEBhMCVVMxCzAJBgNV\n"
+ + "BAgMAkNBMQ0wCwYDVQQKDARUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE\n"
+ + "voGJi4DxuqH8rzPV6Eq0OVULc0xFzaM0500VBqiQEB7Qt0Ktk2d+3bUrFAb3SZV4\n"
+ + "6TIdb7SkynvaDtr0x45Ng6NTMFEwHQYDVR0OBBYEFMeGjvGV0ADPBJk5/FPoW9HQ\n"
+ + "uTc6MB8GA1UdIwQYMBaAFMeGjvGV0ADPBJk5/FPoW9HQuTc6MA8GA1UdEwEB/wQF\n"
+ + "MAMBAf8wCgYIKoZIzj0EAwIDRwAwRAIgd1gu7iiNOQXaQUn5BT3WwWR0Yk78ndWt\n"
+ + "ew7tRiTOhFcCIFURi6WcNH0oWa6IbwBSMC9aZlo98Fbg+dTwhLAAw+PW\n";
+ byte[] cert1Bytes = Base64.getDecoder().decode(cert1.replaceAll("\\s+", ""));
+ byte[] cert2Bytes = Base64.getDecoder().decode(cert2.replaceAll("\\s+", ""));
+ byte[] certChain = Arrays.copyOf(cert1Bytes, cert1Bytes.length + cert2Bytes.length);
+ System.arraycopy(cert2Bytes, 0, certChain, cert1Bytes.length, cert2Bytes.length);
+ RemotelyProvisionedKey keyMock = mock(RemotelyProvisionedKey.class);
+ when(keyMock.getEncodedCertChain()).thenReturn(certChain);
+ RegistrationProxy defaultMock = mock(RegistrationProxy.class);
+ doAnswer(invocation -> {
+ ((OutcomeReceiver<RemotelyProvisionedKey, Exception>) invocation.getArgument(3))
+ .onResult(keyMock);
+ return null;
+ }).when(defaultMock).getKeyAsync(anyInt(), any(), any(), any());
+
+ Injector injector = new Injector();
+ injector.mRegistrationProxies = Map.of("default", defaultMock);
+ RemoteProvisioningShellCommand cmd = new RemoteProvisioningShellCommand(
+ mContext, Process.SHELL_UID, injector);
+ CommandResult res = exec(cmd, new String[] {"certify", "default"});
+ assertThat(res.getErr()).isEmpty();
+ assertThat(res.getCode()).isEqualTo(0);
+ assertThat(res.getOut()).isEqualTo(
+ "-----BEGIN CERTIFICATE-----\n" + cert1 + "-----END CERTIFICATE-----\n"
+ + "-----BEGIN CERTIFICATE-----\n" + cert2 + "-----END CERTIFICATE-----\n");
+ }
+
+ @Test
+ public void certify_noBlankLineBeforeTrailer() throws Exception {
+ String cert = "MIIB2zCCAYGgAwIBAgIRAOpN7Em1k7gaqLAB2dzXUTYwCgYIKoZIzj0EAwIwKTET\n"
+ + "MBEGA1UEChMKR29vZ2xlIExMQzESMBAGA1UEAxMJRHJvaWQgQ0EzMB4XDTIzMDgx\n"
+ + "ODIzMzI1MloXDTIzMDkyMTIzMzI1MlowOTEMMAoGA1UEChMDVEVFMSkwJwYDVQQD\n"
+ + "EyBlYTRkZWM0OWI1OTNiODFhYThiMDAxZDlkY2Q3NTEzNjBZMBMGByqGSM49AgEG\n"
+ + "CCqGSM49AwEHA0IABHM/cKZblmlw8bdGbDXnX+ZiLiGjSjaLHXYOoHDrVArAMXUi\n"
+ + "L6brhcUPaqSGcVLcfFZbaFMOxXW6TsGdQiwJ0iyjejB4MB0GA1UdDgQWBBTYzft+\n"
+ + "X32TH/Hh+ngwQF6aPhnfXDAfBgNVHSMEGDAWgBQT4JObI9mzNNW2FRsHRcw4zVn2\n"
+ + "8jAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwICBDAVBgorBgEEAdZ5AgEe\n"
+ + "BAehARoABAAAMAoGCCqGSM49BAMCA0gAMEUCIDc0OR7CzIYw0myTr0y/Brl1nZyk\n"
+ + "eGSQp615WpTwYhwxAiEApM10gSIKBIo7Z4/FNzkuiz1zZwW9+Dcqisqxkfe6icQ=\n";
+ byte[] certBytes = Base64.getDecoder().decode(cert.replaceAll("\\s+", ""));
+ RemotelyProvisionedKey keyMock = mock(RemotelyProvisionedKey.class);
+ when(keyMock.getEncodedCertChain()).thenReturn(certBytes);
+ RegistrationProxy defaultMock = mock(RegistrationProxy.class);
+ doAnswer(invocation -> {
+ ((OutcomeReceiver<RemotelyProvisionedKey, Exception>) invocation.getArgument(3))
+ .onResult(keyMock);
+ return null;
+ }).when(defaultMock).getKeyAsync(anyInt(), any(), any(), any());
+
+ Injector injector = new Injector();
+ injector.mRegistrationProxies = Map.of("strongbox", defaultMock);
+ RemoteProvisioningShellCommand cmd = new RemoteProvisioningShellCommand(
+ mContext, Process.SHELL_UID, injector);
+ CommandResult res = exec(cmd, new String[] {"certify", "strongbox"});
+ assertThat(res.getErr()).isEmpty();
+ assertThat(res.getCode()).isEqualTo(0);
+ assertThat(res.getOut()).isEqualTo(
+ "-----BEGIN CERTIFICATE-----\n" + cert + "-----END CERTIFICATE-----\n");
+ }
}
diff --git a/services/tests/displayservicetests/src/com/android/server/display/DisplayDeviceTest.java b/services/tests/displayservicetests/src/com/android/server/display/DisplayDeviceTest.java
new file mode 100644
index 0000000..4fd8f26
--- /dev/null
+++ b/services/tests/displayservicetests/src/com/android/server/display/DisplayDeviceTest.java
@@ -0,0 +1,120 @@
+/*
+ * 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.server.display;
+
+import static android.view.Surface.ROTATION_0;
+import static android.view.Surface.ROTATION_180;
+import static android.view.Surface.ROTATION_270;
+import static android.view.Surface.ROTATION_90;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.graphics.Point;
+import android.graphics.Rect;
+import android.platform.test.annotations.Presubmit;
+import android.view.SurfaceControl;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+/**
+ * Tests for the {@link DisplayDevice} class.
+ *
+ * Build/Install/Run:
+ * atest DisplayServicesTests:DisplayDeviceTest
+ */
+@SmallTest
+@Presubmit
+@RunWith(AndroidJUnit4.class)
+public class DisplayDeviceTest {
+ private final DisplayDeviceInfo mDisplayDeviceInfo = new DisplayDeviceInfo();
+ private static final int WIDTH = 500;
+ private static final int HEIGHT = 900;
+ private static final Point PORTRAIT_SIZE = new Point(WIDTH, HEIGHT);
+ private static final Point LANDSCAPE_SIZE = new Point(HEIGHT, WIDTH);
+
+ @Mock
+ private SurfaceControl.Transaction mMockTransaction;
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ mDisplayDeviceInfo.width = WIDTH;
+ mDisplayDeviceInfo.height = HEIGHT;
+ mDisplayDeviceInfo.rotation = ROTATION_0;
+ }
+
+ @Test
+ public void testGetDisplaySurfaceDefaultSizeLocked_notRotated() {
+ DisplayDevice displayDevice = new FakeDisplayDevice(mDisplayDeviceInfo);
+ assertThat(displayDevice.getDisplaySurfaceDefaultSizeLocked()).isEqualTo(PORTRAIT_SIZE);
+ }
+
+ @Test
+ public void testGetDisplaySurfaceDefaultSizeLocked_rotation0() {
+ DisplayDevice displayDevice = new FakeDisplayDevice(mDisplayDeviceInfo);
+ displayDevice.setProjectionLocked(mMockTransaction, ROTATION_0, new Rect(), new Rect());
+ assertThat(displayDevice.getDisplaySurfaceDefaultSizeLocked()).isEqualTo(PORTRAIT_SIZE);
+ }
+
+ @Test
+ public void testGetDisplaySurfaceDefaultSizeLocked_rotation90() {
+ DisplayDevice displayDevice = new FakeDisplayDevice(mDisplayDeviceInfo);
+ displayDevice.setProjectionLocked(mMockTransaction, ROTATION_90, new Rect(), new Rect());
+ assertThat(displayDevice.getDisplaySurfaceDefaultSizeLocked()).isEqualTo(LANDSCAPE_SIZE);
+ }
+
+ @Test
+ public void testGetDisplaySurfaceDefaultSizeLocked_rotation180() {
+ DisplayDevice displayDevice = new FakeDisplayDevice(mDisplayDeviceInfo);
+ displayDevice.setProjectionLocked(mMockTransaction, ROTATION_180, new Rect(), new Rect());
+ assertThat(displayDevice.getDisplaySurfaceDefaultSizeLocked()).isEqualTo(PORTRAIT_SIZE);
+ }
+
+ @Test
+ public void testGetDisplaySurfaceDefaultSizeLocked_rotation270() {
+ DisplayDevice displayDevice = new FakeDisplayDevice(mDisplayDeviceInfo);
+ displayDevice.setProjectionLocked(mMockTransaction, ROTATION_270, new Rect(), new Rect());
+ assertThat(displayDevice.getDisplaySurfaceDefaultSizeLocked()).isEqualTo(LANDSCAPE_SIZE);
+ }
+
+ private static class FakeDisplayDevice extends DisplayDevice {
+ private final DisplayDeviceInfo mDisplayDeviceInfo;
+
+ FakeDisplayDevice(DisplayDeviceInfo displayDeviceInfo) {
+ super(null, null, "", InstrumentationRegistry.getInstrumentation().getContext());
+ mDisplayDeviceInfo = displayDeviceInfo;
+ }
+
+ @Override
+ public boolean hasStableUniqueId() {
+ return false;
+ }
+
+ @Override
+ public DisplayDeviceInfo getDisplayDeviceInfoLocked() {
+ return mDisplayDeviceInfo;
+ }
+ }
+}
diff --git a/services/tests/displayservicetests/src/com/android/server/display/whitebalance/AmbientLuxTest.java b/services/tests/displayservicetests/src/com/android/server/display/whitebalance/AmbientLuxTest.java
index f975b6f..183a84d 100644
--- a/services/tests/displayservicetests/src/com/android/server/display/whitebalance/AmbientLuxTest.java
+++ b/services/tests/displayservicetests/src/com/android/server/display/whitebalance/AmbientLuxTest.java
@@ -64,7 +64,9 @@
private static final int AMBIENT_COLOR_TYPE = 20705;
private static final String AMBIENT_COLOR_TYPE_STR = "colorSensoryDensoryDoc";
private static final float LOW_LIGHT_AMBIENT_COLOR_TEMPERATURE = 5432.1f;
+ private static final float LOW_LIGHT_AMBIENT_COLOR_TEMPERATURE_STRONG = 5555.5f;
private static final float HIGH_LIGHT_AMBIENT_COLOR_TEMPERATURE = 3456.7f;
+ private static final float HIGH_LIGHT_AMBIENT_COLOR_TEMPERATURE_STRONG = 3333.3f;
private Handler mHandler = new Handler(Looper.getMainLooper());
private Sensor mLightSensor;
@@ -78,6 +80,10 @@
@Mock private TypedArray mBiases;
@Mock private TypedArray mHighLightBrightnesses;
@Mock private TypedArray mHighLightBiases;
+ @Mock private TypedArray mBrightnessesStrong;
+ @Mock private TypedArray mBiasesStrong;
+ @Mock private TypedArray mHighLightBrightnessesStrong;
+ @Mock private TypedArray mHighLightBiasesStrong;
@Mock private TypedArray mAmbientColorTemperatures;
@Mock private TypedArray mDisplayColorTemperatures;
@Mock private TypedArray mStrongAmbientColorTemperatures;
@@ -108,6 +114,10 @@
LOW_LIGHT_AMBIENT_COLOR_TEMPERATURE);
mockResourcesFloat(R.dimen.config_displayWhiteBalanceHighLightAmbientColorTemperature,
HIGH_LIGHT_AMBIENT_COLOR_TEMPERATURE);
+ mockResourcesFloat(R.dimen.config_displayWhiteBalanceLowLightAmbientColorTemperatureStrong,
+ LOW_LIGHT_AMBIENT_COLOR_TEMPERATURE_STRONG);
+ mockResourcesFloat(R.dimen.config_displayWhiteBalanceHighLightAmbientColorTemperatureStrong,
+ HIGH_LIGHT_AMBIENT_COLOR_TEMPERATURE_STRONG);
when(mResourcesSpy.obtainTypedArray(
R.array.config_displayWhiteBalanceAmbientColorTemperatures))
.thenReturn(mAmbientColorTemperatures);
@@ -133,6 +143,18 @@
when(mResourcesSpy.obtainTypedArray(
R.array.config_displayWhiteBalanceHighLightAmbientBiases))
.thenReturn(mHighLightBiases);
+ when(mResourcesSpy.obtainTypedArray(
+ R.array.config_displayWhiteBalanceLowLightAmbientBrightnessesStrong))
+ .thenReturn(mBrightnessesStrong);
+ when(mResourcesSpy.obtainTypedArray(
+ R.array.config_displayWhiteBalanceLowLightAmbientBiasesStrong))
+ .thenReturn(mBiasesStrong);
+ when(mResourcesSpy.obtainTypedArray(
+ R.array.config_displayWhiteBalanceHighLightAmbientBrightnessesStrong))
+ .thenReturn(mHighLightBrightnessesStrong);
+ when(mResourcesSpy.obtainTypedArray(
+ R.array.config_displayWhiteBalanceHighLightAmbientBiasesStrong))
+ .thenReturn(mHighLightBiasesStrong);
mockThrottler();
LocalServices.removeServiceForTest(ColorDisplayService.ColorDisplayServiceInternal.class);
LocalServices.addService(ColorDisplayService.ColorDisplayServiceInternal.class,
@@ -388,8 +410,8 @@
public void testStrongMode() {
final float lowerBrightness = 10.0f;
final float upperBrightness = 50.0f;
- setBrightnesses(lowerBrightness, upperBrightness);
- setBiases(0.0f, 1.0f);
+ setBrightnessesStrong(lowerBrightness, upperBrightness);
+ setBiasesStrong(0.0f, 1.0f);
final int ambientColorTempLow = 6000;
final int ambientColorTempHigh = 8000;
final int displayColorTempLow = 6400;
@@ -413,7 +435,7 @@
setEstimatedBrightnessAndUpdate(controller,
mix(lowerBrightness, upperBrightness, brightnessFraction));
assertEquals(controller.mPendingAmbientColorTemperature,
- mix(LOW_LIGHT_AMBIENT_COLOR_TEMPERATURE,
+ mix(LOW_LIGHT_AMBIENT_COLOR_TEMPERATURE_STRONG,
mix(displayColorTempLow, displayColorTempHigh, ambientTempFraction),
brightnessFraction),
ALLOWED_ERROR_DELTA);
@@ -458,7 +480,7 @@
assertEquals(-1.0f, controller.mPendingAmbientColorTemperature, 0);
}
- void mockThrottler() {
+ private void mockThrottler() {
when(mResourcesSpy.getInteger(
R.integer.config_displayWhiteBalanceDecreaseDebounce)).thenReturn(0);
when(mResourcesSpy.getInteger(
@@ -513,10 +535,18 @@
setFloatArrayResource(mBrightnesses, vals);
}
+ private void setBrightnessesStrong(float... vals) {
+ setFloatArrayResource(mBrightnessesStrong, vals);
+ }
+
private void setBiases(float... vals) {
setFloatArrayResource(mBiases, vals);
}
+ private void setBiasesStrong(float... vals) {
+ setFloatArrayResource(mBiasesStrong, vals);
+ }
+
private void setHighLightBrightnesses(float... vals) {
setFloatArrayResource(mHighLightBrightnesses, vals);
}
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/SettingsToPropertiesMapperTest.java b/services/tests/mockingservicestests/src/com/android/server/am/SettingsToPropertiesMapperTest.java
index de27d77..e672928 100644
--- a/services/tests/mockingservicestests/src/com/android/server/am/SettingsToPropertiesMapperTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/am/SettingsToPropertiesMapperTest.java
@@ -102,7 +102,7 @@
).when(() -> Settings.Global.getString(any(), anyString()));
mTestMapper = new SettingsToPropertiesMapper(
- mMockContentResolver, TEST_MAPPING, new String[] {});
+ mMockContentResolver, TEST_MAPPING, new String[] {}, new String[] {});
}
@After
diff --git a/services/tests/mockingservicestests/src/com/android/server/backup/UserBackupManagerServiceTest.java b/services/tests/mockingservicestests/src/com/android/server/backup/UserBackupManagerServiceTest.java
index 7eb78eb..65286d9 100644
--- a/services/tests/mockingservicestests/src/com/android/server/backup/UserBackupManagerServiceTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/backup/UserBackupManagerServiceTest.java
@@ -62,7 +62,7 @@
import com.android.server.backup.transport.BackupTransportClient;
import com.android.server.backup.transport.TransportConnection;
import com.android.server.backup.utils.BackupEligibilityRules;
-import com.android.server.backup.utils.BackupManagerMonitorUtils;
+import com.android.server.backup.utils.BackupManagerMonitorEventSender;
import com.google.common.collect.ImmutableSet;
@@ -98,6 +98,7 @@
@Mock LifecycleOperationStorage mOperationStorage;
@Mock JobScheduler mJobScheduler;
@Mock BackupHandler mBackupHandler;
+ @Mock BackupManagerMonitorEventSender mBackupManagerMonitorEventSender;
private TestableContext mContext;
private MockitoSession mSession;
@@ -107,7 +108,7 @@
public void setUp() throws Exception {
mSession = mockitoSession()
.initMocks(this)
- .mockStatic(BackupManagerMonitorUtils.class)
+ .mockStatic(BackupManagerMonitorEventSender.class)
.mockStatic(FeatureFlagUtils.class)
// TODO(b/263239775): Remove unnecessary stubbing.
.strictness(Strictness.LENIENT)
@@ -124,7 +125,7 @@
mService.setEnabled(true);
mService.setSetupComplete(true);
mService.enqueueFullBackup("com.test.backup.app", /* lastBackedUp= */ 0);
- }
+ }
@After
public void tearDown() {
@@ -297,9 +298,9 @@
new DataTypeResult(/* dataType */ "type_2"));
mService.reportDelayedRestoreResult(TEST_PACKAGE, results);
- verify(() -> BackupManagerMonitorUtils.sendAgentLoggingResults(
- eq(mBackupManagerMonitor), eq(packageInfo), eq(results), eq(
- BackupAnnotations.OperationType.RESTORE)));
+
+ verify(mBackupManagerMonitorEventSender).sendAgentLoggingResults(
+ eq(packageInfo), eq(results), eq(BackupAnnotations.OperationType.RESTORE));
}
private static PackageInfo getPackageInfo(String packageName) {
@@ -309,7 +310,7 @@
return packageInfo;
}
- private static class TestBackupService extends UserBackupManagerService {
+ private class TestBackupService extends UserBackupManagerService {
boolean isEnabledStatePersisted = false;
boolean shouldUseNewBackupEligibilityRules = false;
@@ -356,6 +357,11 @@
return mWorkerThread;
}
+ @Override
+ BackupManagerMonitorEventSender getBMMEventSender(IBackupManagerMonitor monitor) {
+ return mBackupManagerMonitorEventSender;
+ }
+
private void waitForAsyncOperation() {
if (mWorkerThread == null) {
return;
diff --git a/services/tests/mockingservicestests/src/com/android/server/backup/utils/BackupManagerMonitorDumpsysUtilsTest.java b/services/tests/mockingservicestests/src/com/android/server/backup/utils/BackupManagerMonitorDumpsysUtilsTest.java
new file mode 100644
index 0000000..8e17b3a
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/backup/utils/BackupManagerMonitorDumpsysUtilsTest.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.backup.utils;
+
+import static org.junit.Assert.assertTrue;
+
+import android.app.backup.BackupManagerMonitor;
+import android.os.Bundle;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+
+import java.io.File;
+
+public class BackupManagerMonitorDumpsysUtilsTest {
+ private File mTempFile;
+ private TestBackupManagerMonitorDumpsysUtils mBackupManagerMonitorDumpsysUtils;
+ @Rule
+ public TemporaryFolder tmp = new TemporaryFolder();
+
+ @Before
+ public void setUp() throws Exception {
+ mTempFile = tmp.newFile("testbmmevents.txt");
+ mBackupManagerMonitorDumpsysUtils = new TestBackupManagerMonitorDumpsysUtils();
+ }
+
+
+ @Test
+ public void parseBackupManagerMonitorEventForDumpsys_bundleIsNull_noLogsWrittenToFile()
+ throws Exception {
+ mBackupManagerMonitorDumpsysUtils.parseBackupManagerMonitorRestoreEventForDumpsys(null);
+
+ assertTrue(mTempFile.length() == 0);
+
+ }
+
+ @Test
+ public void parseBackupManagerMonitorEventForDumpsys_missingID_noLogsWrittenToFile()
+ throws Exception {
+ Bundle event = new Bundle();
+ event.putInt(BackupManagerMonitor.EXTRA_LOG_EVENT_CATEGORY, 1);
+ mBackupManagerMonitorDumpsysUtils.parseBackupManagerMonitorRestoreEventForDumpsys(event);
+
+ assertTrue(mTempFile.length() == 0);
+ }
+
+ @Test
+ public void parseBackupManagerMonitorEventForDumpsys_missingCategory_noLogsWrittenToFile()
+ throws Exception {
+ Bundle event = new Bundle();
+ event.putInt(BackupManagerMonitor.EXTRA_LOG_EVENT_ID, 1);
+ mBackupManagerMonitorDumpsysUtils.parseBackupManagerMonitorRestoreEventForDumpsys(event);
+
+ assertTrue(mTempFile.length() == 0);
+ }
+
+ private class TestBackupManagerMonitorDumpsysUtils
+ extends BackupManagerMonitorDumpsysUtils {
+ TestBackupManagerMonitorDumpsysUtils() {
+ super();
+ }
+
+ @Override
+ public File getBMMEventsFile() {
+ return mTempFile;
+ }
+ }
+}
diff --git a/services/tests/mockingservicestests/src/com/android/server/backup/utils/BackupManagerMonitorUtilsTest.java b/services/tests/mockingservicestests/src/com/android/server/backup/utils/BackupManagerMonitorEventSenderTest.java
similarity index 67%
rename from services/tests/mockingservicestests/src/com/android/server/backup/utils/BackupManagerMonitorUtilsTest.java
rename to services/tests/mockingservicestests/src/com/android/server/backup/utils/BackupManagerMonitorEventSenderTest.java
index 093ad3c..3af2932 100644
--- a/services/tests/mockingservicestests/src/com/android/server/backup/utils/BackupManagerMonitorUtilsTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/backup/utils/BackupManagerMonitorEventSenderTest.java
@@ -30,11 +30,11 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import android.app.IBackupAgent;
-import android.app.backup.BackupAnnotations;
import android.app.backup.BackupAnnotations.OperationType;
import android.app.backup.BackupManagerMonitor;
import android.app.backup.BackupRestoreEventLogger;
@@ -62,39 +62,65 @@
@SmallTest
@Presubmit
@RunWith(AndroidJUnit4.class)
-public class BackupManagerMonitorUtilsTest {
+public class BackupManagerMonitorEventSenderTest {
@Mock private IBackupManagerMonitor mMonitorMock;
+ @Mock private BackupManagerMonitorDumpsysUtils mBackupManagerMonitorDumpsysUtilsMock;
+
+ private BackupManagerMonitorEventSender mBackupManagerMonitorEventSender;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
+ mBackupManagerMonitorEventSender = new BackupManagerMonitorEventSender(mMonitorMock,
+ mBackupManagerMonitorDumpsysUtilsMock);
}
@Test
- public void monitorEvent_monitorIsNull_returnsNull() throws Exception {
- IBackupManagerMonitor result = BackupManagerMonitorUtils.monitorEvent(null, 0, null, 0,
- null);
+ public void monitorEvent_monitorIsNull_sendBundleToDumpsys() throws Exception {
+ Bundle extras = new Bundle();
+ extras.putInt(EXTRA_LOG_OPERATION_TYPE, OperationType.RESTORE);
+ mBackupManagerMonitorEventSender.setMonitor(null);
+ mBackupManagerMonitorEventSender.monitorEvent(0, null, 0, extras);
+ IBackupManagerMonitor monitor = mBackupManagerMonitorEventSender.getMonitor();
- assertThat(result).isNull();
+ verify(mBackupManagerMonitorDumpsysUtilsMock).parseBackupManagerMonitorRestoreEventForDumpsys(any(
+ Bundle.class));
}
@Test
- public void monitorEvent_monitorOnEventThrows_returnsNull() throws Exception {
+ public void monitorEvent_monitorIsNull_doNotCallOnEvent() throws Exception {
+ mBackupManagerMonitorEventSender = new BackupManagerMonitorEventSender(null);
+ mBackupManagerMonitorEventSender.monitorEvent(0, null, 0, null);
+ IBackupManagerMonitor monitor = mBackupManagerMonitorEventSender.getMonitor();
+
+ verify(mMonitorMock, never()).onEvent(any(Bundle.class));
+ }
+
+ @Test
+ public void monitorEvent_monitorOnEventThrows_setsMonitorToNull() throws Exception {
doThrow(new RemoteException()).when(mMonitorMock).onEvent(any(Bundle.class));
- IBackupManagerMonitor result = BackupManagerMonitorUtils.monitorEvent(mMonitorMock, 0, null,
- 0, null);
+ mBackupManagerMonitorEventSender.monitorEvent(0, null, 0, null);
+ IBackupManagerMonitor monitor = mBackupManagerMonitorEventSender.getMonitor();
verify(mMonitorMock).onEvent(any(Bundle.class));
- assertThat(result).isNull();
+ assertThat(monitor).isNull();
+ }
+
+ @Test
+ public void monitorEvent_extrasAreNull_doNotSendBundleToDumpsys() throws Exception {
+ mBackupManagerMonitorEventSender.monitorEvent(1, null, 2, null);
+
+ verify(mBackupManagerMonitorDumpsysUtilsMock, never())
+ .parseBackupManagerMonitorRestoreEventForDumpsys(any(Bundle.class));
}
@Test
public void monitorEvent_packageAndExtrasAreNull_fillsBundleCorrectly() throws Exception {
- IBackupManagerMonitor result = BackupManagerMonitorUtils.monitorEvent(mMonitorMock, 1, null,
- 2, null);
+ mBackupManagerMonitorEventSender.monitorEvent(1, null, 2, null);
+ IBackupManagerMonitor monitor = mBackupManagerMonitorEventSender.getMonitor();
- assertThat(result).isEqualTo(mMonitorMock);
+ assertThat(monitor).isEqualTo(mMonitorMock);
ArgumentCaptor<Bundle> bundleCaptor = ArgumentCaptor.forClass(Bundle.class);
verify(mMonitorMock).onEvent(bundleCaptor.capture());
Bundle eventBundle = bundleCaptor.getValue();
@@ -112,10 +138,10 @@
extras.putInt("key1", 4);
extras.putString("key2", "value2");
- IBackupManagerMonitor result = BackupManagerMonitorUtils.monitorEvent(mMonitorMock, 1,
- packageInfo, 2, extras);
+ mBackupManagerMonitorEventSender.monitorEvent(1, packageInfo, 2, extras);
+ IBackupManagerMonitor monitor = mBackupManagerMonitorEventSender.getMonitor();
- assertThat(result).isEqualTo(mMonitorMock);
+ assertThat(monitor).isEqualTo(mMonitorMock);
ArgumentCaptor<Bundle> bundleCaptor = ArgumentCaptor.forClass(Bundle.class);
verify(mMonitorMock).onEvent(bundleCaptor.capture());
Bundle eventBundle = bundleCaptor.getValue();
@@ -130,7 +156,8 @@
}
@Test
- public void monitorEvent_packageAndExtrasAreNotNull_fillsBundleCorrectlyLong() throws Exception {
+ public void monitorEvent_packageAndExtrasAreNotNull_fillsBundleCorrectlyLong()
+ throws Exception {
PackageInfo packageInfo = new PackageInfo();
packageInfo.packageName = "test.package";
packageInfo.versionCode = 3;
@@ -139,10 +166,10 @@
extras.putInt("key1", 4);
extras.putString("key2", "value2");
- IBackupManagerMonitor result = BackupManagerMonitorUtils.monitorEvent(mMonitorMock, 1,
- packageInfo, 2, extras);
+ mBackupManagerMonitorEventSender.monitorEvent(1, packageInfo, 2, extras);
+ IBackupManagerMonitor monitor = mBackupManagerMonitorEventSender.getMonitor();
- assertThat(result).isEqualTo(mMonitorMock);
+ assertThat(monitor).isEqualTo(mMonitorMock);
ArgumentCaptor<Bundle> bundleCaptor = ArgumentCaptor.forClass(Bundle.class);
verify(mMonitorMock).onEvent(bundleCaptor.capture());
Bundle eventBundle = bundleCaptor.getValue();
@@ -158,15 +185,45 @@
}
@Test
+ public void monitorEvent_eventOpTypeIsRestore_sendBundleToDumpsys() throws Exception {
+ Bundle extras = new Bundle();
+ extras.putInt(EXTRA_LOG_OPERATION_TYPE, OperationType.RESTORE);
+ mBackupManagerMonitorEventSender.monitorEvent(1, null, 2, extras);
+
+ verify(mBackupManagerMonitorDumpsysUtilsMock).parseBackupManagerMonitorRestoreEventForDumpsys(any(
+ Bundle.class));
+ }
+
+ @Test
+ public void monitorEvent_eventOpTypeIsBackup_doNotSendBundleToDumpsys() throws Exception {
+ Bundle extras = new Bundle();
+ extras.putInt(EXTRA_LOG_OPERATION_TYPE, OperationType.BACKUP);
+ mBackupManagerMonitorEventSender.monitorEvent(1, null, 2, extras);
+
+ verify(mBackupManagerMonitorDumpsysUtilsMock, never())
+ .parseBackupManagerMonitorRestoreEventForDumpsys(any(Bundle.class));
+ }
+
+ @Test
+ public void monitorEvent_eventOpTypeIsUnknown_doNotSendBundleToDumpsys() throws Exception {
+ Bundle extras = new Bundle();
+ extras.putInt(EXTRA_LOG_OPERATION_TYPE, OperationType.UNKNOWN);
+ mBackupManagerMonitorEventSender.monitorEvent(1, null, 2, extras);
+
+ verify(mBackupManagerMonitorDumpsysUtilsMock, never())
+ .parseBackupManagerMonitorRestoreEventForDumpsys(any(Bundle.class));
+ }
+
+ @Test
public void monitorAgentLoggingResults_onBackup_fillsBundleCorrectly() throws Exception {
PackageInfo packageInfo = new PackageInfo();
packageInfo.packageName = "test.package";
// Mock an agent that returns a logging result.
IBackupAgent agent = setUpLoggingAgentForOperation(OperationType.BACKUP);
- IBackupManagerMonitor monitor =
- BackupManagerMonitorUtils.monitorAgentLoggingResults(
- mMonitorMock, packageInfo, agent);
+
+ mBackupManagerMonitorEventSender.monitorAgentLoggingResults(packageInfo, agent);
+ IBackupManagerMonitor monitor = mBackupManagerMonitorEventSender.getMonitor();
assertCorrectBundleSentToMonitor(monitor, OperationType.BACKUP);
}
@@ -178,9 +235,8 @@
// Mock an agent that returns a logging result.
IBackupAgent agent = setUpLoggingAgentForOperation(OperationType.RESTORE);
- IBackupManagerMonitor monitor =
- BackupManagerMonitorUtils.monitorAgentLoggingResults(
- mMonitorMock, packageInfo, agent);
+ mBackupManagerMonitorEventSender.monitorAgentLoggingResults(packageInfo, agent);
+ IBackupManagerMonitor monitor = mBackupManagerMonitorEventSender.getMonitor();
assertCorrectBundleSentToMonitor(monitor, OperationType.RESTORE);
}
@@ -217,9 +273,9 @@
List<BackupRestoreEventLogger.DataTypeResult> loggingResults = new ArrayList<>();
loggingResults.add(new BackupRestoreEventLogger.DataTypeResult("testLoggingResult"));
- IBackupManagerMonitor monitor = BackupManagerMonitorUtils.sendAgentLoggingResults(
- mMonitorMock, packageInfo, loggingResults, OperationType.BACKUP);
-
+ mBackupManagerMonitorEventSender.sendAgentLoggingResults(
+ packageInfo, loggingResults, OperationType.BACKUP);
+ IBackupManagerMonitor monitor = mBackupManagerMonitorEventSender.getMonitor();
assertCorrectBundleSentToMonitor(monitor, OperationType.BACKUP);
}
@@ -230,8 +286,9 @@
List<BackupRestoreEventLogger.DataTypeResult> loggingResults = new ArrayList<>();
loggingResults.add(new BackupRestoreEventLogger.DataTypeResult("testLoggingResult"));
- IBackupManagerMonitor monitor = BackupManagerMonitorUtils.sendAgentLoggingResults(
- mMonitorMock, packageInfo, loggingResults, OperationType.RESTORE);
+ mBackupManagerMonitorEventSender.sendAgentLoggingResults(
+ packageInfo, loggingResults, OperationType.RESTORE);
+ IBackupManagerMonitor monitor = mBackupManagerMonitorEventSender.getMonitor();
assertCorrectBundleSentToMonitor(monitor, OperationType.RESTORE);
}
@@ -262,7 +319,7 @@
public void putMonitoringExtraString_bundleExists_fillsBundleCorrectly() throws Exception {
Bundle bundle = new Bundle();
- Bundle result = BackupManagerMonitorUtils.putMonitoringExtra(bundle, "key", "value");
+ Bundle result = mBackupManagerMonitorEventSender.putMonitoringExtra(bundle, "key", "value");
assertThat(result).isEqualTo(bundle);
assertThat(result.size()).isEqualTo(1);
@@ -272,7 +329,7 @@
@Test
public void putMonitoringExtraString_bundleDoesNotExist_fillsBundleCorrectly()
throws Exception {
- Bundle result = BackupManagerMonitorUtils.putMonitoringExtra(null, "key", "value");
+ Bundle result = mBackupManagerMonitorEventSender.putMonitoringExtra(null, "key", "value");
assertThat(result).isNotNull();
assertThat(result.size()).isEqualTo(1);
@@ -284,7 +341,7 @@
public void putMonitoringExtraLong_bundleExists_fillsBundleCorrectly() throws Exception {
Bundle bundle = new Bundle();
- Bundle result = BackupManagerMonitorUtils.putMonitoringExtra(bundle, "key", 123);
+ Bundle result = mBackupManagerMonitorEventSender.putMonitoringExtra(bundle, "key", 123);
assertThat(result).isEqualTo(bundle);
assertThat(result.size()).isEqualTo(1);
@@ -293,7 +350,7 @@
@Test
public void putMonitoringExtraLong_bundleDoesNotExist_fillsBundleCorrectly() throws Exception {
- Bundle result = BackupManagerMonitorUtils.putMonitoringExtra(null, "key", 123);
+ Bundle result = mBackupManagerMonitorEventSender.putMonitoringExtra(null, "key", 123);
assertThat(result).isNotNull();
assertThat(result.size()).isEqualTo(1);
@@ -304,7 +361,7 @@
public void putMonitoringExtraBoolean_bundleExists_fillsBundleCorrectly() throws Exception {
Bundle bundle = new Bundle();
- Bundle result = BackupManagerMonitorUtils.putMonitoringExtra(bundle, "key", true);
+ Bundle result = mBackupManagerMonitorEventSender.putMonitoringExtra(bundle, "key", true);
assertThat(result).isEqualTo(bundle);
assertThat(result.size()).isEqualTo(1);
@@ -314,10 +371,10 @@
@Test
public void putMonitoringExtraBoolean_bundleDoesNotExist_fillsBundleCorrectly()
throws Exception {
- Bundle result = BackupManagerMonitorUtils.putMonitoringExtra(null, "key", true);
+ Bundle result = mBackupManagerMonitorEventSender.putMonitoringExtra(null, "key", true);
assertThat(result).isNotNull();
assertThat(result.size()).isEqualTo(1);
assertThat(result.getBoolean("key")).isTrue();
}
-}
\ No newline at end of file
+}
diff --git a/services/tests/mockingservicestests/src/com/android/server/pm/SuspendPackageHelperTest.kt b/services/tests/mockingservicestests/src/com/android/server/pm/SuspendPackageHelperTest.kt
index 5cca5fa..6797576 100644
--- a/services/tests/mockingservicestests/src/com/android/server/pm/SuspendPackageHelperTest.kt
+++ b/services/tests/mockingservicestests/src/com/android/server/pm/SuspendPackageHelperTest.kt
@@ -40,7 +40,7 @@
val failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
targetPackages, true /* suspended */, null /* appExtras */,
null /* launcherExtras */, null /* dialogInfo */, DEVICE_OWNER_PACKAGE,
- TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */)
+ TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */, false /* quarantined */)
testHandler.flush()
verify(pms).scheduleWritePackageRestrictions(eq(TEST_USER_ID))
@@ -64,14 +64,14 @@
var failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
null /* packageNames */, true /* suspended */, null /* appExtras */,
null /* launcherExtras */, null /* dialogInfo */, DEVICE_OWNER_PACKAGE,
- TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */)
+ TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */, false /* quarantined */)
assertThat(failedNames).isNull()
failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
arrayOfNulls(0), true /* suspended */, null /* appExtras */,
null /* launcherExtras */, null /* dialogInfo */, DEVICE_OWNER_PACKAGE,
- TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */)
+ TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */, false /* quarantined */)
assertThat(failedNames).isEmpty()
}
@@ -81,7 +81,7 @@
val failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
arrayOf(TEST_PACKAGE_2), true /* suspended */, null /* appExtras */,
null /* launcherExtras */, null /* dialogInfo */, TEST_PACKAGE_1, TEST_USER_ID,
- Binder.getCallingUid(), false /* forQuietMode */)
+ Binder.getCallingUid(), false /* forQuietMode */, false /* quarantined */)
assertThat(failedNames).asList().hasSize(1)
assertThat(failedNames).asList().contains(TEST_PACKAGE_2)
@@ -92,7 +92,7 @@
val failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
arrayOf(DEVICE_OWNER_PACKAGE), true /* suspended */, null /* appExtras */,
null /* launcherExtras */, null /* dialogInfo */, DEVICE_OWNER_PACKAGE,
- TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */)
+ TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */, false /* quarantined */)
assertThat(failedNames).asList().hasSize(1)
assertThat(failedNames).asList().contains(DEVICE_OWNER_PACKAGE)
@@ -103,7 +103,7 @@
val failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
arrayOf(NONEXISTENT_PACKAGE), true /* suspended */, null /* appExtras */,
null /* launcherExtras */, null /* dialogInfo */, DEVICE_OWNER_PACKAGE,
- TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */)
+ TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */, false /* quarantined */)
assertThat(failedNames).asList().hasSize(1)
assertThat(failedNames).asList().contains(NONEXISTENT_PACKAGE)
@@ -116,7 +116,7 @@
val failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
knownPackages, true /* suspended */, null /* appExtras */,
null /* launcherExtras */, null /* dialogInfo */, DEVICE_OWNER_PACKAGE,
- TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */)!!
+ TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */, false /* quarantined */)!!
assertThat(failedNames.size).isEqualTo(knownPackages.size)
for (pkg in knownPackages) {
@@ -132,7 +132,7 @@
val failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
knownPackages, true /* suspended */, null /* appExtras */,
null /* launcherExtras */, null /* dialogInfo */, DEVICE_OWNER_PACKAGE,
- TEST_USER_ID, deviceOwnerUid, true /* forQuietMode */)!!
+ TEST_USER_ID, deviceOwnerUid, true /* forQuietMode */, false /* quarantined */)!!
assertThat(failedNames.size).isEqualTo(1)
assertThat(failedNames[0]).isEqualTo(MGMT_ROLE_HOLDER_PACKAGE)
@@ -144,13 +144,13 @@
var failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
targetPackages, true /* suspended */, null /* appExtras */,
null /* launcherExtras */, null /* dialogInfo */, DEVICE_OWNER_PACKAGE,
- TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */)
+ TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */, false /* quarantined */)
testHandler.flush()
assertThat(failedNames).isEmpty()
failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
targetPackages, false /* suspended */, null /* appExtras */,
null /* launcherExtras */, null /* dialogInfo */, DEVICE_OWNER_PACKAGE,
- TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */)
+ TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */, false /* quarantined */)
testHandler.flush()
verify(pms, times(2)).scheduleWritePackageRestrictions(eq(TEST_USER_ID))
@@ -202,7 +202,7 @@
var failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
arrayOf(TEST_PACKAGE_1), true /* suspended */, appExtras, null /* launcherExtras */,
null /* dialogInfo */, DEVICE_OWNER_PACKAGE, TEST_USER_ID, deviceOwnerUid,
- false /* forQuietMode */)
+ false /* forQuietMode */, false /* quarantined */)
testHandler.flush()
assertThat(failedNames).isEmpty()
@@ -220,7 +220,7 @@
var failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
targetPackages, true /* suspended */, appExtras, null /* launcherExtras */,
null /* dialogInfo */, DEVICE_OWNER_PACKAGE, TEST_USER_ID, deviceOwnerUid,
- false /* forQuietMode */)
+ false /* forQuietMode */, false /* quarantined */)
testHandler.flush()
assertThat(failedNames).isEmpty()
assertThat(suspendPackageHelper.getSuspendingPackage(pms.snapshotComputer(),
@@ -265,7 +265,7 @@
var failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
arrayOf(TEST_PACKAGE_2), true /* suspended */, null /* appExtras */, launcherExtras,
null /* dialogInfo */, DEVICE_OWNER_PACKAGE, TEST_USER_ID, deviceOwnerUid,
- false /* forQuietMode */)
+ false /* forQuietMode */, false /* quarantined */)
testHandler.flush()
assertThat(failedNames).isEmpty()
@@ -280,7 +280,7 @@
var failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
arrayOf(TEST_PACKAGE_1), true /* suspended */, null /* appExtras */,
null /* launcherExtras */, null /* dialogInfo */, DEVICE_OWNER_PACKAGE,
- TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */)
+ TEST_USER_ID, deviceOwnerUid, false /* forQuietMode */, false /* quarantined */)
testHandler.flush()
assertThat(failedNames).isEmpty()
@@ -295,7 +295,7 @@
var failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
arrayOf(TEST_PACKAGE_2), true /* suspended */, null /* appExtras */, launcherExtras,
null /* dialogInfo */, DEVICE_OWNER_PACKAGE, TEST_USER_ID, deviceOwnerUid,
- false /* forQuietMode */)
+ false /* forQuietMode */, false /* quarantined */)
testHandler.flush()
assertThat(failedNames).isEmpty()
@@ -310,7 +310,7 @@
var failedNames = suspendPackageHelper.setPackagesSuspended(pms.snapshotComputer(),
arrayOf(TEST_PACKAGE_1), true /* suspended */, null /* appExtras */,
null /* launcherExtras */, dialogInfo, DEVICE_OWNER_PACKAGE, TEST_USER_ID,
- deviceOwnerUid, false /* forQuietMode */)
+ deviceOwnerUid, false /* forQuietMode */, false /* quarantined */)
testHandler.flush()
assertThat(failedNames).isEmpty()
@@ -324,7 +324,7 @@
@Throws(Exception::class)
fun sendPackagesSuspendedForUser() {
suspendPackageHelper.sendPackagesSuspendedForUser(
- Intent.ACTION_PACKAGES_SUSPENDED, packagesToChange, uidsToChange, TEST_USER_ID)
+ Intent.ACTION_PACKAGES_SUSPENDED, packagesToChange, uidsToChange, false, TEST_USER_ID)
testHandler.flush()
verify(broadcastHelper).sendPackageBroadcast(any(), nullable(), bundleCaptor.capture(),
anyInt(), nullable(), nullable(), any(), nullable(), nullable(), nullable(),
@@ -341,7 +341,7 @@
@Throws(Exception::class)
fun sendPackagesSuspendModifiedForUser() {
suspendPackageHelper.sendPackagesSuspendedForUser(
- Intent.ACTION_PACKAGES_SUSPENSION_CHANGED, packagesToChange, uidsToChange, TEST_USER_ID)
+ Intent.ACTION_PACKAGES_SUSPENSION_CHANGED, packagesToChange, uidsToChange, false, TEST_USER_ID)
testHandler.flush()
verify(broadcastHelper).sendPackageBroadcast(
eq(Intent.ACTION_PACKAGES_SUSPENSION_CHANGED), nullable(), bundleCaptor.capture(),
diff --git a/services/tests/mockingservicestests/src/com/android/server/pm/UserManagerServiceTest.java b/services/tests/mockingservicestests/src/com/android/server/pm/UserManagerServiceTest.java
index 78e5a42..bdbf4ec 100644
--- a/services/tests/mockingservicestests/src/com/android/server/pm/UserManagerServiceTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/pm/UserManagerServiceTest.java
@@ -63,6 +63,8 @@
import org.junit.Test;
import org.mockito.Mock;
+import java.io.File;
+
/**
* Run as {@code atest FrameworksMockingServicesTests:com.android.server.pm.UserManagerServiceTest}
*/
@@ -107,6 +109,8 @@
.getTargetContext();
private final SparseArray<UserData> mUsers = new SparseArray<>();
+ private File mTestDir;
+
private Context mSpiedContext;
private @Mock PackageManagerService mMockPms;
@@ -144,17 +148,23 @@
doNothing().when(mSpiedContext).sendBroadcastAsUser(any(), any(), any());
// Must construct UserManagerService in the UiThread
+ mTestDir = new File(mRealContext.getDataDir(), "umstest");
+ mTestDir.mkdirs();
mUms = new UserManagerService(mSpiedContext, mMockPms, mMockUserDataPreparer,
- mPackagesLock, mRealContext.getDataDir(), mUsers);
+ mPackagesLock, mTestDir, mUsers);
mUmi = LocalServices.getService(UserManagerInternal.class);
assertWithMessage("LocalServices.getService(UserManagerInternal.class)").that(mUmi)
.isNotNull();
}
@After
- public void resetUserManagerInternal() {
+ public void tearDown() {
// LocalServices follows the "Highlander rule" - There can be only one!
LocalServices.removeServiceForTest(UserManagerInternal.class);
+
+ // Clean up test dir to remove persisted user files.
+ assertThat(deleteRecursive(mTestDir)).isTrue();
+ mUsers.clear();
}
@Test
@@ -496,6 +506,14 @@
@Test
public void testMainUser_hasNoCallsOrSMSRestrictionsByDefault() {
+ // Remove the main user so we can add another one
+ for (int i = 0; i < mUsers.size(); i++) {
+ UserData userData = mUsers.valueAt(i);
+ if (userData.info.isMain()) {
+ mUsers.delete(i);
+ break;
+ }
+ }
UserInfo mainUser = mUms.createUserWithThrow("main user", USER_TYPE_FULL_SECONDARY,
UserInfo.FLAG_FULL | UserInfo.FLAG_MAIN);
@@ -621,6 +639,18 @@
userData.mLastEnteredForegroundTimeMillis = timeMillis;
}
+ public boolean deleteRecursive(File file) {
+ if (file.isDirectory()) {
+ for (File item : file.listFiles()) {
+ boolean success = deleteRecursive(item);
+ if (!success) {
+ return false;
+ }
+ }
+ }
+ return file.delete();
+ }
+
private static final class TestUserData extends UserData {
@SuppressWarnings("deprecation")
diff --git a/services/tests/mockingservicestests/src/com/android/server/rollback/RollbackPackageHealthObserverTest.java b/services/tests/mockingservicestests/src/com/android/server/rollback/RollbackPackageHealthObserverTest.java
index 35d4ffd..a140730 100644
--- a/services/tests/mockingservicestests/src/com/android/server/rollback/RollbackPackageHealthObserverTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/rollback/RollbackPackageHealthObserverTest.java
@@ -145,7 +145,7 @@
observer.onHealthCheckFailed(null,
PackageWatchdog.FAILURE_REASON_NATIVE_CRASH, 1));
// non-native crash for the package
- assertEquals(PackageWatchdog.PackageHealthObserverImpact.USER_IMPACT_LEVEL_60,
+ assertEquals(PackageWatchdog.PackageHealthObserverImpact.USER_IMPACT_LEVEL_30,
observer.onHealthCheckFailed(testFailedPackage,
PackageWatchdog.FAILURE_REASON_APP_CRASH, 1));
// non-native crash for a different package
diff --git a/services/tests/powerstatstests/Android.bp b/services/tests/powerstatstests/Android.bp
index 05acd9b..8ab4507 100644
--- a/services/tests/powerstatstests/Android.bp
+++ b/services/tests/powerstatstests/Android.bp
@@ -23,6 +23,8 @@
"androidx.test.uiautomator_uiautomator",
"mockito-target-minus-junit4",
"servicestests-utils",
+ "platform-test-annotations",
+ "flag-junit",
],
libs: [
diff --git a/services/tests/powerstatstests/AndroidManifest.xml b/services/tests/powerstatstests/AndroidManifest.xml
index d3a88d2..d6898a1 100644
--- a/services/tests/powerstatstests/AndroidManifest.xml
+++ b/services/tests/powerstatstests/AndroidManifest.xml
@@ -21,6 +21,7 @@
<uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
<uses-permission android:name="android.permission.MANAGE_USERS"/>
+ <uses-permission android:name="android.permission.READ_DEVICE_CONFIG" />
<queries>
<package android:name="com.android.coretests.apps.bstatstestapp" />
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryIteratorTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryIteratorTest.java
index 4fde73b..77124d0 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryIteratorTest.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryIteratorTest.java
@@ -32,6 +32,8 @@
import org.junit.runner.RunWith;
import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Random;
import java.util.concurrent.Future;
@@ -49,6 +51,7 @@
@Before
public void setup() {
final File historyDir = createTemporaryDirectory(getClass().getSimpleName());
+ mMockClock.currentTime = 3000;
mBatteryStats = new MockBatteryStatsImpl(mMockClock, historyDir);
mBatteryStats.setDummyExternalStatsSync(mExternalStatsSync);
mBatteryStats.setRecordAllHistoryLocked(true);
@@ -70,20 +73,10 @@
}
@Test
- public void testIterator() {
- mMockClock.realtime = 1000;
- mMockClock.uptime = 1000;
+ public void unconstrainedIteration() {
+ prepareHistory();
- mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING,
- 100, /* plugType */ 0, 90, 72, 3700, 3_600_000, 4_000_000, 0, 1_000_000,
- 1_000_000, 1_000_000);
- mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING,
- 100, /* plugType */ 0, 80, 72, 3700, 2_400_000, 4_000_000, 0, 2_000_000,
- 2_000_000, 2_000_000);
- mBatteryStats.noteAlarmStartLocked("foo", null, APP_UID, 3_000_000, 2_000_000);
- mBatteryStats.noteAlarmFinishLocked("foo", null, APP_UID, 3_001_000, 2_001_000);
-
- final BatteryStatsHistoryIterator iterator = mBatteryStats.iterateBatteryStatsHistory();
+ final BatteryStatsHistoryIterator iterator = mBatteryStats.iterateBatteryStatsHistory(0, 0);
BatteryStats.HistoryItem item;
@@ -116,23 +109,75 @@
assertThat(iterator.next()).isNull();
}
- // Test history that spans multiple buffers and uses more than 32k different strings.
@Test
- public void tagsLongHistory() {
+ public void constrainedIteration() {
+ prepareHistory();
+
+ // Initial time is 3000
+ assertIncludedEvents(mBatteryStats.iterateBatteryStatsHistory(0, 0),
+ 3_000L, 3_000L, 1003_000L, 2003_000L, 2004_000L);
+ assertIncludedEvents(mBatteryStats.iterateBatteryStatsHistory(1000_000, 0),
+ 1003_000L, 2003_000L, 2004_000L);
+ assertIncludedEvents(mBatteryStats.iterateBatteryStatsHistory(0, 2000_000L),
+ 3_000L, 3_000L, 1003_000L);
+ assertIncludedEvents(mBatteryStats.iterateBatteryStatsHistory(1003_000L, 2004_000L),
+ 1003_000L, 2003_000L);
+ }
+
+ private void prepareHistory() {
+ mMockClock.realtime = 1000;
+ mMockClock.uptime = 1000;
+ mMockClock.currentTime = 3000;
+
mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING,
100, /* plugType */ 0, 90, 72, 3700, 3_600_000, 4_000_000, 0, 1_000_000,
1_000_000, 1_000_000);
+ mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING,
+ 100, /* plugType */ 0, 80, 72, 3700, 2_400_000, 4_000_000, 0, 2_000_000,
+ 2_000_000, 2_000_000);
+ mBatteryStats.noteAlarmStartLocked("foo", null, APP_UID, 3_000_000, 2_000_000);
+ mBatteryStats.noteAlarmFinishLocked("foo", null, APP_UID, 3_001_000, 2_001_000);
+ }
+
+ private void assertIncludedEvents(BatteryStatsHistoryIterator iterator,
+ Long... expectedTimestamps) {
+ ArrayList<Long> actualTimestamps = new ArrayList<>();
+ while (iterator.hasNext()) {
+ BatteryStats.HistoryItem item = iterator.next();
+ actualTimestamps.add(item.currentTime);
+ }
+ assertThat(actualTimestamps).isEqualTo(Arrays.asList(expectedTimestamps));
+ }
+
+ // Test history that spans multiple buffers and uses more than 32k different strings.
+ @Test
+ public void tagsLongHistory() {
+ mMockClock.currentTime = 1_000_000;
+ mMockClock.realtime = 1_000_000;
+ mMockClock.uptime = 1_000_000;
+
+ mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING,
+ 100, /* plugType */ 0, 90, 72, 3700, 3_600_000, 4_000_000, 0, mMockClock.realtime,
+ mMockClock.uptime, mMockClock.currentTime);
// More than 32k strings
final int eventCount = 0x7FFF + 100;
for (int i = 0; i < eventCount; i++) {
// Names repeat in order to verify de-duping of identical history tags.
String name = "a" + (i % 10);
- mBatteryStats.noteAlarmStartLocked(name, null, APP_UID, 3_000_000, 2_000_000);
- mBatteryStats.noteAlarmFinishLocked(name, null, APP_UID, 3_500_000, 2_500_000);
+ mMockClock.currentTime += 1_000_000;
+ mMockClock.realtime += 1_000_000;
+ mMockClock.uptime += 1_000_000;
+ mBatteryStats.noteAlarmStartLocked(name, null, APP_UID,
+ mMockClock.realtime, mMockClock.uptime);
+ mMockClock.currentTime += 500_000;
+ mMockClock.realtime += 500_000;
+ mMockClock.uptime += 500_000;
+ mBatteryStats.noteAlarmFinishLocked(name, null, APP_UID,
+ mMockClock.realtime, mMockClock.uptime);
}
- final BatteryStatsHistoryIterator iterator = mBatteryStats.iterateBatteryStatsHistory();
+ final BatteryStatsHistoryIterator iterator = mBatteryStats.iterateBatteryStatsHistory(0, 0);
BatteryStats.HistoryItem item;
assertThat(item = iterator.next()).isNotNull();
@@ -146,12 +191,6 @@
assertThat(item.eventTag).isNull();
assertThat(item.time).isEqualTo(1_000_000);
- assertThat(item = iterator.next()).isNotNull();
- assertThat(item.cmd).isEqualTo((int) BatteryStats.HistoryItem.CMD_UPDATE);
- assertThat(item.eventCode).isEqualTo(BatteryStats.HistoryItem.EVENT_NONE);
- assertThat(item.eventTag).isNull();
- assertThat(item.time).isEqualTo(2_000_000);
-
for (int i = 0; i < eventCount; i++) {
String name = "a" + (i % 10);
do {
@@ -205,7 +244,7 @@
mExternalStatsSync.updateCpuStats(300, 7_100_000, 4_100_000);
- final BatteryStatsHistoryIterator iterator = mBatteryStats.iterateBatteryStatsHistory();
+ final BatteryStatsHistoryIterator iterator = mBatteryStats.iterateBatteryStatsHistory(0, 0);
BatteryStats.HistoryItem item;
assertThat(item = iterator.next()).isNotNull();
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryTest.java
index f2cbef6..f22296a 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryTest.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryTest.java
@@ -24,13 +24,16 @@
import static org.mockito.Mockito.when;
import android.content.Context;
+import android.os.BatteryConsumer;
import android.os.BatteryManager;
import android.os.BatteryStats;
-import android.os.BatteryStats.CpuUsageDetails;
-import android.os.BatteryStats.EnergyConsumerDetails;
import android.os.BatteryStats.HistoryItem;
import android.os.Parcel;
+import android.os.PersistableBundle;
+import android.os.Process;
+import android.os.UserHandle;
import android.telephony.NetworkRegistrationInfo;
+import android.util.AtomicFile;
import android.util.Log;
import androidx.test.InstrumentationRegistry;
@@ -38,6 +41,7 @@
import com.android.internal.os.BatteryStatsHistory;
import com.android.internal.os.BatteryStatsHistoryIterator;
+import com.android.internal.os.PowerStats;
import org.junit.Before;
import org.junit.Test;
@@ -71,6 +75,7 @@
private BatteryStatsHistory.TraceDelegate mTracer;
@Mock
private BatteryStatsHistory.HistoryStepDetailsCalculator mStepDetailsCalculator;
+ private List<String> mReadFiles = new ArrayList<>();
@Before
public void setUp() {
@@ -85,8 +90,17 @@
}
}
mHistoryDir.delete();
+
+ mClock.realtime = 123;
+
mHistory = new BatteryStatsHistory(mHistoryBuffer, mSystemDir, 32, 1024,
- mStepDetailsCalculator, mClock, mTracer);
+ mStepDetailsCalculator, mClock, mTracer) {
+ @Override
+ public boolean readFileToParcel(Parcel out, AtomicFile file) {
+ mReadFiles.add(file.getBaseFile().getName());
+ return super.readFileToParcel(out, file);
+ }
+ };
when(mStepDetailsCalculator.getHistoryStepDetails())
.thenReturn(new BatteryStats.HistoryStepDetails());
@@ -179,70 +193,165 @@
@Test
public void testConstruct() {
createActiveFile(mHistory);
- verifyFileNumbers(mHistory, Arrays.asList(0));
- verifyActiveFile(mHistory, "0.bin");
+ verifyFileNames(mHistory, Arrays.asList("123.bh"));
+ verifyActiveFile(mHistory, "123.bh");
}
@Test
public void testStartNextFile() {
- List<Integer> fileList = new ArrayList<>();
- fileList.add(0);
+ mClock.realtime = 123;
+
+ List<String> fileList = new ArrayList<>();
+ fileList.add("123.bh");
createActiveFile(mHistory);
// create file 1 to 31.
for (int i = 1; i < 32; i++) {
- fileList.add(i);
+ mClock.realtime = 1000 * i;
+ fileList.add(mClock.realtime + ".bh");
+
mHistory.startNextFile();
createActiveFile(mHistory);
- verifyFileNumbers(mHistory, fileList);
- verifyActiveFile(mHistory, i + ".bin");
+ verifyFileNames(mHistory, fileList);
+ verifyActiveFile(mHistory, mClock.realtime + ".bh");
}
// create file 32
+ mClock.realtime = 1000 * 32;
mHistory.startNextFile();
createActiveFile(mHistory);
- fileList.add(32);
+ fileList.add("32000.bh");
fileList.remove(0);
// verify file 0 is deleted.
- verifyFileDeleted("0.bin");
- verifyFileNumbers(mHistory, fileList);
- verifyActiveFile(mHistory, "32.bin");
+ verifyFileDeleted("123.bh");
+ verifyFileNames(mHistory, fileList);
+ verifyActiveFile(mHistory, "32000.bh");
// create file 33
+ mClock.realtime = 1000 * 33;
mHistory.startNextFile();
createActiveFile(mHistory);
// verify file 1 is deleted
- fileList.add(33);
+ fileList.add("33000.bh");
fileList.remove(0);
- verifyFileDeleted("1.bin");
- verifyFileNumbers(mHistory, fileList);
- verifyActiveFile(mHistory, "33.bin");
-
- assertEquals(0, mHistory.getHistoryUsedSize());
+ verifyFileDeleted("1000.bh");
+ verifyFileNames(mHistory, fileList);
+ verifyActiveFile(mHistory, "33000.bh");
// create a new BatteryStatsHistory object, it will pick up existing history files.
BatteryStatsHistory history2 = new BatteryStatsHistory(mHistoryBuffer, mSystemDir, 32, 1024,
null, mClock, mTracer);
// verify constructor can pick up all files from file system.
- verifyFileNumbers(history2, fileList);
- verifyActiveFile(history2, "33.bin");
+ verifyFileNames(history2, fileList);
+ verifyActiveFile(history2, "33000.bh");
+
+ mClock.realtime = 1234567;
history2.reset();
createActiveFile(history2);
+
// verify all existing files are deleted.
- for (int i = 2; i < 33; ++i) {
- verifyFileDeleted(i + ".bin");
+ for (String file : fileList) {
+ verifyFileDeleted(file);
}
// verify file 0 is created
- verifyFileNumbers(history2, Arrays.asList(0));
- verifyActiveFile(history2, "0.bin");
+ verifyFileNames(history2, Arrays.asList("1234567.bh"));
+ verifyActiveFile(history2, "1234567.bh");
// create file 1.
+ mClock.realtime = 2345678;
+
history2.startNextFile();
createActiveFile(history2);
- verifyFileNumbers(history2, Arrays.asList(0, 1));
- verifyActiveFile(history2, "1.bin");
+ verifyFileNames(history2, Arrays.asList("1234567.bh", "2345678.bh"));
+ verifyActiveFile(history2, "2345678.bh");
+ }
+
+ @Test
+ public void unconstrainedIteration() {
+ prepareMultiFileHistory();
+
+ mReadFiles.clear();
+
+ // Prepare history for iteration
+ mHistory.iterate(0, 0);
+
+ Parcel parcel = mHistory.getNextParcel(0, Long.MAX_VALUE);
+ assertThat(parcel).isNotNull();
+ assertThat(mReadFiles).containsExactly("123.bh");
+
+ // Skip to the end to force reading the next parcel
+ parcel.setDataPosition(parcel.dataSize());
+ mReadFiles.clear();
+ parcel = mHistory.getNextParcel(0, Long.MAX_VALUE);
+ assertThat(parcel).isNotNull();
+ assertThat(mReadFiles).containsExactly("1000.bh");
+
+ parcel.setDataPosition(parcel.dataSize());
+ mReadFiles.clear();
+ parcel = mHistory.getNextParcel(0, Long.MAX_VALUE);
+ assertThat(parcel).isNotNull();
+ assertThat(mReadFiles).containsExactly("2000.bh");
+
+ parcel.setDataPosition(parcel.dataSize());
+ mReadFiles.clear();
+ parcel = mHistory.getNextParcel(0, Long.MAX_VALUE);
+ assertThat(parcel).isNull();
+ assertThat(mReadFiles).isEmpty();
+ }
+
+ @Test
+ public void constrainedIteration() {
+ prepareMultiFileHistory();
+
+ mReadFiles.clear();
+
+ // Prepare history for iteration
+ mHistory.iterate(1000, 3000);
+
+ Parcel parcel = mHistory.getNextParcel(1000, 3000);
+ assertThat(parcel).isNotNull();
+ assertThat(mReadFiles).containsExactly("1000.bh");
+
+ // Skip to the end to force reading the next parcel
+ parcel.setDataPosition(parcel.dataSize());
+ mReadFiles.clear();
+ parcel = mHistory.getNextParcel(1000, 3000);
+ assertThat(parcel).isNotNull();
+ assertThat(mReadFiles).containsExactly("2000.bh");
+
+ parcel.setDataPosition(parcel.dataSize());
+ mReadFiles.clear();
+ parcel = mHistory.getNextParcel(1000, 3000);
+ assertThat(parcel).isNull();
+ assertThat(mReadFiles).isEmpty();
+ }
+
+ private void prepareMultiFileHistory() {
+ mHistory.forceRecordAllHistory();
+
+ mClock.realtime = 1000;
+ mClock.uptime = 1000;
+ mHistory.recordEvent(mClock.realtime, mClock.uptime,
+ BatteryStats.HistoryItem.EVENT_JOB_START, "job", 42);
+
+ mHistory.startNextFile(); // 1000.bh
+
+ mClock.realtime = 2000;
+ mClock.uptime = 2000;
+ mHistory.recordEvent(mClock.realtime, mClock.uptime,
+ BatteryStats.HistoryItem.EVENT_JOB_FINISH, "job", 42);
+
+ mHistory.startNextFile(); // 2000.bh
+
+ mClock.realtime = 3000;
+ mClock.uptime = 3000;
+ mHistory.recordEvent(mClock.realtime, mClock.uptime,
+ HistoryItem.EVENT_ALARM, "alarm", 42);
+
+ // Flush accumulated history to disk
+ mHistory.startNextFile();
}
private void verifyActiveFile(BatteryStatsHistory history, String file) {
@@ -251,12 +360,11 @@
assertTrue(expectedFile.exists());
}
- private void verifyFileNumbers(BatteryStatsHistory history, List<Integer> fileList) {
- assertEquals(fileList.size(), history.getFilesNumbers().size());
+ private void verifyFileNames(BatteryStatsHistory history, List<String> fileList) {
+ assertEquals(fileList.size(), history.getFilesNames().size());
for (int i = 0; i < fileList.size(); i++) {
- assertEquals(fileList.get(i), history.getFilesNumbers().get(i));
- final File expectedFile =
- new File(mHistoryDir, fileList.get(i) + ".bin");
+ assertEquals(fileList.get(i), history.getFilesNames().get(i));
+ final File expectedFile = new File(mHistoryDir, fileList.get(i));
assertTrue(expectedFile.exists());
}
}
@@ -267,6 +375,9 @@
private void createActiveFile(BatteryStatsHistory history) {
final File file = history.getActiveFile().getBaseFile();
+ if (file.exists()) {
+ return;
+ }
try {
file.createNewFile();
} catch (IOException e) {
@@ -275,49 +386,18 @@
}
@Test
- public void testRecordMeasuredEnergyDetails() {
- mHistory.forceRecordAllHistory();
- mHistory.startRecordingHistory(0, 0, /* reset */ true);
- mHistory.setBatteryState(true /* charging */, BatteryManager.BATTERY_STATUS_CHARGING, 80,
- 1234);
+ public void recordPowerStats() {
+ PowerStats.Descriptor descriptor = new PowerStats.Descriptor(42, "foo", 1, 2,
+ new PersistableBundle());
+ PowerStats powerStats = new PowerStats(descriptor);
+ powerStats.durationMs = 100;
+ powerStats.stats[0] = 200;
+ powerStats.uidStats.put(300, new long[]{400, 500});
+ powerStats.uidStats.put(600, new long[]{700, 800});
- EnergyConsumerDetails details = new EnergyConsumerDetails();
- EnergyConsumerDetails.EnergyConsumer consumer1 =
- new EnergyConsumerDetails.EnergyConsumer();
- consumer1.type = 42;
- consumer1.ordinal = 0;
- consumer1.name = "A";
+ mHistory.recordPowerStats(200, 200, powerStats);
- EnergyConsumerDetails.EnergyConsumer consumer2 =
- new EnergyConsumerDetails.EnergyConsumer();
- consumer2.type = 777;
- consumer2.ordinal = 0;
- consumer2.name = "B/0";
-
- EnergyConsumerDetails.EnergyConsumer consumer3 =
- new EnergyConsumerDetails.EnergyConsumer();
- consumer3.type = 777;
- consumer3.ordinal = 1;
- consumer3.name = "B/1";
-
- EnergyConsumerDetails.EnergyConsumer consumer4 =
- new EnergyConsumerDetails.EnergyConsumer();
- consumer4.type = 314;
- consumer4.ordinal = 1;
- consumer4.name = "C";
-
- details.consumers =
- new EnergyConsumerDetails.EnergyConsumer[]{consumer1, consumer2, consumer3,
- consumer4};
- details.chargeUC = new long[details.consumers.length];
- for (int i = 0; i < details.chargeUC.length; i++) {
- details.chargeUC[i] = 100L * i;
- }
- details.chargeUC[3] = BatteryStats.POWER_DATA_UNAVAILABLE;
-
- mHistory.recordEnergyConsumerDetails(200, 200, details);
-
- BatteryStatsHistoryIterator iterator = mHistory.iterate();
+ BatteryStatsHistoryIterator iterator = mHistory.iterate(0, 0);
BatteryStats.HistoryItem item;
assertThat(item = iterator.next()).isNotNull(); // First item contains current time only
@@ -325,62 +405,10 @@
String dump = toString(item, /* checkin */ false);
assertThat(dump).contains("+200ms");
- assertThat(dump).contains("ext=energy:A=0 B/0=100 B/1=200");
- assertThat(dump).doesNotContain("C=");
-
- String checkin = toString(item, /* checkin */ true);
- assertThat(checkin).contains("XE");
- assertThat(checkin).contains("A=0,B/0=100,B/1=200");
- assertThat(checkin).doesNotContain("C=");
- }
-
- @Test
- public void cpuUsageDetails() {
- mHistory.forceRecordAllHistory();
- mHistory.startRecordingHistory(0, 0, /* reset */ true);
- mHistory.setBatteryState(true /* charging */, BatteryManager.BATTERY_STATUS_CHARGING, 80,
- 1234);
-
- CpuUsageDetails details = new CpuUsageDetails();
- details.cpuBracketDescriptions = new String[] {"low", "Med", "HIGH"};
- details.uid = 10123;
- details.cpuUsageMs = new long[] { 100, 200, 300};
- mHistory.recordCpuUsage(200, 200, details);
-
- details.uid = 10321;
- details.cpuUsageMs = new long[] { 400, 500, 600};
- mHistory.recordCpuUsage(300, 300, details);
-
- BatteryStatsHistoryIterator iterator = mHistory.iterate();
- BatteryStats.HistoryItem item = new BatteryStats.HistoryItem();
- assertThat(item = iterator.next()).isNotNull(); // First item contains current time only
-
- assertThat(item = iterator.next()).isNotNull();
-
- String dump = toString(item, /* checkin */ false);
- assertThat(dump).contains("+200ms");
- assertThat(dump).contains("ext=cpu:u0a123: 100, 200, 300");
- assertThat(dump).contains("ext=cpu-bracket:0:low");
- assertThat(dump).contains("ext=cpu-bracket:1:Med");
- assertThat(dump).contains("ext=cpu-bracket:2:HIGH");
-
- String checkin = toString(item, /* checkin */ true);
- assertThat(checkin).contains("XB,3,0,low");
- assertThat(checkin).contains("XB,3,1,Med");
- assertThat(checkin).contains("XB,3,2,HIGH");
- assertThat(checkin).contains("XC,10123,100,200,300");
-
- assertThat(item = iterator.next()).isNotNull();
-
- dump = toString(item, /* checkin */ false);
- assertThat(dump).contains("+300ms");
- assertThat(dump).contains("ext=cpu:u0a321: 400, 500, 600");
- // Power bracket descriptions are written only once
- assertThat(dump).doesNotContain("ext=cpu-bracket");
-
- checkin = toString(item, /* checkin */ true);
- assertThat(checkin).doesNotContain("XB");
- assertThat(checkin).contains("XC,10321,400,500,600");
+ assertThat(dump).contains("duration=100");
+ assertThat(dump).contains("foo=[200]");
+ assertThat(dump).contains("300: [400, 500]");
+ assertThat(dump).contains("600: [700, 800]");
}
@Test
@@ -399,7 +427,7 @@
mHistory.recordNrStateChangeEvent(500, 500,
NetworkRegistrationInfo.NR_STATE_NONE);
- BatteryStatsHistoryIterator iterator = mHistory.iterate();
+ BatteryStatsHistoryIterator iterator = mHistory.iterate(0, 0);
BatteryStats.HistoryItem item = new BatteryStats.HistoryItem();
assertThat(item = iterator.next()).isNotNull(); // First item contains current time only
@@ -440,7 +468,7 @@
mHistory.recordNrStateChangeEvent(500, 500,
NetworkRegistrationInfo.NR_STATE_NONE);
- BatteryStatsHistoryIterator iterator = mHistory.iterate();
+ BatteryStatsHistoryIterator iterator = mHistory.iterate(0, 0);
BatteryStats.HistoryItem item = new BatteryStats.HistoryItem();
assertThat(item = iterator.next()).isNotNull(); // First item contains current time only
@@ -498,7 +526,7 @@
mClock.uptime = 1_000_000;
// More than 32k strings
final int tagCount = 0x7FFF + 20;
- for (int tag = 0; tag < tagCount;) {
+ for (int tag = 0; tag < tagCount; ) {
mClock.realtime += 10;
mClock.uptime += 10;
mHistory.recordEvent(mClock.realtime, mClock.uptime, HistoryItem.EVENT_ALARM_START,
@@ -522,8 +550,8 @@
int wakelockTagsUnpooled = 0;
int wakeReasonTagsPooled = 0;
int wakeReasonTagsUnpooled = 0;
- for (BatteryStatsHistoryIterator iterator = mHistory.iterate(); iterator.hasNext(); ) {
- HistoryItem item = iterator.next();
+ for (BatteryStatsHistoryIterator iterator = mHistory.iterate(0, 0); iterator.hasNext(); ) {
+ HistoryItem item = iterator.next();
if (item.cmd != HistoryItem.CMD_UPDATE) {
continue;
}
@@ -569,10 +597,40 @@
assertThat(wakeReasonTagsUnpooled).isGreaterThan(0);
}
+ @Test
+ public void recordProcStateChange() {
+ mHistory.recordProcessStateChange(200, 200, 42, BatteryConsumer.PROCESS_STATE_BACKGROUND);
+ mHistory.recordProcessStateChange(300, 300, 42, BatteryConsumer.PROCESS_STATE_FOREGROUND);
+ // Large UID, > 0xFFFFFF
+ mHistory.recordProcessStateChange(400, 400,
+ UserHandle.getUid(777, Process.LAST_ISOLATED_UID),
+ BatteryConsumer.PROCESS_STATE_FOREGROUND_SERVICE);
+
+ BatteryStatsHistoryIterator iterator = mHistory.iterate(0, 0);
+ BatteryStats.HistoryItem item;
+ assertThat(item = iterator.next()).isNotNull(); // First item contains current time only
+
+ assertThat(item = iterator.next()).isNotNull();
+
+ String dump = toString(item, /* checkin */ false);
+ assertThat(dump).contains("+200ms");
+ assertThat(dump).contains("procstate: 42: bg");
+
+ assertThat(item = iterator.next()).isNotNull();
+ dump = toString(item, /* checkin */ false);
+ assertThat(dump).contains("+300ms");
+ assertThat(dump).contains("procstate: 42: fg");
+
+ assertThat(item = iterator.next()).isNotNull();
+ dump = toString(item, /* checkin */ false);
+ assertThat(dump).contains("+400ms");
+ assertThat(dump).contains("procstate: u777i999: fgs");
+ }
+
private String toString(BatteryStats.HistoryItem item, boolean checkin) {
StringWriter writer = new StringWriter();
PrintWriter pw = new PrintWriter(writer);
- mHistoryPrinter.printNextItem(pw, item, 0, checkin, /* verbose */ false);
+ mHistoryPrinter.printNextItem(pw, item, 0, checkin, /* verbose */ true);
pw.flush();
return writer.toString();
}
@@ -596,6 +654,7 @@
0xffffffffffffffffL};
// Parcel subarrays of different lengths and assert the size of the resulting parcel
+ testVarintParceler(Arrays.copyOfRange(values, 0, 0), 0);
testVarintParceler(Arrays.copyOfRange(values, 0, 1), 4); // v. 8
testVarintParceler(Arrays.copyOfRange(values, 0, 2), 4); // v. 16
testVarintParceler(Arrays.copyOfRange(values, 0, 3), 4); // v. 24
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsNoteTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsNoteTest.java
index 88b9522..7ef1a3f 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsNoteTest.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsNoteTest.java
@@ -263,7 +263,7 @@
clocks.realtime = clocks.uptime = 220;
bi.noteLongPartialWakelockFinish(name, historyName, ISOLATED_UID);
- final BatteryStatsHistoryIterator iterator = bi.iterateBatteryStatsHistory();
+ final BatteryStatsHistoryIterator iterator = bi.iterateBatteryStatsHistory(0, 0);
BatteryStats.HistoryItem item;
@@ -319,7 +319,7 @@
clocks.realtime = clocks.uptime = 220;
bi.noteLongPartialWakelockFinish(name, historyName, ISOLATED_UID);
- final BatteryStatsHistoryIterator iterator = bi.iterateBatteryStatsHistory();
+ final BatteryStatsHistoryIterator iterator = bi.iterateBatteryStatsHistory(0, 0);
BatteryStats.HistoryItem item;
@@ -933,7 +933,7 @@
clocks.realtime = clocks.uptime = 5000;
bi.noteAlarmFinishLocked("foo", null, UID);
- BatteryStatsHistoryIterator iterator = bi.iterateBatteryStatsHistory();
+ BatteryStatsHistoryIterator iterator = bi.iterateBatteryStatsHistory(0, 0);
HistoryItem item;
assertThat(item = iterator.next()).isNotNull();
@@ -972,7 +972,7 @@
clocks.realtime = clocks.uptime = 5000;
bi.noteAlarmFinishLocked("foo", ws, UID);
- BatteryStatsHistoryIterator iterator = bi.iterateBatteryStatsHistory();
+ BatteryStatsHistoryIterator iterator = bi.iterateBatteryStatsHistory(0, 0);
HistoryItem item;
assertThat(item = iterator.next()).isNotNull();
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/CpuPowerStatsCollectorTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/CpuPowerStatsCollectorTest.java
new file mode 100644
index 0000000..f2ee6db
--- /dev/null
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/CpuPowerStatsCollectorTest.java
@@ -0,0 +1,137 @@
+/*
+ * 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.server.power.stats;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.Mockito.when;
+
+import android.os.ConditionVariable;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.util.SparseArray;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.internal.os.CpuScalingPolicies;
+import com.android.internal.os.PowerProfile;
+import com.android.internal.os.PowerStats;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class CpuPowerStatsCollectorTest {
+ private final MockClock mMockClock = new MockClock();
+ private final HandlerThread mHandlerThread = new HandlerThread("test");
+ private Handler mHandler;
+ private CpuPowerStatsCollector mCollector;
+ private PowerStats mCollectedStats;
+ @Mock
+ private PowerProfile mPowerProfile;
+ @Mock
+ private CpuPowerStatsCollector.KernelCpuStatsReader mMockKernelCpuStatsReader;
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+
+ mHandlerThread.start();
+ mHandler = mHandlerThread.getThreadHandler();
+ when(mPowerProfile.getCpuPowerBracketCount()).thenReturn(2);
+ when(mPowerProfile.getCpuPowerBracketForScalingStep(0, 0)).thenReturn(0);
+ when(mPowerProfile.getCpuPowerBracketForScalingStep(0, 1)).thenReturn(1);
+ mCollector = new CpuPowerStatsCollector(new CpuScalingPolicies(
+ new SparseArray<>() {{
+ put(0, new int[]{0});
+ }},
+ new SparseArray<>() {{
+ put(0, new int[]{1, 12});
+ }}),
+ mPowerProfile, mHandler, mMockKernelCpuStatsReader, 60_000, mMockClock);
+ mCollector.addConsumer(stats -> mCollectedStats = stats);
+ mCollector.setEnabled(true);
+ }
+
+ @Test
+ public void collectStats() {
+ mockKernelCpuStats(new SparseArray<>() {{
+ put(42, new long[]{100, 200});
+ put(99, new long[]{300, 600});
+ }}, 0, 1234);
+
+ mMockClock.uptime = 1000;
+ mCollector.forceSchedule();
+ waitForIdle();
+
+ assertThat(mCollectedStats.durationMs).isEqualTo(1234);
+ assertThat(mCollectedStats.uidStats.get(42)).isEqualTo(new long[]{100, 200});
+ assertThat(mCollectedStats.uidStats.get(99)).isEqualTo(new long[]{300, 600});
+
+ mockKernelCpuStats(new SparseArray<>() {{
+ put(42, new long[]{123, 234});
+ put(99, new long[]{345, 678});
+ }}, 1234, 3421);
+
+ mMockClock.uptime = 2000;
+ mCollector.forceSchedule();
+ waitForIdle();
+
+ assertThat(mCollectedStats.durationMs).isEqualTo(3421 - 1234);
+ assertThat(mCollectedStats.uidStats.get(42)).isEqualTo(new long[]{23, 34});
+ assertThat(mCollectedStats.uidStats.get(99)).isEqualTo(new long[]{45, 78});
+ }
+
+ private void mockKernelCpuStats(SparseArray<long[]> uidToCpuStats,
+ long expectedLastUpdateTimestampMs, long newLastUpdateTimestampMs) {
+ when(mMockKernelCpuStatsReader.nativeReadCpuStats(
+ any(CpuPowerStatsCollector.KernelCpuStatsCallback.class),
+ any(int[].class), anyLong(), any(long[].class)))
+ .thenAnswer(invocation -> {
+ CpuPowerStatsCollector.KernelCpuStatsCallback callback =
+ invocation.getArgument(0);
+ int[] powerBucketIndexes = invocation.getArgument(1);
+ long lastTimestamp = invocation.getArgument(2);
+ long[] tempStats = invocation.getArgument(3);
+
+ assertThat(powerBucketIndexes).isEqualTo(new int[]{0, 1});
+ assertThat(lastTimestamp / 1000000L).isEqualTo(expectedLastUpdateTimestampMs);
+ assertThat(tempStats).hasLength(2);
+
+ for (int i = 0; i < uidToCpuStats.size(); i++) {
+ int uid = uidToCpuStats.keyAt(i);
+ long[] cpuStats = uidToCpuStats.valueAt(i);
+ System.arraycopy(cpuStats, 0, tempStats, 0, tempStats.length);
+ callback.processUidStats(uid, tempStats);
+ }
+ return newLastUpdateTimestampMs * 1000000L; // Nanoseconds
+ });
+ }
+
+ private void waitForIdle() {
+ ConditionVariable done = new ConditionVariable();
+ mHandler.post(done::open);
+ done.block();
+ }
+}
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/CpuPowerStatsCollectorValidationTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/CpuPowerStatsCollectorValidationTest.java
new file mode 100644
index 0000000..38a5d19
--- /dev/null
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/CpuPowerStatsCollectorValidationTest.java
@@ -0,0 +1,165 @@
+/*
+ * 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.server.power.stats;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static junit.framework.Assert.fail;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
+import android.provider.DeviceConfig;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.LargeTest;
+import androidx.test.runner.AndroidJUnit4;
+import androidx.test.uiautomator.UiDevice;
+
+import com.android.frameworks.coretests.aidl.ICmdCallback;
+import com.android.frameworks.coretests.aidl.ICmdReceiver;
+import com.android.server.power.optimization.Flags;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.Arrays;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class CpuPowerStatsCollectorValidationTest {
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule =
+ DeviceFlagsValueProvider.createCheckFlagsRule();
+
+ private static final int WORK_DURATION_MS = 2000;
+ private static final String TEST_PKG = "com.android.coretests.apps.bstatstestapp";
+ private static final String TEST_ACTIVITY = TEST_PKG + ".TestActivity";
+ private static final String EXTRA_KEY_CMD_RECEIVER = "cmd_receiver";
+ private static final int START_ACTIVITY_TIMEOUT_MS = 2000;
+
+ private Context mContext;
+ private UiDevice mUiDevice;
+ private DeviceConfig.Properties mBackupFlags;
+ private int mTestPkgUid;
+
+ @Before
+ public void setup() throws Exception {
+ mContext = InstrumentationRegistry.getContext();
+ mUiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
+ mTestPkgUid = mContext.getPackageManager().getPackageUid(TEST_PKG, 0);
+ }
+
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_STREAMLINED_BATTERY_STATS)
+ public void totalTimeInPowerBrackets() throws Exception {
+ dumpCpuStats(); // For the side effect of capturing the baseline.
+
+ doSomeWork();
+
+ long duration = 0;
+ long[] stats = null;
+
+ String[] cpuStatsDump = dumpCpuStats();
+ Pattern durationPattern = Pattern.compile("duration=([0-9]*)");
+ Pattern uidPattern = Pattern.compile("UID " + mTestPkgUid + ": \\[([0-9,\\s]*)]");
+ for (String line : cpuStatsDump) {
+ Matcher durationMatcher = durationPattern.matcher(line);
+ if (durationMatcher.find()) {
+ duration = Long.parseLong(durationMatcher.group(1));
+ }
+ Matcher uidMatcher = uidPattern.matcher(line);
+ if (uidMatcher.find()) {
+ String[] strings = uidMatcher.group(1).split(", ");
+ stats = new long[strings.length];
+ for (int i = 0; i < strings.length; i++) {
+ stats[i] = Long.parseLong(strings[i]);
+ }
+ }
+ }
+ if (stats == null) {
+ fail("No CPU stats for " + mTestPkgUid + " (" + TEST_PKG + ")");
+ }
+
+ assertThat(duration).isAtLeast(WORK_DURATION_MS);
+
+ long total = Arrays.stream(stats).sum();
+ assertThat(total).isAtLeast((long) (WORK_DURATION_MS * 0.8));
+ }
+
+ private String[] dumpCpuStats() throws Exception {
+ String dump = executeCmdSilent("dumpsys batterystats --sample");
+ String[] lines = dump.split("\n");
+ for (int i = 0; i < lines.length; i++) {
+ if (lines[i].startsWith("CpuPowerStatsCollector")) {
+ return Arrays.copyOfRange(lines, i + 1, lines.length);
+ }
+ }
+ return new String[0];
+ }
+
+ private void doSomeWork() throws Exception {
+ final ICmdReceiver receiver;
+ receiver = ICmdReceiver.Stub.asInterface(startActivity());
+ try {
+ receiver.doSomeWork(WORK_DURATION_MS);
+ } finally {
+ receiver.finishHost();
+ }
+ }
+
+ private IBinder startActivity() throws Exception {
+ final CountDownLatch latch = new CountDownLatch(1);
+ final Intent launchIntent = new Intent().setComponent(
+ new ComponentName(TEST_PKG, TEST_ACTIVITY));
+ final Bundle extras = new Bundle();
+ final IBinder[] binders = new IBinder[1];
+ extras.putBinder(EXTRA_KEY_CMD_RECEIVER, new ICmdCallback.Stub() {
+ @Override
+ public void onLaunched(IBinder receiver) {
+ binders[0] = receiver;
+ latch.countDown();
+ }
+ });
+ launchIntent.putExtras(extras).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ mContext.startActivity(launchIntent);
+ if (latch.await(START_ACTIVITY_TIMEOUT_MS, TimeUnit.MILLISECONDS)) {
+ if (binders[0] == null) {
+ fail("Receiver binder should not be null");
+ }
+ return binders[0];
+ } else {
+ fail("Timed out waiting for the test activity to start; testUid=" + mTestPkgUid);
+ }
+ return null;
+ }
+
+ private String executeCmdSilent(String cmd) throws Exception {
+ return mUiDevice.executeShellCommand(cmd).trim();
+ }
+}
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/EnergyConsumerSnapshotTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/EnergyConsumerSnapshotTest.java
index 28f4799..6cd0865 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/EnergyConsumerSnapshotTest.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/EnergyConsumerSnapshotTest.java
@@ -26,7 +26,6 @@
import android.hardware.power.stats.EnergyConsumerAttribution;
import android.hardware.power.stats.EnergyConsumerResult;
import android.hardware.power.stats.EnergyConsumerType;
-import android.os.BatteryStats;
import android.util.SparseArray;
import android.util.SparseLongArray;
@@ -238,17 +237,6 @@
}
@Test
- public void getMeasuredEnergyDetails() {
- final EnergyConsumerSnapshot snapshot = new EnergyConsumerSnapshot(ALL_ID_CONSUMER_MAP);
- snapshot.updateAndGetDelta(RESULTS_0, VOLTAGE_0);
- EnergyConsumerDeltaData delta = snapshot.updateAndGetDelta(RESULTS_1, VOLTAGE_1);
- BatteryStats.EnergyConsumerDetails details = snapshot.getEnergyConsumerDetails(delta);
- assertThat(details.consumers).hasLength(4);
- assertThat(details.chargeUC).isEqualTo(new long[]{2667, 3200000, 0, 0});
- assertThat(details.toString()).isEqualTo("DISPLAY=2667 HPU=3200000 GPU=0 IPU &_=0");
- }
-
- @Test
public void testUpdateAndGetDelta_updatesCameraCharge() {
EnergyConsumer cameraConsumer =
createEnergyConsumer(7, 0, EnergyConsumerType.CAMERA, "CAMERA");
@@ -266,12 +254,8 @@
createEnergyConsumerResult(cameraConsumer.id, 90_000, null, null),
};
EnergyConsumerDeltaData delta = snapshot.updateAndGetDelta(result1, VOLTAGE_1);
-
- // Verify that the delta between the two results is reported.
- BatteryStats.EnergyConsumerDetails details = snapshot.getEnergyConsumerDetails(delta);
- assertThat(details.consumers).hasLength(1);
long expectedDeltaUC = calculateChargeConsumedUC(60_000, VOLTAGE_1, 90_000, VOLTAGE_1);
- assertThat(details.chargeUC[0]).isEqualTo(expectedDeltaUC);
+ assertThat(delta.cameraChargeUC).isEqualTo(expectedDeltaUC);
}
private static EnergyConsumer createEnergyConsumer(int id, int ord, byte type, String name) {
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/MockBatteryStatsImpl.java b/services/tests/powerstatstests/src/com/android/server/power/stats/MockBatteryStatsImpl.java
index 6d3f1f2..4150972a 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/MockBatteryStatsImpl.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/MockBatteryStatsImpl.java
@@ -119,6 +119,13 @@
return MOBILE_RADIO_POWER_STATE_UPDATE_FREQ_MS;
}
+ public MockBatteryStatsImpl setBatteryStatsConfig(BatteryStatsConfig config) {
+ synchronized (this) {
+ mBatteryStatsConfig = config;
+ }
+ return this;
+ }
+
public MockBatteryStatsImpl setNetworkStats(NetworkStats networkStats) {
mNetworkStats = networkStats;
return this;
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/MultiStateStatsTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/MultiStateStatsTest.java
new file mode 100644
index 0000000..4ecee9f
--- /dev/null
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/MultiStateStatsTest.java
@@ -0,0 +1,267 @@
+/*
+ * 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.server.power.stats;
+
+import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth.assertWithMessage;
+
+import static org.junit.Assert.assertThrows;
+
+import android.os.BatteryConsumer;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.internal.os.MultiStateStats;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Arrays;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class MultiStateStatsTest {
+
+ public static final int DIMENSION_COUNT = 2;
+
+ @Test
+ public void compositeStateIndex_allEnabled() {
+ MultiStateStats.Factory factory = makeFactory(true, true, true);
+ assertThatCpuPerformanceStatsFactory(factory)
+ .hasSerialStateCount(BatteryConsumer.PROCESS_STATE_COUNT * 4)
+ .haveDifferentSerialStates(
+ state(false, false, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(false, false, BatteryConsumer.PROCESS_STATE_BACKGROUND),
+ state(false, true, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(false, true, BatteryConsumer.PROCESS_STATE_BACKGROUND),
+ state(true, false, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(true, false, BatteryConsumer.PROCESS_STATE_BACKGROUND),
+ state(true, true, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(true, true, BatteryConsumer.PROCESS_STATE_BACKGROUND));
+ }
+
+ @Test
+ public void compositeStateIndex_procStateTrackingDisabled() {
+ MultiStateStats.Factory factory = makeFactory(true, false, true);
+ assertThatCpuPerformanceStatsFactory(factory)
+ .hasSerialStateCount(4)
+ .haveDifferentSerialStates(
+ state(false, false, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(false, true, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(true, false, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(true, true, BatteryConsumer.PROCESS_STATE_FOREGROUND))
+ .haveSameSerialStates(
+ state(false, false, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(false, false, BatteryConsumer.PROCESS_STATE_BACKGROUND))
+ .haveSameSerialStates(
+ state(false, true, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(false, true, BatteryConsumer.PROCESS_STATE_BACKGROUND))
+ .haveSameSerialStates(
+ state(true, false, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(true, false, BatteryConsumer.PROCESS_STATE_BACKGROUND))
+ .haveSameSerialStates(
+ state(true, true, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(true, true, BatteryConsumer.PROCESS_STATE_BACKGROUND));
+ }
+
+ @Test
+ public void compositeStateIndex_screenTrackingDisabled() {
+ MultiStateStats.Factory factory = makeFactory(true, true, false);
+ assertThatCpuPerformanceStatsFactory(factory)
+ .hasSerialStateCount(BatteryConsumer.PROCESS_STATE_COUNT * 2)
+ .haveDifferentSerialStates(
+ state(false, false, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(false, true, BatteryConsumer.PROCESS_STATE_BACKGROUND),
+ state(true, false, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(true, true, BatteryConsumer.PROCESS_STATE_BACKGROUND))
+ .haveSameSerialStates(
+ state(false, false, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(false, true, BatteryConsumer.PROCESS_STATE_FOREGROUND))
+ .haveSameSerialStates(
+ state(true, false, BatteryConsumer.PROCESS_STATE_BACKGROUND),
+ state(true, true, BatteryConsumer.PROCESS_STATE_BACKGROUND));
+ }
+
+ @Test
+ public void compositeStateIndex_allDisabled() {
+ MultiStateStats.Factory factory = makeFactory(false, false, false);
+ assertThatCpuPerformanceStatsFactory(factory)
+ .hasSerialStateCount(1)
+ .haveSameSerialStates(
+ state(false, false, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(false, false, BatteryConsumer.PROCESS_STATE_BACKGROUND),
+ state(false, true, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(false, true, BatteryConsumer.PROCESS_STATE_BACKGROUND),
+ state(true, false, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(true, false, BatteryConsumer.PROCESS_STATE_BACKGROUND),
+ state(true, true, BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ state(true, true, BatteryConsumer.PROCESS_STATE_BACKGROUND));
+ }
+
+ @Test
+ public void tooManyStates() {
+ // 4 bits needed to represent
+ String[] labels = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
+ // 4 * 10 = 40 bits needed to represent the composite state
+ MultiStateStats.States[] states = new MultiStateStats.States[10];
+ for (int i = 0; i < states.length; i++) {
+ states[i] = new MultiStateStats.States(true, labels);
+ }
+ IllegalArgumentException e = assertThrows(IllegalArgumentException.class,
+ () -> new MultiStateStats.Factory(DIMENSION_COUNT, states));
+ assertThat(e.getMessage()).contains("40");
+ }
+
+ @Test
+ public void multiStateStats_aggregation() {
+ MultiStateStats.Factory factory = makeFactory(true, true, false);
+ MultiStateStats multiStateStats = factory.create();
+ multiStateStats.setState(0 /* batteryState */, 1 /* on */, 1000);
+ multiStateStats.setState(1 /* procState */, BatteryConsumer.PROCESS_STATE_FOREGROUND, 1000);
+ multiStateStats.setState(2 /* screenState */, 0 /* off */, 1000);
+
+ multiStateStats.increment(new long[]{100, 200}, 1000);
+
+ multiStateStats.setState(0 /* batteryState */, 0 /* off */, 2000);
+ multiStateStats.setState(2 /* screenState */, 1 /* on */, 2000); // untracked
+
+ multiStateStats.increment(new long[]{300, 500}, 3000);
+
+ multiStateStats.setState(1 /* procState */, BatteryConsumer.PROCESS_STATE_BACKGROUND, 4000);
+
+ multiStateStats.increment(new long[]{200, 200}, 5000);
+
+ long[] stats = new long[DIMENSION_COUNT];
+ multiStateStats.getStats(stats, new int[]{0, BatteryConsumer.PROCESS_STATE_FOREGROUND, 0});
+ // (400 - 100) * 0.5 + (600 - 400) * 0.5
+ assertThat(stats).isEqualTo(new long[]{250, 350});
+
+ multiStateStats.getStats(stats, new int[]{1, BatteryConsumer.PROCESS_STATE_FOREGROUND, 0});
+ // (400 - 100) * 0.5 + (600 - 400) * 0
+ assertThat(stats).isEqualTo(new long[]{150, 250});
+
+ // Note that screen state does not affect the result, as it is untracked
+ multiStateStats.getStats(stats, new int[]{0, BatteryConsumer.PROCESS_STATE_BACKGROUND, 1});
+ // (400 - 100) * 0 + (600 - 400) * 0.5
+ assertThat(stats).isEqualTo(new long[]{100, 100});
+
+ multiStateStats.getStats(stats, new int[]{1, BatteryConsumer.PROCESS_STATE_BACKGROUND, 0});
+ // Never been in this composite state
+ assertThat(stats).isEqualTo(new long[]{0, 0});
+ }
+
+ @Test
+ public void dump() {
+ MultiStateStats.Factory factory = makeFactory(true, true, false);
+ MultiStateStats multiStateStats = factory.create();
+ multiStateStats.setState(0 /* batteryState */, 0 /* off */, 1000);
+ multiStateStats.setState(1 /* procState */, BatteryConsumer.PROCESS_STATE_FOREGROUND, 1000);
+ multiStateStats.setState(2 /* screenState */, 0 /* off */, 1000);
+ multiStateStats.setState(0 /* batteryState */, 1 /* on */, 2000);
+ multiStateStats.setState(1 /* procState */, BatteryConsumer.PROCESS_STATE_BACKGROUND, 3000);
+ multiStateStats.increment(new long[]{100, 200}, 5000);
+
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw, true);
+ multiStateStats.dump(pw);
+ assertThat(sw.toString()).isEqualTo(
+ "plugged-in fg [25, 50]\n"
+ + "on-battery fg [25, 50]\n"
+ + "on-battery bg [50, 100]\n"
+ );
+ }
+
+ private static MultiStateStats.Factory makeFactory(boolean trackBatteryState,
+ boolean trackProcState, boolean trackScreenState) {
+ return new MultiStateStats.Factory(DIMENSION_COUNT,
+ new MultiStateStats.States(trackBatteryState, "plugged-in", "on-battery"),
+ new MultiStateStats.States(trackProcState,
+ BatteryConsumer.processStateToString(
+ BatteryConsumer.PROCESS_STATE_UNSPECIFIED),
+ BatteryConsumer.processStateToString(
+ BatteryConsumer.PROCESS_STATE_FOREGROUND),
+ BatteryConsumer.processStateToString(
+ BatteryConsumer.PROCESS_STATE_BACKGROUND),
+ BatteryConsumer.processStateToString(
+ BatteryConsumer.PROCESS_STATE_FOREGROUND_SERVICE),
+ BatteryConsumer.processStateToString(
+ BatteryConsumer.PROCESS_STATE_CACHED)),
+ new MultiStateStats.States(trackScreenState, "screen-off", "plugged-in"));
+ }
+
+ private FactorySubject assertThatCpuPerformanceStatsFactory(
+ MultiStateStats.Factory factory) {
+ FactorySubject subject = new FactorySubject();
+ subject.mFactory = factory;
+ return subject;
+ }
+
+ private static class FactorySubject {
+ private MultiStateStats.Factory mFactory;
+
+ FactorySubject hasSerialStateCount(int stateCount) {
+ assertThat(mFactory.getSerialStateCount()).isEqualTo(stateCount);
+ return this;
+ }
+
+ public FactorySubject haveDifferentSerialStates(State... states) {
+ int[] serialStates = getSerialStates(states);
+ assertWithMessage("Expected all to be different: " + Arrays.toString(serialStates))
+ .that(Arrays.stream(serialStates).distinct().toArray())
+ .hasLength(states.length);
+ return this;
+ }
+
+ public FactorySubject haveSameSerialStates(State... states) {
+ int[] serialStates = getSerialStates(states);
+ assertWithMessage("Expected all to be the same: " + Arrays.toString(serialStates))
+ .that(Arrays.stream(serialStates).distinct().toArray())
+ .hasLength(1);
+ return this;
+ }
+
+ private int[] getSerialStates(State[] states) {
+ int[] serialStates = new int[states.length];
+ for (int i = 0; i < states.length; i++) {
+ serialStates[i] = mFactory.getSerialState(
+ new int[]{
+ states[i].batteryState ? 0 : 1,
+ states[i].procstate,
+ states[i].screenState ? 0 : 1
+ });
+ }
+ return serialStates;
+ }
+ }
+
+ private State state(boolean batteryState, boolean screenState, int procstate) {
+ State state = new State();
+ state.batteryState = batteryState;
+ state.screenState = screenState;
+ state.procstate = procstate;
+ return state;
+ }
+
+ private static class State {
+ public boolean batteryState;
+ public boolean screenState;
+ public int procstate;
+ }
+}
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/PowerStatsAggregatorTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/PowerStatsAggregatorTest.java
new file mode 100644
index 0000000..47de443
--- /dev/null
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/PowerStatsAggregatorTest.java
@@ -0,0 +1,232 @@
+/*
+ * 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.server.power.stats;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+
+import android.os.BatteryConsumer;
+import android.os.BatteryStats;
+import android.os.PersistableBundle;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.internal.os.BatteryStatsHistory;
+import com.android.internal.os.PowerStats;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class PowerStatsAggregatorTest {
+ private static final int TEST_POWER_COMPONENT = 77;
+ private static final int TEST_UID = 42;
+
+ private final MockClock mClock = new MockClock();
+ private long mStartTime;
+ private BatteryStatsHistory mHistory;
+ private PowerStatsAggregator mAggregator;
+ private int mAggregatedStatsCount;
+
+ @Before
+ public void setup() throws ParseException {
+ mHistory = new BatteryStatsHistory(32, 1024,
+ mock(BatteryStatsHistory.HistoryStepDetailsCalculator.class), mClock);
+ mStartTime = new SimpleDateFormat("yyyy-MM-dd HH:mm")
+ .parse("2008-09-23 08:00").getTime();
+ mClock.currentTime = mStartTime;
+
+ PowerStatsAggregator.Builder builder = new PowerStatsAggregator.Builder(mHistory);
+ builder.trackPowerComponent(TEST_POWER_COMPONENT)
+ .trackDeviceStates(
+ PowerStatsAggregator.STATE_POWER,
+ PowerStatsAggregator.STATE_SCREEN)
+ .trackUidStates(
+ PowerStatsAggregator.STATE_POWER,
+ PowerStatsAggregator.STATE_SCREEN,
+ PowerStatsAggregator.STATE_PROCESS_STATE);
+ mAggregator = builder.build();
+ }
+
+ @Test
+ public void stateUpdates() {
+ mHistory.forceRecordAllHistory();
+ mHistory.recordBatteryState(mClock.realtime, mClock.uptime, 10, /* plugged */ true);
+ mHistory.recordStateStartEvent(mClock.realtime, mClock.uptime,
+ BatteryStats.HistoryItem.STATE_SCREEN_ON_FLAG);
+ mHistory.recordProcessStateChange(mClock.realtime, mClock.uptime, TEST_UID,
+ BatteryConsumer.PROCESS_STATE_FOREGROUND);
+
+ advance(1000);
+
+ PowerStats.Descriptor descriptor =
+ new PowerStats.Descriptor(TEST_POWER_COMPONENT, "majorDrain", 1, 1,
+ new PersistableBundle());
+ PowerStats powerStats = new PowerStats(descriptor);
+ powerStats.stats = new long[]{10000};
+ powerStats.uidStats.put(TEST_UID, new long[]{1234});
+ mHistory.recordPowerStats(mClock.realtime, mClock.uptime, powerStats);
+
+ mHistory.recordBatteryState(mClock.realtime, mClock.uptime, 90, /* plugged */ false);
+ mHistory.recordStateStopEvent(mClock.realtime, mClock.uptime,
+ BatteryStats.HistoryItem.STATE_SCREEN_ON_FLAG);
+
+ advance(1000);
+
+ mHistory.recordProcessStateChange(mClock.realtime, mClock.uptime, TEST_UID,
+ BatteryConsumer.PROCESS_STATE_BACKGROUND);
+
+ advance(3000);
+
+ powerStats.stats = new long[]{20000};
+ powerStats.uidStats.put(TEST_UID, new long[]{4444});
+ mHistory.recordPowerStats(mClock.realtime, mClock.uptime, powerStats);
+
+ mAggregator.aggregateBatteryStats(0, 0, stats -> {
+ assertThat(mAggregatedStatsCount++).isEqualTo(0);
+ assertThat(stats.getStartTime()).isEqualTo(mStartTime);
+ assertThat(stats.getDuration()).isEqualTo(5000);
+
+ long[] values = new long[1];
+
+ PowerComponentAggregatedPowerStats powerComponentStats = stats.getPowerComponentStats(
+ TEST_POWER_COMPONENT);
+
+ assertThat(powerComponentStats.getDeviceStats(values, new int[]{
+ PowerStatsAggregator.POWER_STATE_OTHER,
+ PowerStatsAggregator.SCREEN_STATE_ON}))
+ .isTrue();
+ assertThat(values).isEqualTo(new long[]{10000});
+
+ assertThat(powerComponentStats.getDeviceStats(values, new int[]{
+ PowerStatsAggregator.POWER_STATE_BATTERY,
+ PowerStatsAggregator.SCREEN_STATE_OTHER}))
+ .isTrue();
+ assertThat(values).isEqualTo(new long[]{20000});
+
+ assertThat(powerComponentStats.getUidStats(values, TEST_UID, new int[]{
+ PowerStatsAggregator.POWER_STATE_OTHER,
+ PowerStatsAggregator.SCREEN_STATE_ON,
+ BatteryConsumer.PROCESS_STATE_FOREGROUND}))
+ .isTrue();
+ assertThat(values).isEqualTo(new long[]{1234});
+
+ assertThat(powerComponentStats.getUidStats(values, TEST_UID, new int[]{
+ PowerStatsAggregator.POWER_STATE_BATTERY,
+ PowerStatsAggregator.SCREEN_STATE_OTHER,
+ BatteryConsumer.PROCESS_STATE_FOREGROUND}))
+ .isTrue();
+ assertThat(values).isEqualTo(new long[]{1111});
+
+ assertThat(powerComponentStats.getUidStats(values, TEST_UID, new int[]{
+ PowerStatsAggregator.POWER_STATE_BATTERY,
+ PowerStatsAggregator.SCREEN_STATE_OTHER,
+ BatteryConsumer.PROCESS_STATE_BACKGROUND}))
+ .isTrue();
+ assertThat(values).isEqualTo(new long[]{3333});
+ });
+ }
+
+ @Test
+ public void incompatiblePowerStats() {
+ mHistory.forceRecordAllHistory();
+ mHistory.recordBatteryState(mClock.realtime, mClock.uptime, 10, /* plugged */ true);
+ mHistory.recordProcessStateChange(mClock.realtime, mClock.uptime, TEST_UID,
+ BatteryConsumer.PROCESS_STATE_FOREGROUND);
+
+ advance(1000);
+
+ PowerStats.Descriptor descriptor =
+ new PowerStats.Descriptor(TEST_POWER_COMPONENT, "majorDrain", 1, 1,
+ new PersistableBundle());
+ PowerStats powerStats = new PowerStats(descriptor);
+ powerStats.stats = new long[]{10000};
+ powerStats.uidStats.put(TEST_UID, new long[]{1234});
+ mHistory.recordPowerStats(mClock.realtime, mClock.uptime, powerStats);
+
+ mHistory.recordBatteryState(mClock.realtime, mClock.uptime, 90, /* plugged */ false);
+
+ advance(1000);
+
+ descriptor = new PowerStats.Descriptor(TEST_POWER_COMPONENT, "majorDrain", 1, 1,
+ PersistableBundle.forPair("something", "changed"));
+ powerStats = new PowerStats(descriptor);
+ powerStats.stats = new long[]{20000};
+ powerStats.uidStats.put(TEST_UID, new long[]{4444});
+ mHistory.recordPowerStats(mClock.realtime, mClock.uptime, powerStats);
+
+ advance(1000);
+
+ mHistory.recordBatteryState(mClock.realtime, mClock.uptime, 50, /* plugged */ true);
+
+ mAggregator.aggregateBatteryStats(0, 0, stats -> {
+ long[] values = new long[1];
+
+ PowerComponentAggregatedPowerStats powerComponentStats =
+ stats.getPowerComponentStats(TEST_POWER_COMPONENT);
+
+ if (mAggregatedStatsCount == 0) {
+ assertThat(stats.getStartTime()).isEqualTo(mStartTime);
+ assertThat(stats.getDuration()).isEqualTo(2000);
+
+ assertThat(powerComponentStats.getDeviceStats(values, new int[]{
+ PowerStatsAggregator.POWER_STATE_OTHER,
+ PowerStatsAggregator.SCREEN_STATE_ON}))
+ .isTrue();
+ assertThat(values).isEqualTo(new long[]{10000});
+ assertThat(powerComponentStats.getUidStats(values, TEST_UID, new int[]{
+ PowerStatsAggregator.POWER_STATE_OTHER,
+ PowerStatsAggregator.SCREEN_STATE_ON,
+ BatteryConsumer.PROCESS_STATE_FOREGROUND}))
+ .isTrue();
+ assertThat(values).isEqualTo(new long[]{1234});
+ } else if (mAggregatedStatsCount == 1) {
+ assertThat(stats.getStartTime()).isEqualTo(mStartTime + 2000);
+ assertThat(stats.getDuration()).isEqualTo(1000);
+
+ assertThat(powerComponentStats.getDeviceStats(values, new int[]{
+ PowerStatsAggregator.POWER_STATE_BATTERY,
+ PowerStatsAggregator.SCREEN_STATE_ON}))
+ .isTrue();
+ assertThat(values).isEqualTo(new long[]{20000});
+ assertThat(powerComponentStats.getUidStats(values, TEST_UID, new int[]{
+ PowerStatsAggregator.POWER_STATE_BATTERY,
+ PowerStatsAggregator.SCREEN_STATE_ON,
+ BatteryConsumer.PROCESS_STATE_FOREGROUND}))
+ .isTrue();
+ assertThat(values).isEqualTo(new long[]{4444});
+ } else {
+ fail();
+ }
+ mAggregatedStatsCount++;
+ });
+ }
+
+ private void advance(long durationMs) {
+ mClock.realtime += durationMs;
+ mClock.uptime += durationMs;
+ mClock.currentTime += durationMs;
+ }
+}
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/PowerStatsCollectorTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/PowerStatsCollectorTest.java
new file mode 100644
index 0000000..330f698
--- /dev/null
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/PowerStatsCollectorTest.java
@@ -0,0 +1,88 @@
+/*
+ * 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.server.power.stats;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.os.ConditionVariable;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.PersistableBundle;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.internal.os.PowerStats;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class PowerStatsCollectorTest {
+ private final MockClock mMockClock = new MockClock();
+ private final HandlerThread mHandlerThread = new HandlerThread("test");
+ private Handler mHandler;
+ private PowerStatsCollector mCollector;
+ private PowerStats mCollectedStats;
+
+ @Before
+ public void setup() {
+ mHandlerThread.start();
+ mHandler = mHandlerThread.getThreadHandler();
+ mCollector = new PowerStatsCollector(mHandler,
+ 60000,
+ mMockClock) {
+ @Override
+ protected PowerStats collectStats() {
+ return new PowerStats(new PowerStats.Descriptor(0, 0, 0, new PersistableBundle()));
+ }
+ };
+ mCollector.addConsumer(stats -> mCollectedStats = stats);
+ mCollector.setEnabled(true);
+ }
+
+ @Test
+ public void throttlePeriod() {
+ mMockClock.uptime = 1000;
+ mCollector.schedule();
+ waitForIdle();
+
+ assertThat(mCollectedStats).isNotNull();
+
+ mMockClock.uptime += 1000;
+ mCollectedStats = null;
+ mCollector.schedule(); // Should be throttled
+ waitForIdle();
+
+ assertThat(mCollectedStats).isNull();
+
+ // Should be allowed to run
+ mMockClock.uptime += 100_000;
+ mCollector.schedule();
+ waitForIdle();
+
+ assertThat(mCollectedStats).isNotNull();
+ }
+
+ private void waitForIdle() {
+ ConditionVariable done = new ConditionVariable();
+ mHandler.post(done::open);
+ done.block();
+ }
+}
diff --git a/services/tests/servicestests/Android.bp b/services/tests/servicestests/Android.bp
index 92ff7ab..20d8a5d 100644
--- a/services/tests/servicestests/Android.bp
+++ b/services/tests/servicestests/Android.bp
@@ -68,6 +68,7 @@
"ActivityContext",
"coretests-aidl",
"securebox",
+ "flag-junit",
],
libs: [
diff --git a/services/tests/servicestests/src/com/android/server/CertBlacklisterTest.java b/services/tests/servicestests/src/com/android/server/CertBlacklisterTest.java
index 90df786..45e7f35 100644
--- a/services/tests/servicestests/src/com/android/server/CertBlacklisterTest.java
+++ b/services/tests/servicestests/src/com/android/server/CertBlacklisterTest.java
@@ -34,10 +34,10 @@
*/
public class CertBlacklisterTest extends AndroidTestCase {
- private static final String BLACKLIST_ROOT = System.getenv("ANDROID_DATA") + "/misc/keychain/";
+ private static final String DENYLIST_ROOT = System.getenv("ANDROID_DATA") + "/misc/keychain/";
- public static final String PUBKEY_PATH = BLACKLIST_ROOT + "pubkey_blacklist.txt";
- public static final String SERIAL_PATH = BLACKLIST_ROOT + "serial_blacklist.txt";
+ public static final String PUBKEY_PATH = DENYLIST_ROOT + "pubkey_blacklist.txt";
+ public static final String SERIAL_PATH = DENYLIST_ROOT + "serial_blacklist.txt";
public static final String PUBKEY_KEY = "pubkey_blacklist";
public static final String SERIAL_KEY = "serial_blacklist";
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/magnification/FullScreenMagnificationGestureHandlerTest.java b/services/tests/servicestests/src/com/android/server/accessibility/magnification/FullScreenMagnificationGestureHandlerTest.java
index 0a8c570..9fe743d 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/magnification/FullScreenMagnificationGestureHandlerTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/magnification/FullScreenMagnificationGestureHandlerTest.java
@@ -30,6 +30,7 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
@@ -43,6 +44,7 @@
import android.animation.ValueAnimator;
import android.annotation.NonNull;
+import android.content.pm.PackageManager;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.Region;
@@ -252,7 +254,11 @@
detectTripleTap, detectShortcutTrigger,
mWindowMagnificationPromptController, DISPLAY_0,
mMockFullScreenMagnificationVibrationHelper);
- h.setSinglePanningEnabled(true);
+ if (isWatch()) {
+ h.setSinglePanningEnabled(true);
+ } else {
+ h.setSinglePanningEnabled(false);
+ }
mHandler = new TestHandler(h.mDetectingState, mClock) {
@Override
protected String messageToString(Message m) {
@@ -569,6 +575,7 @@
@Test
public void testActionUpNotAtEdge_singlePanningState_detectingState() {
+ assumeTrue(mMgh.mIsSinglePanningEnabled);
goFromStateIdleTo(STATE_SINGLE_PANNING);
send(upEvent());
@@ -579,6 +586,7 @@
@Test
public void testScroll_SinglePanningDisabled_delegatingState() {
+ assumeTrue(mMgh.mIsSinglePanningEnabled);
mMgh.setSinglePanningEnabled(false);
goFromStateIdleTo(STATE_ACTIVATED);
@@ -591,6 +599,7 @@
@Test
@FlakyTest
public void testScroll_singleHorizontalPanningAndAtEdge_leftEdgeOverscroll() {
+ assumeTrue(mMgh.mIsSinglePanningEnabled);
goFromStateIdleTo(STATE_SINGLE_PANNING);
float centerY =
(INITIAL_MAGNIFICATION_BOUNDS.top + INITIAL_MAGNIFICATION_BOUNDS.bottom) / 2.0f;
@@ -614,6 +623,7 @@
@Test
@FlakyTest
public void testScroll_singleHorizontalPanningAndAtEdge_rightEdgeOverscroll() {
+ assumeTrue(mMgh.mIsSinglePanningEnabled);
goFromStateIdleTo(STATE_SINGLE_PANNING);
float centerY =
(INITIAL_MAGNIFICATION_BOUNDS.top + INITIAL_MAGNIFICATION_BOUNDS.bottom) / 2.0f;
@@ -637,6 +647,7 @@
@Test
@FlakyTest
public void testScroll_singleVerticalPanningAndAtEdge_verticalOverscroll() {
+ assumeTrue(mMgh.mIsSinglePanningEnabled);
goFromStateIdleTo(STATE_SINGLE_PANNING);
float centerX =
(INITIAL_MAGNIFICATION_BOUNDS.right + INITIAL_MAGNIFICATION_BOUNDS.left) / 2.0f;
@@ -658,6 +669,7 @@
@Test
public void testScroll_singlePanningAndAtEdge_noOverscroll() {
+ assumeTrue(mMgh.mIsSinglePanningEnabled);
goFromStateIdleTo(STATE_SINGLE_PANNING);
float centerY =
(INITIAL_MAGNIFICATION_BOUNDS.top + INITIAL_MAGNIFICATION_BOUNDS.bottom) / 2.0f;
@@ -679,6 +691,7 @@
@Test
public void testScroll_singleHorizontalPanningAndAtEdge_vibrate() {
+ assumeTrue(mMgh.mIsSinglePanningEnabled);
goFromStateIdleTo(STATE_SINGLE_PANNING);
mFullScreenMagnificationController.setCenter(
DISPLAY_0,
@@ -702,6 +715,7 @@
@Test
public void testScroll_singleVerticalPanningAndAtEdge_doNotVibrate() {
+ assumeTrue(mMgh.mIsSinglePanningEnabled);
goFromStateIdleTo(STATE_SINGLE_PANNING);
mFullScreenMagnificationController.setCenter(
DISPLAY_0,
@@ -868,6 +882,10 @@
mFullScreenMagnificationController.onUserContextChanged(DISPLAY_0);
}
+ private boolean isWatch() {
+ return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH);
+ }
+
/**
* Asserts that {@link #mMgh the handler} is in the given {@code state}
*/
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/AuthenticationStatsCollectorTest.java b/services/tests/servicestests/src/com/android/server/biometrics/AuthenticationStatsCollectorTest.java
index 99d66c5..746fb53 100644
--- a/services/tests/servicestests/src/com/android/server/biometrics/AuthenticationStatsCollectorTest.java
+++ b/services/tests/servicestests/src/com/android/server/biometrics/AuthenticationStatsCollectorTest.java
@@ -16,20 +16,42 @@
package com.android.server.biometrics;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anySet;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import static java.util.Collections.emptySet;
+
import android.content.Context;
+import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
import android.content.res.Resources;
+import android.hardware.face.FaceManager;
+import android.hardware.fingerprint.FingerprintManager;
+import android.platform.test.annotations.Presubmit;
+
+import androidx.test.filters.SmallTest;
import com.android.internal.R;
+import com.android.server.biometrics.sensors.BiometricNotification;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.io.File;
+
+@Presubmit
+@SmallTest
public class AuthenticationStatsCollectorTest {
private AuthenticationStatsCollector mAuthenticationStatsCollector;
@@ -40,47 +62,220 @@
private Context mContext;
@Mock
private Resources mResources;
+ @Mock
+ private PackageManager mPackageManager;
+ @Mock
+ private FingerprintManager mFingerprintManager;
+ @Mock
+ private FaceManager mFaceManager;
+ @Mock
+ private SharedPreferences mSharedPreferences;
+ @Mock
+ private BiometricNotification mBiometricNotification;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(mContext.getResources()).thenReturn(mResources);
- when(mResources.getFraction(R.fraction.config_biometricNotificationFrrThreshold, 1, 1))
- .thenReturn(FRR_THRESHOLD);
+ when(mResources.getFraction(eq(R.fraction.config_biometricNotificationFrrThreshold),
+ anyInt(), anyInt())).thenReturn(FRR_THRESHOLD);
+
+ when(mContext.getPackageManager()).thenReturn(mPackageManager);
+
+ when(mContext.getSystemServiceName(FingerprintManager.class))
+ .thenReturn(Context.FINGERPRINT_SERVICE);
+ when(mContext.getSystemService(Context.FINGERPRINT_SERVICE))
+ .thenReturn(mFingerprintManager);
+ when(mContext.getSystemServiceName(FaceManager.class)).thenReturn(Context.FACE_SERVICE);
+ when(mContext.getSystemService(Context.FACE_SERVICE)).thenReturn(mFaceManager);
+
+ when(mContext.getSharedPreferences(any(File.class), anyInt()))
+ .thenReturn(mSharedPreferences);
+ when(mSharedPreferences.getStringSet(anyString(), anySet())).thenReturn(emptySet());
mAuthenticationStatsCollector = new AuthenticationStatsCollector(mContext,
- 0 /* modality */);
+ 0 /* modality */, mBiometricNotification);
}
@Test
public void authenticate_authenticationSucceeded_mapShouldBeUpdated() {
// Assert that the user doesn't exist in the map initially.
- assertNull(mAuthenticationStatsCollector.getAuthenticationStatsForUser(USER_ID_1));
+ assertThat(mAuthenticationStatsCollector.getAuthenticationStatsForUser(USER_ID_1)).isNull();
- mAuthenticationStatsCollector.authenticate(USER_ID_1, true /* authenticated*/);
+ mAuthenticationStatsCollector.authenticate(USER_ID_1, true /* authenticated */);
AuthenticationStats authenticationStats =
mAuthenticationStatsCollector.getAuthenticationStatsForUser(USER_ID_1);
- assertEquals(USER_ID_1, authenticationStats.getUserId());
- assertEquals(1, authenticationStats.getTotalAttempts());
- assertEquals(0, authenticationStats.getRejectedAttempts());
- assertEquals(0, authenticationStats.getEnrollmentNotifications());
+ assertThat(authenticationStats.getUserId()).isEqualTo(USER_ID_1);
+ assertThat(authenticationStats.getTotalAttempts()).isEqualTo(1);
+ assertThat(authenticationStats.getRejectedAttempts()).isEqualTo(0);
+ assertThat(authenticationStats.getEnrollmentNotifications()).isEqualTo(0);
}
@Test
public void authenticate_authenticationFailed_mapShouldBeUpdated() {
// Assert that the user doesn't exist in the map initially.
- assertNull(mAuthenticationStatsCollector.getAuthenticationStatsForUser(USER_ID_1));
+ assertThat(mAuthenticationStatsCollector.getAuthenticationStatsForUser(USER_ID_1)).isNull();
- mAuthenticationStatsCollector.authenticate(USER_ID_1, false /* authenticated*/);
+ mAuthenticationStatsCollector.authenticate(USER_ID_1, false /* authenticated */);
AuthenticationStats authenticationStats =
mAuthenticationStatsCollector.getAuthenticationStatsForUser(USER_ID_1);
- assertEquals(USER_ID_1, authenticationStats.getUserId());
- assertEquals(1, authenticationStats.getTotalAttempts());
- assertEquals(1, authenticationStats.getRejectedAttempts());
- assertEquals(0, authenticationStats.getEnrollmentNotifications());
+
+ assertThat(authenticationStats.getUserId()).isEqualTo(USER_ID_1);
+ assertThat(authenticationStats.getTotalAttempts()).isEqualTo(1);
+ assertThat(authenticationStats.getRejectedAttempts()).isEqualTo(1);
+ assertThat(authenticationStats.getEnrollmentNotifications()).isEqualTo(0);
+ }
+
+ @Test
+ public void authenticate_frrNotExceeded_notificationNotExceeded_shouldNotSendNotification() {
+
+ mAuthenticationStatsCollector.setAuthenticationStatsForUser(USER_ID_1,
+ new AuthenticationStats(USER_ID_1, 500 /* totalAttempts */,
+ 40 /* rejectedAttempts */, 0 /* enrollmentNotifications */,
+ 0 /* modality */));
+
+ mAuthenticationStatsCollector.authenticate(USER_ID_1, false /* authenticated */);
+
+ // Assert that no notification should be sent.
+ verify(mBiometricNotification, never()).sendFaceEnrollNotification(any());
+ verify(mBiometricNotification, never()).sendFpEnrollNotification(any());
+ // Assert that data has been reset.
+ AuthenticationStats authenticationStats = mAuthenticationStatsCollector
+ .getAuthenticationStatsForUser(USER_ID_1);
+ assertThat(authenticationStats.getTotalAttempts()).isEqualTo(0);
+ assertThat(authenticationStats.getRejectedAttempts()).isEqualTo(0);
+ assertThat(authenticationStats.getFrr()).isWithin(0f).of(-1.0f);
+ }
+
+ @Test
+ public void authenticate_frrExceeded_notificationExceeded_shouldNotSendNotification() {
+
+ mAuthenticationStatsCollector.setAuthenticationStatsForUser(USER_ID_1,
+ new AuthenticationStats(USER_ID_1, 500 /* totalAttempts */,
+ 400 /* rejectedAttempts */, 2 /* enrollmentNotifications */,
+ 0 /* modality */));
+
+ mAuthenticationStatsCollector.authenticate(USER_ID_1, false /* authenticated */);
+
+ // Assert that no notification should be sent.
+ verify(mBiometricNotification, never()).sendFaceEnrollNotification(any());
+ verify(mBiometricNotification, never()).sendFpEnrollNotification(any());
+ // Assert that data has been reset.
+ AuthenticationStats authenticationStats = mAuthenticationStatsCollector
+ .getAuthenticationStatsForUser(USER_ID_1);
+ assertThat(authenticationStats.getTotalAttempts()).isEqualTo(0);
+ assertThat(authenticationStats.getRejectedAttempts()).isEqualTo(0);
+ assertThat(authenticationStats.getFrr()).isWithin(0f).of(-1.0f);
+ }
+
+ @Test
+ public void authenticate_frrExceeded_bothBiometricsEnrolled_shouldNotSendNotification() {
+
+ mAuthenticationStatsCollector.setAuthenticationStatsForUser(USER_ID_1,
+ new AuthenticationStats(USER_ID_1, 500 /* totalAttempts */,
+ 400 /* rejectedAttempts */, 0 /* enrollmentNotifications */,
+ 0 /* modality */));
+
+ when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT))
+ .thenReturn(true);
+ when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(true);
+ when(mFingerprintManager.hasEnrolledTemplates(anyInt())).thenReturn(true);
+ when(mFaceManager.hasEnrolledTemplates(anyInt())).thenReturn(true);
+
+ mAuthenticationStatsCollector.authenticate(USER_ID_1, false /* authenticated */);
+
+ // Assert that no notification should be sent.
+ verify(mBiometricNotification, never()).sendFaceEnrollNotification(any());
+ verify(mBiometricNotification, never()).sendFpEnrollNotification(any());
+ // Assert that data has been reset.
+ AuthenticationStats authenticationStats = mAuthenticationStatsCollector
+ .getAuthenticationStatsForUser(USER_ID_1);
+ assertThat(authenticationStats.getTotalAttempts()).isEqualTo(0);
+ assertThat(authenticationStats.getRejectedAttempts()).isEqualTo(0);
+ assertThat(authenticationStats.getFrr()).isWithin(0f).of(-1.0f);
+ }
+
+ @Test
+ public void authenticate_frrExceeded_singleModality_shouldNotSendNotification() {
+
+ mAuthenticationStatsCollector.setAuthenticationStatsForUser(USER_ID_1,
+ new AuthenticationStats(USER_ID_1, 500 /* totalAttempts */,
+ 400 /* rejectedAttempts */, 0 /* enrollmentNotifications */,
+ 0 /* modality */));
+
+ when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT))
+ .thenReturn(true);
+ when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(false);
+ when(mFingerprintManager.hasEnrolledTemplates(anyInt())).thenReturn(true);
+
+ mAuthenticationStatsCollector.authenticate(USER_ID_1, false /* authenticated */);
+
+ // Assert that no notification should be sent.
+ verify(mBiometricNotification, never()).sendFaceEnrollNotification(any());
+ verify(mBiometricNotification, never()).sendFpEnrollNotification(any());
+ // Assert that data has been reset.
+ AuthenticationStats authenticationStats = mAuthenticationStatsCollector
+ .getAuthenticationStatsForUser(USER_ID_1);
+ assertThat(authenticationStats.getTotalAttempts()).isEqualTo(0);
+ assertThat(authenticationStats.getRejectedAttempts()).isEqualTo(0);
+ assertThat(authenticationStats.getFrr()).isWithin(0f).of(-1.0f);
+ }
+
+ @Test
+ public void authenticate_frrExceeded_faceEnrolled_shouldSendFpNotification() {
+ mAuthenticationStatsCollector.setAuthenticationStatsForUser(USER_ID_1,
+ new AuthenticationStats(USER_ID_1, 500 /* totalAttempts */,
+ 400 /* rejectedAttempts */, 0 /* enrollmentNotifications */,
+ 0 /* modality */));
+
+ when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT))
+ .thenReturn(true);
+ when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(true);
+ when(mFingerprintManager.hasEnrolledTemplates(anyInt())).thenReturn(false);
+ when(mFaceManager.hasEnrolledTemplates(anyInt())).thenReturn(true);
+
+ mAuthenticationStatsCollector.authenticate(USER_ID_1, false /* authenticated */);
+
+ // Assert that fingerprint enrollment notification should be sent.
+ verify(mBiometricNotification, times(1))
+ .sendFpEnrollNotification(mContext);
+ verify(mBiometricNotification, never()).sendFaceEnrollNotification(any());
+ // Assert that data has been reset.
+ AuthenticationStats authenticationStats = mAuthenticationStatsCollector
+ .getAuthenticationStatsForUser(USER_ID_1);
+ assertThat(authenticationStats.getTotalAttempts()).isEqualTo(0);
+ assertThat(authenticationStats.getRejectedAttempts()).isEqualTo(0);
+ assertThat(authenticationStats.getFrr()).isWithin(0f).of(-1.0f);
+ }
+
+ @Test
+ public void authenticate_frrExceeded_fpEnrolled_shouldSendFaceNotification() {
+ mAuthenticationStatsCollector.setAuthenticationStatsForUser(USER_ID_1,
+ new AuthenticationStats(USER_ID_1, 500 /* totalAttempts */,
+ 400 /* rejectedAttempts */, 0 /* enrollmentNotifications */,
+ 0 /* modality */));
+
+ when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT))
+ .thenReturn(true);
+ when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(true);
+ when(mFingerprintManager.hasEnrolledTemplates(anyInt())).thenReturn(true);
+ when(mFaceManager.hasEnrolledTemplates(anyInt())).thenReturn(false);
+
+ mAuthenticationStatsCollector.authenticate(USER_ID_1, false /* authenticated */);
+
+ // Assert that fingerprint enrollment notification should be sent.
+ verify(mBiometricNotification, times(1))
+ .sendFaceEnrollNotification(mContext);
+ verify(mBiometricNotification, never()).sendFpEnrollNotification(any());
+ // Assert that data has been reset.
+ AuthenticationStats authenticationStats = mAuthenticationStatsCollector
+ .getAuthenticationStatsForUser(USER_ID_1);
+ assertThat(authenticationStats.getTotalAttempts()).isEqualTo(0);
+ assertThat(authenticationStats.getRejectedAttempts()).isEqualTo(0);
+ assertThat(authenticationStats.getFrr()).isWithin(0f).of(-1.0f);
}
}
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/AuthenticationStatsPersisterTest.java b/services/tests/servicestests/src/com/android/server/biometrics/AuthenticationStatsPersisterTest.java
new file mode 100644
index 0000000..dde2a3c
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/biometrics/AuthenticationStatsPersisterTest.java
@@ -0,0 +1,252 @@
+/*
+ * 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.server.biometrics;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anySet;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.hardware.biometrics.BiometricsProtoEnums;
+import android.platform.test.annotations.Presubmit;
+
+import androidx.test.filters.SmallTest;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+
+import java.io.File;
+import java.util.List;
+import java.util.Set;
+
+@Presubmit
+@SmallTest
+public class AuthenticationStatsPersisterTest {
+
+ @Rule public MockitoRule mockitoRule = MockitoJUnit.rule();
+
+ private static final int USER_ID_1 = 1;
+ private static final int USER_ID_2 = 2;
+ private static final String USER_ID = "user_id";
+ private static final String FACE_ATTEMPTS = "face_attempts";
+ private static final String FACE_REJECTIONS = "face_rejections";
+ private static final String FINGERPRINT_ATTEMPTS = "fingerprint_attempts";
+ private static final String FINGERPRINT_REJECTIONS = "fingerprint_rejections";
+ private static final String ENROLLMENT_NOTIFICATIONS = "enrollment_notifications";
+ private static final String KEY = "frr_stats";
+
+ @Mock
+ private Context mContext;
+ @Mock
+ private SharedPreferences mSharedPreferences;
+ @Mock
+ private SharedPreferences.Editor mEditor;
+ private AuthenticationStatsPersister mAuthenticationStatsPersister;
+
+ @Captor
+ private ArgumentCaptor<Set<String>> mStringSetArgumentCaptor;
+
+ @Before
+ public void setUp() {
+ when(mContext.getSharedPreferences(any(File.class), anyInt()))
+ .thenReturn(mSharedPreferences);
+ when(mSharedPreferences.edit()).thenReturn(mEditor);
+ when(mEditor.putStringSet(anyString(), anySet())).thenReturn(mEditor);
+
+ mAuthenticationStatsPersister = new AuthenticationStatsPersister(mContext);
+ }
+
+ @Test
+ public void getAllFrrStats_face_shouldListAllFrrStats() throws JSONException {
+ AuthenticationStats stats1 = new AuthenticationStats(USER_ID_1,
+ 300 /* totalAttempts */, 10 /* rejectedAttempts */,
+ 0 /* enrollmentNotifications */, BiometricsProtoEnums.MODALITY_FACE);
+ AuthenticationStats stats2 = new AuthenticationStats(USER_ID_2,
+ 200 /* totalAttempts */, 20 /* rejectedAttempts */,
+ 0 /* enrollmentNotifications */, BiometricsProtoEnums.MODALITY_FINGERPRINT);
+ when(mSharedPreferences.getStringSet(eq(KEY), anySet())).thenReturn(
+ Set.of(buildFrrStats(stats1), buildFrrStats(stats2)));
+
+ List<AuthenticationStats> authenticationStatsList =
+ mAuthenticationStatsPersister.getAllFrrStats(BiometricsProtoEnums.MODALITY_FACE);
+
+ assertThat(authenticationStatsList.size()).isEqualTo(2);
+ AuthenticationStats expectedStats2 = new AuthenticationStats(USER_ID_2,
+ 0 /* totalAttempts */, 0 /* rejectedAttempts */,
+ 0 /* enrollmentNotifications */, BiometricsProtoEnums.MODALITY_FACE);
+ assertThat(authenticationStatsList).contains(stats1);
+ assertThat(authenticationStatsList).contains(expectedStats2);
+ }
+
+ @Test
+ public void getAllFrrStats_fingerprint_shouldListAllFrrStats() throws JSONException {
+ // User 1 with fingerprint authentication stats.
+ AuthenticationStats stats1 = new AuthenticationStats(USER_ID_1,
+ 200 /* totalAttempts */, 20 /* rejectedAttempts */,
+ 0 /* enrollmentNotifications */, BiometricsProtoEnums.MODALITY_FINGERPRINT);
+ // User 2 without fingerprint authentication stats.
+ AuthenticationStats stats2 = new AuthenticationStats(USER_ID_2,
+ 300 /* totalAttempts */, 10 /* rejectedAttempts */,
+ 0 /* enrollmentNotifications */, BiometricsProtoEnums.MODALITY_FACE);
+ when(mSharedPreferences.getStringSet(eq(KEY), anySet())).thenReturn(
+ Set.of(buildFrrStats(stats1), buildFrrStats(stats2)));
+
+ List<AuthenticationStats> authenticationStatsList =
+ mAuthenticationStatsPersister
+ .getAllFrrStats(BiometricsProtoEnums.MODALITY_FINGERPRINT);
+
+ assertThat(authenticationStatsList.size()).isEqualTo(2);
+ AuthenticationStats expectedStats2 = new AuthenticationStats(USER_ID_2,
+ 0 /* totalAttempts */, 0 /* rejectedAttempts */,
+ 0 /* enrollmentNotifications */, BiometricsProtoEnums.MODALITY_FINGERPRINT);
+ assertThat(authenticationStatsList).contains(stats1);
+ assertThat(authenticationStatsList).contains(expectedStats2);
+ }
+
+ @Test
+ public void persistFrrStats_newUser_face_shouldSuccess() throws JSONException {
+ AuthenticationStats authenticationStats = new AuthenticationStats(USER_ID_1,
+ 300 /* totalAttempts */, 10 /* rejectedAttempts */,
+ 0 /* enrollmentNotifications */, BiometricsProtoEnums.MODALITY_FACE);
+
+ mAuthenticationStatsPersister.persistFrrStats(authenticationStats.getUserId(),
+ authenticationStats.getTotalAttempts(),
+ authenticationStats.getRejectedAttempts(),
+ authenticationStats.getEnrollmentNotifications(),
+ authenticationStats.getModality());
+
+ verify(mEditor).putStringSet(eq(KEY), mStringSetArgumentCaptor.capture());
+ assertThat(mStringSetArgumentCaptor.getValue())
+ .contains(buildFrrStats(authenticationStats));
+ }
+
+ @Test
+ public void persistFrrStats_newUser_fingerprint_shouldSuccess() throws JSONException {
+ AuthenticationStats authenticationStats = new AuthenticationStats(USER_ID_1,
+ 300 /* totalAttempts */, 10 /* rejectedAttempts */,
+ 0 /* enrollmentNotifications */, BiometricsProtoEnums.MODALITY_FINGERPRINT);
+
+ mAuthenticationStatsPersister.persistFrrStats(authenticationStats.getUserId(),
+ authenticationStats.getTotalAttempts(),
+ authenticationStats.getRejectedAttempts(),
+ authenticationStats.getEnrollmentNotifications(),
+ authenticationStats.getModality());
+
+ verify(mEditor).putStringSet(eq(KEY), mStringSetArgumentCaptor.capture());
+ assertThat(mStringSetArgumentCaptor.getValue())
+ .contains(buildFrrStats(authenticationStats));
+ }
+
+ @Test
+ public void persistFrrStats_existingUser_shouldUpdateRecord() throws JSONException {
+ AuthenticationStats authenticationStats = new AuthenticationStats(USER_ID_1,
+ 300 /* totalAttempts */, 10 /* rejectedAttempts */,
+ 0 /* enrollmentNotifications */, BiometricsProtoEnums.MODALITY_FACE);
+ AuthenticationStats newAuthenticationStats = new AuthenticationStats(USER_ID_1,
+ 500 /* totalAttempts */, 30 /* rejectedAttempts */,
+ 1 /* enrollmentNotifications */, BiometricsProtoEnums.MODALITY_FACE);
+ when(mSharedPreferences.getStringSet(eq(KEY), anySet())).thenReturn(
+ Set.of(buildFrrStats(authenticationStats)));
+
+ mAuthenticationStatsPersister.persistFrrStats(newAuthenticationStats.getUserId(),
+ newAuthenticationStats.getTotalAttempts(),
+ newAuthenticationStats.getRejectedAttempts(),
+ newAuthenticationStats.getEnrollmentNotifications(),
+ newAuthenticationStats.getModality());
+
+ verify(mEditor).putStringSet(eq(KEY), mStringSetArgumentCaptor.capture());
+ assertThat(mStringSetArgumentCaptor.getValue())
+ .contains(buildFrrStats(newAuthenticationStats));
+ }
+
+ @Test
+ public void persistFrrStats_existingUserWithFingerprint_faceAuthenticate_shouldUpdateRecord()
+ throws JSONException {
+ // User with fingerprint authentication stats.
+ AuthenticationStats authenticationStats = new AuthenticationStats(USER_ID_1,
+ 200 /* totalAttempts */, 20 /* rejectedAttempts */,
+ 0 /* enrollmentNotifications */, BiometricsProtoEnums.MODALITY_FINGERPRINT);
+ // The same user with face authentication stats.
+ AuthenticationStats newAuthenticationStats = new AuthenticationStats(USER_ID_1,
+ 500 /* totalAttempts */, 30 /* rejectedAttempts */,
+ 1 /* enrollmentNotifications */, BiometricsProtoEnums.MODALITY_FACE);
+ when(mSharedPreferences.getStringSet(eq(KEY), anySet())).thenReturn(
+ Set.of(buildFrrStats(authenticationStats)));
+
+ mAuthenticationStatsPersister.persistFrrStats(newAuthenticationStats.getUserId(),
+ newAuthenticationStats.getTotalAttempts(),
+ newAuthenticationStats.getRejectedAttempts(),
+ newAuthenticationStats.getEnrollmentNotifications(),
+ newAuthenticationStats.getModality());
+
+ String expectedFrrStats = new JSONObject(buildFrrStats(authenticationStats))
+ .put(ENROLLMENT_NOTIFICATIONS, newAuthenticationStats.getEnrollmentNotifications())
+ .put(FACE_ATTEMPTS, newAuthenticationStats.getTotalAttempts())
+ .put(FACE_REJECTIONS, newAuthenticationStats.getRejectedAttempts()).toString();
+ verify(mEditor).putStringSet(eq(KEY), mStringSetArgumentCaptor.capture());
+ assertThat(mStringSetArgumentCaptor.getValue()).contains(expectedFrrStats);
+ }
+
+ @Test
+ public void removeFrrStats_existingUser_shouldUpdateRecord() throws JSONException {
+ AuthenticationStats authenticationStats = new AuthenticationStats(USER_ID_1,
+ 300 /* totalAttempts */, 10 /* rejectedAttempts */,
+ 0 /* enrollmentNotifications */, BiometricsProtoEnums.MODALITY_FACE);
+ when(mSharedPreferences.getStringSet(eq(KEY), anySet())).thenReturn(
+ Set.of(buildFrrStats(authenticationStats)));
+
+ mAuthenticationStatsPersister.removeFrrStats(USER_ID_1);
+
+ verify(mEditor).putStringSet(eq(KEY), mStringSetArgumentCaptor.capture());
+ assertThat(mStringSetArgumentCaptor.getValue()).doesNotContain(authenticationStats);
+ }
+
+ private String buildFrrStats(AuthenticationStats authenticationStats)
+ throws JSONException {
+ if (authenticationStats.getModality() == BiometricsProtoEnums.MODALITY_FACE) {
+ return new JSONObject()
+ .put(USER_ID, authenticationStats.getUserId())
+ .put(FACE_ATTEMPTS, authenticationStats.getTotalAttempts())
+ .put(FACE_REJECTIONS, authenticationStats.getRejectedAttempts())
+ .put(ENROLLMENT_NOTIFICATIONS, authenticationStats.getEnrollmentNotifications())
+ .toString();
+ } else if (authenticationStats.getModality() == BiometricsProtoEnums.MODALITY_FINGERPRINT) {
+ return new JSONObject()
+ .put(USER_ID, authenticationStats.getUserId())
+ .put(FINGERPRINT_ATTEMPTS, authenticationStats.getTotalAttempts())
+ .put(FINGERPRINT_REJECTIONS, authenticationStats.getRejectedAttempts())
+ .put(ENROLLMENT_NOTIFICATIONS, authenticationStats.getEnrollmentNotifications())
+ .toString();
+ }
+ return "";
+ }
+}
diff --git a/services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceManagerServiceTest.java
index bcbbcd4..908afc8 100644
--- a/services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/companion/virtual/VirtualDeviceManagerServiceTest.java
@@ -61,6 +61,7 @@
import android.companion.virtual.sensor.VirtualSensor;
import android.companion.virtual.sensor.VirtualSensorCallback;
import android.companion.virtual.sensor.VirtualSensorConfig;
+import android.content.AttributionSource;
import android.content.ComponentName;
import android.content.Context;
import android.content.ContextWrapper;
@@ -1729,7 +1730,9 @@
private VirtualDeviceImpl createVirtualDevice(int virtualDeviceId, int ownerUid,
VirtualDeviceParams params) {
VirtualDeviceImpl virtualDeviceImpl = new VirtualDeviceImpl(mContext,
- mAssociationInfo, mVdms, new Binder(), ownerUid, virtualDeviceId,
+ mAssociationInfo, mVdms, new Binder(),
+ new AttributionSource(ownerUid, "com.android.virtualdevice.test", "virtualdevice"),
+ virtualDeviceId,
mInputController, mCameraAccessController,
mPendingTrampolineCallback, mActivityListener, mSoundEffectListener,
mRunningAppsChangedCallback, params, new DisplayManagerGlobal(mIDisplayManager));
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
index b539a76..943a9c47 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerServiceMigrationTest.java
@@ -236,7 +236,7 @@
verify(getServices().packageManagerInternal, never())
.unsuspendForSuspendingPackage(PLATFORM_PACKAGE_NAME, USER_SYSTEM);
verify(getServices().ipackageManager, never()).setPackagesSuspendedAsUser(
- any(), anyBoolean(), any(), any(), any(), any(), anyInt());
+ any(), anyBoolean(), any(), any(), any(), anyInt(), any(), anyInt());
final DpmMockContext poContext = new DpmMockContext(getServices(), mRealTestContext);
poContext.binder.callingUid = UserHandle.getUid(COPE_PROFILE_USER_ID, COPE_ADMIN1_APP_ID);
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
index 7478778..f408ef0 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
@@ -7527,7 +7527,7 @@
.cancel(eq(SystemMessageProto.SystemMessage.NOTE_PERSONAL_APPS_SUSPENDED));
// Verify that the apps are NOT unsuspeded.
verify(getServices().ipackageManager, never()).setPackagesSuspendedAsUser(
- any(), eq(false), any(), any(), any(), any(), anyInt());
+ any(), eq(false), any(), any(), any(), anyInt(), any(), anyInt());
// Verify that DPC is invoked to check policy compliance.
verify(mContext.spiedContext).startActivityAsUser(
MockUtils.checkIntentAction(ACTION_CHECK_POLICY_COMPLIANCE),
diff --git a/services/tests/servicestests/src/com/android/server/graphics/fonts/UpdatableFontDirTest.java b/services/tests/servicestests/src/com/android/server/graphics/fonts/UpdatableFontDirTest.java
index e9a7d85..0376376 100644
--- a/services/tests/servicestests/src/com/android/server/graphics/fonts/UpdatableFontDirTest.java
+++ b/services/tests/servicestests/src/com/android/server/graphics/fonts/UpdatableFontDirTest.java
@@ -67,6 +67,8 @@
@RunWith(AndroidJUnit4.class)
public final class UpdatableFontDirTest {
+ private static final String LEGACY_FONTS_XML = "/system/etc/fonts.xml";
+
/**
* A {@link UpdatableFontDir.FontFileParser} for testing. Instead of using real font files,
* this test uses fake font files. A fake font file has its PostScript naem and revision as the
@@ -140,7 +142,7 @@
private List<File> mPreinstalledFontDirs;
private final Supplier<Long> mCurrentTimeSupplier = () -> CURRENT_TIME;
private final Function<Map<String, File>, FontConfig> mConfigSupplier =
- (map) -> SystemFonts.getSystemFontConfig(map, 0, 0);
+ (map) -> SystemFonts.getSystemFontConfigForTesting(LEGACY_FONTS_XML, map, 0, 0);
private FakeFontFileParser mParser;
private FakeFsverityUtil mFakeFsverityUtil;
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/BaseAbsoluteVolumeBehaviorTest.java b/services/tests/servicestests/src/com/android/server/hdmi/BaseAbsoluteVolumeBehaviorTest.java
index 399655ffa..e6d326a 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/BaseAbsoluteVolumeBehaviorTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/BaseAbsoluteVolumeBehaviorTest.java
@@ -92,11 +92,11 @@
// Default Audio Status given by the System Audio device in its initial <Report Audio Status>
// that triggers AVB being enabled
- private static final AudioStatus INITIAL_SYSTEM_AUDIO_DEVICE_STATUS =
+ protected static final AudioStatus INITIAL_SYSTEM_AUDIO_DEVICE_STATUS =
new AudioStatus(50, false);
// VolumeInfo passed to AudioDeviceVolumeManager#setDeviceAbsoluteVolumeBehavior to enable AVB
- private static final VolumeInfo ENABLE_AVB_VOLUME_INFO =
+ protected static final VolumeInfo ENABLE_AVB_VOLUME_INFO =
new VolumeInfo.Builder(AudioManager.STREAM_MUSIC)
.setMuted(INITIAL_SYSTEM_AUDIO_DEVICE_STATUS.getMute())
.setVolumeIndex(INITIAL_SYSTEM_AUDIO_DEVICE_STATUS.getVolume())
@@ -106,6 +106,8 @@
private static final int EMPTY_FLAGS = 0;
+ protected static final int STREAM_MUSIC_MAX_VOLUME = 25;
+
protected abstract HdmiCecLocalDevice createLocalDevice(HdmiControlService hdmiControlService);
protected abstract int getPhysicalAddress();
@@ -201,7 +203,7 @@
Collections.singletonList(getAudioOutputDevice()));
// Max volume of STREAM_MUSIC
- mAudioFramework.setStreamMaxVolume(AudioManager.STREAM_MUSIC, 25);
+ mAudioFramework.setStreamMaxVolume(AudioManager.STREAM_MUSIC, STREAM_MUSIC_MAX_VOLUME);
// Receive messages from devices to make sure they're registered in HdmiCecNetwork
mNativeWrapper.onCecMessage(HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/TvToAudioSystemAvbTest.java b/services/tests/servicestests/src/com/android/server/hdmi/TvToAudioSystemAvbTest.java
index 024e36d..86647fc 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/TvToAudioSystemAvbTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/TvToAudioSystemAvbTest.java
@@ -321,4 +321,98 @@
getLogicalAddress(), getSystemAudioDeviceLogicalAddress(),
Constants.AUDIO_VOLUME_STATUS_UNKNOWN));
}
+
+ /**
+ * Tests that a volume adjustment command with direction ADJUST_SAME causes HdmiControlService
+ * to request the System Audio device's audio status, and notify AudioService of the
+ * audio status.
+ */
+ @Test
+ public void avbEnabled_audioDeviceVolumeAdjusted_adjustSame_updatesAudioService() {
+ enableAbsoluteVolumeBehavior();
+ mNativeWrapper.clearResultMessages();
+
+ // HdmiControlService receives a volume adjustment with direction ADJUST_SAME
+ mHdmiControlService.getAbsoluteVolumeChangedListener().onAudioDeviceVolumeAdjusted(
+ getAudioOutputDevice(),
+ ENABLE_AVB_VOLUME_INFO,
+ AudioManager.ADJUST_SAME,
+ AudioDeviceVolumeManager.ADJUST_MODE_NORMAL
+ );
+ mTestLooper.dispatchAll();
+
+ // Device sends <Give Audio Status>
+ assertThat(mNativeWrapper.getResultMessages()).contains(
+ HdmiCecMessageBuilder.buildGiveAudioStatus(getLogicalAddress(),
+ getSystemAudioDeviceLogicalAddress()));
+
+ clearInvocations(mAudioManager);
+
+ // Device receives <Report Audio Status> with a new volume and mute state
+ mNativeWrapper.onCecMessage(HdmiCecMessageBuilder.buildReportAudioStatus(
+ getSystemAudioDeviceLogicalAddress(),
+ getLogicalAddress(),
+ 80,
+ true));
+ mTestLooper.dispatchAll();
+
+ // HdmiControlService calls setStreamVolume and adjustStreamVolume to trigger volume UI
+ verify(mAudioManager).setStreamVolume(
+ eq(AudioManager.STREAM_MUSIC),
+ // Volume level is rescaled to the max volume of STREAM_MUSIC
+ eq(80 * STREAM_MUSIC_MAX_VOLUME / AudioStatus.MAX_VOLUME),
+ eq(AudioManager.FLAG_ABSOLUTE_VOLUME | AudioManager.FLAG_SHOW_UI));
+ verify(mAudioManager).adjustStreamVolume(
+ eq(AudioManager.STREAM_MUSIC),
+ eq(AudioManager.ADJUST_MUTE),
+ eq(AudioManager.FLAG_ABSOLUTE_VOLUME | AudioManager.FLAG_SHOW_UI));
+ }
+
+ /**
+ * Tests that a volume adjustment command with direction ADJUST_SAME causes HdmiControlService
+ * to request the System Audio device's audio status, and notify AudioService of the
+ * audio status, even if it's unchanged from the previous one.
+ */
+ @Test
+ public void avbEnabled_audioDeviceVolumeAdjusted_adjustSame_noChange_updatesAudioService() {
+ enableAbsoluteVolumeBehavior();
+ mNativeWrapper.clearResultMessages();
+
+ // HdmiControlService receives a volume adjustment with direction ADJUST_SAME
+ mHdmiControlService.getAbsoluteVolumeChangedListener().onAudioDeviceVolumeAdjusted(
+ getAudioOutputDevice(),
+ ENABLE_AVB_VOLUME_INFO,
+ AudioManager.ADJUST_SAME,
+ AudioDeviceVolumeManager.ADJUST_MODE_NORMAL
+ );
+ mTestLooper.dispatchAll();
+
+ // Device sends <Give Audio Status>
+ assertThat(mNativeWrapper.getResultMessages()).contains(
+ HdmiCecMessageBuilder.buildGiveAudioStatus(getLogicalAddress(),
+ getSystemAudioDeviceLogicalAddress()));
+
+ clearInvocations(mAudioManager);
+
+ // Device receives <Report Audio Status> with the same volume level and mute state that
+ // as when AVB was enabled
+ mNativeWrapper.onCecMessage(HdmiCecMessageBuilder.buildReportAudioStatus(
+ getSystemAudioDeviceLogicalAddress(),
+ getLogicalAddress(),
+ INITIAL_SYSTEM_AUDIO_DEVICE_STATUS.getVolume(),
+ INITIAL_SYSTEM_AUDIO_DEVICE_STATUS.getMute()));
+ mTestLooper.dispatchAll();
+
+ // HdmiControlService calls setStreamVolume and adjustStreamVolume to trigger volume UI
+ verify(mAudioManager).setStreamVolume(
+ eq(AudioManager.STREAM_MUSIC),
+ // Volume level is rescaled to the max volume of STREAM_MUSIC
+ eq(INITIAL_SYSTEM_AUDIO_DEVICE_STATUS.getVolume()
+ * STREAM_MUSIC_MAX_VOLUME / AudioStatus.MAX_VOLUME),
+ eq(AudioManager.FLAG_ABSOLUTE_VOLUME | AudioManager.FLAG_SHOW_UI));
+ verify(mAudioManager).adjustStreamVolume(
+ eq(AudioManager.STREAM_MUSIC),
+ eq(AudioManager.ADJUST_UNMUTE),
+ eq(AudioManager.FLAG_ABSOLUTE_VOLUME | AudioManager.FLAG_SHOW_UI));
+ }
}
diff --git a/services/tests/servicestests/src/com/android/server/integrity/AppIntegrityManagerServiceImplTest.java b/services/tests/servicestests/src/com/android/server/integrity/AppIntegrityManagerServiceImplTest.java
index 9ca84d3..ce15c6d 100644
--- a/services/tests/servicestests/src/com/android/server/integrity/AppIntegrityManagerServiceImplTest.java
+++ b/services/tests/servicestests/src/com/android/server/integrity/AppIntegrityManagerServiceImplTest.java
@@ -218,7 +218,7 @@
@Test
public void updateRuleSet_notSystemApp() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp(false);
Rule rule =
new Rule(
@@ -237,7 +237,7 @@
@Test
public void updateRuleSet_authorized() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp();
Rule rule =
new Rule(
@@ -251,7 +251,7 @@
@Test
public void updateRuleSet_correctMethodCall() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp();
IntentSender mockReceiver = mock(IntentSender.class);
List<Rule> rules =
@@ -271,7 +271,7 @@
@Test
public void updateRuleSet_fail() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp();
doThrow(new IOException()).when(mIntegrityFileManager).writeRules(any(), any(), any());
IntentSender mockReceiver = mock(IntentSender.class);
@@ -292,7 +292,7 @@
@Test
public void broadcastReceiverRegistration() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp();
ArgumentCaptor<IntentFilter> intentFilterCaptor =
ArgumentCaptor.forClass(IntentFilter.class);
@@ -308,7 +308,7 @@
@Test
public void handleBroadcast_correctArgs() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp();
ArgumentCaptor<BroadcastReceiver> broadcastReceiverCaptor =
ArgumentCaptor.forClass(BroadcastReceiver.class);
@@ -345,7 +345,7 @@
@Test
public void handleBroadcast_correctArgs_multipleCerts() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp();
ArgumentCaptor<BroadcastReceiver> broadcastReceiverCaptor =
ArgumentCaptor.forClass(BroadcastReceiver.class);
@@ -368,7 +368,7 @@
@Test
public void handleBroadcast_correctArgs_sourceStamp() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp();
ArgumentCaptor<BroadcastReceiver> broadcastReceiverCaptor =
ArgumentCaptor.forClass(BroadcastReceiver.class);
@@ -393,7 +393,7 @@
@Test
public void handleBroadcast_allow() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp();
ArgumentCaptor<BroadcastReceiver> broadcastReceiverCaptor =
ArgumentCaptor.forClass(BroadcastReceiver.class);
@@ -412,7 +412,7 @@
@Test
public void handleBroadcast_reject() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp();
ArgumentCaptor<BroadcastReceiver> broadcastReceiverCaptor =
ArgumentCaptor.forClass(BroadcastReceiver.class);
@@ -438,7 +438,7 @@
@Test
public void handleBroadcast_notInitialized() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp();
when(mIntegrityFileManager.initialized()).thenReturn(false);
ArgumentCaptor<BroadcastReceiver> broadcastReceiverCaptor =
@@ -459,7 +459,7 @@
@Test
public void verifierAsInstaller_skipIntegrityVerification() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp();
setIntegrityCheckIncludesRuleProvider(false);
ArgumentCaptor<BroadcastReceiver> broadcastReceiverCaptor =
@@ -480,7 +480,7 @@
@Test
public void getCurrentRules() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp();
Rule rule = new Rule(IntegrityFormula.Application.packageNameEquals("package"), Rule.DENY);
when(mIntegrityFileManager.readRules(any())).thenReturn(Arrays.asList(rule));
@@ -490,7 +490,7 @@
@Test
public void getWhitelistedRuleProviders_returnsEmptyForNonSystemApps() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp(false);
assertThat(mService.getWhitelistedRuleProviders()).isEmpty();
@@ -498,13 +498,13 @@
@Test
public void getWhitelistedRuleProviders() throws Exception {
- whitelistUsAsRuleProvider();
+ allowlistUsAsRuleProvider();
makeUsSystemApp();
assertThat(mService.getWhitelistedRuleProviders()).containsExactly(TEST_FRAMEWORK_PACKAGE);
}
- private void whitelistUsAsRuleProvider() {
+ private void allowlistUsAsRuleProvider() {
Resources mockResources = mock(Resources.class);
when(mockResources.getStringArray(R.array.config_integrityRuleProviderPackages))
.thenReturn(new String[] {TEST_FRAMEWORK_PACKAGE});
diff --git a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/KeySyncTaskTest.java b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/KeySyncTaskTest.java
index e5909a4..80fb5e3 100644
--- a/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/KeySyncTaskTest.java
+++ b/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/KeySyncTaskTest.java
@@ -512,7 +512,7 @@
verify(mTestOnlyInsecureCertificateHelper, atLeast(1))
.isTestOnlyCertificateAlias(eq(TEST_ROOT_CERT_ALIAS));
- // no whitelists check
+ // no allowlists check
verify(mTestOnlyInsecureCertificateHelper, never())
.doesCredentialSupportInsecureMode(anyInt(), any());
verify(mTestOnlyInsecureCertificateHelper, never())
diff --git a/services/tests/servicestests/src/com/android/server/os/BugreportManagerServiceImplTest.java b/services/tests/servicestests/src/com/android/server/os/BugreportManagerServiceImplTest.java
index 24029b1..fc27edc 100644
--- a/services/tests/servicestests/src/com/android/server/os/BugreportManagerServiceImplTest.java
+++ b/services/tests/servicestests/src/com/android/server/os/BugreportManagerServiceImplTest.java
@@ -35,6 +35,7 @@
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -68,6 +69,27 @@
mBugreportFileManager = new BugreportManagerServiceImpl.BugreportFileManager();
}
+ @After
+ public void tearDown() throws Exception {
+ // Changes to RoleManager persist between tests, so we need to clear out any funny
+ // business we did in previous tests.
+ RoleManager roleManager = mContext.getSystemService(RoleManager.class);
+ CallbackFuture future = new CallbackFuture();
+ runWithShellPermissionIdentity(
+ () -> {
+ roleManager.setBypassingRoleQualification(false);
+ roleManager.removeRoleHolderAsUser(
+ "android.app.role.SYSTEM_AUTOMOTIVE_PROJECTION",
+ mContext.getPackageName(),
+ /* flags= */ 0,
+ Process.myUserHandle(),
+ mContext.getMainExecutor(),
+ future);
+ });
+
+ assertThat(future.get()).isEqualTo(true);
+ }
+
@Test
public void testBugreportFileManagerFileExists() {
Pair<Integer, String> callingInfo = new Pair<>(mCallingUid, mCallingPackage);
@@ -131,14 +153,17 @@
new BugreportManagerServiceImpl.Injector(mContext, new ArraySet<>()));
RoleManager roleManager = mContext.getSystemService(RoleManager.class);
CallbackFuture future = new CallbackFuture();
- runWithShellPermissionIdentity(() -> roleManager.setBypassingRoleQualification(true));
- runWithShellPermissionIdentity(() -> roleManager.addRoleHolderAsUser(
- "android.app.role.SYSTEM_AUTOMOTIVE_PROJECTION",
- mContext.getPackageName(),
- /* flags= */ 0,
- Process.myUserHandle(),
- mContext.getMainExecutor(),
- future));
+ runWithShellPermissionIdentity(
+ () -> {
+ roleManager.setBypassingRoleQualification(true);
+ roleManager.addRoleHolderAsUser(
+ "android.app.role.SYSTEM_AUTOMOTIVE_PROJECTION",
+ mContext.getPackageName(),
+ /* flags= */ 0,
+ Process.myUserHandle(),
+ mContext.getMainExecutor(),
+ future);
+ });
assertThat(future.get()).isEqualTo(true);
mService.cancelBugreport(Binder.getCallingUid(), mContext.getPackageName());
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java b/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
index d77ceb2..ecd35a5 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
@@ -326,6 +326,24 @@
assertThat(hasUser(user2.id)).isTrue();
}
+
+ @MediumTest
+ @Test
+ public void testGetFullUserCount() throws Exception {
+ assertThat(mUserManager.getFullUserCount()).isEqualTo(1);
+ UserInfo user1 = createUser("User 1", UserInfo.FLAG_FULL);
+ UserInfo user2 = createUser("User 2", UserInfo.FLAG_ADMIN);
+
+ assertThat(user1).isNotNull();
+ assertThat(user2).isNotNull();
+
+ assertThat(mUserManager.getFullUserCount()).isEqualTo(3);
+ removeUser(user1.id);
+ assertThat(mUserManager.getFullUserCount()).isEqualTo(2);
+ removeUser(user2.id);
+ assertThat(mUserManager.getFullUserCount()).isEqualTo(1);
+ }
+
/**
* Tests that UserManager knows how many users can be created.
*
@@ -1547,6 +1565,25 @@
assertThat(userInfo.name).isEqualTo(newName);
}
+ @Test
+ public void testCannotCreateAdditionalMainUser() {
+ UserHandle mainUser = mUserManager.getMainUser();
+ assumeTrue("There is no main user", mainUser != null);
+
+ // Users with FLAG_MAIN can't be removed, so no point using the local createUser method.
+ UserInfo newMainUser = mUserManager.createUser("test", UserInfo.FLAG_MAIN);
+ assertThat(newMainUser).isNull();
+
+ List<UserInfo> users = mUserManager.getUsers();
+ int mainUserCount = 0;
+ for (UserInfo user : users) {
+ if (user.isMain()) {
+ mainUserCount++;
+ }
+ }
+ assertThat(mainUserCount).isEqualTo(1);
+ }
+
private boolean isPackageInstalledForUser(String packageName, int userId) {
try {
return mPackageManager.getPackageInfoAsUser(packageName, 0, userId) != null;
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserSystemPackageInstallerTest.java b/services/tests/servicestests/src/com/android/server/pm/UserSystemPackageInstallerTest.java
index 07d4065e..a8e3c7e 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserSystemPackageInstallerTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserSystemPackageInstallerTest.java
@@ -117,7 +117,7 @@
for (int userId : mRemoveUsers) {
um.removeUser(userId);
}
- setUserTypePackageWhitelistMode(mOriginalWhitelistMode);
+ setUserTypePackageAllowlistMode(mOriginalWhitelistMode);
}
/**
@@ -184,7 +184,7 @@
}
}
- final ArrayMap<String, Long> expectedOutput = getNewPackageToWhitelistedBitSetMap();
+ final ArrayMap<String, Long> expectedOutput = getNewPackageToAllowlistedBitSetMap();
expectedOutput.put("com.android.package1", expectedUserTypeBitSet1);
expectedOutput.put("com.android.package2", expectedUserTypeBitSet2);
expectedOutput.put("com.android.package3", expectedUserTypeBitSet3);
@@ -227,7 +227,7 @@
}
};
- final ArrayMap<String, Long> expectedOutput = getNewPackageToWhitelistedBitSetMap();
+ final ArrayMap<String, Long> expectedOutput = getNewPackageToAllowlistedBitSetMap();
expectedOutput.put("com.android.package2", 0L);
expectedOutput.put("com.android.package3", 0L);
expectedOutput.put("com.android.package4", 0L);
@@ -340,7 +340,7 @@
public void testPackagesForCreateUser_full() {
final String userTypeToCreate = USER_TYPE_FULL_SECONDARY;
final long userTypeMask = mUserSystemPackageInstaller.getUserTypeMask(userTypeToCreate);
- setUserTypePackageWhitelistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_ENFORCE);
+ setUserTypePackageAllowlistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_ENFORCE);
PackageManager pm = mContext.getPackageManager();
final SystemConfig sysConfig = new SystemConfigTestClass(true);
@@ -384,7 +384,7 @@
*/
@Test
public void testInstallOverlayPackagesExplicitMode() {
- setUserTypePackageWhitelistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_ENFORCE);
+ setUserTypePackageAllowlistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_ENFORCE);
final String[] userTypes = new String[]{"type"};
final long maskOfType = 0b0001L;
@@ -453,49 +453,49 @@
*/
@Test
public void testSetWhitelistEnabledMode() {
- setUserTypePackageWhitelistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_DISABLE);
+ setUserTypePackageAllowlistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_DISABLE);
assertFalse(mUserSystemPackageInstaller.isLogMode());
assertFalse(mUserSystemPackageInstaller.isEnforceMode());
assertFalse(mUserSystemPackageInstaller.isImplicitWhitelistMode());
assertFalse(mUserSystemPackageInstaller.isImplicitWhitelistSystemMode());
assertFalse(mUserSystemPackageInstaller.isIgnoreOtaMode());
- setUserTypePackageWhitelistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_LOG);
+ setUserTypePackageAllowlistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_LOG);
assertTrue(mUserSystemPackageInstaller.isLogMode());
assertFalse(mUserSystemPackageInstaller.isEnforceMode());
assertFalse(mUserSystemPackageInstaller.isImplicitWhitelistMode());
assertFalse(mUserSystemPackageInstaller.isImplicitWhitelistSystemMode());
assertFalse(mUserSystemPackageInstaller.isIgnoreOtaMode());
- setUserTypePackageWhitelistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_ENFORCE);
+ setUserTypePackageAllowlistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_ENFORCE);
assertFalse(mUserSystemPackageInstaller.isLogMode());
assertTrue(mUserSystemPackageInstaller.isEnforceMode());
assertFalse(mUserSystemPackageInstaller.isImplicitWhitelistMode());
assertFalse(mUserSystemPackageInstaller.isImplicitWhitelistSystemMode());
assertFalse(mUserSystemPackageInstaller.isIgnoreOtaMode());
- setUserTypePackageWhitelistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_IMPLICIT_WHITELIST);
+ setUserTypePackageAllowlistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_IMPLICIT_WHITELIST);
assertFalse(mUserSystemPackageInstaller.isLogMode());
assertFalse(mUserSystemPackageInstaller.isEnforceMode());
assertTrue(mUserSystemPackageInstaller.isImplicitWhitelistMode());
assertFalse(mUserSystemPackageInstaller.isImplicitWhitelistSystemMode());
assertFalse(mUserSystemPackageInstaller.isIgnoreOtaMode());
- setUserTypePackageWhitelistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_IMPLICIT_WHITELIST_SYSTEM);
+ setUserTypePackageAllowlistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_IMPLICIT_WHITELIST_SYSTEM);
assertFalse(mUserSystemPackageInstaller.isLogMode());
assertFalse(mUserSystemPackageInstaller.isEnforceMode());
assertFalse(mUserSystemPackageInstaller.isImplicitWhitelistMode());
assertTrue(mUserSystemPackageInstaller.isImplicitWhitelistSystemMode());
assertFalse(mUserSystemPackageInstaller.isIgnoreOtaMode());
- setUserTypePackageWhitelistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_IGNORE_OTA);
+ setUserTypePackageAllowlistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_IGNORE_OTA);
assertFalse(mUserSystemPackageInstaller.isLogMode());
assertFalse(mUserSystemPackageInstaller.isEnforceMode());
assertFalse(mUserSystemPackageInstaller.isImplicitWhitelistMode());
assertFalse(mUserSystemPackageInstaller.isImplicitWhitelistSystemMode());
assertTrue(mUserSystemPackageInstaller.isIgnoreOtaMode());
- setUserTypePackageWhitelistMode(
+ setUserTypePackageAllowlistMode(
USER_TYPE_PACKAGE_WHITELIST_MODE_LOG | USER_TYPE_PACKAGE_WHITELIST_MODE_ENFORCE);
assertTrue(mUserSystemPackageInstaller.isLogMode());
assertTrue(mUserSystemPackageInstaller.isEnforceMode());
@@ -503,7 +503,7 @@
assertFalse(mUserSystemPackageInstaller.isImplicitWhitelistSystemMode());
assertFalse(mUserSystemPackageInstaller.isIgnoreOtaMode());
- setUserTypePackageWhitelistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_IMPLICIT_WHITELIST
+ setUserTypePackageAllowlistMode(USER_TYPE_PACKAGE_WHITELIST_MODE_IMPLICIT_WHITELIST
| USER_TYPE_PACKAGE_WHITELIST_MODE_ENFORCE);
assertFalse(mUserSystemPackageInstaller.isLogMode());
assertTrue(mUserSystemPackageInstaller.isEnforceMode());
@@ -513,7 +513,7 @@
}
/** Sets the allowlist mode to the desired value via adb's setprop. */
- private void setUserTypePackageWhitelistMode(int mode) {
+ private void setUserTypePackageAllowlistMode(int mode) {
UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
try {
String result = uiDevice.executeShellCommand(String.format("setprop %s %d",
@@ -526,7 +526,7 @@
}
/** @see UserSystemPackageInstaller#mWhitelistedPackagesForUserTypes */
- private ArrayMap<String, Long> getNewPackageToWhitelistedBitSetMap() {
+ private ArrayMap<String, Long> getNewPackageToAllowlistedBitSetMap() {
final ArrayMap<String, Long> pkgBitSetMap = new ArrayMap<>();
// "android" is always treated as allowlisted for all types, regardless of the xml file.
pkgBitSetMap.put("android", ~0L);
diff --git a/services/tests/servicestests/src/com/android/server/pm/parsing/AndroidPackageParsingValidationTest.kt b/services/tests/servicestests/src/com/android/server/pm/parsing/AndroidPackageParsingValidationTest.kt
index 560a919..20c0b0a 100644
--- a/services/tests/servicestests/src/com/android/server/pm/parsing/AndroidPackageParsingValidationTest.kt
+++ b/services/tests/servicestests/src/com/android/server/pm/parsing/AndroidPackageParsingValidationTest.kt
@@ -529,7 +529,6 @@
"}",
":",
"?",
- "-",
"%",
"^",
"*",
diff --git a/services/tests/servicestests/src/com/android/server/power/hint/HintManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/power/hint/HintManagerServiceTest.java
index 9fca513..ee3ab97 100644
--- a/services/tests/servicestests/src/com/android/server/power/hint/HintManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/power/hint/HintManagerServiceTest.java
@@ -149,6 +149,32 @@
}
@Test
+ public void testCreateHintSession_exceedsLimit() throws Exception {
+ HintManagerService service = createService();
+ IBinder token1 = new Binder();
+ IBinder token2 = new Binder();
+
+ for (int i = 0; i < 10; i++) {
+ IHintSession a = service.getBinderServiceInstance().createHintSession(token1,
+ SESSION_TIDS_A, DEFAULT_TARGET_DURATION);
+ assertNotNull(a);
+ }
+
+ for (int i = 0; i < 10; i++) {
+ IHintSession b = service.getBinderServiceInstance().createHintSession(token2,
+ SESSION_TIDS_B, DEFAULT_TARGET_DURATION);
+ assertNotNull(b);
+ }
+
+ assertThrows(IllegalStateException.class,
+ () -> service.getBinderServiceInstance().createHintSession(token1, SESSION_TIDS_A,
+ DEFAULT_TARGET_DURATION));
+ assertThrows(IllegalStateException.class,
+ () -> service.getBinderServiceInstance().createHintSession(token2, SESSION_TIDS_B,
+ DEFAULT_TARGET_DURATION));
+ }
+
+ @Test
public void testPauseResumeHintSession() throws Exception {
HintManagerService service = createService();
IBinder token = new Binder();
diff --git a/services/tests/servicestests/src/com/android/server/power/hint/OWNERS b/services/tests/servicestests/src/com/android/server/power/hint/OWNERS
new file mode 100644
index 0000000..c28c07a
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/power/hint/OWNERS
@@ -0,0 +1,2 @@
+include /ADPF_OWNERS
+
diff --git a/services/tests/servicestests/utils/com/android/server/testutils/TestHandler.java b/services/tests/servicestests/utils/com/android/server/testutils/TestHandler.java
index 22d383a..fc5213c 100644
--- a/services/tests/servicestests/utils/com/android/server/testutils/TestHandler.java
+++ b/services/tests/servicestests/utils/com/android/server/testutils/TestHandler.java
@@ -82,7 +82,7 @@
uptimeMillis = uptimeMillis - SystemClock.uptimeMillis() + mClock.getAsLong();
}
- // post a dummy queue entry to keep track of message removal
+ // post a sentinel queue entry to keep track of message removal
return super.sendMessageAtTime(msg, Long.MAX_VALUE)
&& mMessages.add(new MsgInfo(Message.obtain(msg), uptimeMillis, mMessageCount));
}
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
index e1f3c2b..579bbc8 100755
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -6044,6 +6044,49 @@
}
@Test
+ public void testVisitUris_styleExtrasWithoutStyle() {
+ Notification notification = new Notification.Builder(mContext, "a")
+ .setSmallIcon(android.R.drawable.sym_def_app_icon)
+ .build();
+
+ Notification.MessagingStyle messagingStyle = new Notification.MessagingStyle(
+ personWithIcon("content://user"))
+ .addHistoricMessage(new Notification.MessagingStyle.Message("Heyhey!",
+ System.currentTimeMillis(),
+ personWithIcon("content://historicalMessenger")))
+ .addMessage(new Notification.MessagingStyle.Message("Are you there",
+ System.currentTimeMillis(),
+ personWithIcon("content://messenger")))
+ .setShortcutIcon(
+ Icon.createWithContentUri("content://conversationShortcut"));
+ messagingStyle.addExtras(notification.extras); // Instead of Builder.setStyle(style).
+
+ Notification.CallStyle callStyle = Notification.CallStyle.forOngoingCall(
+ personWithIcon("content://caller"),
+ PendingIntent.getActivity(mContext, 0, new Intent(),
+ PendingIntent.FLAG_IMMUTABLE))
+ .setVerificationIcon(Icon.createWithContentUri("content://callVerification"));
+ callStyle.addExtras(notification.extras); // Same.
+
+ Consumer<Uri> visitor = (Consumer<Uri>) spy(Consumer.class);
+ notification.visitUris(visitor);
+
+ verify(visitor).accept(eq(Uri.parse("content://user")));
+ verify(visitor).accept(eq(Uri.parse("content://historicalMessenger")));
+ verify(visitor).accept(eq(Uri.parse("content://messenger")));
+ verify(visitor).accept(eq(Uri.parse("content://conversationShortcut")));
+ verify(visitor).accept(eq(Uri.parse("content://caller")));
+ verify(visitor).accept(eq(Uri.parse("content://callVerification")));
+ }
+
+ private static Person personWithIcon(String iconUri) {
+ return new Person.Builder()
+ .setName("Mr " + iconUri)
+ .setIcon(Icon.createWithContentUri(iconUri))
+ .build();
+ }
+
+ @Test
public void testVisitUris_wearableExtender() {
Icon actionIcon = Icon.createWithContentUri("content://media/action");
Icon wearActionIcon = Icon.createWithContentUri("content://media/wearAction");
@@ -7753,7 +7796,8 @@
public void testOnNotificationActionClick() {
final int actionIndex = 2;
final Notification.Action action =
- new Notification.Action.Builder(null, "text", null).build();
+ new Notification.Action.Builder(null, "text", PendingIntent.getActivity(
+ mContext, 0, new Intent(), PendingIntent.FLAG_IMMUTABLE)).build();
final boolean generatedByAssistant = false;
NotificationRecord r = generateNotificationRecord(mTestNotificationChannel);
@@ -7777,7 +7821,8 @@
public void testOnAssistantNotificationActionClick() {
final int actionIndex = 1;
final Notification.Action action =
- new Notification.Action.Builder(null, "text", null).build();
+ new Notification.Action.Builder(null, "text", PendingIntent.getActivity(
+ mContext, 0, new Intent(), PendingIntent.FLAG_IMMUTABLE)).build();
final boolean generatedByAssistant = true;
NotificationRecord r = generateNotificationRecord(mTestNotificationChannel);
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java
index fae92d9..f83a1df 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationRecordTest.java
@@ -36,7 +36,7 @@
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
@@ -44,7 +44,6 @@
import static org.mockito.Mockito.when;
import android.app.ActivityManager;
-import android.app.IActivityManager;
import android.app.Notification;
import android.app.Notification.Builder;
import android.app.NotificationChannel;
@@ -76,6 +75,7 @@
import com.android.internal.R;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.server.LocalServices;
import com.android.server.UiServiceTestCase;
import com.android.server.uri.UriGrantsManagerInternal;
@@ -850,84 +850,78 @@
@Test
public void testCalculateGrantableUris_PappProvided() {
- IActivityManager am = mock(IActivityManager.class);
UriGrantsManagerInternal ugm = mock(UriGrantsManagerInternal.class);
when(ugm.checkGrantUriPermission(anyInt(), eq(null), any(Uri.class),
anyInt(), anyInt())).thenThrow(new SecurityException());
+ LocalServices.removeServiceForTest(UriGrantsManagerInternal.class);
+ LocalServices.addService(UriGrantsManagerInternal.class, ugm);
+
channel.setSound(null, null);
Notification n = new Notification.Builder(mContext, channel.getId())
.setSmallIcon(Icon.createWithContentUri(Uri.parse("content://something")))
.build();
StatusBarNotification sbn =
new StatusBarNotification(PKG_P, PKG_P, id1, tag1, uid, uid, n, mUser, null, uid);
- NotificationRecord record = new NotificationRecord(mMockContext, sbn, channel);
- record.mAm = am;
- record.mUgmInternal = ugm;
- try {
- record.calculateGrantableUris();
- fail("App provided uri for p targeting app should throw exception");
- } catch (SecurityException e) {
- // expected
- }
+ assertThrows("App provided uri for p targeting app should throw exception",
+ SecurityException.class,
+ () -> new NotificationRecord(mMockContext, sbn, channel));
}
@Test
public void testCalculateGrantableUris_PappProvided_invalidSound() {
- IActivityManager am = mock(IActivityManager.class);
UriGrantsManagerInternal ugm = mock(UriGrantsManagerInternal.class);
when(ugm.checkGrantUriPermission(anyInt(), eq(null), any(Uri.class),
anyInt(), anyInt())).thenThrow(new SecurityException());
+ LocalServices.removeServiceForTest(UriGrantsManagerInternal.class);
+ LocalServices.addService(UriGrantsManagerInternal.class, ugm);
+
channel.setSound(Uri.parse("content://something"), mock(AudioAttributes.class));
Notification n = mock(Notification.class);
when(n.getChannelId()).thenReturn(channel.getId());
StatusBarNotification sbn =
new StatusBarNotification(PKG_P, PKG_P, id1, tag1, uid, uid, n, mUser, null, uid);
- NotificationRecord record = new NotificationRecord(mMockContext, sbn, channel);
- record.mAm = am;
- record.mUgmInternal = ugm;
- record.calculateGrantableUris();
+ NotificationRecord record = new NotificationRecord(mMockContext, sbn, channel);
assertEquals(Settings.System.DEFAULT_NOTIFICATION_URI, record.getSound());
}
@Test
public void testCalculateGrantableUris_PuserOverridden() {
- IActivityManager am = mock(IActivityManager.class);
UriGrantsManagerInternal ugm = mock(UriGrantsManagerInternal.class);
when(ugm.checkGrantUriPermission(anyInt(), eq(null), any(Uri.class),
anyInt(), anyInt())).thenThrow(new SecurityException());
+ LocalServices.removeServiceForTest(UriGrantsManagerInternal.class);
+ LocalServices.addService(UriGrantsManagerInternal.class, ugm);
+
channel.lockFields(NotificationChannel.USER_LOCKED_SOUND);
Notification n = mock(Notification.class);
when(n.getChannelId()).thenReturn(channel.getId());
StatusBarNotification sbn =
new StatusBarNotification(PKG_P, PKG_P, id1, tag1, uid, uid, n, mUser, null, uid);
- NotificationRecord record = new NotificationRecord(mMockContext, sbn, channel);
- record.mAm = am;
- record.calculateGrantableUris();
+ new NotificationRecord(mMockContext, sbn, channel); // should not throw
}
@Test
public void testCalculateGrantableUris_prePappProvided() {
- IActivityManager am = mock(IActivityManager.class);
UriGrantsManagerInternal ugm = mock(UriGrantsManagerInternal.class);
when(ugm.checkGrantUriPermission(anyInt(), eq(null), any(Uri.class),
anyInt(), anyInt())).thenThrow(new SecurityException());
+ LocalServices.removeServiceForTest(UriGrantsManagerInternal.class);
+ LocalServices.addService(UriGrantsManagerInternal.class, ugm);
+
Notification n = mock(Notification.class);
when(n.getChannelId()).thenReturn(channel.getId());
StatusBarNotification sbn =
new StatusBarNotification(PKG_O, PKG_O, id1, tag1, uid, uid, n, mUser, null, uid);
- NotificationRecord record = new NotificationRecord(mMockContext, sbn, channel);
- record.mAm = am;
- record.calculateGrantableUris();
- // should not throw
+ new NotificationRecord(mMockContext, sbn, channel); // should not throw
}
@Test
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java b/services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java
index 81d939f..9b745f5 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/PreferencesHelperTest.java
@@ -115,6 +115,7 @@
import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
+import android.os.Process;
import android.os.RemoteCallback;
import android.os.RemoteException;
import android.os.UserHandle;
@@ -209,6 +210,7 @@
@Mock Context mContext;
@Mock ZenModeHelper mMockZenModeHelper;
@Mock AppOpsManager mAppOpsManager;
+ @Mock ManagedServices.UserProfiles mUserProfiles;
@Mock PermissionManager mPermissionManager;
private NotificationManager.Policy mTestNotificationPolicy;
@@ -327,10 +329,12 @@
when(mPermissionHelper.getNotificationPermissionValues(USER_SYSTEM))
.thenReturn(appPermissions);
+ when(mUserProfiles.getCurrentProfileIds()).thenReturn(IntArray.wrap(new int[] {0}));
+
mStatsEventBuilderFactory = new WrappedSysUiStatsEvent.WrappedBuilderFactory();
mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager,
+ mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mUserProfiles,
mStatsEventBuilderFactory, false);
resetZenModeHelper();
@@ -678,7 +682,8 @@
@Test
public void testReadXml_oldXml_migrates() throws Exception {
mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, true);
+ mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mUserProfiles,
+ mStatsEventBuilderFactory, /* showReviewPermissionsNotification= */ true);
String xml = "<ranking version=\"2\">\n"
+ "<package name=\"" + PKG_N_MR1 + "\" uid=\"" + UID_N_MR1
@@ -743,9 +748,6 @@
@Test
public void testReadXml_oldXml_backup_migratesWhenPkgInstalled() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false);
-
when(mPm.getPackageUidAsUser("pkg1", USER_SYSTEM)).thenReturn(UNKNOWN_UID);
when(mPm.getPackageUidAsUser("pkg2", USER_SYSTEM)).thenReturn(UNKNOWN_UID);
when(mPm.getPackageUidAsUser("pkg3", USER_SYSTEM)).thenReturn(UNKNOWN_UID);
@@ -822,7 +824,8 @@
@Test
public void testReadXml_newXml_noMigration_showPermissionNotification() throws Exception {
mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, true);
+ mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mUserProfiles,
+ mStatsEventBuilderFactory, /* showReviewPermissionsNotification= */ true);
String xml = "<ranking version=\"3\">\n"
+ "<package name=\"" + PKG_N_MR1 + "\" show_badge=\"true\">\n"
@@ -879,7 +882,8 @@
@Test
public void testReadXml_newXml_permissionNotificationOff() throws Exception {
mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false);
+ mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mUserProfiles,
+ mStatsEventBuilderFactory, /* showReviewPermissionsNotification= */ false);
String xml = "<ranking version=\"3\">\n"
+ "<package name=\"" + PKG_N_MR1 + "\" show_badge=\"true\">\n"
@@ -936,7 +940,8 @@
@Test
public void testReadXml_newXml_noMigration_noPermissionNotification() throws Exception {
mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, true);
+ mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mUserProfiles,
+ mStatsEventBuilderFactory, /* showReviewPermissionsNotification= */ true);
String xml = "<ranking version=\"4\">\n"
+ "<package name=\"" + PKG_N_MR1 + "\" show_badge=\"true\">\n"
@@ -991,9 +996,6 @@
@Test
public void testReadXml_oldXml_migration_NoUid() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false);
-
when(mPm.getPackageUidAsUser("something", USER_SYSTEM)).thenReturn(UNKNOWN_UID);
String xml = "<ranking version=\"2\">\n"
+ "<package name=\"something\" show_badge=\"true\">\n"
@@ -1024,9 +1026,6 @@
@Test
public void testReadXml_newXml_noMigration_NoUid() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false);
-
when(mPm.getPackageUidAsUser("something", USER_SYSTEM)).thenReturn(UNKNOWN_UID);
String xml = "<ranking version=\"3\">\n"
+ "<package name=\"something\" show_badge=\"true\">\n"
@@ -1056,9 +1055,6 @@
@Test
public void testChannelXmlForNonBackup_postMigration() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false);
-
ArrayMap<Pair<Integer, String>, Pair<Boolean, Boolean>> appPermissions = new ArrayMap<>();
appPermissions.put(new Pair<>(1, "first"), new Pair<>(true, false));
appPermissions.put(new Pair<>(3, "third"), new Pair<>(false, false));
@@ -1142,9 +1138,6 @@
@Test
public void testChannelXmlForBackup_postMigration() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false);
-
ArrayMap<Pair<Integer, String>, Pair<Boolean, Boolean>> appPermissions = new ArrayMap<>();
appPermissions.put(new Pair<>(1, "first"), new Pair<>(true, false));
appPermissions.put(new Pair<>(3, "third"), new Pair<>(false, false));
@@ -1234,9 +1227,6 @@
@Test
public void testChannelXmlForBackup_postMigration_noExternal() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false);
-
ArrayMap<Pair<Integer, String>, Pair<Boolean, Boolean>> appPermissions = new ArrayMap<>();
appPermissions.put(new Pair<>(UID_P, PKG_P), new Pair<>(true, false));
appPermissions.put(new Pair<>(UID_O, PKG_O), new Pair<>(false, false));
@@ -1319,9 +1309,6 @@
@Test
public void testChannelXmlForBackup_postMigration_noLocalSettings() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false);
-
ArrayMap<Pair<Integer, String>, Pair<Boolean, Boolean>> appPermissions = new ArrayMap<>();
appPermissions.put(new Pair<>(1, "first"), new Pair<>(true, false));
appPermissions.put(new Pair<>(3, "third"), new Pair<>(false, false));
@@ -1533,7 +1520,8 @@
new FileNotFoundException("")).thenReturn(resId);
mHelper = new PreferencesHelper(mContext, mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mStatsEventBuilderFactory, false);
+ mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mUserProfiles,
+ mStatsEventBuilderFactory, false);
NotificationChannel channel =
new NotificationChannel("id", "name", IMPORTANCE_LOW);
@@ -2477,9 +2465,6 @@
mTestNotificationPolicy = new NotificationManager.Policy(0, 0, 0, 0,
NotificationManager.Policy.STATE_CHANNELS_BYPASSING_DND, 0);
when(mMockZenModeHelper.getNotificationPolicy()).thenReturn(mTestNotificationPolicy);
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
mHelper.syncChannelsBypassingDnd();
// create notification channel that can bypass dnd, but app is blocked
@@ -2508,9 +2493,6 @@
mTestNotificationPolicy = new NotificationManager.Policy(0, 0, 0, 0,
NotificationManager.Policy.STATE_CHANNELS_BYPASSING_DND, 0);
when(mMockZenModeHelper.getNotificationPolicy()).thenReturn(mTestNotificationPolicy);
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
mHelper.syncChannelsBypassingDnd();
// create notification channel that can bypass dnd, but app is blocked
@@ -2533,9 +2515,6 @@
mTestNotificationPolicy = new NotificationManager.Policy(0, 0, 0, 0,
NotificationManager.Policy.STATE_CHANNELS_BYPASSING_DND, 0);
when(mMockZenModeHelper.getNotificationPolicy()).thenReturn(mTestNotificationPolicy);
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
mHelper.syncChannelsBypassingDnd();
// create notification channel that can bypass dnd, but app is blocked
@@ -2588,9 +2567,6 @@
mTestNotificationPolicy = new NotificationManager.Policy(0, 0, 0, 0,
NotificationManager.Policy.STATE_CHANNELS_BYPASSING_DND, 0);
when(mMockZenModeHelper.getNotificationPolicy()).thenReturn(mTestNotificationPolicy);
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
mHelper.syncChannelsBypassingDnd();
assertFalse(mHelper.areChannelsBypassingDnd());
verify(mMockZenModeHelper, times(1)).setNotificationPolicy(any(), anyInt(), anyBoolean());
@@ -2602,15 +2578,58 @@
// start notification policy off with mAreChannelsBypassingDnd = false
mTestNotificationPolicy = new NotificationManager.Policy(0, 0, 0, 0, 0, 0);
when(mMockZenModeHelper.getNotificationPolicy()).thenReturn(mTestNotificationPolicy);
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
assertFalse(mHelper.areChannelsBypassingDnd());
verify(mMockZenModeHelper, never()).setNotificationPolicy(any(), anyInt(), anyBoolean());
resetZenModeHelper();
}
@Test
+ public void syncChannelsBypassingDnd_includesProfilesOfCurrentUser() throws Exception {
+ when(mUserProfiles.getCurrentProfileIds()).thenReturn(IntArray.wrap(new int[] {0, 10}));
+ when(mPermissionHelper.hasPermission(anyInt())).thenReturn(true);
+ ApplicationInfo appInfo = new ApplicationInfo();
+ appInfo.targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE;
+ when(mPm.getApplicationInfoAsUser(any(), anyInt(), anyInt())).thenReturn(appInfo);
+
+ NotificationChannel withBypass = new NotificationChannel("1", "with", IMPORTANCE_DEFAULT);
+ withBypass.setBypassDnd(true);
+ NotificationChannel withoutBypass = new NotificationChannel("2", "without",
+ IMPORTANCE_DEFAULT);
+ withoutBypass.setBypassDnd(false);
+ mHelper.createNotificationChannel("com.example", UserHandle.getUid(0, 444), withoutBypass,
+ false, false, Process.SYSTEM_UID, true);
+ mHelper.createNotificationChannel("com.example", UserHandle.getUid(10, 444), withBypass,
+ false, false, Process.SYSTEM_UID, true);
+
+ mHelper.syncChannelsBypassingDnd();
+
+ assertThat(mHelper.areChannelsBypassingDnd()).isTrue();
+ }
+
+ @Test
+ public void syncChannelsBypassingDnd_excludesOtherUsers() throws Exception {
+ when(mUserProfiles.getCurrentProfileIds()).thenReturn(IntArray.wrap(new int[] {0}));
+ when(mPermissionHelper.hasPermission(anyInt())).thenReturn(true);
+ ApplicationInfo appInfo = new ApplicationInfo();
+ appInfo.targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE;
+ when(mPm.getApplicationInfoAsUser(any(), anyInt(), anyInt())).thenReturn(appInfo);
+
+ NotificationChannel withBypass = new NotificationChannel("1", "with", IMPORTANCE_DEFAULT);
+ withBypass.setBypassDnd(true);
+ NotificationChannel withoutBypass = new NotificationChannel("2", "without",
+ IMPORTANCE_DEFAULT);
+ withoutBypass.setBypassDnd(false);
+ mHelper.createNotificationChannel("com.example", UserHandle.getUid(0, 444), withoutBypass,
+ false, false, Process.SYSTEM_UID, true);
+ mHelper.createNotificationChannel("com.example", UserHandle.getUid(10, 444), withBypass,
+ false, false, Process.SYSTEM_UID, true);
+
+ mHelper.syncChannelsBypassingDnd();
+
+ assertThat(mHelper.areChannelsBypassingDnd()).isFalse();
+ }
+
+ @Test
public void testCreateDeletedChannel() throws Exception {
long[] vibration = new long[]{100, 67, 145, 156};
NotificationChannel channel =
@@ -3705,9 +3724,7 @@
+ "content_type=\"4\" flags=\"0\" show_badge=\"true\" />\n"
+ "</package>\n"
+ "</ranking>\n";
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
+
loadByteArrayXml(preQXml.getBytes(), true, USER_SYSTEM);
assertEquals(PreferencesHelper.DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS,
@@ -3719,9 +3736,6 @@
mHelper.setHideSilentStatusIcons(!PreferencesHelper.DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS);
ByteArrayOutputStream baos = writeXmlAndPurge(PKG_O, UID_O, false, UserHandle.USER_ALL);
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
loadStreamXml(baos, false, UserHandle.USER_ALL);
assertEquals(!PreferencesHelper.DEFAULT_HIDE_SILENT_STATUS_BAR_ICONS,
@@ -3789,9 +3803,6 @@
mHelper.canShowBadge(PKG_O, UID_O);
ByteArrayOutputStream baos = writeXmlAndPurge(PKG_O, UID_O, false, UserHandle.USER_ALL);
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
loadStreamXml(baos, false, UserHandle.USER_ALL);
assertNull(mHelper.getNotificationDelegate(PKG_O, UID_O));
@@ -3802,9 +3813,6 @@
mHelper.setNotificationDelegate(PKG_O, UID_O, "other", 53);
ByteArrayOutputStream baos = writeXmlAndPurge(PKG_O, UID_O, false, UserHandle.USER_ALL);
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
loadStreamXml(baos, false, UserHandle.USER_ALL);
assertEquals("other", mHelper.getNotificationDelegate(PKG_O, UID_O));
@@ -3816,9 +3824,6 @@
mHelper.revokeNotificationDelegate(PKG_O, UID_O);
ByteArrayOutputStream baos = writeXmlAndPurge(PKG_O, UID_O, false, UserHandle.USER_ALL);
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
loadStreamXml(baos, false, UserHandle.USER_ALL);
assertNull(mHelper.getNotificationDelegate(PKG_O, UID_O));
@@ -3832,9 +3837,6 @@
assertEquals(BUBBLE_PREFERENCE_NONE, mHelper.getBubblePreference(PKG_O, UID_O));
ByteArrayOutputStream baos = writeXmlAndPurge(PKG_O, UID_O, false, UserHandle.USER_ALL);
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
loadStreamXml(baos, false, UserHandle.USER_ALL);
assertEquals(BUBBLE_PREFERENCE_NONE, mHelper.getBubblePreference(PKG_O, UID_O));
@@ -3888,9 +3890,6 @@
mHelper.getAppLockedFields(PKG_O, UID_O));
ByteArrayOutputStream baos = writeXmlAndPurge(PKG_O, UID_O, false, UserHandle.USER_ALL);
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
loadStreamXml(baos, false, UserHandle.USER_ALL);
assertEquals(BUBBLE_PREFERENCE_SELECTED, mHelper.getBubblePreference(PKG_O, UID_O));
@@ -3926,9 +3925,6 @@
mHelper.getAppLockedFields(PKG_O, UID_O));
ByteArrayOutputStream baos = writeXmlAndPurge(PKG_O, UID_O, false, UserHandle.USER_ALL);
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
loadStreamXml(baos, false, UserHandle.USER_ALL);
assertEquals(mHelper.getBubblePreference(PKG_O, UID_O), BUBBLE_PREFERENCE_NONE);
@@ -4584,10 +4580,6 @@
@Test
public void testPlaceholderConversationId_shortcutRequired() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
-
final String xml = "<ranking version=\"1\">\n"
+ "<package name=\"" + PKG_O + "\" uid=\"" + UID_O + "\" >\n"
+ "<channel id=\"id\" name=\"hi\" importance=\"3\" conv_id=\"foo:placeholder_id\"/>"
@@ -4604,10 +4596,6 @@
@Test
public void testNormalConversationId_shortcutRequired() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
-
final String xml = "<ranking version=\"1\">\n"
+ "<package name=\"" + PKG_O + "\" uid=\"" + UID_O + "\" >\n"
+ "<channel id=\"id\" name=\"hi\" importance=\"3\" conv_id=\"other\"/>"
@@ -4624,10 +4612,6 @@
@Test
public void testNoConversationId_shortcutRequired() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
-
final String xml = "<ranking version=\"1\">\n"
+ "<package name=\"" + PKG_O + "\" uid=\"" + UID_O + "\" >\n"
+ "<channel id=\"id\" name=\"hi\" importance=\"3\"/>"
@@ -4644,10 +4628,6 @@
@Test
public void testDeleted_noTime() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
-
final String xml = "<ranking version=\"1\">\n"
+ "<package name=\"" + PKG_O + "\" uid=\"" + UID_O + "\" >\n"
+ "<channel id=\"id\" name=\"hi\" importance=\"3\" deleted=\"true\"/>"
@@ -4664,13 +4644,10 @@
@Test
public void testDeleted_twice() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
-
mHelper.createNotificationChannel(
PKG_P, UID_P, new NotificationChannel("id", "id", 2), true, false,
UID_P, false);
+
assertTrue(mHelper.deleteNotificationChannel(PKG_P, UID_P, "id",
UID_P, false));
assertFalse(mHelper.deleteNotificationChannel(PKG_P, UID_P, "id",
@@ -4679,10 +4656,6 @@
@Test
public void testDeleted_recentTime() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
-
mHelper.createNotificationChannel(
PKG_P, UID_P, new NotificationChannel("id", "id", 2), true, false,
UID_P, false);
@@ -4698,9 +4671,6 @@
parser.setInput(new BufferedInputStream(new ByteArrayInputStream(baos.toByteArray())),
null);
parser.nextTag();
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
mHelper.readXml(parser, true, USER_SYSTEM);
NotificationChannel nc = mHelper.getNotificationChannel(PKG_P, UID_P, "id", true);
@@ -4710,10 +4680,6 @@
@Test
public void testUnDelete_time() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
-
mHelper.createNotificationChannel(
PKG_P, UID_P, new NotificationChannel("id", "id", 2), true, false,
UID_P, false);
@@ -4732,10 +4698,6 @@
@Test
public void testDeleted_longTime() throws Exception {
- mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
- mPermissionHelper, mPermissionManager, mLogger,
- mAppOpsManager, mStatsEventBuilderFactory, false);
-
long time = System.currentTimeMillis() - (DateUtils.DAY_IN_MILLIS * 30);
final String xml = "<ranking version=\"1\">\n"
diff --git a/services/tests/wmtests/src/com/android/server/policy/SingleKeyGestureTests.java b/services/tests/wmtests/src/com/android/server/policy/SingleKeyGestureTests.java
index 3bb86a7..b9492e9 100644
--- a/services/tests/wmtests/src/com/android/server/policy/SingleKeyGestureTests.java
+++ b/services/tests/wmtests/src/com/android/server/policy/SingleKeyGestureTests.java
@@ -170,10 +170,15 @@
}
private void pressKey(int keyCode, long pressTime, boolean interactive) {
+ pressKey(keyCode, pressTime, interactive, false /* defaultDisplayOn */);
+ }
+
+ private void pressKey(
+ int keyCode, long pressTime, boolean interactive, boolean defaultDisplayOn) {
long eventTime = SystemClock.uptimeMillis();
final KeyEvent keyDown = new KeyEvent(eventTime, eventTime, ACTION_DOWN,
keyCode, 0 /* repeat */, 0 /* metaState */);
- mDetector.interceptKey(keyDown, interactive);
+ mDetector.interceptKey(keyDown, interactive, defaultDisplayOn);
// keep press down.
try {
@@ -186,7 +191,7 @@
final KeyEvent keyUp = new KeyEvent(eventTime, eventTime, ACTION_UP,
keyCode, 0 /* repeat */, 0 /* metaState */);
- mDetector.interceptKey(keyUp, interactive);
+ mDetector.interceptKey(keyUp, interactive, defaultDisplayOn);
}
@Test
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
index 3eed0b7..302ad7f 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
@@ -2719,6 +2719,9 @@
assertEquals(Configuration.ORIENTATION_PORTRAIT, displayConfig.orientation);
assertEquals(Configuration.ORIENTATION_PORTRAIT, activityConfig.orientation);
+ // Unblock the rotation animation, so the further orientation updates won't be ignored.
+ unblockDisplayRotation(activity.mDisplayContent);
+
final ActivityRecord topActivity = createActivityRecord(activity.getTask());
topActivity.setOrientation(SCREEN_ORIENTATION_LANDSCAPE);
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityTaskManagerServiceTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityTaskManagerServiceTests.java
index 4290f4b..d169a58 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityTaskManagerServiceTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityTaskManagerServiceTests.java
@@ -490,6 +490,11 @@
.build();
final Task task = activity.getTask();
final TaskDisplayArea tda = task.getDisplayArea();
+ // Ensure the display is not a large screen
+ if (tda.getConfiguration().smallestScreenWidthDp
+ >= WindowManager.LARGE_SCREEN_SMALLEST_SCREEN_WIDTH_DP) {
+ resizeDisplay(activity.mDisplayContent, 500, 800);
+ }
// Ignore the activity min width/height for determine multi window eligibility.
mAtm.mRespectsActivityMinWidthHeightMultiWindow = -1;
diff --git a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java
index 6e52af1..c1be5ca 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java
@@ -353,6 +353,7 @@
@Test
public void testRecentViewInFixedPortraitWhenTopAppInLandscape() {
+ makeDisplayPortrait(mDefaultDisplay);
unblockDisplayRotation(mDefaultDisplay);
mWm.setRecentsAnimationController(mController);
@@ -488,6 +489,7 @@
@Test
public void testWallpaperHasFixedRotationApplied() {
+ makeDisplayPortrait(mDefaultDisplay);
unblockDisplayRotation(mDefaultDisplay);
mWm.setRecentsAnimationController(mController);
diff --git a/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java b/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java
index d5afe3b..0cdd9b8 100644
--- a/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java
@@ -1880,6 +1880,11 @@
final int dh = 2500;
final int notchHeight = 200;
setUpApp(new TestDisplayContent.Builder(mAtm, dw, dh).setNotch(notchHeight).build());
+ // The test assumes the notch will be at left side when the orientation is landscape.
+ if (mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_reverseDefaultRotation)) {
+ setReverseDefaultRotation(mActivity.mDisplayContent, false);
+ }
addStatusBar(mActivity.mDisplayContent);
mActivity.setVisible(false);
diff --git a/services/tests/wmtests/src/com/android/server/wm/SurfaceControlViewHostTests.java b/services/tests/wmtests/src/com/android/server/wm/SurfaceControlViewHostTests.java
index ce1a46b..1f9e8c2 100644
--- a/services/tests/wmtests/src/com/android/server/wm/SurfaceControlViewHostTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/SurfaceControlViewHostTests.java
@@ -16,10 +16,8 @@
package com.android.server.wm;
-import static android.Manifest.permission.ACCESS_SURFACE_FLINGER;
-import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW;
-import static android.server.wm.CtsWindowInfoUtils.waitForWindowVisible;
import static android.server.wm.CtsWindowInfoUtils.waitForWindowFocus;
+import static android.server.wm.CtsWindowInfoUtils.waitForWindowVisible;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static org.junit.Assert.assertTrue;
@@ -78,17 +76,11 @@
@Before
public void setUp() throws Exception {
mInstrumentation = InstrumentationRegistry.getInstrumentation();
-
- // ACCESS_SURFACE_FLINGER is necessary to call waitForWindow
- // INTERNAL_SYSTEM_WINDOW is necessary to add SCVH with no host parent
- mInstrumentation.getUiAutomation().adoptShellPermissionIdentity(ACCESS_SURFACE_FLINGER,
- INTERNAL_SYSTEM_WINDOW);
mActivity = mActivityRule.launchActivity(null);
}
@After
public void tearDown() {
- mInstrumentation.getUiAutomation().dropShellPermissionIdentity();
CommonUtils.waitUntilActivityRemoved(mActivity);
}
@@ -102,14 +94,15 @@
mView2 = new Button(mActivity);
mInstrumentation.runOnMainSync(() -> {
- TestWindowlessWindowManager wwm = new TestWindowlessWindowManager(
- mActivity.getResources().getConfiguration(), sc, null);
-
try {
mActivity.attachToSurfaceView(sc);
} catch (InterruptedException e) {
}
+ TestWindowlessWindowManager wwm = new TestWindowlessWindowManager(
+ mActivity.getResources().getConfiguration(), sc,
+ mActivity.mSurfaceView.getHostToken());
+
mScvh1 = new SurfaceControlViewHost(mActivity, mActivity.getDisplay(),
wwm, "requestFocusWithMultipleWindows");
mScvh2 = new SurfaceControlViewHost(mActivity, mActivity.getDisplay(),
@@ -130,11 +123,13 @@
assertTrue("Failed to wait for view1", waitForWindowVisible(mView1));
assertTrue("Failed to wait for view2", waitForWindowVisible(mView2));
- WindowManagerGlobal.getWindowSession().grantEmbeddedWindowFocus(null /* window */,
+ IWindow window = IWindow.Stub.asInterface(mActivity.mSurfaceView.getWindowToken());
+
+ WindowManagerGlobal.getWindowSession().grantEmbeddedWindowFocus(window,
mScvh1.getFocusGrantToken(), true);
assertTrue("Failed to gain focus for view1", waitForWindowFocus(mView1, true));
- WindowManagerGlobal.getWindowSession().grantEmbeddedWindowFocus(null /* window */,
+ WindowManagerGlobal.getWindowSession().grantEmbeddedWindowFocus(window,
mScvh2.getFocusGrantToken(), true);
assertTrue("Failed to gain focus for view2", waitForWindowFocus(mView2, true));
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java
index 54b9351..bfa279d 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java
@@ -143,6 +143,7 @@
@Before
public void setup() throws RemoteException {
MockitoAnnotations.initMocks(this);
+ removeGlobalMinSizeRestriction();
mWindowOrganizerController = mAtm.mWindowOrganizerController;
mTransitionController = mWindowOrganizerController.mTransitionController;
mController = mWindowOrganizerController.mTaskFragmentOrganizerController;
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java
index 16c38ac..08438c8 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java
@@ -354,25 +354,37 @@
}
});
- final LandscapeActivity activity =
- (LandscapeActivity) startTestActivity(LandscapeActivity.class);
+ final boolean isIgnoringOrientationRequest =
+ CommonUtils.getIgnoreOrientationRequest(Display.DEFAULT_DISPLAY);
+ if (isIgnoringOrientationRequest) {
+ CommonUtils.setIgnoreOrientationRequest(Display.DEFAULT_DISPLAY, false);
+ }
- int[] taskIdAndOrientation = waitForResult(taskIdAndOrientationQueue,
- candidate -> candidate[0] == activity.getTaskId());
- assertNotNull(taskIdAndOrientation);
- assertEquals(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE, taskIdAndOrientation[1]);
+ try {
+ final LandscapeActivity activity =
+ (LandscapeActivity) startTestActivity(LandscapeActivity.class);
- activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
- taskIdAndOrientation = waitForResult(taskIdAndOrientationQueue,
- candidate -> candidate[0] == activity.getTaskId());
- assertNotNull(taskIdAndOrientation);
- assertEquals(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT, taskIdAndOrientation[1]);
+ int[] taskIdAndOrientation = waitForResult(taskIdAndOrientationQueue,
+ candidate -> candidate[0] == activity.getTaskId());
+ assertNotNull(taskIdAndOrientation);
+ assertEquals(
+ ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE, taskIdAndOrientation[1]);
- activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
- taskIdAndOrientation = waitForResult(taskIdAndOrientationQueue,
- candidate -> candidate[0] == activity.getTaskId());
- assertNotNull(taskIdAndOrientation);
- assertEquals(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED, taskIdAndOrientation[1]);
+ activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
+ taskIdAndOrientation = waitForResult(taskIdAndOrientationQueue,
+ candidate -> candidate[0] == activity.getTaskId());
+ assertNotNull(taskIdAndOrientation);
+ assertEquals(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT, taskIdAndOrientation[1]);
+
+ activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
+ taskIdAndOrientation = waitForResult(taskIdAndOrientationQueue,
+ candidate -> candidate[0] == activity.getTaskId());
+ assertNotNull(taskIdAndOrientation);
+ assertEquals(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED, taskIdAndOrientation[1]);
+ } finally {
+ CommonUtils.setIgnoreOrientationRequest(
+ Display.DEFAULT_DISPLAY, isIgnoringOrientationRequest);
+ }
}
/**
diff --git a/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java b/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
index 07cdfaf..873d09b 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
@@ -39,6 +39,7 @@
import static android.window.TransitionInfo.FLAG_IS_WALLPAPER;
import static android.window.TransitionInfo.FLAG_MOVED_TO_TOP;
import static android.window.TransitionInfo.FLAG_SHOW_WALLPAPER;
+import static android.window.TransitionInfo.FLAG_SYNC;
import static android.window.TransitionInfo.FLAG_TRANSLUCENT;
import static android.window.TransitionInfo.isIndependent;
@@ -1190,6 +1191,7 @@
final WindowState statusBar = createWindow(null, TYPE_STATUS_BAR, "statusBar");
makeWindowVisible(statusBar);
mDisplayContent.getDisplayPolicy().addWindowLw(statusBar, statusBar.mAttrs);
+ final WindowState navBar = createWindow(null, TYPE_NAVIGATION_BAR, "navBar");
final ActivityRecord app = createActivityRecord(mDisplayContent);
final Transition transition = app.mTransitionController.createTransition(TRANSIT_OPEN);
app.mTransitionController.requestStartTransition(transition, app.getTask(),
@@ -1219,9 +1221,17 @@
mDisplayContent.mTransitionController.dispatchLegacyAppTransitionFinished(app);
assertTrue(mDisplayContent.hasTopFixedRotationLaunchingApp());
+ // The bar was invisible so it is not handled by the controller. But if it becomes visible
+ // and drawn before the transition starts,
+ assertFalse(asyncRotationController.isTargetToken(navBar.mToken));
+ navBar.finishDrawing(null /* postDrawTransaction */, Integer.MAX_VALUE);
+ assertTrue(asyncRotationController.isTargetToken(navBar.mToken));
+
player.startTransition();
// Non-app windows should not be collected.
assertFalse(mDisplayContent.mTransitionController.isCollecting(statusBar.mToken));
+ // Avoid DeviceStateController disturbing the test by triggering another rotation change.
+ doReturn(false).when(mDisplayContent).updateRotationUnchecked();
onRotationTransactionReady(player, mWm.mTransactionFactory.get()).onTransactionCommitted();
assertEquals(ROTATION_ANIMATION_SEAMLESS, player.mLastReady.getChange(
@@ -2390,6 +2400,37 @@
assertFalse(controller.isCollecting());
}
+ @Test
+ public void testNoSyncFlagIfOneTrack() {
+ final TransitionController controller = mAtm.getTransitionController();
+ final TestTransitionPlayer player = registerTestTransitionPlayer();
+
+ mSyncEngine = createTestBLASTSyncEngine();
+ controller.setSyncEngine(mSyncEngine);
+
+ final Transition transitA = createTestTransition(TRANSIT_OPEN, controller);
+ final Transition transitB = createTestTransition(TRANSIT_OPEN, controller);
+ final Transition transitC = createTestTransition(TRANSIT_OPEN, controller);
+
+ controller.startCollectOrQueue(transitA, (deferred) -> {});
+ controller.startCollectOrQueue(transitB, (deferred) -> {});
+ controller.startCollectOrQueue(transitC, (deferred) -> {});
+
+ // Verify that, as-long as there is <= 1 track, we won't get a SYNC flag
+ transitA.start();
+ transitA.setAllReady();
+ mSyncEngine.tryFinishForTest(transitA.getSyncId());
+ assertTrue((player.mLastReady.getFlags() & FLAG_SYNC) == 0);
+ transitB.start();
+ transitB.setAllReady();
+ mSyncEngine.tryFinishForTest(transitB.getSyncId());
+ assertTrue((player.mLastReady.getFlags() & FLAG_SYNC) == 0);
+ transitC.start();
+ transitC.setAllReady();
+ mSyncEngine.tryFinishForTest(transitC.getSyncId());
+ assertTrue((player.mLastReady.getFlags() & FLAG_SYNC) == 0);
+ }
+
private static void makeTaskOrganized(Task... tasks) {
final ITaskOrganizer organizer = mock(ITaskOrganizer.class);
for (Task t : tasks) {
diff --git a/services/tests/wmtests/src/com/android/server/wm/WallpaperControllerTests.java b/services/tests/wmtests/src/com/android/server/wm/WallpaperControllerTests.java
index 6305bb6..6216acb 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WallpaperControllerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WallpaperControllerTests.java
@@ -116,10 +116,7 @@
public void testWallpaperSizeWithFixedTransform() {
// No wallpaper
final DisplayContent dc = mDisplayContent;
- if (dc.mBaseDisplayHeight == dc.mBaseDisplayWidth) {
- // Make sure the size is different when changing orientation.
- resizeDisplay(dc, 500, 1000);
- }
+ makeDisplayPortrait(dc);
// No wallpaper WSA Surface
final WindowState wallpaperWindow = createWallpaperWindow(dc);
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
index 62de67a..99688da 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
@@ -48,6 +48,7 @@
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.doAnswer;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doNothing;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
@@ -59,6 +60,7 @@
import static org.junit.Assert.assertFalse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.mock;
import android.annotation.IntDef;
@@ -956,6 +958,38 @@
return testPlayer;
}
+ /** Overrides the behavior of config_reverseDefaultRotation for the given display. */
+ void setReverseDefaultRotation(DisplayContent dc, boolean reverse) {
+ final DisplayRotation displayRotation = dc.getDisplayRotation();
+ if (!Mockito.mockingDetails(displayRotation).isSpy()) {
+ spyOn(displayRotation);
+ }
+ doAnswer(invocation -> {
+ invocation.callRealMethod();
+ final int w = invocation.getArgument(0);
+ final int h = invocation.getArgument(1);
+ if (w > h) {
+ if (reverse) {
+ displayRotation.mPortraitRotation = Surface.ROTATION_90;
+ displayRotation.mUpsideDownRotation = Surface.ROTATION_270;
+ } else {
+ displayRotation.mPortraitRotation = Surface.ROTATION_270;
+ displayRotation.mUpsideDownRotation = Surface.ROTATION_90;
+ }
+ } else {
+ if (reverse) {
+ displayRotation.mLandscapeRotation = Surface.ROTATION_270;
+ displayRotation.mSeascapeRotation = Surface.ROTATION_90;
+ } else {
+ displayRotation.mLandscapeRotation = Surface.ROTATION_90;
+ displayRotation.mSeascapeRotation = Surface.ROTATION_270;
+ }
+ }
+ return null;
+ }).when(displayRotation).configure(anyInt(), anyInt());
+ displayRotation.configure(dc.mBaseDisplayWidth, dc.mBaseDisplayHeight);
+ }
+
/**
* Avoids rotating screen disturbed by some conditions. It is usually used for the default
* display that is not the instance of {@link TestDisplayContent} (it bypasses the conditions).
@@ -963,6 +997,8 @@
* @see DisplayRotation#updateRotationUnchecked
*/
void unblockDisplayRotation(DisplayContent dc) {
+ dc.mOpeningApps.clear();
+ mWm.mAppsFreezingScreen = 0;
mWm.stopFreezingDisplayLocked();
// The rotation animation won't actually play, it needs to be cleared manually.
dc.setRotationAnimation(null);
@@ -971,11 +1007,19 @@
static void resizeDisplay(DisplayContent displayContent, int width, int height) {
displayContent.updateBaseDisplayMetrics(width, height, displayContent.mBaseDisplayDensity,
displayContent.mBaseDisplayPhysicalXDpi, displayContent.mBaseDisplayPhysicalYDpi);
+ displayContent.getDisplayRotation().configure(width, height);
final Configuration c = new Configuration();
displayContent.computeScreenConfiguration(c);
displayContent.onRequestedOverrideConfigurationChanged(c);
}
+ /** Used for the tests that assume the display is portrait by default. */
+ static void makeDisplayPortrait(DisplayContent displayContent) {
+ if (displayContent.mBaseDisplayHeight <= displayContent.mBaseDisplayWidth) {
+ resizeDisplay(displayContent, 500, 1000);
+ }
+ }
+
// The window definition for UseTestDisplay#addWindows. The test can declare to add only
// necessary windows, that avoids adding unnecessary overhead of unused windows.
static final int W_NOTIFICATION_SHADE = TYPE_NOTIFICATION_SHADE;
diff --git a/services/tests/wmtests/src/com/android/server/wm/utils/CommonUtils.java b/services/tests/wmtests/src/com/android/server/wm/utils/CommonUtils.java
index ed23296..bfbba5f 100644
--- a/services/tests/wmtests/src/com/android/server/wm/utils/CommonUtils.java
+++ b/services/tests/wmtests/src/com/android/server/wm/utils/CommonUtils.java
@@ -21,9 +21,12 @@
import android.app.Activity;
import android.app.KeyguardManager;
import android.app.UiAutomation;
+import android.os.RemoteException;
import android.os.SystemClock;
import android.util.Log;
+import android.view.IWindowManager;
import android.view.KeyEvent;
+import android.view.WindowManagerGlobal;
import androidx.test.uiautomator.UiDevice;
@@ -48,6 +51,37 @@
}
}
+ public static boolean getIgnoreOrientationRequest(int displayId) {
+ final UiDevice uiDevice = UiDevice.getInstance(getInstrumentation());
+ final String result;
+ try {
+ result = uiDevice.executeShellCommand("cmd window get-ignore-orientation-request -d "
+ + displayId);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+
+ final String[] tokens = result.split(" ");
+ if (tokens.length != 4) {
+ throw new RuntimeException("Expecting a result with 4 tokens, but got " + result);
+ }
+
+ // The output looks like "ignoreOrientationRequest true for displayId=0"
+ return Boolean.parseBoolean(tokens[1]);
+ }
+
+ public static void setIgnoreOrientationRequest(
+ int displayId, boolean ignoreOrientationRequest) {
+ runWithShellPermissionIdentity(() -> {
+ final IWindowManager wm = WindowManagerGlobal.getWindowManagerService();
+ try {
+ wm.setIgnoreOrientationRequest(displayId, ignoreOrientationRequest);
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ });
+ }
+
/** Dismisses the Keyguard if it is locked. */
public static void dismissKeyguard() {
final KeyguardManager keyguardManager = getInstrumentation().getContext().getSystemService(
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/HotwordDetectionConnection.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/HotwordDetectionConnection.java
index 58da4b43..3d78a1d 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/HotwordDetectionConnection.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/HotwordDetectionConnection.java
@@ -54,6 +54,7 @@
import android.service.voice.HotwordDetectionService;
import android.service.voice.HotwordDetectionServiceFailure;
import android.service.voice.HotwordDetector;
+import android.service.voice.IDetectorSessionStorageService;
import android.service.voice.IMicrophoneHotwordDetectionVoiceInteractionCallback;
import android.service.voice.ISandboxedDetectionService;
import android.service.voice.IVisualQueryDetectionVoiceInteractionCallback;
@@ -69,6 +70,7 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.app.IHotwordRecognitionStatusCallback;
import com.android.internal.app.IVisualQueryDetectionAttentionListener;
+import com.android.internal.infra.AndroidFuture;
import com.android.internal.infra.ServiceConnector;
import com.android.server.LocalServices;
import com.android.server.pm.permission.PermissionManagerServiceInternal;
@@ -157,6 +159,8 @@
@NonNull private ServiceConnection mRemoteVisualQueryDetectionService;
@GuardedBy("mLock")
@Nullable private IBinder mAudioFlinger;
+
+ @Nullable private IHotwordRecognitionStatusCallback mHotwordRecognitionCallback;
@GuardedBy("mLock")
private boolean mDebugHotwordLogging = false;
@@ -694,6 +698,7 @@
updateContentCaptureManager(connection);
updateSpeechService(connection);
updateServiceIdentity(connection);
+ updateStorageService(connection);
return connection;
}
}
@@ -910,6 +915,7 @@
mVoiceInteractionServiceUid, mVoiceInteractorIdentity,
mScheduledExecutorService, mDebugHotwordLogging, mRemoteExceptionListener);
}
+ mHotwordRecognitionCallback = callback;
mDetectorSessions.put(detectorType, session);
session.initialize(options, sharedMemory);
}
@@ -1035,6 +1041,23 @@
}));
}
+ private void updateStorageService(ServiceConnection connection) {
+ connection.run(service -> {
+ service.registerRemoteStorageService(new IDetectorSessionStorageService.Stub() {
+ @Override
+ public void openFile(String filename, AndroidFuture future)
+ throws RemoteException {
+ Slog.v(TAG, "BinderCallback#onFileOpen");
+ try {
+ mHotwordRecognitionCallback.onOpenFile(filename, future);
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+ });
+ });
+ }
+
private void addServiceUidForAudioPolicy(int uid) {
mScheduledExecutorService.execute(() -> {
AudioManagerInternal audioManager =
diff --git a/telecomm/OWNERS b/telecomm/OWNERS
index dcaf858..b57b7c7 100644
--- a/telecomm/OWNERS
+++ b/telecomm/OWNERS
@@ -4,7 +4,6 @@
tgunn@google.com
xiaotonj@google.com
rgreenwalt@google.com
-chinmayd@google.com
grantmenke@google.com
pmadapurmath@google.com
tjstuart@google.com
\ No newline at end of file
diff --git a/telecomm/java/android/telecom/Call.java b/telecomm/java/android/telecom/Call.java
index 5bdcdf4..eb0a1e1 100644
--- a/telecomm/java/android/telecom/Call.java
+++ b/telecomm/java/android/telecom/Call.java
@@ -361,18 +361,6 @@
"android.telecom.extra.DIAGNOSTIC_MESSAGE";
/**
- * Event reported from the Telecom stack to indicate that the {@link Connection} is not able to
- * find any network and likely will not get connected. Upon receiving this event, the dialer
- * app should show satellite SOS button if satellite is provisioned.
- * <p>
- * The dialer app receives this event via
- * {@link Call.Callback#onConnectionEvent(Call, String, Bundle)}.
- * @hide
- */
- public static final String EVENT_DISPLAY_SOS_MESSAGE =
- "android.telecom.event.DISPLAY_SOS_MESSAGE";
-
- /**
* Reject reason used with {@link #reject(int)} to indicate that the user is rejecting this
* call because they have declined to answer it. This typically means that they are unable
* to answer the call at this time and would prefer it be sent to voicemail.
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index 943d8d6..4a541da 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -3388,7 +3388,11 @@
public void onAbort() {}
/**
- * Notifies this Connection of a request to hold.
+ * Notifies this Connection of a request to hold. {@link Connection#setOnHold} should be within
+ * the onHold() body in order to transition the call state to {@link Connection#STATE_HOLDING}.
+ * <p>
+ * Note: If the Connection does not transition to {@link Connection#STATE_HOLDING} within 2
+ * seconds, the call will be disconnected.
*/
public void onHold() {}
diff --git a/telecomm/java/android/telecom/RemoteConnectionManager.java b/telecomm/java/android/telecom/RemoteConnectionManager.java
index fbbfefd..fbf8eef 100644
--- a/telecomm/java/android/telecom/RemoteConnectionManager.java
+++ b/telecomm/java/android/telecom/RemoteConnectionManager.java
@@ -39,18 +39,21 @@
void addConnectionService(
ComponentName componentName,
IConnectionService outgoingConnectionServiceRpc) {
- if (!mRemoteConnectionServices.containsKey(componentName)) {
- try {
- RemoteConnectionService remoteConnectionService = new RemoteConnectionService(
- outgoingConnectionServiceRpc,
- mOurConnectionServiceImpl);
- mRemoteConnectionServices.put(componentName, remoteConnectionService);
- } catch (RemoteException e) {
- Log.w(RemoteConnectionManager.this,
- "error when addConnectionService of %s: %s", componentName,
- e.toString());
- }
- }
+ mRemoteConnectionServices.computeIfAbsent(
+ componentName,
+ key -> {
+ try {
+ return new RemoteConnectionService(
+ outgoingConnectionServiceRpc, mOurConnectionServiceImpl);
+ } catch (RemoteException e) {
+ Log.w(
+ RemoteConnectionManager.this,
+ "error when addConnectionService of %s: %s",
+ componentName,
+ e.toString());
+ return null;
+ }
+ });
}
public RemoteConnection createRemoteConnection(
@@ -63,17 +66,14 @@
}
ComponentName componentName = request.getAccountHandle().getComponentName();
- if (!mRemoteConnectionServices.containsKey(componentName)) {
+ RemoteConnectionService remoteService = mRemoteConnectionServices.get(componentName);
+ if (remoteService == null) {
throw new UnsupportedOperationException("accountHandle not supported: "
+ componentName);
}
- RemoteConnectionService remoteService = mRemoteConnectionServices.get(componentName);
- if (remoteService != null) {
- return remoteService.createRemoteConnection(
- connectionManagerPhoneAccount, request, isIncoming);
- }
- return null;
+ return remoteService.createRemoteConnection(
+ connectionManagerPhoneAccount, request, isIncoming);
}
/**
@@ -94,17 +94,14 @@
}
ComponentName componentName = request.getAccountHandle().getComponentName();
- if (!mRemoteConnectionServices.containsKey(componentName)) {
+ RemoteConnectionService remoteService = mRemoteConnectionServices.get(componentName);
+ if (remoteService == null) {
throw new UnsupportedOperationException("accountHandle not supported: "
+ componentName);
}
- RemoteConnectionService remoteService = mRemoteConnectionServices.get(componentName);
- if (remoteService != null) {
- return remoteService.createRemoteConference(
- connectionManagerPhoneAccount, request, isIncoming);
- }
- return null;
+ return remoteService.createRemoteConference(
+ connectionManagerPhoneAccount, request, isIncoming);
}
public void conferenceRemoteConnections(RemoteConnection a, RemoteConnection b) {
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 4907134..13e5ff1 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -10408,7 +10408,7 @@
sDefaults.putIntArray(KEY_DISCONNECT_CAUSE_PLAY_BUSYTONE_INT_ARRAY,
new int[] {4 /* BUSY */});
sDefaults.putBoolean(KEY_PREVENT_CLIR_ACTIVATION_AND_DEACTIVATION_CODE_BOOL, false);
- sDefaults.putLong(KEY_DATA_SWITCH_VALIDATION_TIMEOUT_LONG, 2000);
+ sDefaults.putLong(KEY_DATA_SWITCH_VALIDATION_TIMEOUT_LONG, 5000);
sDefaults.putStringArray(KEY_MMI_TWO_DIGIT_NUMBER_PATTERN_STRING_ARRAY, new String[0]);
sDefaults.putInt(KEY_PARAMETERS_USED_FOR_LTE_SIGNAL_BAR_INT,
CellSignalStrengthLte.USE_RSRP);
@@ -10518,7 +10518,7 @@
auto_data_switch_rat_signal_score_string_bundle.putIntArray(
"eHRPD", new int[]{10, 400, 600, 800, 1000});
auto_data_switch_rat_signal_score_string_bundle.putIntArray(
- "TD_SCDMA", new int[]{1, 100, 500, 1000});
+ "TD_SCDMA", new int[]{1, 50, 100, 500, 1000});
auto_data_switch_rat_signal_score_string_bundle.putIntArray(
"iDEN", new int[]{1, 2, 10, 50, 100});
auto_data_switch_rat_signal_score_string_bundle.putIntArray(
@@ -10536,7 +10536,7 @@
auto_data_switch_rat_signal_score_string_bundle.putIntArray(
"EvDo_0", new int[]{300, 600, 1000, 1500, 2000});
auto_data_switch_rat_signal_score_string_bundle.putIntArray(
- "1xRTT", new int[]{50, 60, 70, 80});
+ "1xRTT", new int[]{50, 60, 70, 80, 90});
auto_data_switch_rat_signal_score_string_bundle.putIntArray(
"EDGE", new int[]{154, 169, 183, 192, 267});
auto_data_switch_rat_signal_score_string_bundle.putIntArray(
diff --git a/telephony/java/android/telephony/DisconnectCause.java b/telephony/java/android/telephony/DisconnectCause.java
index 6997f3c7..f9844bc 100644
--- a/telephony/java/android/telephony/DisconnectCause.java
+++ b/telephony/java/android/telephony/DisconnectCause.java
@@ -362,7 +362,6 @@
/**
* Indicates that the call was unable to be made because the satellite modem is enabled.
- * @hide
*/
public static final int SATELLITE_ENABLED = 82;
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 64c2a4c..12ab5c3 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -85,11 +85,11 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
-import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
import java.util.stream.Collectors;
@@ -1328,10 +1328,24 @@
private final Context mContext;
- // Cache of Resource that has been created in getResourcesForSubId. Key is a Pair containing
- // the Context and subId.
- private static final Map<Pair<Context, Integer>, Resources> sResourcesCache =
- new ConcurrentHashMap<>();
+ /**
+ * In order to prevent the overflow of the heap size due to an indiscriminate increase in the
+ * cache, the heap size of the resource cache is set sufficiently large.
+ */
+ private static final int MAX_RESOURCE_CACHE_ENTRY_COUNT = 10_000;
+
+ /**
+ * Cache of Resources that has been created in getResourcesForSubId. Key contains package name,
+ * and Configuration of Resources. If more than the maximum number of resources are stored in
+ * this cache, the least recently used Resources will be removed to maintain the maximum size.
+ */
+ private static final Map<Pair<String, Configuration>, Resources> sResourcesCache =
+ Collections.synchronizedMap(new LinkedHashMap<>(16, 0.75f, true) {
+ @Override
+ protected boolean removeEldestEntry(Entry eldest) {
+ return size() > MAX_RESOURCE_CACHE_ENTRY_COUNT;
+ }
+ });
/**
* A listener class for monitoring changes to {@link SubscriptionInfo} records.
@@ -2817,14 +2831,20 @@
@NonNull
public static Resources getResourcesForSubId(Context context, int subId,
boolean useRootLocale) {
- // Check if resources for this context and subId already exist in the resource cache.
- // Resources that use the root locale are not cached.
- Pair<Context, Integer> cacheKey = null;
- if (isValidSubscriptionId(subId) && !useRootLocale) {
- cacheKey = Pair.create(context, subId);
- if (sResourcesCache.containsKey(cacheKey)) {
+ // Check if the Resources already exists in the cache based on the given context. Find a
+ // Resource that match Configuration.
+ Pair<String, Configuration> cacheKey = null;
+ if (isValidSubscriptionId(subId)) {
+ Configuration configurationKey =
+ new Configuration(context.getResources().getConfiguration());
+ if (useRootLocale) {
+ configurationKey.setLocale(Locale.ROOT);
+ }
+ cacheKey = Pair.create(context.getPackageName(), configurationKey);
+ Resources cached = sResourcesCache.get(cacheKey);
+ if (cached != null) {
// Cache hit. Use cached Resources.
- return sResourcesCache.get(cacheKey);
+ return cached;
}
}
@@ -3376,15 +3396,11 @@
if (iSub != null) {
groupUuid = iSub.createSubscriptionGroup(subIdArray, pkgForDebug);
} else {
- if (!isSystemProcess()) {
- throw new IllegalStateException("telephony service is null.");
- }
+ throw new IllegalStateException("telephony service is null.");
}
} catch (RemoteException ex) {
loge("createSubscriptionGroup RemoteException " + ex);
- if (!isSystemProcess()) {
- ex.rethrowAsRuntimeException();
- }
+ ex.rethrowAsRuntimeException();
}
return groupUuid;
@@ -3426,15 +3442,11 @@
if (iSub != null) {
iSub.addSubscriptionsIntoGroup(subIdArray, groupUuid, pkgForDebug);
} else {
- if (!isSystemProcess()) {
- throw new IllegalStateException("telephony service is null.");
- }
+ throw new IllegalStateException("telephony service is null.");
}
} catch (RemoteException ex) {
loge("addSubscriptionsIntoGroup RemoteException " + ex);
- if (!isSystemProcess()) {
- ex.rethrowAsRuntimeException();
- }
+ ex.rethrowAsRuntimeException();
}
}
@@ -3477,15 +3489,11 @@
if (iSub != null) {
iSub.removeSubscriptionsFromGroup(subIdArray, groupUuid, callingPackage);
} else {
- if (!isSystemProcess()) {
- throw new IllegalStateException("telephony service is null.");
- }
+ throw new IllegalStateException("telephony service is null.");
}
} catch (RemoteException ex) {
loge("removeSubscriptionsFromGroup RemoteException " + ex);
- if (!isSystemProcess()) {
- ex.rethrowAsRuntimeException();
- }
+ ex.rethrowAsRuntimeException();
}
}
@@ -3542,6 +3550,11 @@
}
}
+ // TODO(b/296125268) Really this method should throw, but it's common enough that for
+ // system callers it's worth having a little magic for the system process until it's
+ // made safer.
+ if (result == null) result = Collections.emptyList();
+
return result;
}
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index f1ee76e..5f67441 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -76,7 +76,9 @@
import android.service.carrier.CarrierIdentifier;
import android.service.carrier.CarrierService;
import android.sysprop.TelephonyProperties;
+import android.telecom.Call;
import android.telecom.CallScreeningService;
+import android.telecom.Connection;
import android.telecom.InCallService;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
@@ -1186,6 +1188,17 @@
"android.telephony.event.EVENT_SUPPLEMENTARY_SERVICE_NOTIFICATION";
/**
+ * Event reported from the Telephony stack to indicate that the {@link Connection} is not
+ * able to find any network and likely will not get connected. Upon receiving this event,
+ * the dialer app should show satellite SOS button if satellite is provisioned.
+ * <p>
+ * The dialer app receives this event via
+ * {@link Call.Callback#onConnectionEvent(Call, String, Bundle)}.
+ */
+ public static final String EVENT_DISPLAY_SOS_MESSAGE =
+ "android.telephony.event.DISPLAY_SOS_MESSAGE";
+
+ /**
* Integer extra key used with {@link #EVENT_SUPPLEMENTARY_SERVICE_NOTIFICATION} which indicates
* the type of supplementary service notification which occurred.
* Will be either
diff --git a/telephony/java/android/telephony/satellite/ISatelliteTransmissionUpdateCallback.aidl b/telephony/java/android/telephony/satellite/ISatelliteTransmissionUpdateCallback.aidl
index a81444d..06fc3c6 100644
--- a/telephony/java/android/telephony/satellite/ISatelliteTransmissionUpdateCallback.aidl
+++ b/telephony/java/android/telephony/satellite/ISatelliteTransmissionUpdateCallback.aidl
@@ -45,6 +45,7 @@
* Called when the satellite position changed.
*
* @param pointingInfo The pointing info containing the satellite location.
+ * Satellite location is based on magnetic north direction.
*/
void onSatellitePositionChanged(in PointingInfo pointingInfo);
}
diff --git a/telephony/java/android/telephony/satellite/PointingInfo.java b/telephony/java/android/telephony/satellite/PointingInfo.java
index 47dbdaf..dc4d38b 100644
--- a/telephony/java/android/telephony/satellite/PointingInfo.java
+++ b/telephony/java/android/telephony/satellite/PointingInfo.java
@@ -26,7 +26,7 @@
/**
* PointingInfo is used to store the position of satellite received from satellite modem.
* The position of satellite is represented by azimuth and elevation angles
- * with degrees as unit of measurement.
+ * with degrees as unit of measurement. Satellite position is based on magnetic north direction.
* @hide
*/
@SystemApi
diff --git a/tests/ApkVerityTest/ApkVerityTestApp/feature_split/src/com/android/apkverity/feature_x/DummyActivity.java b/tests/ApkVerityTest/ApkVerityTestApp/feature_split/src/com/android/apkverity/feature_x/DummyActivity.java
index 0f694c2..fe91260 100644
--- a/tests/ApkVerityTest/ApkVerityTestApp/feature_split/src/com/android/apkverity/feature_x/DummyActivity.java
+++ b/tests/ApkVerityTest/ApkVerityTestApp/feature_split/src/com/android/apkverity/feature_x/DummyActivity.java
@@ -18,5 +18,5 @@
import android.app.Activity;
-/** Dummy class just to generate some dex */
+/** Placeholder class just to generate some dex */
public class DummyActivity extends Activity {}
diff --git a/tests/ApkVerityTest/ApkVerityTestApp/src/com/android/apkverity/DummyActivity.java b/tests/ApkVerityTest/ApkVerityTestApp/src/com/android/apkverity/DummyActivity.java
index 837c7be..a7bd771 100644
--- a/tests/ApkVerityTest/ApkVerityTestApp/src/com/android/apkverity/DummyActivity.java
+++ b/tests/ApkVerityTest/ApkVerityTestApp/src/com/android/apkverity/DummyActivity.java
@@ -18,5 +18,5 @@
import android.app.Activity;
-/** Dummy class just to generate some dex */
+/** Placeholder class just to generate some dex */
public class DummyActivity extends Activity {}
diff --git a/tests/BinaryTransparencyHostTest/Android.bp b/tests/BinaryTransparencyHostTest/Android.bp
index dc6bdff..615990f 100644
--- a/tests/BinaryTransparencyHostTest/Android.bp
+++ b/tests/BinaryTransparencyHostTest/Android.bp
@@ -35,6 +35,8 @@
data: [
":BinaryTransparencyTestApp",
":EasterEgg",
+ ":FeatureSplitBase",
+ ":FeatureSplit1",
":com.android.apex.cts.shim.v2_rebootless_prebuilt",
],
test_suites: [
diff --git a/tests/BinaryTransparencyHostTest/src/android/transparency/test/BinaryTransparencyHostTest.java b/tests/BinaryTransparencyHostTest/src/android/transparency/test/BinaryTransparencyHostTest.java
index 346622f..6e5f08a 100644
--- a/tests/BinaryTransparencyHostTest/src/android/transparency/test/BinaryTransparencyHostTest.java
+++ b/tests/BinaryTransparencyHostTest/src/android/transparency/test/BinaryTransparencyHostTest.java
@@ -91,20 +91,20 @@
public void testCollectAllSilentInstalledMbaInfo() throws Exception {
try {
new InstallMultiple()
- .addFile("ApkVerityTestApp.apk")
- .addFile("ApkVerityTestAppSplit.apk")
+ .addFile("FeatureSplitBase.apk")
+ .addFile("FeatureSplit1.apk")
.run();
updatePreloadApp();
- assertNotNull(getDevice().getAppPackageInfo("com.android.apkverity"));
+ assertNotNull(getDevice().getAppPackageInfo("com.android.test.split.feature"));
assertNotNull(getDevice().getAppPackageInfo("com.android.egg"));
assertTrue(getDevice().setProperty("debug.transparency.bg-install-apps",
- "com.android.apkverity,com.android.egg"));
+ "com.android.test.split.feature,com.android.egg"));
runDeviceTest("testCollectAllSilentInstalledMbaInfo");
} finally {
// No need to wait until job complete, since we can't verifying very meaningfully.
cancelPendingJob();
- uninstallPackage("com.android.apkverity");
+ uninstallPackage("com.android.test.split.feature");
uninstallPackage("com.android.egg");
}
}
diff --git a/tests/BinaryTransparencyHostTest/test-app/src/android/transparency/test/app/BinaryTransparencyTest.java b/tests/BinaryTransparencyHostTest/test-app/src/android/transparency/test/app/BinaryTransparencyTest.java
index c087a85..2bc056e 100644
--- a/tests/BinaryTransparencyHostTest/test-app/src/android/transparency/test/app/BinaryTransparencyTest.java
+++ b/tests/BinaryTransparencyHostTest/test-app/src/android/transparency/test/app/BinaryTransparencyTest.java
@@ -121,7 +121,7 @@
// Verify
assertThat(appInfoList).isNotEmpty(); // because we just installed from the host side
- var expectedAppNames = Set.of("com.android.apkverity", "com.android.egg");
+ var expectedAppNames = Set.of("com.android.test.split.feature", "com.android.egg");
var actualAppNames = appInfoList.stream().map((appInfo) -> appInfo.packageName)
.collect(Collectors.toList());
assertThat(actualAppNames).containsAtLeastElementsIn(expectedAppNames);
@@ -141,6 +141,6 @@
}
}
}
- assertThat(actualSplitNames).containsExactly("feature_x"); // Name of ApkVerityTestAppSplit
+ assertThat(actualSplitNames).containsExactly("feature1"); // Name of FeatureSplit1
}
}
diff --git a/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/GraphExporter.java b/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/GraphExporter.java
index 0013965..4b7ca53 100644
--- a/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/GraphExporter.java
+++ b/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/GraphExporter.java
@@ -113,7 +113,7 @@
getDotName(target.getFilter().getName()) + ":" +
getDotName(target.getName()) + "_IN;\n" );
} else {
- // Found a unconnected output port, add dummy node
+ // Found a unconnected output port, add placeholder node
String color = filter.getSignature().getOutputPortInfo(portName).isRequired()
? "red" : "blue"; // red for unconnected, required ports
dotFile.write(" " +
@@ -131,7 +131,7 @@
if(target != null) {
// Found a connection -- nothing to do, connections have been written out above
} else {
- // Found a unconnected input port, add dummy node
+ // Found a unconnected input port, add placeholder node
String color = filter.getSignature().getInputPortInfo(portName).isRequired()
? "red" : "blue"; // red for unconnected, required ports
dotFile.write(" " +
diff --git a/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/MffContext.java b/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/MffContext.java
index b7212f9..6bd6c18 100644
--- a/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/MffContext.java
+++ b/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/MffContext.java
@@ -66,9 +66,9 @@
/**
* On older Android versions the Camera may need a SurfaceView to render into in order to
- * function. You may specify a dummy SurfaceView here if you do not want the context to
+ * function. You may specify a placeholder SurfaceView here if you do not want the context to
* create its own view. Note, that your view may or may not be used. You cannot rely on
- * your dummy view to be used by the Camera. If you pass null, no dummy view will be used.
+ * your placeholder view to be used by the Camera. If you pass null, no placeholder view will be used.
* In this case your application may not run correctly on older devices if you use the
* camera. This flag has no effect if you do not require the camera.
*/
@@ -104,7 +104,7 @@
/** The current context state. */
private State mState = new State();
- /** A dummy SurfaceView that is required for Camera operation on older devices. */
+ /** A placeholder SurfaceView that is required for Camera operation on older devices. */
private SurfaceView mDummySurfaceView = null;
/** Handler to execute code in the context's thread, such as issuing callbacks. */
@@ -126,7 +126,7 @@
* multiple MffContexts, however data between them cannot be shared. The context must be
* created in a thread with a Looper (such as the main/UI thread).
*
- * On older versions of Android, the MffContext may create a visible dummy view for the
+ * On older versions of Android, the MffContext may create a visible placeholder view for the
* camera to render into. This is a 1x1 SurfaceView that is placed into the top-left corner.
*
* @param context The application context to attach the MffContext to.
@@ -142,7 +142,7 @@
* multiple MffContexts, however data between them cannot be shared. The context must be
* created in a thread with a Looper (such as the main/UI thread).
*
- * On older versions of Android, the MffContext may create a visible dummy view for the
+ * On older versions of Android, the MffContext may create a visible placeholder view for the
* camera to render into. This is a 1x1 SurfaceView that is placed into the top-left corner.
* You may alternatively specify your own SurfaceView in the configuration.
*
diff --git a/tests/DynamicCodeLoggerIntegrationTests/src/com/android/dcl/Simple.java b/tests/DynamicCodeLoggerIntegrationTests/src/com/android/dcl/Simple.java
index e995a26..2ca91fb 100644
--- a/tests/DynamicCodeLoggerIntegrationTests/src/com/android/dcl/Simple.java
+++ b/tests/DynamicCodeLoggerIntegrationTests/src/com/android/dcl/Simple.java
@@ -16,7 +16,7 @@
package com.android.dcl;
-/** Dummy class which is built into a jar purely so we can pass it to DexClassLoader. */
+/** Placeholder class which is built into a jar purely so we can pass it to DexClassLoader. */
public final class Simple {
public Simple() {}
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/activityembedding/splitscreen/EnterSystemSplitTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/activityembedding/splitscreen/EnterSystemSplitTest.kt
new file mode 100644
index 0000000..87231c8
--- /dev/null
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/activityembedding/splitscreen/EnterSystemSplitTest.kt
@@ -0,0 +1,189 @@
+/*
+ * 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.server.wm.flicker.activityembedding.splitscreen
+
+import android.platform.test.annotations.Presubmit
+import android.platform.test.annotations.RequiresDevice
+import android.tools.common.datatypes.Rect
+import android.tools.device.flicker.junit.FlickerParametersRunnerFactory
+import android.tools.device.flicker.legacy.FlickerBuilder
+import android.tools.device.flicker.legacy.LegacyFlickerTest
+import android.tools.device.flicker.legacy.LegacyFlickerTestFactory
+import android.tools.device.traces.parsers.toFlickerComponent
+import com.android.server.wm.flicker.helpers.ActivityEmbeddingAppHelper
+import com.android.server.wm.flicker.activityembedding.ActivityEmbeddingTestBase
+import com.android.server.wm.flicker.testapp.ActivityOptions
+import com.android.wm.shell.flicker.utils.*
+import org.junit.FixMethodOrder
+import org.junit.Ignore
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.MethodSorters
+import org.junit.runners.Parameterized
+
+/***
+ * Test entering System SplitScreen with Activity Embedding Split and another app.
+ *
+ * Setup: Launch A|B in split and secondaryApp, return to home.
+ * Transitions: Let AE Split A|B enter splitscreen with secondaryApp. Resulting in A|B|secondaryApp.
+ *
+ * To run this test: `atest FlickerTestsOther:EnterSystemSplitTest`
+ */
+@RequiresDevice
+@RunWith(Parameterized::class)
+@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+class EnterSystemSplitTest(flicker: LegacyFlickerTest) :
+ ActivityEmbeddingTestBase(flicker) {
+
+ private val secondaryApp = SplitScreenUtils.getPrimary(instrumentation)
+ override val transition: FlickerBuilder.() -> Unit = {
+ setup {
+ testApp.launchViaIntent(wmHelper)
+ testApp.launchSecondaryActivity(wmHelper)
+ secondaryApp.launchViaIntent(wmHelper)
+ tapl.goHome()
+ wmHelper
+ .StateSyncBuilder()
+ .withAppTransitionIdle()
+ .withHomeActivityVisible()
+ .waitForAndVerify()
+ startDisplayBounds =
+ wmHelper.currentState.layerState.physicalDisplayBounds ?:
+ error("Display not found")
+ }
+ transitions {
+ SplitScreenUtils.enterSplit(wmHelper, tapl, device, testApp, secondaryApp)
+ SplitScreenUtils.waitForSplitComplete(wmHelper, testApp, secondaryApp)
+ }
+ }
+
+ @Presubmit
+ @Test
+ fun splitScreenDividerBecomesVisible() = flicker.splitScreenDividerBecomesVisible()
+
+ @Presubmit
+ @Test
+ fun activityEmbeddingSplitLayerBecomesVisible() {
+ flicker.splitAppLayerBoundsIsVisibleAtEnd(
+ testApp, landscapePosLeft = tapl.isTablet, portraitPosTop = false)
+ }
+
+ @Presubmit
+ @Test
+ fun activityEmbeddingSplitWindowBecomesVisible() = flicker.appWindowIsVisibleAtEnd(testApp)
+
+ @Presubmit
+ @Test
+ fun secondaryLayerBecomesVisible() {
+ flicker.splitAppLayerBoundsIsVisibleAtEnd(
+ secondaryApp, landscapePosLeft = !tapl.isTablet, portraitPosTop = true)
+ }
+
+ @Presubmit
+ @Test
+ fun secondaryAppWindowBecomesVisible() = flicker.appWindowIsVisibleAtEnd(secondaryApp)
+
+ /**
+ * After the transition there should be both ActivityEmbedding activities,
+ * SplitScreenPrimaryActivity and the system split divider on screen.
+ * Verify the layers are in expected sizes.
+ */
+ @Presubmit
+ @Test
+ fun activityEmbeddingSplitSurfaceAreEven() {
+ flicker.assertLayersEnd {
+ val leftAELayerRegion =
+ visibleRegion(ActivityEmbeddingAppHelper.MAIN_ACTIVITY_COMPONENT)
+ val rightAELayerRegion =
+ visibleRegion(ActivityEmbeddingAppHelper.SECONDARY_ACTIVITY_COMPONENT)
+ val secondaryAppLayerRegion =
+ visibleRegion(
+ ActivityOptions.SplitScreen.Primary.COMPONENT.toFlickerComponent())
+ val systemDivider = visibleRegion(SPLIT_SCREEN_DIVIDER_COMPONENT)
+ leftAELayerRegion
+ .plus(rightAELayerRegion.region)
+ .plus(secondaryAppLayerRegion.region)
+ .plus(systemDivider.region)
+ .coversExactly(startDisplayBounds)
+ check { "ActivityEmbeddingSplitHeight" }
+ .that(leftAELayerRegion.region.height)
+ .isEqual(rightAELayerRegion.region.height)
+ check { "SystemSplitHeight" }
+ .that(rightAELayerRegion.region.height)
+ .isEqual(secondaryAppLayerRegion.region.height)
+ // TODO(b/292283182): Remove this special case handling.
+ check { "ActivityEmbeddingSplitWidth" }
+ .that(Math.abs(
+ leftAELayerRegion.region.width - rightAELayerRegion.region.width))
+ .isLower(2)
+ check { "SystemSplitWidth" }
+ .that(Math.abs(secondaryAppLayerRegion.region.width -
+ 2 * rightAELayerRegion.region.width))
+ .isLower(2)
+ }
+ }
+
+ /**
+ * Verify the windows are in expected sizes.
+ */
+ @Presubmit
+ @Test
+ fun activityEmbeddingSplitWindowsAreEven() {
+ flicker.assertWmEnd {
+ val leftAEWindowRegion =
+ visibleRegion(ActivityEmbeddingAppHelper.MAIN_ACTIVITY_COMPONENT)
+ val rightAEWindowRegion =
+ visibleRegion(ActivityEmbeddingAppHelper.SECONDARY_ACTIVITY_COMPONENT)
+ // There's no window for the divider bar.
+ val secondaryAppLayerRegion =
+ visibleRegion(
+ ActivityOptions.SplitScreen.Primary.COMPONENT.toFlickerComponent())
+ check { "ActivityEmbeddingSplitHeight" }
+ .that(leftAEWindowRegion.region.height)
+ .isEqual(rightAEWindowRegion.region.height)
+ check { "SystemSplitHeight" }
+ .that(rightAEWindowRegion.region.height)
+ .isEqual(secondaryAppLayerRegion.region.height)
+ check { "ActivityEmbeddingSplitWidth" }
+ .that(Math.abs(
+ leftAEWindowRegion.region.width - rightAEWindowRegion.region.width))
+ .isLower(2)
+ check { "SystemSplitWidth" }
+ .that(Math.abs(secondaryAppLayerRegion.region.width -
+ 2 * rightAEWindowRegion.region.width))
+ .isLower(2)
+ }
+ }
+
+ @Ignore("Not applicable to this CUJ.")
+ override fun visibleLayersShownMoreThanOneConsecutiveEntry() {}
+
+ companion object {
+ /** {@inheritDoc} */
+ private var startDisplayBounds = Rect.EMPTY
+ /**
+ * Creates the test configurations.
+ *
+ * See [LegacyFlickerTestFactory.nonRotationTests] for configuring screen orientation and
+ * navigation modes.
+ */
+ @Parameterized.Parameters(name = "{0}")
+ @JvmStatic
+ fun getParams() = LegacyFlickerTestFactory.nonRotationTests()
+ }
+}
\ No newline at end of file
diff --git a/tests/FlickerTests/test-apps/flickerapp/AndroidManifest.xml b/tests/FlickerTests/test-apps/flickerapp/AndroidManifest.xml
index 704798e..f867c98 100644
--- a/tests/FlickerTests/test-apps/flickerapp/AndroidManifest.xml
+++ b/tests/FlickerTests/test-apps/flickerapp/AndroidManifest.xml
@@ -70,7 +70,7 @@
<activity android:name=".SeamlessRotationActivity"
android:taskAffinity="com.android.server.wm.flicker.testapp.SeamlessRotationActivity"
android:theme="@style/CutoutShortEdges"
- android:configChanges="orientation|screenSize"
+ android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
android:label="SeamlessActivity"
android:exported="true">
<intent-filter>
diff --git a/tests/Input/src/com/android/server/input/FocusEventDebugViewTest.java b/tests/Input/src/com/android/server/input/FocusEventDebugViewTest.java
new file mode 100644
index 0000000..1b98887
--- /dev/null
+++ b/tests/Input/src/com/android/server/input/FocusEventDebugViewTest.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright 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.server.input;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.anyInt;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.view.InputChannel;
+import android.view.InputDevice;
+import android.view.MotionEvent;
+import android.view.MotionEvent.PointerCoords;
+import android.view.MotionEvent.PointerProperties;
+import android.view.ViewConfiguration;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Build/Install/Run:
+ * atest FocusEventDebugViewTest
+ */
+@RunWith(AndroidJUnit4.class)
+public class FocusEventDebugViewTest {
+
+ private FocusEventDebugView mFocusEventDebugView;
+ private FocusEventDebugView.RotaryInputValueView mRotaryInputValueView;
+ private FocusEventDebugView.RotaryInputGraphView mRotaryInputGraphView;
+ private float mScaledVerticalScrollFactor;
+
+ @Before
+ public void setUp() throws Exception {
+ Context context = InstrumentationRegistry.getContext();
+ mScaledVerticalScrollFactor =
+ ViewConfiguration.get(context).getScaledVerticalScrollFactor();
+ InputManagerService mockService = mock(InputManagerService.class);
+ when(mockService.monitorInput(anyString(), anyInt()))
+ .thenReturn(InputChannel.openInputChannelPair("FocusEventDebugViewTest")[1]);
+
+ mRotaryInputValueView = new FocusEventDebugView.RotaryInputValueView(context);
+ mRotaryInputGraphView = new FocusEventDebugView.RotaryInputGraphView(context);
+ mFocusEventDebugView = new FocusEventDebugView(context, mockService,
+ () -> mRotaryInputValueView, () -> mRotaryInputGraphView);
+ }
+
+ @Test
+ public void startsRotaryInputValueViewWithDefaultValue() {
+ assertEquals("+0.0", mRotaryInputValueView.getText());
+ }
+
+ @Test
+ public void startsRotaryInputGraphViewWithDefaultFrameCenter() {
+ assertEquals(0, mRotaryInputGraphView.getFrameCenterPosition(), 0.01);
+ }
+
+ @Test
+ public void handleRotaryInput_updatesRotaryInputValueViewWithScrollValue() {
+ mFocusEventDebugView.handleUpdateShowRotaryInput(true);
+
+ mFocusEventDebugView.handleRotaryInput(createRotaryMotionEvent(0.5f));
+
+ assertEquals(String.format("+%.1f", 0.5f * mScaledVerticalScrollFactor),
+ mRotaryInputValueView.getText());
+ }
+
+ @Test
+ public void handleRotaryInput_translatesRotaryInputGraphViewWithHighScrollValue() {
+ mFocusEventDebugView.handleUpdateShowRotaryInput(true);
+
+ mFocusEventDebugView.handleRotaryInput(createRotaryMotionEvent(1000f));
+
+ assertTrue(mRotaryInputGraphView.getFrameCenterPosition() > 0);
+ }
+
+ @Test
+ public void updateActivityStatus_setsAndRemovesColorFilter() {
+ // It should not be active initially.
+ assertNull(mRotaryInputValueView.getBackground().getColorFilter());
+
+ mRotaryInputValueView.updateActivityStatus(true);
+ // It should be active after rotary input.
+ assertNotNull(mRotaryInputValueView.getBackground().getColorFilter());
+
+ mRotaryInputValueView.updateActivityStatus(false);
+ // It should not be active after waiting for mUpdateActivityStatusCallback.
+ assertNull(mRotaryInputValueView.getBackground().getColorFilter());
+ }
+
+ private MotionEvent createRotaryMotionEvent(float scrollAxisValue) {
+ PointerCoords pointerCoords = new PointerCoords();
+ pointerCoords.setAxisValue(MotionEvent.AXIS_SCROLL, scrollAxisValue);
+ PointerProperties pointerProperties = new PointerProperties();
+
+ return MotionEvent.obtain(
+ /* downTime */ 0,
+ /* eventTime */ 0,
+ /* action */ MotionEvent.ACTION_SCROLL,
+ /* pointerCount */ 1,
+ /* pointerProperties */ new PointerProperties[] {pointerProperties},
+ /* pointerCoords */ new PointerCoords[] {pointerCoords},
+ /* metaState */ 0,
+ /* buttonState */ 0,
+ /* xPrecision */ 0,
+ /* yPrecision */ 0,
+ /* deviceId */ 0,
+ /* edgeFlags */ 0,
+ /* source */ InputDevice.SOURCE_ROTARY_ENCODER,
+ /* flags */ 0
+ );
+ }
+}
diff --git a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/ImeStressTestUtil.java b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/ImeStressTestUtil.java
index c9b5c96..12556bc 100644
--- a/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/ImeStressTestUtil.java
+++ b/tests/InputMethodStressTest/src/com/android/inputmethod/stresstest/ImeStressTestUtil.java
@@ -154,7 +154,7 @@
* <p>The given {@code pred} will be called on the main thread.
*/
public static void waitOnMainUntil(String message, Callable<Boolean> pred) {
- eventually(() -> assertWithMessage(message).that(pred.call()).isTrue(), TIMEOUT);
+ eventually(() -> assertWithMessage(message).that(callOnMainSync(pred)).isTrue(), TIMEOUT);
}
/** Waits until IME is shown, or throws on timeout. */
diff --git a/tests/PlatformCompatGating/src/com/android/compat/testing/DummyApi.java b/tests/PlatformCompatGating/src/com/android/compat/testing/DummyApi.java
index 731be8e..a77950f 100644
--- a/tests/PlatformCompatGating/src/com/android/compat/testing/DummyApi.java
+++ b/tests/PlatformCompatGating/src/com/android/compat/testing/DummyApi.java
@@ -24,7 +24,7 @@
import com.android.internal.compat.IPlatformCompat;
/**
- * This is a dummy API to test gating
+ * This is a placeholder API to test gating
*
* @hide
*/
@@ -36,7 +36,7 @@
public static final long CHANGE_SYSTEM_SERVER = 666016;
/**
- * Dummy method
+ * Placeholder method
* @return "A" if change is enabled, "B" otherwise.
*/
public static String dummyFunc() {
@@ -47,7 +47,7 @@
}
/**
- * Dummy combined method
+ * Placeholder combined method
* @return "0" if {@link CHANGE_ID_1} is disabled and {@link CHANGE_ID_2} is disabled,
"1" if {@link CHANGE_ID_1} is disabled and {@link CHANGE_ID_2} is enabled,
"2" if {@link CHANGE_ID_1} is enabled and {@link CHANGE_ID_2} is disabled,
@@ -68,7 +68,7 @@
}
/**
- * Dummy api using system server API.
+ * Placeholder api using system server API.
*/
public static boolean dummySystemServer(Context context) {
IPlatformCompat platformCompat = IPlatformCompat.Stub
diff --git a/tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapImage.kt b/tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapImage.kt
index 31ea832..c92d768 100644
--- a/tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapImage.kt
+++ b/tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapImage.kt
@@ -16,10 +16,6 @@
package com.android.test.silkfx.hdr
-import android.animation.AnimatorSet
-import android.animation.ObjectAnimator
-import android.animation.ValueAnimator
-import android.animation.ValueAnimator.AnimatorUpdateListener
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
@@ -46,7 +42,7 @@
private var selectedImage = -1
private var outputMode = R.id.output_hdr
private var bitmap: Bitmap? = null
- private var gainmap: Gainmap? = null
+ private var originalGainmap: Gainmap? = null
private var gainmapVisualizer: Bitmap? = null
private lateinit var imageView: SubsamplingScaleImageView
private lateinit var gainmapMetadataEditor: GainmapMetadataEditor
@@ -70,7 +66,6 @@
it.check(outputMode)
it.setOnCheckedChangeListener { _, checkedId ->
outputMode = checkedId
- // Intentionally don't do anything fancy so that mode A/B comparisons are easy
updateDisplay()
}
}
@@ -101,41 +96,10 @@
imageView.apply {
isClickable = true
- // Example of animating between SDR and HDR using gainmap params; animates HDR->SDR->HDR
- // with a brief pause on SDR. The key thing here is that the gainmap's
- // minDisplayRatioForHdrTransition is animated between its original value (for full HDR)
- // and displayRatioForFullHdr (for full SDR). The view must also be invalidated during
- // the animation for the updates to take effect.
setOnClickListener {
- if (gainmap != null && (outputMode == R.id.output_hdr ||
- outputMode == R.id.output_hdr_test)) {
- val animationLengthMs: Long = 500
- val updateListener = object : AnimatorUpdateListener {
- override fun onAnimationUpdate(animation: ValueAnimator) {
- imageView.invalidate()
- }
- }
- val hdrToSdr = ObjectAnimator.ofFloat(
- gainmap, "minDisplayRatioForHdrTransition",
- gainmap!!.minDisplayRatioForHdrTransition,
- gainmap!!.displayRatioForFullHdr).apply {
- duration = animationLengthMs
- addUpdateListener(updateListener)
- }
- val sdrToHdr = ObjectAnimator.ofFloat(
- gainmap, "minDisplayRatioForHdrTransition",
- gainmap!!.displayRatioForFullHdr,
- gainmap!!.minDisplayRatioForHdrTransition).apply {
- duration = animationLengthMs
- addUpdateListener(updateListener)
- }
-
- AnimatorSet().apply {
- play(hdrToSdr)
- play(sdrToHdr).after(animationLengthMs)
- start()
- }
- }
+ animate().alpha(.5f).withEndAction {
+ animate().alpha(1f).start()
+ }.start()
}
}
}
@@ -149,7 +113,7 @@
}
private fun doDecode(source: ImageDecoder.Source) {
- gainmap = null
+ originalGainmap = null
bitmap = ImageDecoder.decodeBitmap(source) { decoder, info, source ->
decoder.allocator = ImageDecoder.ALLOCATOR_SOFTWARE
}
@@ -167,9 +131,10 @@
findViewById<TextView>(R.id.error_msg)!!.visibility = View.GONE
findViewById<RadioGroup>(R.id.output_mode)!!.visibility = View.VISIBLE
- gainmap = bitmap!!.gainmap
- gainmapMetadataEditor.setGainmap(gainmap)
- val map = gainmap!!.gainmapContents
+ val gainmap = bitmap!!.gainmap!!
+ originalGainmap = gainmap
+ gainmapMetadataEditor.setGainmap(Gainmap(gainmap, gainmap.gainmapContents))
+ val map = gainmap.gainmapContents
if (map.config != Bitmap.Config.ALPHA_8) {
gainmapVisualizer = map
} else {
@@ -198,14 +163,12 @@
imageView.setImage(ImageSource.cachedBitmap(when (outputMode) {
R.id.output_hdr -> {
- gainmapMetadataEditor.useOriginalMetadata()
- bitmap!!.gainmap = gainmap
+ bitmap!!.gainmap = originalGainmap
bitmap!!
}
R.id.output_hdr_test -> {
- gainmapMetadataEditor.useEditMetadata()
- bitmap!!.gainmap = gainmap
+ bitmap!!.gainmap = gainmapMetadataEditor.editedGainmap()
bitmap!!
}
diff --git a/tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapMetadataEditor.kt b/tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapMetadataEditor.kt
index 8a65304..c4bc600 100644
--- a/tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapMetadataEditor.kt
+++ b/tests/SilkFX/src/com/android/test/silkfx/hdr/GainmapMetadataEditor.kt
@@ -28,23 +28,27 @@
import com.android.test.silkfx.R
data class GainmapMetadata(
- var ratioMin: Float,
- var ratioMax: Float,
- var capacityMin: Float,
- var capacityMax: Float,
- var gamma: Float,
- var offsetSdr: Float,
- var offsetHdr: Float
+ var ratioMin: Float,
+ var ratioMax: Float,
+ var capacityMin: Float,
+ var capacityMax: Float,
+ var gamma: Float,
+ var offsetSdr: Float,
+ var offsetHdr: Float
)
+/**
+ * Note: This can only handle single-channel gainmaps nicely. It will force all 3-channel
+ * metadata to have the same value single value and is not intended to be a robust demonstration
+ * of gainmap metadata editing
+ */
class GainmapMetadataEditor(val parent: ViewGroup, val renderView: View) {
- private var gainmap: Gainmap? = null
- private var showingEdits = false
+ private lateinit var gainmap: Gainmap
private var metadataPopup: PopupWindow? = null
private var originalMetadata: GainmapMetadata = GainmapMetadata(
- 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f)
+ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f)
private var currentMetadata: GainmapMetadata = originalMetadata.copy()
private val maxProgress = 100.0f
@@ -61,23 +65,18 @@
private val maxGamma = 3.0f
// Min and max offsets are 0.0 and 1.0 respectively
- fun setGainmap(newGainmap: Gainmap?) {
+ fun setGainmap(newGainmap: Gainmap) {
gainmap = newGainmap
- originalMetadata = GainmapMetadata(gainmap!!.getRatioMin()[0],
- gainmap!!.getRatioMax()[0], gainmap!!.getMinDisplayRatioForHdrTransition(),
- gainmap!!.getDisplayRatioForFullHdr(), gainmap!!.getGamma()[0],
- gainmap!!.getEpsilonSdr()[0], gainmap!!.getEpsilonHdr()[0])
+ originalMetadata = GainmapMetadata(gainmap.getRatioMin()[0],
+ gainmap.getRatioMax()[0], gainmap.getMinDisplayRatioForHdrTransition(),
+ gainmap.getDisplayRatioForFullHdr(), gainmap.getGamma()[0],
+ gainmap.getEpsilonSdr()[0], gainmap.getEpsilonHdr()[0])
currentMetadata = originalMetadata.copy()
}
- fun useOriginalMetadata() {
- showingEdits = false
- applyMetadata(originalMetadata)
- }
-
- fun useEditMetadata() {
- showingEdits = true
+ fun editedGainmap(): Gainmap {
applyMetadata(currentMetadata)
+ return gainmap
}
fun closeEditor() {
@@ -93,7 +92,7 @@
val view = LayoutInflater.from(parent.getContext()).inflate(R.layout.gainmap_metadata, null)
metadataPopup = PopupWindow(view, ViewGroup.LayoutParams.WRAP_CONTENT,
- ViewGroup.LayoutParams.WRAP_CONTENT)
+ ViewGroup.LayoutParams.WRAP_CONTENT)
metadataPopup!!.showAtLocation(view, Gravity.CENTER, 0, 0)
(view.getParent() as ViewGroup).removeView(view)
@@ -117,7 +116,7 @@
val offsetSdrSeek = view.findViewById<SeekBar>(R.id.gainmap_metadata_offsetsdr)
val offsetHdrSeek = view.findViewById<SeekBar>(R.id.gainmap_metadata_offsethdr)
arrayOf(gainmapMinSeek, gainmapMaxSeek, capacityMinSeek, capacityMaxSeek, gammaSeek,
- offsetSdrSeek, offsetHdrSeek).forEach {
+ offsetSdrSeek, offsetHdrSeek).forEach {
it.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {
if (!fromUser) return
@@ -149,37 +148,37 @@
val offsetHdrSeek = parent.findViewById<SeekBar>(R.id.gainmap_metadata_offsethdr)
gainmapMinSeek.setProgress(
- ((currentMetadata.ratioMin - minRatioMin) / maxRatioMin * maxProgress).toInt())
+ ((currentMetadata.ratioMin - minRatioMin) / maxRatioMin * maxProgress).toInt())
gainmapMaxSeek.setProgress(
- ((currentMetadata.ratioMax - minRatioMax) / maxRatioMax * maxProgress).toInt())
+ ((currentMetadata.ratioMax - minRatioMax) / maxRatioMax * maxProgress).toInt())
capacityMinSeek.setProgress(
- ((currentMetadata.capacityMin - minCapacityMin) / maxCapacityMin * maxProgress).toInt())
+ ((currentMetadata.capacityMin - minCapacityMin) / maxCapacityMin * maxProgress).toInt())
capacityMaxSeek.setProgress(
- ((currentMetadata.capacityMax - minCapacityMax) / maxCapacityMax * maxProgress).toInt())
+ ((currentMetadata.capacityMax - minCapacityMax) / maxCapacityMax * maxProgress).toInt())
gammaSeek.setProgress(
- ((currentMetadata.gamma - minGamma) / maxGamma * maxProgress).toInt())
+ ((currentMetadata.gamma - minGamma) / maxGamma * maxProgress).toInt())
// Log base 3 via: log_b(x) = log_y(x) / log_y(b)
offsetSdrSeek.setProgress(
- ((1.0 - Math.log(currentMetadata.offsetSdr.toDouble() / Math.log(3.0)) / -11.0)
- .toFloat() * maxProgress).toInt())
+ ((1.0 - Math.log(currentMetadata.offsetSdr.toDouble() / Math.log(3.0)) / -11.0)
+ .toFloat() * maxProgress).toInt())
offsetHdrSeek.setProgress(
- ((1.0 - Math.log(currentMetadata.offsetHdr.toDouble() / Math.log(3.0)) / -11.0)
- .toFloat() * maxProgress).toInt())
+ ((1.0 - Math.log(currentMetadata.offsetHdr.toDouble() / Math.log(3.0)) / -11.0)
+ .toFloat() * maxProgress).toInt())
parent.findViewById<TextView>(R.id.gainmap_metadata_gainmapmin_val)!!.setText(
- "%.3f".format(currentMetadata.ratioMin))
+ "%.3f".format(currentMetadata.ratioMin))
parent.findViewById<TextView>(R.id.gainmap_metadata_gainmapmax_val)!!.setText(
- "%.3f".format(currentMetadata.ratioMax))
+ "%.3f".format(currentMetadata.ratioMax))
parent.findViewById<TextView>(R.id.gainmap_metadata_capacitymin_val)!!.setText(
- "%.3f".format(currentMetadata.capacityMin))
+ "%.3f".format(currentMetadata.capacityMin))
parent.findViewById<TextView>(R.id.gainmap_metadata_capacitymax_val)!!.setText(
- "%.3f".format(currentMetadata.capacityMax))
+ "%.3f".format(currentMetadata.capacityMax))
parent.findViewById<TextView>(R.id.gainmap_metadata_gamma_val)!!.setText(
- "%.3f".format(currentMetadata.gamma))
+ "%.3f".format(currentMetadata.gamma))
parent.findViewById<TextView>(R.id.gainmap_metadata_offsetsdr_val)!!.setText(
- "%.5f".format(currentMetadata.offsetSdr))
+ "%.5f".format(currentMetadata.offsetSdr))
parent.findViewById<TextView>(R.id.gainmap_metadata_offsethdr_val)!!.setText(
- "%.5f".format(currentMetadata.offsetHdr))
+ "%.5f".format(currentMetadata.offsetHdr))
}
private fun resetGainmapMetadata() {
@@ -189,69 +188,59 @@
}
private fun applyMetadata(newMetadata: GainmapMetadata) {
- gainmap!!.setRatioMin(newMetadata.ratioMin, newMetadata.ratioMin, newMetadata.ratioMin)
- gainmap!!.setRatioMax(newMetadata.ratioMax, newMetadata.ratioMax, newMetadata.ratioMax)
- gainmap!!.setMinDisplayRatioForHdrTransition(newMetadata.capacityMin)
- gainmap!!.setDisplayRatioForFullHdr(newMetadata.capacityMax)
- gainmap!!.setGamma(newMetadata.gamma, newMetadata.gamma, newMetadata.gamma)
- gainmap!!.setEpsilonSdr(newMetadata.offsetSdr, newMetadata.offsetSdr, newMetadata.offsetSdr)
- gainmap!!.setEpsilonHdr(newMetadata.offsetHdr, newMetadata.offsetHdr, newMetadata.offsetHdr)
+ gainmap.setRatioMin(newMetadata.ratioMin, newMetadata.ratioMin, newMetadata.ratioMin)
+ gainmap.setRatioMax(newMetadata.ratioMax, newMetadata.ratioMax, newMetadata.ratioMax)
+ gainmap.setMinDisplayRatioForHdrTransition(newMetadata.capacityMin)
+ gainmap.setDisplayRatioForFullHdr(newMetadata.capacityMax)
+ gainmap.setGamma(newMetadata.gamma, newMetadata.gamma, newMetadata.gamma)
+ gainmap.setEpsilonSdr(newMetadata.offsetSdr, newMetadata.offsetSdr, newMetadata.offsetSdr)
+ gainmap.setEpsilonHdr(newMetadata.offsetHdr, newMetadata.offsetHdr, newMetadata.offsetHdr)
renderView.invalidate()
}
private fun updateGainmapMin(normalized: Float) {
val newValue = minRatioMin + normalized * (maxRatioMin - minRatioMin)
parent.findViewById<TextView>(R.id.gainmap_metadata_gainmapmin_val)!!.setText(
- "%.3f".format(newValue))
+ "%.3f".format(newValue))
currentMetadata.ratioMin = newValue
- if (showingEdits) {
- gainmap!!.setRatioMin(newValue, newValue, newValue)
- renderView.invalidate()
- }
+ gainmap.setRatioMin(newValue, newValue, newValue)
+ renderView.invalidate()
}
private fun updateGainmapMax(normalized: Float) {
val newValue = minRatioMax + normalized * (maxRatioMax - minRatioMax)
parent.findViewById<TextView>(R.id.gainmap_metadata_gainmapmax_val)!!.setText(
- "%.3f".format(newValue))
+ "%.3f".format(newValue))
currentMetadata.ratioMax = newValue
- if (showingEdits) {
- gainmap!!.setRatioMax(newValue, newValue, newValue)
- renderView.invalidate()
- }
+ gainmap.setRatioMax(newValue, newValue, newValue)
+ renderView.invalidate()
}
private fun updateCapacityMin(normalized: Float) {
val newValue = minCapacityMin + normalized * (maxCapacityMin - minCapacityMin)
parent.findViewById<TextView>(R.id.gainmap_metadata_capacitymin_val)!!.setText(
- "%.3f".format(newValue))
+ "%.3f".format(newValue))
currentMetadata.capacityMin = newValue
- if (showingEdits) {
- gainmap!!.setMinDisplayRatioForHdrTransition(newValue)
- renderView.invalidate()
- }
+ gainmap.setMinDisplayRatioForHdrTransition(newValue)
+ renderView.invalidate()
}
private fun updateCapacityMax(normalized: Float) {
val newValue = minCapacityMax + normalized * (maxCapacityMax - minCapacityMax)
parent.findViewById<TextView>(R.id.gainmap_metadata_capacitymax_val)!!.setText(
- "%.3f".format(newValue))
+ "%.3f".format(newValue))
currentMetadata.capacityMax = newValue
- if (showingEdits) {
- gainmap!!.setDisplayRatioForFullHdr(newValue)
- renderView.invalidate()
- }
+ gainmap.setDisplayRatioForFullHdr(newValue)
+ renderView.invalidate()
}
private fun updateGamma(normalized: Float) {
val newValue = minGamma + normalized * (maxGamma - minGamma)
parent.findViewById<TextView>(R.id.gainmap_metadata_gamma_val)!!.setText(
- "%.3f".format(newValue))
+ "%.3f".format(newValue))
currentMetadata.gamma = newValue
- if (showingEdits) {
- gainmap!!.setGamma(newValue, newValue, newValue)
- renderView.invalidate()
- }
+ gainmap.setGamma(newValue, newValue, newValue)
+ renderView.invalidate()
}
private fun updateOffsetSdr(normalized: Float) {
@@ -260,12 +249,10 @@
newValue = Math.pow(3.0, (1.0 - normalized.toDouble()) * -11.0).toFloat()
}
parent.findViewById<TextView>(R.id.gainmap_metadata_offsetsdr_val)!!.setText(
- "%.5f".format(newValue))
+ "%.5f".format(newValue))
currentMetadata.offsetSdr = newValue
- if (showingEdits) {
- gainmap!!.setEpsilonSdr(newValue, newValue, newValue)
- renderView.invalidate()
- }
+ gainmap.setEpsilonSdr(newValue, newValue, newValue)
+ renderView.invalidate()
}
private fun updateOffsetHdr(normalized: Float) {
@@ -274,11 +261,9 @@
newValue = Math.pow(3.0, (1.0 - normalized.toDouble()) * -11.0).toFloat()
}
parent.findViewById<TextView>(R.id.gainmap_metadata_offsethdr_val)!!.setText(
- "%.5f".format(newValue))
+ "%.5f".format(newValue))
currentMetadata.offsetHdr = newValue
- if (showingEdits) {
- gainmap!!.setEpsilonHdr(newValue, newValue, newValue)
- renderView.invalidate()
- }
+ gainmap.setEpsilonHdr(newValue, newValue, newValue)
+ renderView.invalidate()
}
}
diff --git a/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/SoundTriggerTestService.java b/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/SoundTriggerTestService.java
index 3567c08..cc6cebf 100644
--- a/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/SoundTriggerTestService.java
+++ b/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/SoundTriggerTestService.java
@@ -469,7 +469,7 @@
}
}
- // Create a few dummy models if we didn't load anything.
+ // Create a few placeholder models if we didn't load anything.
if (!loadedModel) {
Properties dummyModelProperties = new Properties();
for (String name : new String[]{"1", "2", "3"}) {
diff --git a/tests/WindowInsetsTests/src/com/google/android/test/windowinsetstests/ChatActivity.java b/tests/WindowInsetsTests/src/com/google/android/test/windowinsetstests/ChatActivity.java
index ba12acb..2b605c5 100644
--- a/tests/WindowInsetsTests/src/com/google/android/test/windowinsetstests/ChatActivity.java
+++ b/tests/WindowInsetsTests/src/com/google/android/test/windowinsetstests/ChatActivity.java
@@ -18,6 +18,7 @@
import static android.view.WindowInsets.Type.ime;
import static android.view.WindowInsetsAnimation.Callback.DISPATCH_MODE_STOP;
+
import static java.lang.Math.max;
import static java.lang.Math.min;
@@ -41,11 +42,11 @@
import android.view.animation.LinearInterpolator;
import android.widget.LinearLayout;
+import androidx.appcompat.app.AppCompatActivity;
+
import java.util.ArrayList;
import java.util.List;
-import androidx.appcompat.app.AppCompatActivity;
-
public class ChatActivity extends AppCompatActivity {
private View mRoot;
@@ -148,7 +149,7 @@
inset = min(inset, shown);
mAnimationController.setInsetsAndAlpha(
Insets.of(0, 0, 0, inset),
- 1f, (inset - start) / (float)(end - start));
+ 1f, start == end ? 1f : (inset - start) / (float) (end - start));
}
});
diff --git a/tests/libs-permissions/system_ext/java/com/android/test/libs/system_ext/LibsSystemExtTest.java b/tests/libs-permissions/system_ext/java/com/android/test/libs/system_ext/LibsSystemExtTest.java
index 9999aba..673c73a 100644
--- a/tests/libs-permissions/system_ext/java/com/android/test/libs/system_ext/LibsSystemExtTest.java
+++ b/tests/libs-permissions/system_ext/java/com/android/test/libs/system_ext/LibsSystemExtTest.java
@@ -22,7 +22,7 @@
public class LibsSystemExtTest {
/**
- * Dummy method for testing.
+ * Placeholder method for testing.
*/
public static void test() {
}
diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp
index 899d268..b94d14f 100644
--- a/tools/aapt/AaptAssets.cpp
+++ b/tools/aapt/AaptAssets.cpp
@@ -219,7 +219,7 @@
if (numTags >= 1) {
const String8& lang = parts[0];
if (isAlpha(lang) && (lang.length() == 2 || lang.length() == 3)) {
- setLanguage(lang.string());
+ setLanguage(lang.c_str());
valid = true;
}
}
@@ -232,11 +232,11 @@
const String8& part2 = parts[1];
if ((part2.length() == 2 && isAlpha(part2)) ||
(part2.length() == 3 && isNumber(part2))) {
- setRegion(part2.string());
+ setRegion(part2.c_str());
} else if (part2.length() == 4 && isAlpha(part2)) {
- setScript(part2.string());
+ setScript(part2.c_str());
} else if (part2.length() >= 4 && part2.length() <= 8) {
- setVariant(part2.string());
+ setVariant(part2.c_str());
} else {
valid = false;
}
@@ -249,9 +249,9 @@
const String8& part3 = parts[2];
if (((part3.length() == 2 && isAlpha(part3)) ||
(part3.length() == 3 && isNumber(part3))) && script[0]) {
- setRegion(part3.string());
+ setRegion(part3.c_str());
} else if (part3.length() >= 4 && part3.length() <= 8) {
- setVariant(part3.string());
+ setVariant(part3.c_str());
} else {
valid = false;
}
@@ -262,7 +262,7 @@
const String8& part4 = parts[3];
if (part4.length() >= 4 && part4.length() <= 8) {
- setVariant(part4.string());
+ setVariant(part4.c_str());
} else {
valid = false;
}
@@ -310,7 +310,7 @@
break;
default:
fprintf(stderr, "ERROR: Invalid BCP 47 tag in directory name %s\n",
- part.string());
+ part.c_str());
return -1;
}
} else if (subtags.size() == 3) {
@@ -324,7 +324,7 @@
} else if (subtags[1].size() == 2 || subtags[1].size() == 3) {
setRegion(subtags[1]);
} else {
- fprintf(stderr, "ERROR: Invalid BCP 47 tag in directory name %s\n", part.string());
+ fprintf(stderr, "ERROR: Invalid BCP 47 tag in directory name %s\n", part.c_str());
return -1;
}
@@ -341,14 +341,14 @@
setRegion(subtags[2]);
setVariant(subtags[3]);
} else {
- fprintf(stderr, "ERROR: Invalid BCP 47 tag in directory name: %s\n", part.string());
+ fprintf(stderr, "ERROR: Invalid BCP 47 tag in directory name: %s\n", part.c_str());
return -1;
}
return ++currentIndex;
} else {
if ((part.length() == 2 || part.length() == 3)
- && isAlpha(part) && strcmp("car", part.string())) {
+ && isAlpha(part) && strcmp("car", part.c_str())) {
setLanguage(part);
if (++currentIndex == size) {
return size;
@@ -358,8 +358,8 @@
}
part = parts[currentIndex];
- if (part.string()[0] == 'r' && part.length() == 3) {
- setRegion(part.string() + 1);
+ if (part.c_str()[0] == 'r' && part.length() == 3) {
+ setRegion(part.c_str() + 1);
if (++currentIndex == size) {
return size;
}
@@ -524,8 +524,8 @@
ssize_t index = mFiles.indexOfKey(file->getGroupEntry());
if (index >= 0 && overwriteDuplicate) {
fprintf(stderr, "warning: overwriting '%s' with '%s'\n",
- mFiles[index]->getSourceFile().string(),
- file->getSourceFile().string());
+ mFiles[index]->getSourceFile().c_str(),
+ file->getSourceFile().c_str());
removeFile(index);
index = -1;
}
@@ -545,7 +545,7 @@
const sp<AaptFile>& originalFile = mFiles.valueAt(index);
SourcePos(file->getSourceFile(), -1)
.error("Duplicate file.\n%s: Original is here. %s",
- originalFile->getPrintableSource().string(),
+ originalFile->getPrintableSource().c_str(),
(withoutVersion.version != 0) ? "The version qualifier may be implied." : "");
return UNKNOWN_ERROR;
}
@@ -557,21 +557,21 @@
void AaptGroup::print(const String8& prefix) const
{
- printf("%s%s\n", prefix.string(), getPath().string());
+ printf("%s%s\n", prefix.c_str(), getPath().c_str());
const size_t N=mFiles.size();
size_t i;
for (i=0; i<N; i++) {
sp<AaptFile> file = mFiles.valueAt(i);
const AaptGroupEntry& e = file->getGroupEntry();
if (file->hasData()) {
- printf("%s Gen: (%s) %d bytes\n", prefix.string(), e.toDirName(String8()).string(),
+ printf("%s Gen: (%s) %d bytes\n", prefix.c_str(), e.toDirName(String8()).c_str(),
(int)file->getSize());
} else {
- printf("%s Src: (%s) %s\n", prefix.string(), e.toDirName(String8()).string(),
- file->getPrintableSource().string());
+ printf("%s Src: (%s) %s\n", prefix.c_str(), e.toDirName(String8()).c_str(),
+ file->getPrintableSource().c_str());
}
- //printf("%s File Group Entry: %s\n", prefix.string(),
- // file->getGroupEntry().toDirName(String8()).string());
+ //printf("%s File Group Entry: %s\n", prefix.c_str(),
+ // file->getGroupEntry().toDirName(String8()).c_str());
}
}
@@ -660,9 +660,9 @@
{
DIR* dir = NULL;
- dir = opendir(srcDir.string());
+ dir = opendir(srcDir.c_str());
if (dir == NULL) {
- fprintf(stderr, "ERROR: opendir(%s): %s\n", srcDir.string(), strerror(errno));
+ fprintf(stderr, "ERROR: opendir(%s): %s\n", srcDir.c_str(), strerror(errno));
return UNKNOWN_ERROR;
}
@@ -676,7 +676,7 @@
if (entry == NULL)
break;
- if (isHidden(srcDir.string(), entry->d_name))
+ if (isHidden(srcDir.c_str(), entry->d_name))
continue;
String8 name(entry->d_name);
@@ -701,8 +701,8 @@
String8 pathName(srcDir);
FileType type;
- pathName.appendPath(fileNames[i].string());
- type = getFileType(pathName.string());
+ pathName.appendPath(fileNames[i].c_str());
+ type = getFileType(pathName.c_str());
if (type == kFileTypeDirectory) {
sp<AaptDir> subdir;
bool notAdded = false;
@@ -732,7 +732,7 @@
} else {
if (bundle->getVerbose())
- printf(" (ignoring non-file/dir '%s')\n", pathName.string());
+ printf(" (ignoring non-file/dir '%s')\n", pathName.c_str());
}
}
@@ -745,7 +745,7 @@
const size_t ND = mDirs.size();
size_t i;
for (i = 0; i < NF; i++) {
- if (!validateFileName(mFiles.valueAt(i)->getLeaf().string())) {
+ if (!validateFileName(mFiles.valueAt(i)->getLeaf().c_str())) {
SourcePos(mFiles.valueAt(i)->getPrintableSource(), -1).error(
"Invalid filename. Unable to add.");
return UNKNOWN_ERROR;
@@ -753,11 +753,11 @@
size_t j;
for (j = i+1; j < NF; j++) {
- if (strcasecmp(mFiles.valueAt(i)->getLeaf().string(),
- mFiles.valueAt(j)->getLeaf().string()) == 0) {
+ if (strcasecmp(mFiles.valueAt(i)->getLeaf().c_str(),
+ mFiles.valueAt(j)->getLeaf().c_str()) == 0) {
SourcePos(mFiles.valueAt(i)->getPrintableSource(), -1).error(
"File is case-insensitive equivalent to: %s",
- mFiles.valueAt(j)->getPrintableSource().string());
+ mFiles.valueAt(j)->getPrintableSource().c_str());
return UNKNOWN_ERROR;
}
@@ -766,18 +766,18 @@
}
for (j = 0; j < ND; j++) {
- if (strcasecmp(mFiles.valueAt(i)->getLeaf().string(),
- mDirs.valueAt(j)->getLeaf().string()) == 0) {
+ if (strcasecmp(mFiles.valueAt(i)->getLeaf().c_str(),
+ mDirs.valueAt(j)->getLeaf().c_str()) == 0) {
SourcePos(mFiles.valueAt(i)->getPrintableSource(), -1).error(
"File conflicts with dir from: %s",
- mDirs.valueAt(j)->getPrintableSource().string());
+ mDirs.valueAt(j)->getPrintableSource().c_str());
return UNKNOWN_ERROR;
}
}
}
for (i = 0; i < ND; i++) {
- if (!validateFileName(mDirs.valueAt(i)->getLeaf().string())) {
+ if (!validateFileName(mDirs.valueAt(i)->getLeaf().c_str())) {
SourcePos(mDirs.valueAt(i)->getPrintableSource(), -1).error(
"Invalid directory name, unable to add.");
return UNKNOWN_ERROR;
@@ -785,11 +785,11 @@
size_t j;
for (j = i+1; j < ND; j++) {
- if (strcasecmp(mDirs.valueAt(i)->getLeaf().string(),
- mDirs.valueAt(j)->getLeaf().string()) == 0) {
+ if (strcasecmp(mDirs.valueAt(i)->getLeaf().c_str(),
+ mDirs.valueAt(j)->getLeaf().c_str()) == 0) {
SourcePos(mDirs.valueAt(i)->getPrintableSource(), -1).error(
"Directory is case-insensitive equivalent to: %s",
- mDirs.valueAt(j)->getPrintableSource().string());
+ mDirs.valueAt(j)->getPrintableSource().c_str());
return UNKNOWN_ERROR;
}
}
@@ -846,12 +846,12 @@
const AaptSymbolEntry& entry = javaSymbols->mSymbols.valueAt(i);
ssize_t pos = mSymbols.indexOfKey(name);
if (pos < 0) {
- entry.sourcePos.error("Symbol '%s' declared with <java-symbol> not defined\n", name.string());
+ entry.sourcePos.error("Symbol '%s' declared with <java-symbol> not defined\n", name.c_str());
err = UNKNOWN_ERROR;
continue;
}
//printf("**** setting symbol #%d/%d %s to isJavaSymbol=%d\n",
- // i, N, name.string(), entry.isJavaSymbol ? 1 : 0);
+ // i, N, name.c_str(), entry.isJavaSymbol ? 1 : 0);
mSymbols.editValueAt(pos).isJavaSymbol = entry.isJavaSymbol;
}
@@ -862,11 +862,11 @@
ssize_t pos = mNestedSymbols.indexOfKey(name);
if (pos < 0) {
SourcePos pos;
- pos.error("Java symbol dir %s not defined\n", name.string());
+ pos.error("Java symbol dir %s not defined\n", name.c_str());
err = UNKNOWN_ERROR;
continue;
}
- //printf("**** applying java symbols in dir %s\n", name.string());
+ //printf("**** applying java symbols in dir %s\n", name.c_str());
status_t myerr = mNestedSymbols.valueAt(pos)->applyJavaSymbols(symbols);
if (myerr != NO_ERROR) {
err = myerr;
@@ -1131,9 +1131,9 @@
{
ssize_t err = 0;
- DIR* dir = opendir(srcDir.string());
+ DIR* dir = opendir(srcDir.c_str());
if (dir == NULL) {
- fprintf(stderr, "ERROR: opendir(%s): %s\n", srcDir.string(), strerror(errno));
+ fprintf(stderr, "ERROR: opendir(%s): %s\n", srcDir.c_str(), strerror(errno));
return UNKNOWN_ERROR;
}
@@ -1149,7 +1149,7 @@
break;
}
- if (isHidden(srcDir.string(), entry->d_name)) {
+ if (isHidden(srcDir.c_str(), entry->d_name)) {
continue;
}
@@ -1160,7 +1160,7 @@
String8 resType;
bool b = group.initFromDirName(entry->d_name, &resType);
if (!b) {
- fprintf(stderr, "invalid resource directory name: %s %s\n", srcDir.string(),
+ fprintf(stderr, "invalid resource directory name: %s %s\n", srcDir.c_str(),
entry->d_name);
err = -1;
continue;
@@ -1168,7 +1168,7 @@
if (bundle->getMaxResVersion() != NULL && group.getVersionString().length() != 0) {
int maxResInt = atoi(bundle->getMaxResVersion());
- const char *verString = group.getVersionString().string();
+ const char *verString = group.getVersionString().c_str();
int dirVersionInt = atoi(verString + 1); // skip 'v' in version name
if (dirVersionInt > maxResInt) {
fprintf(stderr, "max res %d, skipping %s\n", maxResInt, entry->d_name);
@@ -1176,7 +1176,7 @@
}
}
- FileType type = getFileType(subdirName.string());
+ FileType type = getFileType(subdirName.c_str());
if (type == kFileTypeDirectory) {
sp<AaptDir> dir = makeDir(resType);
@@ -1200,7 +1200,7 @@
}
} else {
if (bundle->getVerbose()) {
- fprintf(stderr, " (ignoring file '%s')\n", subdirName.string());
+ fprintf(stderr, " (ignoring file '%s')\n", subdirName.c_str());
}
}
}
@@ -1248,7 +1248,7 @@
String8 remain;
if (entryName.walkPath(&remain) == kResourceDir) {
// these are the resources, pull their type out of the directory name
- kind.initFromDirName(remain.walkPath().string(), &resType);
+ kind.initFromDirName(remain.walkPath().c_str(), &resType);
} else {
// these are untyped and don't have an AaptGroupEntry
}
@@ -1263,7 +1263,7 @@
sp<AaptFile> file = new AaptFile(entryName, kind, resType);
status_t err = dir->addLeafFile(entryName.getPathLeaf(), file);
if (err != NO_ERROR) {
- fprintf(stderr, "err=%s entryName=%s\n", strerror(err), entryName.string());
+ fprintf(stderr, "err=%s entryName=%s\n", strerror(err), entryName.c_str());
count = err;
goto bail;
}
@@ -1273,7 +1273,7 @@
if (entryName == "AndroidManifest.xml") {
printf("AndroidManifest.xml\n");
}
- printf("\n\nfile: %s\n", entryName.string());
+ printf("\n\nfile: %s\n", entryName.c_str());
#endif
size_t len = entry->getUncompressedLen();
@@ -1317,9 +1317,9 @@
uint32_t preferredDensity = 0;
if (bundle->getPreferredDensity().size() > 0) {
ResTable_config preferredConfig;
- if (!AaptConfig::parseDensity(bundle->getPreferredDensity().string(), &preferredConfig)) {
+ if (!AaptConfig::parseDensity(bundle->getPreferredDensity().c_str(), &preferredConfig)) {
fprintf(stderr, "Error parsing preferred density: %s\n",
- bundle->getPreferredDensity().string());
+ bundle->getPreferredDensity().c_str());
return UNKNOWN_ERROR;
}
preferredDensity = preferredConfig.density;
@@ -1332,11 +1332,11 @@
if (bundle->getVerbose()) {
if (!reqFilter->isEmpty()) {
printf("Applying required filter: %s\n",
- bundle->getConfigurations().string());
+ bundle->getConfigurations().c_str());
}
if (preferredDensity > 0) {
printf("Applying preferred density filter: %s\n",
- bundle->getPreferredDensity().string());
+ bundle->getPreferredDensity().c_str());
}
}
@@ -1385,7 +1385,7 @@
if (!reqFilter->match(config)) {
if (bundle->getVerbose()) {
printf("Pruning unneeded resource: %s\n",
- file->getPrintableSource().string());
+ file->getPrintableSource().c_str());
}
grp->removeFile(k);
k--;
@@ -1453,7 +1453,7 @@
if (bestDensity != config.density) {
if (bundle->getVerbose()) {
printf("Pruning unneeded resource: %s\n",
- file->getPrintableSource().string());
+ file->getPrintableSource().c_str());
}
grp->removeFile(k);
k--;
@@ -1495,10 +1495,10 @@
ssize_t pos = mSymbols.indexOfKey(name);
if (pos < 0) {
SourcePos pos;
- pos.error("Java symbol dir %s not defined\n", name.string());
+ pos.error("Java symbol dir %s not defined\n", name.c_str());
return UNKNOWN_ERROR;
}
- //printf("**** applying java symbols in dir %s\n", name.string());
+ //printf("**** applying java symbols in dir %s\n", name.c_str());
status_t err = mSymbols.valueAt(pos)->applyJavaSymbols(symbols);
if (err != NO_ERROR) {
return err;
@@ -1510,7 +1510,7 @@
bool AaptAssets::isJavaSymbol(const AaptSymbolEntry& sym, bool includePrivate) const {
//printf("isJavaSymbol %s: public=%d, includePrivate=%d, isJavaSymbol=%d\n",
- // sym.name.string(), sym.isPublic ? 1 : 0, includePrivate ? 1 : 0,
+ // sym.name.c_str(), sym.isPublic ? 1 : 0, includePrivate ? 1 : 0,
// sym.isJavaSymbol ? 1 : 0);
if (!mHavePrivateSymbols) return true;
if (sym.isPublic) return true;
@@ -1529,12 +1529,12 @@
const size_t packageIncludeCount = includes.size();
for (size_t i = 0; i < packageIncludeCount; i++) {
if (bundle->getVerbose()) {
- printf("Including resources from package: %s\n", includes[i].string());
+ printf("Including resources from package: %s\n", includes[i].c_str());
}
if (!mIncludedAssets.addAssetPath(includes[i], NULL)) {
fprintf(stderr, "ERROR: Asset package include '%s' not found.\n",
- includes[i].string());
+ includes[i].c_str());
return UNKNOWN_ERROR;
}
}
@@ -1543,12 +1543,12 @@
if (!featureOfBase.isEmpty()) {
if (bundle->getVerbose()) {
printf("Including base feature resources from package: %s\n",
- featureOfBase.string());
+ featureOfBase.c_str());
}
if (!mIncludedAssets.addAssetPath(featureOfBase, NULL)) {
fprintf(stderr, "ERROR: base feature package '%s' not found.\n",
- featureOfBase.string());
+ featureOfBase.c_str());
return UNKNOWN_ERROR;
}
}
@@ -1581,23 +1581,23 @@
innerPrefix.append(" ");
String8 innerInnerPrefix(innerPrefix);
innerInnerPrefix.append(" ");
- printf("%sConfigurations:\n", prefix.string());
+ printf("%sConfigurations:\n", prefix.c_str());
const size_t N=mGroupEntries.size();
for (size_t i=0; i<N; i++) {
String8 cname = mGroupEntries.itemAt(i).toDirName(String8());
- printf("%s %s\n", prefix.string(),
- cname != "" ? cname.string() : "(default)");
+ printf("%s %s\n", prefix.c_str(),
+ cname != "" ? cname.c_str() : "(default)");
}
- printf("\n%sFiles:\n", prefix.string());
+ printf("\n%sFiles:\n", prefix.c_str());
AaptDir::print(innerPrefix);
- printf("\n%sResource Dirs:\n", prefix.string());
+ printf("\n%sResource Dirs:\n", prefix.c_str());
const Vector<sp<AaptDir> >& resdirs = mResDirs;
const size_t NR = resdirs.size();
for (size_t i=0; i<NR; i++) {
const sp<AaptDir>& d = resdirs.itemAt(i);
- printf("%s Type %s\n", prefix.string(), d->getLeaf().string());
+ printf("%s Type %s\n", prefix.c_str(), d->getLeaf().c_str());
d->print(innerInnerPrefix);
}
}
@@ -1631,7 +1631,7 @@
NULL
};
const char*const* k = KEYWORDS;
- const char*const s = symbol.string();
+ const char*const s = symbol.c_str();
while (*k) {
if (0 == strcmp(s, *k)) {
return false;
diff --git a/tools/aapt/AaptAssets.h b/tools/aapt/AaptAssets.h
index eadd48a..498fc4e 100644
--- a/tools/aapt/AaptAssets.h
+++ b/tools/aapt/AaptAssets.h
@@ -463,7 +463,7 @@
if (valid_symbol_name(symbol)) {
return true;
}
- pos.error("invalid %s: '%s'\n", label, symbol.string());
+ pos.error("invalid %s: '%s'\n", label, symbol.c_str());
return false;
}
AaptSymbolEntry& edit_symbol(const String8& symbol, const SourcePos* pos) {
diff --git a/tools/aapt/AaptConfig.cpp b/tools/aapt/AaptConfig.cpp
index 0aca45e..7578f79 100644
--- a/tools/aapt/AaptConfig.cpp
+++ b/tools/aapt/AaptConfig.cpp
@@ -39,7 +39,7 @@
ssize_t index = 0;
ssize_t localeIndex = 0;
const ssize_t N = parts.size();
- const char* part = parts[index].string();
+ const char* part = parts[index].c_str();
if (str.length() == 0) {
goto success;
@@ -50,7 +50,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseMnc(part, &config)) {
@@ -58,7 +58,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
// Locale spans a few '-' separators, so we let it
@@ -72,7 +72,7 @@
if (index >= N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseLayoutDirection(part, &config)) {
@@ -80,7 +80,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseSmallestScreenWidthDp(part, &config)) {
@@ -88,7 +88,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseScreenWidthDp(part, &config)) {
@@ -96,7 +96,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseScreenHeightDp(part, &config)) {
@@ -104,7 +104,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseScreenLayoutSize(part, &config)) {
@@ -112,7 +112,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseScreenLayoutLong(part, &config)) {
@@ -120,7 +120,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseScreenRound(part, &config)) {
@@ -128,7 +128,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseWideColorGamut(part, &config)) {
@@ -136,7 +136,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseHdr(part, &config)) {
@@ -144,7 +144,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseOrientation(part, &config)) {
@@ -152,7 +152,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseUiModeType(part, &config)) {
@@ -160,7 +160,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseUiModeNight(part, &config)) {
@@ -168,7 +168,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseDensity(part, &config)) {
@@ -176,7 +176,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseTouchscreen(part, &config)) {
@@ -184,7 +184,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseKeysHidden(part, &config)) {
@@ -192,7 +192,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseKeyboard(part, &config)) {
@@ -200,7 +200,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseNavHidden(part, &config)) {
@@ -208,7 +208,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseNavigation(part, &config)) {
@@ -216,7 +216,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseScreenSize(part, &config)) {
@@ -224,7 +224,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
if (parseVersion(part, &config)) {
@@ -232,7 +232,7 @@
if (index == N) {
goto success;
}
- part = parts[index].string();
+ part = parts[index].c_str();
}
// Unrecognized.
@@ -773,8 +773,8 @@
if (y == name || *y != 0) return false;
String8 yName(x, y-x);
- uint16_t w = (uint16_t)atoi(xName.string());
- uint16_t h = (uint16_t)atoi(yName.string());
+ uint16_t w = (uint16_t)atoi(xName.c_str());
+ uint16_t h = (uint16_t)atoi(yName.c_str());
if (w < h) {
return false;
}
@@ -805,7 +805,7 @@
String8 xName(name, x-name);
if (out) {
- out->smallestScreenWidthDp = (uint16_t)atoi(xName.string());
+ out->smallestScreenWidthDp = (uint16_t)atoi(xName.c_str());
}
return true;
@@ -827,7 +827,7 @@
String8 xName(name, x-name);
if (out) {
- out->screenWidthDp = (uint16_t)atoi(xName.string());
+ out->screenWidthDp = (uint16_t)atoi(xName.c_str());
}
return true;
@@ -849,7 +849,7 @@
String8 xName(name, x-name);
if (out) {
- out->screenHeightDp = (uint16_t)atoi(xName.string());
+ out->screenHeightDp = (uint16_t)atoi(xName.c_str());
}
return true;
@@ -875,7 +875,7 @@
String8 sdkName(name, s-name);
if (out) {
- out->sdkVersion = (uint16_t)atoi(sdkName.string());
+ out->sdkVersion = (uint16_t)atoi(sdkName.c_str());
out->minorVersion = 0;
}
diff --git a/tools/aapt/AaptUtil.cpp b/tools/aapt/AaptUtil.cpp
index 293e144..e82860d 100644
--- a/tools/aapt/AaptUtil.cpp
+++ b/tools/aapt/AaptUtil.cpp
@@ -23,7 +23,7 @@
Vector<String8> split(const String8& str, const char sep) {
Vector<String8> parts;
- const char* p = str.string();
+ const char* p = str.c_str();
const char* q;
while (true) {
@@ -41,7 +41,7 @@
Vector<String8> splitAndLowerCase(const String8& str, const char sep) {
Vector<String8> parts;
- const char* p = str.string();
+ const char* p = str.c_str();
const char* q;
while (true) {
diff --git a/tools/aapt/ApkBuilder.cpp b/tools/aapt/ApkBuilder.cpp
index 01e02e2..335c43b 100644
--- a/tools/aapt/ApkBuilder.cpp
+++ b/tools/aapt/ApkBuilder.cpp
@@ -36,7 +36,7 @@
if (splitConfigs.count(*iter) > 0) {
// Can't have overlapping configurations.
fprintf(stderr, "ERROR: Split configuration '%s' is already defined "
- "in another split.\n", iter->toString().string());
+ "in another split.\n", iter->toString().c_str());
return ALREADY_EXISTS;
}
}
@@ -115,10 +115,10 @@
}
void ApkSplit::print() const {
- fprintf(stderr, "APK Split '%s'\n", mName.string());
+ fprintf(stderr, "APK Split '%s'\n", mName.c_str());
std::set<OutputEntry>::const_iterator iter = mFiles.begin();
for (; iter != mFiles.end(); iter++) {
- fprintf(stderr, " %s (%s)\n", iter->getPath().string(), iter->getFile()->getSourceFile().string());
+ fprintf(stderr, " %s (%s)\n", iter->getPath().c_str(), iter->getFile()->getSourceFile().c_str());
}
}
diff --git a/tools/aapt/CacheUpdater.h b/tools/aapt/CacheUpdater.h
index 6fa96d6..2dc143c 100644
--- a/tools/aapt/CacheUpdater.h
+++ b/tools/aapt/CacheUpdater.h
@@ -66,7 +66,7 @@
// Check optomistically to see if all directories exist.
// If something in the path doesn't exist, then walk the path backwards
// and find the place to start creating directories forward.
- if (stat(path.string(),&s) == -1) {
+ if (stat(path.c_str(),&s) == -1) {
// Walk backwards to find place to start creating directories
existsPath = path;
do {
@@ -74,7 +74,7 @@
// the string of paths to create.
toCreate = existsPath.getPathLeaf().appendPath(toCreate);
existsPath = existsPath.getPathDir();
- } while (stat(existsPath.string(),&s) == -1);
+ } while (stat(existsPath.c_str(),&s) == -1);
// Walk forwards and build directories as we go
do {
@@ -82,9 +82,9 @@
existsPath.appendPath(toCreate.walkPath(&remains));
toCreate = remains;
#ifdef _WIN32
- _mkdir(existsPath.string());
+ _mkdir(existsPath.c_str());
#else
- mkdir(existsPath.string(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
+ mkdir(existsPath.c_str(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
#endif
} while (remains.length() > 0);
} //if
@@ -93,8 +93,8 @@
// Delete a file
virtual void deleteFile(String8 path)
{
- if (remove(path.string()) != 0)
- fprintf(stderr,"ERROR DELETING %s\n",path.string());
+ if (remove(path.c_str()) != 0)
+ fprintf(stderr,"ERROR DELETING %s\n",path.c_str());
};
// Process an image from source out to dest
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index d02fd83..5a06b10 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -240,13 +240,13 @@
}
if (value.dataType == Res_value::TYPE_STRING) {
String8 result = AaptXml::getResolvedAttribute(resTable, tree, attrRes, outError);
- printf("%s='%s'", attrLabel.string(),
- ResTable::normalizeForOutput(result.string()).string());
+ printf("%s='%s'", attrLabel.c_str(),
+ ResTable::normalizeForOutput(result.c_str()).c_str());
} else if (Res_value::TYPE_FIRST_INT <= value.dataType &&
value.dataType <= Res_value::TYPE_LAST_INT) {
- printf("%s='%d'", attrLabel.string(), value.data);
+ printf("%s='%d'", attrLabel.c_str(), value.data);
} else {
- printf("%s='0x%x'", attrLabel.string(), (int)value.data);
+ printf("%s='0x%x'", attrLabel.c_str(), (int)value.data);
}
}
@@ -353,23 +353,23 @@
}
static void printUsesPermission(const String8& name, bool optional=false, int maxSdkVersion=-1,
- const String8& requiredFeature = String8::empty(),
- const String8& requiredNotFeature = String8::empty()) {
- printf("uses-permission: name='%s'", ResTable::normalizeForOutput(name.string()).string());
+ const String8& requiredFeature = String8(),
+ const String8& requiredNotFeature = String8()) {
+ printf("uses-permission: name='%s'", ResTable::normalizeForOutput(name.c_str()).c_str());
if (maxSdkVersion != -1) {
printf(" maxSdkVersion='%d'", maxSdkVersion);
}
if (requiredFeature.length() > 0) {
- printf(" requiredFeature='%s'", requiredFeature.string());
+ printf(" requiredFeature='%s'", requiredFeature.c_str());
}
if (requiredNotFeature.length() > 0) {
- printf(" requiredNotFeature='%s'", requiredNotFeature.string());
+ printf(" requiredNotFeature='%s'", requiredNotFeature.c_str());
}
printf("\n");
if (optional) {
printf("optional-permission: name='%s'",
- ResTable::normalizeForOutput(name.string()).string());
+ ResTable::normalizeForOutput(name.c_str()).c_str());
if (maxSdkVersion != -1) {
printf(" maxSdkVersion='%d'", maxSdkVersion);
}
@@ -380,7 +380,7 @@
static void printUsesPermissionSdk23(const String8& name, int maxSdkVersion=-1) {
printf("uses-permission-sdk-23: ");
- printf("name='%s'", ResTable::normalizeForOutput(name.string()).string());
+ printf("name='%s'", ResTable::normalizeForOutput(name.c_str()).c_str());
if (maxSdkVersion != -1) {
printf(" maxSdkVersion='%d'", maxSdkVersion);
}
@@ -390,11 +390,11 @@
static void printUsesImpliedPermission(const String8& name, const String8& reason,
const int32_t maxSdkVersion = -1) {
printf("uses-implied-permission: name='%s'",
- ResTable::normalizeForOutput(name.string()).string());
+ ResTable::normalizeForOutput(name.c_str()).c_str());
if (maxSdkVersion != -1) {
printf(" maxSdkVersion='%d'", maxSdkVersion);
}
- printf(" reason='%s'\n", ResTable::normalizeForOutput(reason.string()).string());
+ printf(" reason='%s'\n", ResTable::normalizeForOutput(reason.c_str()).c_str());
}
Vector<String8> getNfcAidCategories(AssetManager& assets, const String8& xmlPath, bool offHost,
@@ -556,7 +556,7 @@
static void printFeatureGroupImpl(const FeatureGroup& grp,
const KeyedVector<String8, ImpliedFeature>* impliedFeatures) {
- printf("feature-group: label='%s'\n", grp.label.string());
+ printf("feature-group: label='%s'\n", grp.label.c_str());
if (grp.openGLESVersion > 0) {
printf(" uses-gl-es: '0x%x'\n", grp.openGLESVersion);
@@ -570,7 +570,7 @@
const String8& featureName = grp.features.keyAt(i);
printf(" uses-feature%s: name='%s'", (required ? "" : "-not-required"),
- ResTable::normalizeForOutput(featureName.string()).string());
+ ResTable::normalizeForOutput(featureName.c_str()).c_str());
if (version > 0) {
printf(" version='%d'", version);
@@ -589,15 +589,15 @@
}
String8 printableFeatureName(ResTable::normalizeForOutput(
- impliedFeature.name.string()));
+ impliedFeature.name.c_str()));
const char* sdk23Suffix = impliedFeature.impliedBySdk23 ? "-sdk-23" : "";
- printf(" uses-feature%s: name='%s'\n", sdk23Suffix, printableFeatureName.string());
+ printf(" uses-feature%s: name='%s'\n", sdk23Suffix, printableFeatureName.c_str());
printf(" uses-implied-feature%s: name='%s' reason='", sdk23Suffix,
- printableFeatureName.string());
+ printableFeatureName.c_str());
const size_t numReasons = impliedFeature.reasons.size();
for (size_t j = 0; j < numReasons; j++) {
- printf("%s", impliedFeature.reasons[j].string());
+ printf("%s", impliedFeature.reasons[j].c_str());
if (j + 2 < numReasons) {
printf(", ");
} else if (j + 1 < numReasons) {
@@ -649,43 +649,43 @@
bool impliedBySdk23Permission) {
if (name == "android.permission.CAMERA") {
addImpliedFeature(impliedFeatures, "android.hardware.camera",
- String8::format("requested %s permission", name.string()),
+ String8::format("requested %s permission", name.c_str()),
impliedBySdk23Permission);
} else if (name == "android.permission.ACCESS_FINE_LOCATION") {
if (targetSdk < SDK_LOLLIPOP) {
addImpliedFeature(impliedFeatures, "android.hardware.location.gps",
- String8::format("requested %s permission", name.string()),
+ String8::format("requested %s permission", name.c_str()),
impliedBySdk23Permission);
addImpliedFeature(impliedFeatures, "android.hardware.location.gps",
String8::format("targetSdkVersion < %d", SDK_LOLLIPOP),
impliedBySdk23Permission);
}
addImpliedFeature(impliedFeatures, "android.hardware.location",
- String8::format("requested %s permission", name.string()),
+ String8::format("requested %s permission", name.c_str()),
impliedBySdk23Permission);
} else if (name == "android.permission.ACCESS_COARSE_LOCATION") {
if (targetSdk < SDK_LOLLIPOP) {
addImpliedFeature(impliedFeatures, "android.hardware.location.network",
- String8::format("requested %s permission", name.string()),
+ String8::format("requested %s permission", name.c_str()),
impliedBySdk23Permission);
addImpliedFeature(impliedFeatures, "android.hardware.location.network",
String8::format("targetSdkVersion < %d", SDK_LOLLIPOP),
impliedBySdk23Permission);
}
addImpliedFeature(impliedFeatures, "android.hardware.location",
- String8::format("requested %s permission", name.string()),
+ String8::format("requested %s permission", name.c_str()),
impliedBySdk23Permission);
} else if (name == "android.permission.ACCESS_MOCK_LOCATION" ||
name == "android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" ||
name == "android.permission.INSTALL_LOCATION_PROVIDER") {
addImpliedFeature(impliedFeatures, "android.hardware.location",
- String8::format("requested %s permission", name.string()),
+ String8::format("requested %s permission", name.c_str()),
impliedBySdk23Permission);
} else if (name == "android.permission.BLUETOOTH" ||
name == "android.permission.BLUETOOTH_ADMIN") {
if (targetSdk > SDK_DONUT) {
addImpliedFeature(impliedFeatures, "android.hardware.bluetooth",
- String8::format("requested %s permission", name.string()),
+ String8::format("requested %s permission", name.c_str()),
impliedBySdk23Permission);
addImpliedFeature(impliedFeatures, "android.hardware.bluetooth",
String8::format("targetSdkVersion > %d", SDK_DONUT),
@@ -693,13 +693,13 @@
}
} else if (name == "android.permission.RECORD_AUDIO") {
addImpliedFeature(impliedFeatures, "android.hardware.microphone",
- String8::format("requested %s permission", name.string()),
+ String8::format("requested %s permission", name.c_str()),
impliedBySdk23Permission);
} else if (name == "android.permission.ACCESS_WIFI_STATE" ||
name == "android.permission.CHANGE_WIFI_STATE" ||
name == "android.permission.CHANGE_WIFI_MULTICAST_STATE") {
addImpliedFeature(impliedFeatures, "android.hardware.wifi",
- String8::format("requested %s permission", name.string()),
+ String8::format("requested %s permission", name.c_str()),
impliedBySdk23Permission);
} else if (name == "android.permission.CALL_PHONE" ||
name == "android.permission.CALL_PRIVILEGED" ||
@@ -746,7 +746,7 @@
for (size_t i = 0; i < bundle->getPackageIncludes().size(); i++) {
const String8& assetPath = bundle->getPackageIncludes()[i];
if (!assets.addAssetPath(assetPath, NULL)) {
- fprintf(stderr, "ERROR: included asset path %s could not be loaded\n", assetPath.string());
+ fprintf(stderr, "ERROR: included asset path %s could not be loaded\n", assetPath.c_str());
return 1;
}
}
@@ -890,7 +890,7 @@
goto bail;
}
String8 tag(ctag16);
- //printf("Depth %d tag %s\n", depth, tag.string());
+ //printf("Depth %d tag %s\n", depth, tag.c_str());
if (depth == 1) {
if (tag != "manifest") {
SourcePos(manifestFile, tree.getLineNumber()).error(
@@ -898,14 +898,14 @@
goto bail;
}
String8 pkg = AaptXml::getAttribute(tree, NULL, "package", NULL);
- printf("package: %s\n", ResTable::normalizeForOutput(pkg.string()).string());
+ printf("package: %s\n", ResTable::normalizeForOutput(pkg.c_str()).c_str());
} else if (depth == 2) {
if (tag == "permission") {
String8 error;
String8 name = AaptXml::getAttribute(tree, NAME_ATTR, &error);
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'android:name': %s", error.string());
+ "ERROR getting 'android:name': %s", error.c_str());
goto bail;
}
@@ -915,13 +915,13 @@
goto bail;
}
printf("permission: %s\n",
- ResTable::normalizeForOutput(name.string()).string());
+ ResTable::normalizeForOutput(name.c_str()).c_str());
} else if (tag == "uses-permission") {
String8 error;
String8 name = AaptXml::getAttribute(tree, NAME_ATTR, &error);
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'android:name' attribute: %s", error.string());
+ "ERROR getting 'android:name' attribute: %s", error.c_str());
goto bail;
}
@@ -938,7 +938,7 @@
String8 name = AaptXml::getAttribute(tree, NAME_ATTR, &error);
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'android:name' attribute: %s", error.string());
+ "ERROR getting 'android:name' attribute: %s", error.c_str());
goto bail;
}
@@ -1138,7 +1138,7 @@
const size_t N = supportedInput.size();
for (size_t i=0; i<N; i++) {
printf("%s", ResTable::normalizeForOutput(
- supportedInput[i].string()).string());
+ supportedInput[i].c_str()).c_str());
if (i != N - 1) {
printf("' '");
} else {
@@ -1157,27 +1157,27 @@
printf("launchable-activity:");
if (aName.length() > 0) {
printf(" name='%s' ",
- ResTable::normalizeForOutput(aName.string()).string());
+ ResTable::normalizeForOutput(aName.c_str()).c_str());
}
printf(" label='%s' icon='%s'\n",
- ResTable::normalizeForOutput(activityLabel.string())
- .string(),
- ResTable::normalizeForOutput(activityIcon.string())
- .string());
+ ResTable::normalizeForOutput(activityLabel.c_str())
+ .c_str(),
+ ResTable::normalizeForOutput(activityIcon.c_str())
+ .c_str());
}
if (isLeanbackLauncherActivity) {
printf("leanback-launchable-activity:");
if (aName.length() > 0) {
printf(" name='%s' ",
- ResTable::normalizeForOutput(aName.string()).string());
+ ResTable::normalizeForOutput(aName.c_str()).c_str());
}
printf(" label='%s' icon='%s' banner='%s'\n",
- ResTable::normalizeForOutput(activityLabel.string())
- .string(),
- ResTable::normalizeForOutput(activityIcon.string())
- .string(),
- ResTable::normalizeForOutput(activityBanner.string())
- .string());
+ ResTable::normalizeForOutput(activityLabel.c_str())
+ .c_str(),
+ ResTable::normalizeForOutput(activityIcon.c_str())
+ .c_str(),
+ ResTable::normalizeForOutput(activityBanner.c_str())
+ .c_str());
}
}
if (!hasIntentFilter) {
@@ -1265,7 +1265,7 @@
goto bail;
}
String8 tag(ctag16);
- //printf("Depth %d, %s\n", depth, tag.string());
+ //printf("Depth %d, %s\n", depth, tag.c_str());
if (depth == 1) {
if (tag != "manifest") {
SourcePos(manifestFile, tree.getLineNumber()).error(
@@ -1274,13 +1274,13 @@
}
pkg = AaptXml::getAttribute(tree, NULL, "package", NULL);
printf("package: name='%s' ",
- ResTable::normalizeForOutput(pkg.string()).string());
+ ResTable::normalizeForOutput(pkg.c_str()).c_str());
int32_t versionCode = AaptXml::getIntegerAttribute(tree, VERSION_CODE_ATTR,
&error);
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:versionCode' attribute: %s",
- error.string());
+ error.c_str());
goto bail;
}
if (versionCode > 0) {
@@ -1293,16 +1293,16 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:versionName' attribute: %s",
- error.string());
+ error.c_str());
goto bail;
}
printf("versionName='%s'",
- ResTable::normalizeForOutput(versionName.string()).string());
+ ResTable::normalizeForOutput(versionName.c_str()).c_str());
String8 splitName = AaptXml::getAttribute(tree, NULL, "split");
if (!splitName.isEmpty()) {
printf(" split='%s'", ResTable::normalizeForOutput(
- splitName.string()).string());
+ splitName.c_str()).c_str());
}
// For 'platformBuildVersionName', using both string and int type as a fallback
@@ -1313,7 +1313,7 @@
AaptXml::getIntegerAttribute(tree, NULL, "platformBuildVersionName", 0,
NULL);
if (platformBuildVersionName != "") {
- printf(" platformBuildVersionName='%s'", platformBuildVersionName.string());
+ printf(" platformBuildVersionName='%s'", platformBuildVersionName.c_str());
} else if (platformBuildVersionNameInt > 0) {
printf(" platformBuildVersionName='%d'", platformBuildVersionNameInt);
}
@@ -1326,7 +1326,7 @@
AaptXml::getIntegerAttribute(tree, NULL, "platformBuildVersionCode", 0,
NULL);
if (platformBuildVersionCode != "") {
- printf(" platformBuildVersionCode='%s'", platformBuildVersionCode.string());
+ printf(" platformBuildVersionCode='%s'", platformBuildVersionCode.c_str());
} else if (platformBuildVersionCodeInt > 0) {
printf(" platformBuildVersionCode='%d'", platformBuildVersionCodeInt);
}
@@ -1336,7 +1336,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:compileSdkVersion' attribute: %s",
- error.string());
+ error.c_str());
goto bail;
}
if (compileSdkVersion > 0) {
@@ -1347,7 +1347,7 @@
COMPILE_SDK_VERSION_CODENAME_ATTR, &error);
if (compileSdkVersionCodename != "") {
printf(" compileSdkVersionCodename='%s'", ResTable::normalizeForOutput(
- compileSdkVersionCodename.string()).string());
+ compileSdkVersionCodename.c_str()).c_str());
}
printf("\n");
@@ -1357,7 +1357,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:installLocation' attribute: %s",
- error.string());
+ error.c_str());
goto bail;
}
@@ -1387,7 +1387,7 @@
String8 label;
const size_t NL = locales.size();
for (size_t i=0; i<NL; i++) {
- const char* localeStr = locales[i].string();
+ const char* localeStr = locales[i].c_str();
assets.setConfiguration(config, localeStr != NULL ? localeStr : "");
String8 llabel = AaptXml::getResolvedAttribute(res, tree, LABEL_ATTR,
&error);
@@ -1395,13 +1395,13 @@
if (localeStr == NULL || strlen(localeStr) == 0) {
label = llabel;
printf("application-label:'%s'\n",
- ResTable::normalizeForOutput(llabel.string()).string());
+ ResTable::normalizeForOutput(llabel.c_str()).c_str());
} else {
if (label == "") {
label = llabel;
}
printf("application-label-%s:'%s'\n", localeStr,
- ResTable::normalizeForOutput(llabel.string()).string());
+ ResTable::normalizeForOutput(llabel.c_str()).c_str());
}
}
}
@@ -1415,7 +1415,7 @@
&error);
if (icon != "") {
printf("application-icon-%d:'%s'\n", densities[i],
- ResTable::normalizeForOutput(icon.string()).string());
+ ResTable::normalizeForOutput(icon.c_str()).c_str());
}
}
assets.setConfiguration(config);
@@ -1423,7 +1423,7 @@
String8 icon = AaptXml::getResolvedAttribute(res, tree, ICON_ATTR, &error);
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'android:icon' attribute: %s", error.string());
+ "ERROR getting 'android:icon' attribute: %s", error.c_str());
goto bail;
}
int32_t testOnly = AaptXml::getIntegerAttribute(tree, TEST_ONLY_ATTR, 0,
@@ -1431,7 +1431,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:testOnly' attribute: %s",
- error.string());
+ error.c_str());
goto bail;
}
@@ -1439,15 +1439,15 @@
&error);
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'android:banner' attribute: %s", error.string());
+ "ERROR getting 'android:banner' attribute: %s", error.c_str());
goto bail;
}
printf("application: label='%s' ",
- ResTable::normalizeForOutput(label.string()).string());
- printf("icon='%s'", ResTable::normalizeForOutput(icon.string()).string());
+ ResTable::normalizeForOutput(label.c_str()).c_str());
+ printf("icon='%s'", ResTable::normalizeForOutput(icon.c_str()).c_str());
if (banner != "") {
printf(" banner='%s'",
- ResTable::normalizeForOutput(banner.string()).string());
+ ResTable::normalizeForOutput(banner.c_str()).c_str());
}
printf("\n");
if (testOnly != 0) {
@@ -1458,7 +1458,7 @@
ISGAME_ATTR, 0, &error);
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'android:isGame' attribute: %s", error.string());
+ "ERROR getting 'android:isGame' attribute: %s", error.c_str());
goto bail;
}
if (isGame != 0) {
@@ -1470,7 +1470,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:debuggable' attribute: %s",
- error.string());
+ error.c_str());
goto bail;
}
if (debuggable != 0) {
@@ -1500,12 +1500,12 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:minSdkVersion' attribute: %s",
- error.string());
+ error.c_str());
goto bail;
}
if (name == "Donut") targetSdk = SDK_DONUT;
printf("sdkVersion:'%s'\n",
- ResTable::normalizeForOutput(name.string()).string());
+ ResTable::normalizeForOutput(name.c_str()).c_str());
} else if (code != -1) {
targetSdk = code;
printf("sdkVersion:'%d'\n", code);
@@ -1522,7 +1522,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:targetSdkVersion' attribute: %s",
- error.string());
+ error.c_str());
goto bail;
}
if (name == "Donut" && targetSdk < SDK_DONUT) {
@@ -1532,7 +1532,7 @@
targetSdk = SDK_CUR_DEVELOPMENT;
}
printf("targetSdkVersion:'%s'\n",
- ResTable::normalizeForOutput(name.string()).string());
+ ResTable::normalizeForOutput(name.c_str()).c_str());
} else if (code != -1) {
if (targetSdk < code) {
targetSdk = code;
@@ -1592,7 +1592,7 @@
group.label = AaptXml::getResolvedAttribute(res, tree, LABEL_ATTR, &error);
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'android:label' attribute: %s", error.string());
+ "ERROR getting 'android:label' attribute: %s", error.c_str());
goto bail;
}
featureGroups.add(group);
@@ -1608,7 +1608,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"failed to read attribute 'android:required': %s",
- error.string());
+ error.c_str());
goto bail;
}
@@ -1617,7 +1617,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"failed to read attribute 'android:version': %s",
- error.string());
+ error.c_str());
goto bail;
}
@@ -1638,7 +1638,7 @@
String8 name = AaptXml::getAttribute(tree, NAME_ATTR, &error);
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'android:name' attribute: %s", error.string());
+ "ERROR getting 'android:name' attribute: %s", error.c_str());
goto bail;
}
@@ -1682,7 +1682,7 @@
String8 name = AaptXml::getAttribute(tree, NAME_ATTR, &error);
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'android:name' attribute: %s", error.string());
+ "ERROR getting 'android:name' attribute: %s", error.c_str());
goto bail;
}
@@ -1701,37 +1701,37 @@
String8 name = AaptXml::getAttribute(tree, NAME_ATTR, &error);
if (name != "" && error == "") {
printf("uses-package:'%s'\n",
- ResTable::normalizeForOutput(name.string()).string());
+ ResTable::normalizeForOutput(name.c_str()).c_str());
} else {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'android:name' attribute: %s", error.string());
+ "ERROR getting 'android:name' attribute: %s", error.c_str());
goto bail;
}
} else if (tag == "original-package") {
String8 name = AaptXml::getAttribute(tree, NAME_ATTR, &error);
if (name != "" && error == "") {
printf("original-package:'%s'\n",
- ResTable::normalizeForOutput(name.string()).string());
+ ResTable::normalizeForOutput(name.c_str()).c_str());
} else {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'android:name' attribute: %s", error.string());
+ "ERROR getting 'android:name' attribute: %s", error.c_str());
goto bail;
}
} else if (tag == "supports-gl-texture") {
String8 name = AaptXml::getAttribute(tree, NAME_ATTR, &error);
if (name != "" && error == "") {
printf("supports-gl-texture:'%s'\n",
- ResTable::normalizeForOutput(name.string()).string());
+ ResTable::normalizeForOutput(name.c_str()).c_str());
} else {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'android:name' attribute: %s", error.string());
+ "ERROR getting 'android:name' attribute: %s", error.c_str());
goto bail;
}
} else if (tag == "compatible-screens") {
printCompatibleScreens(tree, &error);
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting compatible screens: %s", error.string());
+ "ERROR getting compatible screens: %s", error.c_str());
goto bail;
}
depth--;
@@ -1742,8 +1742,8 @@
&error);
if (publicKey != "" && error == "") {
printf("package-verifier: name='%s' publicKey='%s'\n",
- ResTable::normalizeForOutput(name.string()).string(),
- ResTable::normalizeForOutput(publicKey.string()).string());
+ ResTable::normalizeForOutput(name.c_str()).c_str(),
+ ResTable::normalizeForOutput(publicKey.c_str()).c_str());
}
}
}
@@ -1769,7 +1769,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:name' attribute: %s",
- error.string());
+ error.c_str());
goto bail;
}
@@ -1778,7 +1778,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:label' attribute: %s",
- error.string());
+ error.c_str());
goto bail;
}
@@ -1787,7 +1787,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:icon' attribute: %s",
- error.string());
+ error.c_str());
goto bail;
}
@@ -1796,7 +1796,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:banner' attribute: %s",
- error.string());
+ error.c_str());
goto bail;
}
@@ -1824,14 +1824,14 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:name' attribute for uses-library"
- " %s", error.string());
+ " %s", error.c_str());
goto bail;
}
int req = AaptXml::getIntegerAttribute(tree,
REQUIRED_ATTR, 1);
printf("uses-library%s:'%s'\n",
req ? "" : "-not-required", ResTable::normalizeForOutput(
- libraryName.string()).string());
+ libraryName.c_str()).c_str());
} else if (tag == "receiver") {
withinReceiver = true;
receiverName = AaptXml::getAttribute(tree, NAME_ATTR, &error);
@@ -1839,7 +1839,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:name' attribute for receiver:"
- " %s", error.string());
+ " %s", error.c_str());
goto bail;
}
@@ -1853,7 +1853,7 @@
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:permission' attribute for"
" receiver '%s': %s",
- receiverName.string(), error.string());
+ receiverName.c_str(), error.c_str());
}
} else if (tag == "service") {
withinService = true;
@@ -1862,7 +1862,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:name' attribute for "
- "service:%s", error.string());
+ "service:%s", error.c_str());
goto bail;
}
@@ -1887,7 +1887,7 @@
} else {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:permission' attribute for "
- "service '%s': %s", serviceName.string(), error.string());
+ "service '%s': %s", serviceName.c_str(), error.c_str());
}
} else if (tag == "provider") {
withinProvider = true;
@@ -1897,7 +1897,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:exported' attribute for provider:"
- " %s", error.string());
+ " %s", error.c_str());
goto bail;
}
@@ -1906,7 +1906,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:grantUriPermissions' attribute for "
- "provider: %s", error.string());
+ "provider: %s", error.c_str());
goto bail;
}
@@ -1915,7 +1915,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:permission' attribute for "
- "provider: %s", error.string());
+ "provider: %s", error.c_str());
goto bail;
}
@@ -1928,11 +1928,11 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:name' attribute for "
- "meta-data: %s", error.string());
+ "meta-data: %s", error.c_str());
goto bail;
}
printf("meta-data: name='%s' ",
- ResTable::normalizeForOutput(metaDataName.string()).string());
+ ResTable::normalizeForOutput(metaDataName.c_str()).c_str());
printResolvedResourceAttribute(res, tree, VALUE_ATTR, String8("value"),
&error);
if (error != "") {
@@ -1944,7 +1944,7 @@
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:value' or "
"'android:resource' attribute for "
- "meta-data: %s", error.string());
+ "meta-data: %s", error.c_str());
goto bail;
}
}
@@ -1956,7 +1956,7 @@
} else {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:name' attribute: %s",
- error.string());
+ error.c_str());
goto bail;
}
}
@@ -1969,13 +1969,13 @@
Feature feature(true);
int32_t featureVers = AaptXml::getIntegerAttribute(
- tree, androidSchema.string(), "version", 0, &error);
+ tree, androidSchema.c_str(), "version", 0, &error);
if (error == "") {
feature.version = featureVers;
} else {
SourcePos(manifestFile, tree.getLineNumber()).error(
"failed to read attribute 'android:version': %s",
- error.string());
+ error.c_str());
goto bail;
}
@@ -2016,8 +2016,8 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:name' attribute for "
- "meta-data tag in service '%s': %s", serviceName.string(),
- error.string());
+ "meta-data tag in service '%s': %s", serviceName.c_str(),
+ error.c_str());
goto bail;
}
@@ -2034,7 +2034,7 @@
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting 'android:resource' attribute for "
"meta-data tag in service '%s': %s",
- serviceName.string(), error.string());
+ serviceName.c_str(), error.c_str());
goto bail;
}
@@ -2043,7 +2043,7 @@
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
"ERROR getting AID category for service '%s'",
- serviceName.string());
+ serviceName.c_str());
goto bail;
}
@@ -2064,7 +2064,7 @@
action = AaptXml::getAttribute(tree, NAME_ATTR, &error);
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'android:name' attribute: %s", error.string());
+ "ERROR getting 'android:name' attribute: %s", error.c_str());
goto bail;
}
@@ -2120,7 +2120,7 @@
String8 category = AaptXml::getAttribute(tree, NAME_ATTR, &error);
if (error != "") {
SourcePos(manifestFile, tree.getLineNumber()).error(
- "ERROR getting 'name' attribute: %s", error.string());
+ "ERROR getting 'name' attribute: %s", error.c_str());
goto bail;
}
if (withinActivity) {
@@ -2352,7 +2352,7 @@
printf("locales:");
const size_t NL = locales.size();
for (size_t i=0; i<NL; i++) {
- const char* localeStr = locales[i].string();
+ const char* localeStr = locales[i].c_str();
if (localeStr == NULL || strlen(localeStr) == 0) {
localeStr = "--_--";
}
@@ -2373,7 +2373,7 @@
SortedVector<String8> architectures;
for (size_t i=0; i<dir->getFileCount(); i++) {
architectures.add(ResTable::normalizeForOutput(
- dir->getFileName(i).string()));
+ dir->getFileName(i).c_str()));
}
bool outputAltNativeCode = false;
@@ -2401,7 +2401,7 @@
}
if (index >= 0) {
- printf("native-code: '%s'\n", architectures[index].string());
+ printf("native-code: '%s'\n", architectures[index].c_str());
architectures.removeAt(index);
outputAltNativeCode = true;
}
@@ -2414,7 +2414,7 @@
}
printf("native-code:");
for (size_t i = 0; i < archCount; i++) {
- printf(" '%s'", architectures[i].string());
+ printf(" '%s'", architectures[i].c_str());
}
printf("\n");
}
@@ -2428,7 +2428,7 @@
res.getConfigurations(&configs);
const size_t N = configs.size();
for (size_t i=0; i<N; i++) {
- printf("%s\n", configs[i].toString().string());
+ printf("%s\n", configs[i].toString().c_str());
}
} else {
fprintf(stderr, "ERROR: unknown dump option '%s'\n", option);
@@ -2486,15 +2486,15 @@
for (int i = 1; i < bundle->getFileSpecCount(); i++) {
const char* fileName = bundle->getFileSpecEntry(i);
- if (strcasecmp(String8(fileName).getPathExtension().string(), ".gz") == 0) {
+ if (strcasecmp(String8(fileName).getPathExtension().c_str(), ".gz") == 0) {
printf(" '%s'... (from gzip)\n", fileName);
- result = zip->addGzip(fileName, String8(fileName).getBasePath().string(), NULL);
+ result = zip->addGzip(fileName, String8(fileName).getBasePath().c_str(), NULL);
} else {
if (bundle->getJunkPath()) {
String8 storageName = String8(fileName).getPathLeaf();
printf(" '%s' as '%s'...\n", fileName,
- ResTable::normalizeForOutput(storageName.string()).string());
- result = zip->add(fileName, storageName.string(),
+ ResTable::normalizeForOutput(storageName.c_str()).c_str());
+ result = zip->add(fileName, storageName.c_str(),
bundle->getCompressionMethod(), NULL);
} else {
printf(" '%s'...\n", fileName);
@@ -2581,7 +2581,7 @@
for (size_t i = 0; i < numDirs; i++) {
bool ignore = ignoreConfig;
const sp<AaptDir>& subDir = dir->getDirs().valueAt(i);
- const char* dirStr = subDir->getLeaf().string();
+ const char* dirStr = subDir->getLeaf().c_str();
if (!ignore && strstr(dirStr, "mipmap") == dirStr) {
ignore = true;
}
@@ -2604,7 +2604,7 @@
}
if (err != NO_ERROR) {
fprintf(stderr, "Failed to add %s (%s) to builder.\n",
- gp->getPath().string(), gp->getFiles()[j]->getPrintableSource().string());
+ gp->getPath().c_str(), gp->getFiles()[j]->getPrintableSource().c_str());
return err;
}
}
@@ -2620,13 +2620,13 @@
String8 ext(original.getPathExtension());
if (ext == String8(".apk")) {
return String8::format("%s_%s%s",
- original.getBasePath().string(),
- split->getDirectorySafeName().string(),
- ext.string());
+ original.getBasePath().c_str(),
+ split->getDirectorySafeName().c_str(),
+ ext.c_str());
}
- return String8::format("%s_%s", original.string(),
- split->getDirectorySafeName().string());
+ return String8::format("%s_%s", original.c_str(),
+ split->getDirectorySafeName().c_str());
}
/*
@@ -2712,7 +2712,7 @@
for (size_t i = 0; i < numSplits; i++) {
std::set<ConfigDescription> configs;
if (!AaptConfig::parseCommaSeparatedList(splitStrs[i], &configs)) {
- fprintf(stderr, "ERROR: failed to parse split configuration '%s'\n", splitStrs[i].string());
+ fprintf(stderr, "ERROR: failed to parse split configuration '%s'\n", splitStrs[i].c_str());
goto bail;
}
@@ -2835,7 +2835,7 @@
String8 outputPath = buildApkName(String8(outputAPKFile), split);
err = writeAPK(bundle, outputPath, split);
if (err != NO_ERROR) {
- fprintf(stderr, "ERROR: packaging of '%s' failed\n", outputPath.string());
+ fprintf(stderr, "ERROR: packaging of '%s' failed\n", outputPath.c_str());
goto bail;
}
}
diff --git a/tools/aapt/CrunchCache.cpp b/tools/aapt/CrunchCache.cpp
index 7b8a576..1f2febe 100644
--- a/tools/aapt/CrunchCache.cpp
+++ b/tools/aapt/CrunchCache.cpp
@@ -44,7 +44,7 @@
// This efficiently strips the source directory prefix from our path.
// Also, String8 doesn't have a substring method so this is what we've
// got to work with.
- const char* rPathPtr = mSourceFiles.keyAt(0).string()+mSourcePath.length();
+ const char* rPathPtr = mSourceFiles.keyAt(0).c_str()+mSourcePath.length();
// Strip leading slash if present
int offset = 0;
if (rPathPtr[0] == OS_PATH_SEPARATOR)
diff --git a/tools/aapt/DirectoryWalker.h b/tools/aapt/DirectoryWalker.h
index 88031d0..cea3a6e 100644
--- a/tools/aapt/DirectoryWalker.h
+++ b/tools/aapt/DirectoryWalker.h
@@ -57,7 +57,7 @@
virtual bool openDir(String8 path) {
mBasePath = path;
dir = NULL;
- dir = opendir(mBasePath.string() );
+ dir = opendir(mBasePath.c_str() );
if (dir == NULL)
return false;
@@ -78,7 +78,7 @@
mEntry = *entryPtr;
// Get stats
String8 fullPath = mBasePath.appendPathCopy(mEntry.d_name);
- stat(fullPath.string(),&mStats);
+ stat(fullPath.c_str(),&mStats);
return &mEntry;
};
// Get the stats for the current entry
diff --git a/tools/aapt/FileFinder.cpp b/tools/aapt/FileFinder.cpp
index c9d0744..a5c19806 100644
--- a/tools/aapt/FileFinder.cpp
+++ b/tools/aapt/FileFinder.cpp
@@ -59,14 +59,14 @@
String8 fullPath = basePath.appendPathCopy(entryName);
// If this entry is a directory we'll recurse into it
- if (isDirectory(fullPath.string()) ) {
+ if (isDirectory(fullPath.c_str()) ) {
DirectoryWalker* copy = dw->clone();
findFiles(fullPath, extensions, fileStore,copy);
delete copy;
}
// If this entry is a file, we'll pass it over to checkAndAddFile
- if (isFile(fullPath.string()) ) {
+ if (isFile(fullPath.c_str()) ) {
checkAndAddFile(fullPath,dw->entryStats(),extensions,fileStore);
}
}
diff --git a/tools/aapt/Images.cpp b/tools/aapt/Images.cpp
index 627a231..c6c7e96 100644
--- a/tools/aapt/Images.cpp
+++ b/tools/aapt/Images.cpp
@@ -1328,13 +1328,13 @@
png_init_io(read_ptr, fp);
- read_png(printableName.string(), read_ptr, read_info, imageInfo);
+ read_png(printableName.c_str(), read_ptr, read_info, imageInfo);
const size_t nameLen = file->getPath().length();
if (nameLen > 6) {
- const char* name = file->getPath().string();
+ const char* name = file->getPath().c_str();
if (name[nameLen-5] == '9' && name[nameLen-6] == '.') {
- if (do_9patch(printableName.string(), imageInfo) != NO_ERROR) {
+ if (do_9patch(printableName.c_str(), imageInfo) != NO_ERROR) {
return false;
}
}
@@ -1349,7 +1349,7 @@
return false;
}
- write_png(printableName.string(), write_ptr, write_info, *imageInfo, bundle);
+ write_png(printableName.c_str(), write_ptr, write_info, *imageInfo, bundle);
return true;
}
@@ -1360,7 +1360,7 @@
String8 ext(file->getPath().getPathExtension());
// We currently only process PNG images.
- if (strcmp(ext.string(), ".png") != 0) {
+ if (strcmp(ext.c_str(), ".png") != 0) {
return NO_ERROR;
}
@@ -1371,7 +1371,7 @@
String8 printableName(file->getPrintableSource());
if (bundle->getVerbose()) {
- printf("Processing image: %s\n", printableName.string());
+ printf("Processing image: %s\n", printableName.c_str());
}
png_structp read_ptr = NULL;
@@ -1385,9 +1385,9 @@
status_t error = UNKNOWN_ERROR;
- fp = fopen(file->getSourceFile().string(), "rb");
+ fp = fopen(file->getSourceFile().c_str(), "rb");
if (fp == NULL) {
- fprintf(stderr, "%s: ERROR: Unable to open PNG file\n", printableName.string());
+ fprintf(stderr, "%s: ERROR: Unable to open PNG file\n", printableName.c_str());
goto bail;
}
@@ -1434,7 +1434,7 @@
size_t newSize = file->getSize();
float factor = ((float)newSize)/oldSize;
int percent = (int)(factor*100);
- printf(" (processed image %s: %d%% size of source)\n", printableName.string(), percent);
+ printf(" (processed image %s: %d%% size of source)\n", printableName.c_str(), percent);
}
bail:
@@ -1450,7 +1450,7 @@
if (error != NO_ERROR) {
fprintf(stderr, "ERROR: Failure processing PNG image %s\n",
- file->getPrintableSource().string());
+ file->getPrintableSource().c_str());
}
return error;
}
@@ -1470,13 +1470,13 @@
status_t error = UNKNOWN_ERROR;
if (bundle->getVerbose()) {
- printf("Processing image to cache: %s => %s\n", source.string(), dest.string());
+ printf("Processing image to cache: %s => %s\n", source.c_str(), dest.c_str());
}
// Get a file handler to read from
- fp = fopen(source.string(),"rb");
+ fp = fopen(source.c_str(),"rb");
if (fp == NULL) {
- fprintf(stderr, "%s ERROR: Unable to open PNG file\n", source.string());
+ fprintf(stderr, "%s ERROR: Unable to open PNG file\n", source.c_str());
return error;
}
@@ -1507,7 +1507,7 @@
png_init_io(read_ptr,fp);
// Actually read data from the file
- read_png(source.string(), read_ptr, read_info, &imageInfo);
+ read_png(source.c_str(), read_ptr, read_info, &imageInfo);
// We're done reading so we can clean up
// Find old file size before releasing handle
@@ -1519,7 +1519,7 @@
// Check to see if we're dealing with a 9-patch
// If we are, process appropriately
if (source.getBasePath().getPathExtension() == ".9") {
- if (do_9patch(source.string(), &imageInfo) != NO_ERROR) {
+ if (do_9patch(source.c_str(), &imageInfo) != NO_ERROR) {
return error;
}
}
@@ -1541,9 +1541,9 @@
}
// Open up our destination file for writing
- fp = fopen(dest.string(), "wb");
+ fp = fopen(dest.c_str(), "wb");
if (!fp) {
- fprintf(stderr, "%s ERROR: Unable to open PNG file\n", dest.string());
+ fprintf(stderr, "%s ERROR: Unable to open PNG file\n", dest.c_str());
png_destroy_write_struct(&write_ptr, &write_info);
return error;
}
@@ -1559,11 +1559,11 @@
}
// Actually write out to the new png
- write_png(dest.string(), write_ptr, write_info, imageInfo, bundle);
+ write_png(dest.c_str(), write_ptr, write_info, imageInfo, bundle);
if (bundle->getVerbose()) {
// Find the size of our new file
- FILE* reader = fopen(dest.string(), "rb");
+ FILE* reader = fopen(dest.c_str(), "rb");
fseek(reader, 0, SEEK_END);
size_t newSize = (size_t)ftell(reader);
fclose(reader);
@@ -1571,7 +1571,7 @@
float factor = ((float)newSize)/oldSize;
int percent = (int)(factor*100);
printf(" (processed image to cache entry %s: %d%% size of source)\n",
- dest.string(), percent);
+ dest.c_str(), percent);
}
//Clean up
@@ -1588,7 +1588,7 @@
// At this point, now that we have all the resource data, all we need to
// do is compile XML files.
- if (strcmp(ext.string(), ".xml") == 0) {
+ if (strcmp(ext.c_str(), ".xml") == 0) {
String16 resourceName(parseResourceName(file->getSourceFile().getPathLeaf()));
return compileXmlFile(bundle, assets, resourceName, file, table);
}
diff --git a/tools/aapt/Package.cpp b/tools/aapt/Package.cpp
index f06643dc..965655b 100644
--- a/tools/aapt/Package.cpp
+++ b/tools/aapt/Package.cpp
@@ -69,39 +69,39 @@
* If "update" is set, update the contents of the existing archive.
* Else, if "force" is set, remove the existing archive.
*/
- FileType fileType = getFileType(outputFile.string());
+ FileType fileType = getFileType(outputFile.c_str());
if (fileType == kFileTypeNonexistent) {
// okay, create it below
} else if (fileType == kFileTypeRegular) {
if (bundle->getUpdate()) {
// okay, open it below
} else if (bundle->getForce()) {
- if (unlink(outputFile.string()) != 0) {
- fprintf(stderr, "ERROR: unable to remove '%s': %s\n", outputFile.string(),
+ if (unlink(outputFile.c_str()) != 0) {
+ fprintf(stderr, "ERROR: unable to remove '%s': %s\n", outputFile.c_str(),
strerror(errno));
goto bail;
}
} else {
fprintf(stderr, "ERROR: '%s' exists (use '-f' to force overwrite)\n",
- outputFile.string());
+ outputFile.c_str());
goto bail;
}
} else {
- fprintf(stderr, "ERROR: '%s' exists and is not a regular file\n", outputFile.string());
+ fprintf(stderr, "ERROR: '%s' exists and is not a regular file\n", outputFile.c_str());
goto bail;
}
if (bundle->getVerbose()) {
printf("%s '%s'\n", (fileType == kFileTypeNonexistent) ? "Creating" : "Opening",
- outputFile.string());
+ outputFile.c_str());
}
status_t status;
zip = new ZipFile;
- status = zip->open(outputFile.string(), ZipFile::kOpenReadWrite | ZipFile::kOpenCreate);
+ status = zip->open(outputFile.c_str(), ZipFile::kOpenReadWrite | ZipFile::kOpenCreate);
if (status != NO_ERROR) {
fprintf(stderr, "ERROR: unable to open '%s' as Zip file for writing\n",
- outputFile.string());
+ outputFile.c_str());
goto bail;
}
@@ -112,7 +112,7 @@
count = processAssets(bundle, zip, outputSet);
if (count < 0) {
fprintf(stderr, "ERROR: unable to process assets while packaging '%s'\n",
- outputFile.string());
+ outputFile.c_str());
result = count;
goto bail;
}
@@ -124,7 +124,7 @@
count = processJarFiles(bundle, zip);
if (count < 0) {
fprintf(stderr, "ERROR: unable to process jar files while packaging '%s'\n",
- outputFile.string());
+ outputFile.c_str());
result = count;
goto bail;
}
@@ -169,12 +169,12 @@
/* anything here? */
if (zip->getNumEntries() == 0) {
if (bundle->getVerbose()) {
- printf("Archive is empty -- removing %s\n", outputFile.getPathLeaf().string());
+ printf("Archive is empty -- removing %s\n", outputFile.getPathLeaf().c_str());
}
delete zip; // close the file so we can remove it in Win32
zip = NULL;
- if (unlink(outputFile.string()) != 0) {
- fprintf(stderr, "warning: could not unlink '%s'\n", outputFile.string());
+ if (unlink(outputFile.c_str()) != 0) {
+ fprintf(stderr, "warning: could not unlink '%s'\n", outputFile.c_str());
}
}
@@ -187,9 +187,9 @@
String8 dependencyFile = outputFile;
dependencyFile.append(".d");
- FILE* fp = fopen(dependencyFile.string(), "a");
+ FILE* fp = fopen(dependencyFile.c_str(), "a");
// Add this file to the dependency file
- fprintf(fp, "%s \\\n", outputFile.string());
+ fprintf(fp, "%s \\\n", outputFile.c_str());
fclose(fp);
}
@@ -199,10 +199,10 @@
delete zip; // must close before remove in Win32
if (result != NO_ERROR) {
if (bundle->getVerbose()) {
- printf("Removing %s due to earlier failures\n", outputFile.string());
+ printf("Removing %s due to earlier failures\n", outputFile.c_str());
}
- if (unlink(outputFile.string()) != 0) {
- fprintf(stderr, "warning: could not unlink '%s'\n", outputFile.string());
+ if (unlink(outputFile.c_str()) != 0) {
+ fprintf(stderr, "warning: could not unlink '%s'\n", outputFile.c_str());
}
}
@@ -267,31 +267,31 @@
int fileNameLen = storageName.length();
int excludeExtensionLen = strlen(kExcludeExtension);
if (fileNameLen > excludeExtensionLen
- && (0 == strcmp(storageName.string() + (fileNameLen - excludeExtensionLen),
+ && (0 == strcmp(storageName.c_str() + (fileNameLen - excludeExtensionLen),
kExcludeExtension))) {
- fprintf(stderr, "warning: '%s' not added to Zip\n", storageName.string());
+ fprintf(stderr, "warning: '%s' not added to Zip\n", storageName.c_str());
return true;
}
- if (strcasecmp(storageName.getPathExtension().string(), ".gz") == 0) {
+ if (strcasecmp(storageName.getPathExtension().c_str(), ".gz") == 0) {
fromGzip = true;
storageName = storageName.getBasePath();
}
if (bundle->getUpdate()) {
- entry = zip->getEntryByName(storageName.string());
+ entry = zip->getEntryByName(storageName.c_str());
if (entry != NULL) {
/* file already exists in archive; there can be only one */
if (entry->getMarked()) {
fprintf(stderr,
"ERROR: '%s' exists twice (check for with & w/o '.gz'?)\n",
- file->getPrintableSource().string());
+ file->getPrintableSource().c_str());
return false;
}
if (!hasData) {
const String8& srcName = file->getSourceFile();
time_t fileModWhen;
- fileModWhen = getFileModDate(srcName.string());
+ fileModWhen = getFileModDate(srcName.c_str());
if (fileModWhen == (time_t) -1) { // file existence tested earlier,
return false; // not expecting an error here
}
@@ -299,14 +299,14 @@
if (fileModWhen > entry->getModWhen()) {
// mark as deleted so add() will succeed
if (bundle->getVerbose()) {
- printf(" (removing old '%s')\n", storageName.string());
+ printf(" (removing old '%s')\n", storageName.c_str());
}
zip->remove(entry);
} else {
// version in archive is newer
if (bundle->getVerbose()) {
- printf(" (not updating '%s')\n", storageName.string());
+ printf(" (not updating '%s')\n", storageName.c_str());
}
entry->setMarked(true);
return true;
@@ -321,22 +321,22 @@
//android_setMinPriority(NULL, ANDROID_LOG_VERBOSE);
if (fromGzip) {
- result = zip->addGzip(file->getSourceFile().string(), storageName.string(), &entry);
+ result = zip->addGzip(file->getSourceFile().c_str(), storageName.c_str(), &entry);
} else if (!hasData) {
/* don't compress certain files, e.g. PNGs */
int compressionMethod = bundle->getCompressionMethod();
if (!okayToCompress(bundle, storageName)) {
compressionMethod = ZipEntry::kCompressStored;
}
- result = zip->add(file->getSourceFile().string(), storageName.string(), compressionMethod,
+ result = zip->add(file->getSourceFile().c_str(), storageName.c_str(), compressionMethod,
&entry);
} else {
- result = zip->add(file->getData(), file->getSize(), storageName.string(),
+ result = zip->add(file->getData(), file->getSize(), storageName.c_str(),
file->getCompressionMethod(), &entry);
}
if (result == NO_ERROR) {
if (bundle->getVerbose()) {
- printf(" '%s'%s", storageName.string(), fromGzip ? " (from .gz)" : "");
+ printf(" '%s'%s", storageName.c_str(), fromGzip ? " (from .gz)" : "");
if (entry->getCompressionMethod() == ZipEntry::kCompressStored) {
printf(" (not compressed)\n");
} else {
@@ -348,10 +348,10 @@
} else {
if (result == ALREADY_EXISTS) {
fprintf(stderr, " Unable to add '%s': file already in archive (try '-u'?)\n",
- file->getPrintableSource().string());
+ file->getPrintableSource().c_str());
} else {
fprintf(stderr, " Unable to add '%s': Zip add failed (%d)\n",
- file->getPrintableSource().string(), result);
+ file->getPrintableSource().c_str(), result);
}
return false;
}
@@ -372,7 +372,7 @@
return true;
for (i = 0; i < NELEM(kNoCompressExt); i++) {
- if (strcasecmp(ext.string(), kNoCompressExt[i]) == 0)
+ if (strcasecmp(ext.c_str(), kNoCompressExt[i]) == 0)
return false;
}
@@ -383,7 +383,7 @@
if (pos < 0) {
continue;
}
- const char* path = pathName.string();
+ const char* path = pathName.c_str();
if (strcasecmp(path + pos, str) == 0) {
return false;
}
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index dd3ebdb..4ca3a68 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -57,8 +57,8 @@
String8 parseResourceName(const String8& leaf)
{
- const char* firstDot = strchr(leaf.string(), '.');
- const char* str = leaf.string();
+ const char* firstDot = strchr(leaf.c_str(), '.');
+ const char* str = leaf.c_str();
if (firstDot) {
return String8(str, firstDot-str);
@@ -132,7 +132,7 @@
mParams = file->getGroupEntry().toParams();
if (kIsDebug) {
printf("Dir %s: mcc=%d mnc=%d lang=%c%c cnt=%c%c orient=%d ui=%d density=%d touch=%d key=%d inp=%d nav=%d\n",
- group->getPath().string(), mParams.mcc, mParams.mnc,
+ group->getPath().c_str(), mParams.mcc, mParams.mnc,
mParams.language[0] ? mParams.language[0] : '-',
mParams.language[1] ? mParams.language[1] : '-',
mParams.country[0] ? mParams.country[0] : '-',
@@ -147,12 +147,12 @@
mBaseName = parseResourceName(leaf);
if (mBaseName == "") {
fprintf(stderr, "Error: malformed resource filename %s\n",
- file->getPrintableSource().string());
+ file->getPrintableSource().c_str());
return UNKNOWN_ERROR;
}
if (kIsDebug) {
- printf("file name=%s\n", mBaseName.string());
+ printf("file name=%s\n", mBaseName.c_str());
}
return NO_ERROR;
@@ -222,7 +222,7 @@
{
if (grp->getFiles().size() != 1) {
fprintf(stderr, "warning: Multiple AndroidManifest.xml files found, using %s\n",
- grp->getFiles().valueAt(0)->getPrintableSource().string());
+ grp->getFiles().valueAt(0)->getPrintableSource().c_str());
}
sp<AaptFile> file = grp->getFiles().valueAt(0);
@@ -243,20 +243,20 @@
size_t len;
if (code != ResXMLTree::START_TAG) {
fprintf(stderr, "%s:%d: No start tag found\n",
- file->getPrintableSource().string(), block.getLineNumber());
+ file->getPrintableSource().c_str(), block.getLineNumber());
return UNKNOWN_ERROR;
}
- if (strcmp16(block.getElementName(&len), String16("manifest").string()) != 0) {
+ if (strcmp16(block.getElementName(&len), String16("manifest").c_str()) != 0) {
fprintf(stderr, "%s:%d: Invalid start tag %s, expected <manifest>\n",
- file->getPrintableSource().string(), block.getLineNumber(),
- String8(block.getElementName(&len)).string());
+ file->getPrintableSource().c_str(), block.getLineNumber(),
+ String8(block.getElementName(&len)).c_str());
return UNKNOWN_ERROR;
}
ssize_t nameIndex = block.indexOfAttribute(NULL, "package");
if (nameIndex < 0) {
fprintf(stderr, "%s:%d: <manifest> does not have package attribute.\n",
- file->getPrintableSource().string(), block.getLineNumber());
+ file->getPrintableSource().c_str(), block.getLineNumber());
return UNKNOWN_ERROR;
}
@@ -264,19 +264,19 @@
ssize_t revisionCodeIndex = block.indexOfAttribute(RESOURCES_ANDROID_NAMESPACE, "revisionCode");
if (revisionCodeIndex >= 0) {
- bundle->setRevisionCode(String8(block.getAttributeStringValue(revisionCodeIndex, &len)).string());
+ bundle->setRevisionCode(String8(block.getAttributeStringValue(revisionCodeIndex, &len)).c_str());
}
String16 uses_sdk16("uses-sdk");
while ((code=block.next()) != ResXMLTree::END_DOCUMENT
&& code != ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::START_TAG) {
- if (strcmp16(block.getElementName(&len), uses_sdk16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), uses_sdk16.c_str()) == 0) {
ssize_t minSdkIndex = block.indexOfAttribute(RESOURCES_ANDROID_NAMESPACE,
"minSdkVersion");
if (minSdkIndex >= 0) {
const char16_t* minSdk16 = block.getAttributeStringValue(minSdkIndex, &len);
- const char* minSdk8 = strdup(String8(minSdk16).string());
+ const char* minSdk8 = strdup(String8(minSdk16).c_str());
bundle->setManifestMinSdkVersion(minSdk8);
}
}
@@ -305,17 +305,17 @@
while ((res=it.next()) == NO_ERROR) {
if (bundle->getVerbose()) {
printf(" (new resource id %s from %s)\n",
- it.getBaseName().string(), it.getFile()->getPrintableSource().string());
+ it.getBaseName().c_str(), it.getFile()->getPrintableSource().c_str());
}
String16 baseName(it.getBaseName());
- const char16_t* str = baseName.string();
+ const char16_t* str = baseName.c_str();
const char16_t* const end = str + baseName.size();
while (str < end) {
if (!((*str >= 'a' && *str <= 'z')
|| (*str >= '0' && *str <= '9')
|| *str == '_' || *str == '.')) {
fprintf(stderr, "%s: Invalid file name: must contain only [a-z0-9_.]\n",
- it.getPath().string());
+ it.getPath().c_str());
hasErrors = true;
}
str++;
@@ -413,7 +413,7 @@
sp<ResourceTypeSet> set = new ResourceTypeSet();
if (kIsDebug) {
printf("Creating new resource type set for leaf %s with group %s (%p)\n",
- leafName.string(), group->getPath().string(), group.get());
+ leafName.c_str(), group->getPath().c_str(), group.get());
}
set->add(leafName, group);
resources->add(resType, set);
@@ -423,21 +423,21 @@
if (index < 0) {
if (kIsDebug) {
printf("Adding to resource type set for leaf %s group %s (%p)\n",
- leafName.string(), group->getPath().string(), group.get());
+ leafName.c_str(), group->getPath().c_str(), group.get());
}
set->add(leafName, group);
} else {
sp<AaptGroup> existingGroup = set->valueAt(index);
if (kIsDebug) {
printf("Extending to resource type set for leaf %s group %s (%p)\n",
- leafName.string(), group->getPath().string(), group.get());
+ leafName.c_str(), group->getPath().c_str(), group.get());
}
for (size_t j=0; j<files.size(); j++) {
if (kIsDebug) {
printf("Adding file %s in group %s resType %s\n",
- files.valueAt(j)->getSourceFile().string(),
- files.keyAt(j).toDirName(String8()).string(),
- resType.string());
+ files.valueAt(j)->getSourceFile().c_str(),
+ files.keyAt(j).toDirName(String8()).c_str(),
+ resType.c_str());
}
existingGroup->addFile(files.valueAt(j));
}
@@ -455,14 +455,14 @@
for (int i=0; i<N; i++) {
const sp<AaptDir>& d = dirs.itemAt(i);
if (kIsDebug) {
- printf("Collecting dir #%d %p: %s, leaf %s\n", i, d.get(), d->getPath().string(),
- d->getLeaf().string());
+ printf("Collecting dir #%d %p: %s, leaf %s\n", i, d.get(), d->getPath().c_str(),
+ d->getLeaf().c_str());
}
collect_files(d, resources);
// don't try to include the res dir
if (kIsDebug) {
- printf("Removing dir leaf %s\n", d->getLeaf().string());
+ printf("Removing dir leaf %s\n", d->getLeaf().c_str());
}
ass->removeDir(d->getLeaf());
}
@@ -490,8 +490,8 @@
int strIdx;
if ((strIdx=table.resolveReference(&value, 0x10000000, NULL, &specFlags)) < 0) {
fprintf(stderr, "%s:%d: Tag <%s> attribute %s references unknown resid 0x%08x.\n",
- path.string(), parser.getLineNumber(),
- String8(parser.getElementName(&len)).string(), attr,
+ path.c_str(), parser.getLineNumber(),
+ String8(parser.getElementName(&len)).c_str(), attr,
value.data);
return ATTR_NOT_FOUND;
}
@@ -502,12 +502,12 @@
str = pool->stringAt(value.data, &len);
}
printf("***** RES ATTR: %s specFlags=0x%x strIdx=%d: %s\n", attr,
- specFlags, strIdx, str != NULL ? String8(str).string() : "???");
+ specFlags, strIdx, str != NULL ? String8(str).c_str() : "???");
#endif
if ((specFlags&~ResTable_typeSpec::SPEC_PUBLIC) != 0 && false) {
fprintf(stderr, "%s:%d: Tag <%s> attribute %s varies by configurations 0x%x.\n",
- path.string(), parser.getLineNumber(),
- String8(parser.getElementName(&len)).string(), attr,
+ path.c_str(), parser.getLineNumber(),
+ String8(parser.getElementName(&len)).c_str(), attr,
specFlags);
return ATTR_NOT_FOUND;
}
@@ -515,20 +515,20 @@
if (value.dataType == Res_value::TYPE_STRING) {
if (pool == NULL) {
fprintf(stderr, "%s:%d: Tag <%s> attribute %s has no string block.\n",
- path.string(), parser.getLineNumber(),
- String8(parser.getElementName(&len)).string(), attr);
+ path.c_str(), parser.getLineNumber(),
+ String8(parser.getElementName(&len)).c_str(), attr);
return ATTR_NOT_FOUND;
}
if ((str = UnpackOptionalString(pool->stringAt(value.data), &len)) == NULL) {
fprintf(stderr, "%s:%d: Tag <%s> attribute %s has corrupt string value.\n",
- path.string(), parser.getLineNumber(),
- String8(parser.getElementName(&len)).string(), attr);
+ path.c_str(), parser.getLineNumber(),
+ String8(parser.getElementName(&len)).c_str(), attr);
return ATTR_NOT_FOUND;
}
} else {
fprintf(stderr, "%s:%d: Tag <%s> attribute %s has invalid type %d.\n",
- path.string(), parser.getLineNumber(),
- String8(parser.getElementName(&len)).string(), attr,
+ path.c_str(), parser.getLineNumber(),
+ String8(parser.getElementName(&len)).c_str(), attr,
value.dataType);
return ATTR_NOT_FOUND;
}
@@ -546,30 +546,30 @@
}
if (!okay) {
fprintf(stderr, "%s:%d: Tag <%s> attribute %s has invalid character '%c'.\n",
- path.string(), parser.getLineNumber(),
- String8(parser.getElementName(&len)).string(), attr, (char)str[i]);
+ path.c_str(), parser.getLineNumber(),
+ String8(parser.getElementName(&len)).c_str(), attr, (char)str[i]);
return (int)i;
}
}
}
if (*str == ' ') {
fprintf(stderr, "%s:%d: Tag <%s> attribute %s can not start with a space.\n",
- path.string(), parser.getLineNumber(),
- String8(parser.getElementName(&len)).string(), attr);
+ path.c_str(), parser.getLineNumber(),
+ String8(parser.getElementName(&len)).c_str(), attr);
return ATTR_LEADING_SPACES;
}
if (len != 0 && str[len-1] == ' ') {
fprintf(stderr, "%s:%d: Tag <%s> attribute %s can not end with a space.\n",
- path.string(), parser.getLineNumber(),
- String8(parser.getElementName(&len)).string(), attr);
+ path.c_str(), parser.getLineNumber(),
+ String8(parser.getElementName(&len)).c_str(), attr);
return ATTR_TRAILING_SPACES;
}
return ATTR_OKAY;
}
if (required) {
fprintf(stderr, "%s:%d: Tag <%s> missing required attribute %s.\n",
- path.string(), parser.getLineNumber(),
- String8(parser.getElementName(&len)).string(), attr);
+ path.c_str(), parser.getLineNumber(),
+ String8(parser.getElementName(&len)).c_str(), attr);
return ATTR_NOT_FOUND;
}
return ATTR_OKAY;
@@ -584,7 +584,7 @@
ssize_t index = parser.indexOfAttribute(NULL, "id");
if (index >= 0) {
fprintf(stderr, "%s:%d: warning: found plain 'id' attribute; did you mean the new 'android:id' name?\n",
- path.string(), parser.getLineNumber());
+ path.c_str(), parser.getLineNumber());
}
}
}
@@ -618,7 +618,7 @@
size_t overlayCount = overlaySet->size();
for (size_t overlayIndex=0; overlayIndex<overlayCount; overlayIndex++) {
if (bundle->getVerbose()) {
- printf("trying overlaySet Key=%s\n",overlaySet->keyAt(overlayIndex).string());
+ printf("trying overlaySet Key=%s\n",overlaySet->keyAt(overlayIndex).c_str());
}
ssize_t baseIndex = -1;
if (baseSet->get() != NULL) {
@@ -638,11 +638,11 @@
baseGroup->getFiles();
for (size_t i=0; i < baseFiles.size(); i++) {
printf("baseFile " ZD " has flavor %s\n", (ZD_TYPE) i,
- baseFiles.keyAt(i).toString().string());
+ baseFiles.keyAt(i).toString().c_str());
}
for (size_t i=0; i < overlayFiles.size(); i++) {
printf("overlayFile " ZD " has flavor %s\n", (ZD_TYPE) i,
- overlayFiles.keyAt(i).toString().string());
+ overlayFiles.keyAt(i).toString().c_str());
}
}
@@ -657,16 +657,16 @@
if (bundle->getVerbose()) {
printf("found a match (" ZD ") for overlay file %s, for flavor %s\n",
(ZD_TYPE) baseFileIndex,
- overlayGroup->getLeaf().string(),
- overlayFiles.keyAt(overlayGroupIndex).toString().string());
+ overlayGroup->getLeaf().c_str(),
+ overlayFiles.keyAt(overlayGroupIndex).toString().c_str());
}
baseGroup->removeFile(baseFileIndex);
} else {
// didn't find a match fall through and add it..
if (true || bundle->getVerbose()) {
printf("nothing matches overlay file %s, for flavor %s\n",
- overlayGroup->getLeaf().string(),
- overlayFiles.keyAt(overlayGroupIndex).toString().string());
+ overlayGroup->getLeaf().c_str(),
+ overlayFiles.keyAt(overlayGroupIndex).toString().c_str());
}
}
baseGroup->addFile(overlayFiles.valueAt(overlayGroupIndex));
@@ -728,7 +728,7 @@
if (errorOnFailedInsert) {
fprintf(stderr, "Error: AndroidManifest.xml already defines %s (in %s);"
" cannot insert new value %s.\n",
- String8(attr).string(), String8(ns).string(), value);
+ String8(attr).c_str(), String8(ns).c_str(), value);
return false;
}
@@ -763,7 +763,7 @@
// .asdf .a.b --> package.asdf package.a.b
// asdf.adsf --> asdf.asdf
String8 className;
- const char* p = name.string();
+ const char* p = name.c_str();
const char* q = strchr(p, '.');
if (p == q) {
className += package;
@@ -776,7 +776,7 @@
className += name;
}
if (kIsDebug) {
- printf("Qualifying class '%s' to '%s'", name.string(), className.string());
+ printf("Qualifying class '%s' to '%s'", name.c_str(), className.c_str());
}
attr->string.setTo(String16(className));
}
@@ -810,7 +810,7 @@
const char* err;
String16 iconPackage, iconType, iconName;
- if (!ResTable::expandResourceRef(iconRef.string(), iconRef.size(), &iconPackage, &iconType,
+ if (!ResTable::expandResourceRef(iconRef.c_str(), iconRef.size(), &iconPackage, &iconType,
&iconName, NULL, &table->getAssetsPackage(), &err,
&publicOnly)) {
// Errors will be raised in later XML compilation.
@@ -824,7 +824,7 @@
}
String16 roundIconPackage, roundIconType, roundIconName;
- if (!ResTable::expandResourceRef(roundIconRef.string(), roundIconRef.size(), &roundIconPackage,
+ if (!ResTable::expandResourceRef(roundIconRef.c_str(), roundIconRef.size(), &roundIconPackage,
&roundIconType, &roundIconName, NULL, &table->getAssetsPackage(),
&err, &publicOnly)) {
// Errors will be raised in later XML compilation.
@@ -839,9 +839,9 @@
return;
}
- String16 aliasValue = String16(String8::format("@%s:%s/%s", String8(iconPackage).string(),
- String8(iconType).string(),
- String8(iconName).string()));
+ String16 aliasValue = String16(String8::format("@%s:%s/%s", String8(iconPackage).c_str(),
+ String8(iconType).c_str(),
+ String8(iconName).c_str()));
// Add an equivalent v26 entry to the roundIcon for each v26 variant of the regular icon.
const DefaultKeyedVector<ConfigDescription, sp<ResourceTable::Entry>>& configList =
@@ -872,7 +872,7 @@
const XMLNode::attribute_entry* attr = root->getAttribute(
String16(RESOURCES_ANDROID_NAMESPACE), String16("versionCode"));
if (attr != NULL) {
- bundle->setVersionCode(strdup(String8(attr->string).string()));
+ bundle->setVersionCode(strdup(String8(attr->string).c_str()));
}
}
@@ -883,7 +883,7 @@
const XMLNode::attribute_entry* attr = root->getAttribute(
String16(RESOURCES_ANDROID_NAMESPACE), String16("versionName"));
if (attr != NULL) {
- bundle->setVersionName(strdup(String8(attr->string).string()));
+ bundle->setVersionName(strdup(String8(attr->string).c_str()));
}
}
@@ -914,7 +914,7 @@
const XMLNode::attribute_entry* attr = vers->getAttribute(
String16(RESOURCES_ANDROID_NAMESPACE), String16("minSdkVersion"));
if (attr != NULL) {
- bundle->setMinSdkVersion(strdup(String8(attr->string).string()));
+ bundle->setMinSdkVersion(strdup(String8(attr->string).c_str()));
}
}
@@ -970,7 +970,7 @@
String8 origPackage(attr->string);
attr->string.setTo(String16(manifestPackageNameOverride));
if (kIsDebug) {
- printf("Overriding package '%s' to be '%s'\n", origPackage.string(),
+ printf("Overriding package '%s' to be '%s'\n", origPackage.c_str(),
manifestPackageNameOverride);
}
@@ -1071,7 +1071,7 @@
static ssize_t extractPlatformBuildVersion(const ResTable& table, ResXMLTree& tree, Bundle* bundle) {
// First check if we should be recording the compileSdkVersion* attributes.
static const String16 compileSdkVersionName("android:attr/compileSdkVersion");
- const bool useCompileSdkVersion = table.identifierForName(compileSdkVersionName.string(),
+ const bool useCompileSdkVersion = table.identifierForName(compileSdkVersionName.c_str(),
compileSdkVersionName.size()) != 0u;
size_t len;
@@ -1223,7 +1223,7 @@
// Add the 'revisionCode' attribute, which is set to the original revisionCode.
if (bundle->getRevisionCode().size() > 0) {
if (!addTagAttribute(manifest, RESOURCES_ANDROID_NAMESPACE, "revisionCode",
- bundle->getRevisionCode().string(), true, true)) {
+ bundle->getRevisionCode().c_str(), true, true)) {
return UNKNOWN_ERROR;
}
}
@@ -1270,7 +1270,7 @@
}
if (kIsDebug) {
- printf("Creating resources for package %s\n", assets->getPackage().string());
+ printf("Creating resources for package %s\n", assets->getPackage().c_str());
}
// Set the private symbols package if it was declared.
@@ -1804,7 +1804,7 @@
flattenedTable, split->isBase());
if (err != NO_ERROR) {
fprintf(stderr, "Failed to generate resource table for split '%s'\n",
- split->getPrintableName().string());
+ split->getPrintableName().c_str());
return err;
}
split->addEntry(String8("resources.arsc"), flattenedTable);
@@ -1821,7 +1821,7 @@
err = resTable.add(flattenedTable->getData(), flattenedTable->getSize());
if (err != NO_ERROR) {
fprintf(stderr, "Generated resource table for split '%s' is corrupt.\n",
- split->getPrintableName().string());
+ split->getPrintableName().c_str());
return err;
}
@@ -1849,7 +1849,7 @@
if (block < 0) {
hasError = true;
SourcePos().error("%s has no definition for density split '%s'",
- symbol.toString().string(), config.toString().string());
+ symbol.toString().c_str(), config.toString().c_str());
if (bundle->getVerbose()) {
const Vector<SymbolDefinition>& defs = densityVaryingResources[k];
@@ -1857,7 +1857,7 @@
for (size_t d = 0; d < defCount; d++) {
const SymbolDefinition& def = defs[d];
def.source.error("%s has definition for %s",
- symbol.toString().string(), def.config.toString().string());
+ symbol.toString().c_str(), def.config.toString().c_str());
}
if (defCount < defs.size()) {
@@ -1880,7 +1880,7 @@
generatedManifest, &table);
if (err != NO_ERROR) {
fprintf(stderr, "Failed to generate AndroidManifest.xml for split '%s'\n",
- split->getPrintableName().string());
+ split->getPrintableName().c_str());
return err;
}
split->addEntry(String8("AndroidManifest.xml"), generatedManifest);
@@ -1960,7 +1960,7 @@
if (block.getElementNamespace(&len) != NULL) {
continue;
}
- if (strcmp16(block.getElementName(&len), manifest16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), manifest16.c_str()) == 0) {
if (validateAttr(manifestPath, finalResTable, block, NULL, "package",
packageIdentChars, true) != ATTR_OKAY) {
hasErrors = true;
@@ -1969,10 +1969,10 @@
"sharedUserId", packageIdentChars, false) != ATTR_OKAY) {
hasErrors = true;
}
- } else if (strcmp16(block.getElementName(&len), permission16.string()) == 0
- || strcmp16(block.getElementName(&len), permission_group16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), permission16.c_str()) == 0
+ || strcmp16(block.getElementName(&len), permission_group16.c_str()) == 0) {
const bool isGroup = strcmp16(block.getElementName(&len),
- permission_group16.string()) == 0;
+ permission_group16.c_str()) == 0;
if (validateAttr(manifestPath, finalResTable, block, RESOURCES_ANDROID_NAMESPACE,
"name", isGroup ? packageIdentCharsWithTheStupid
: packageIdentChars, true) != ATTR_OKAY) {
@@ -2002,8 +2002,8 @@
const char16_t* id = block.getAttributeStringValue(index, &len);
if (id == NULL) {
fprintf(stderr, "%s:%d: missing name attribute in element <%s>.\n",
- manifestPath.string(), block.getLineNumber(),
- String8(block.getElementName(&len)).string());
+ manifestPath.c_str(), block.getLineNumber(),
+ String8(block.getElementName(&len)).c_str());
hasErrors = true;
break;
}
@@ -2038,23 +2038,23 @@
if (begins_with_digit || (e != p && *(e-1) != '.')) {
fprintf(stderr,
"%s:%d: Permission name <%s> is not a valid Java symbol\n",
- manifestPath.string(), block.getLineNumber(), idStr.string());
+ manifestPath.c_str(), block.getLineNumber(), idStr.c_str());
hasErrors = true;
}
syms->addStringSymbol(String8(e), idStr, srcPos);
const char16_t* cmt = block.getComment(&len);
if (cmt != NULL && *cmt != 0) {
- //printf("Comment of %s: %s\n", String8(e).string(),
- // String8(cmt).string());
+ //printf("Comment of %s: %s\n", String8(e).c_str(),
+ // String8(cmt).c_str());
syms->appendComment(String8(e), String16(cmt), srcPos);
}
syms->makeSymbolPublic(String8(e), srcPos);
- } else if (strcmp16(block.getElementName(&len), uses_permission16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), uses_permission16.c_str()) == 0) {
if (validateAttr(manifestPath, finalResTable, block, RESOURCES_ANDROID_NAMESPACE,
"name", packageIdentChars, true) != ATTR_OKAY) {
hasErrors = true;
}
- } else if (strcmp16(block.getElementName(&len), instrumentation16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), instrumentation16.c_str()) == 0) {
if (validateAttr(manifestPath, finalResTable, block, RESOURCES_ANDROID_NAMESPACE,
"name", classIdentChars, true) != ATTR_OKAY) {
hasErrors = true;
@@ -2064,7 +2064,7 @@
packageIdentChars, true) != ATTR_OKAY) {
hasErrors = true;
}
- } else if (strcmp16(block.getElementName(&len), application16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), application16.c_str()) == 0) {
if (validateAttr(manifestPath, finalResTable, block, RESOURCES_ANDROID_NAMESPACE,
"name", classIdentChars, false) != ATTR_OKAY) {
hasErrors = true;
@@ -2084,7 +2084,7 @@
processIdentChars, false) != ATTR_OKAY) {
hasErrors = true;
}
- } else if (strcmp16(block.getElementName(&len), provider16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), provider16.c_str()) == 0) {
if (validateAttr(manifestPath, finalResTable, block, RESOURCES_ANDROID_NAMESPACE,
"name", classIdentChars, true) != ATTR_OKAY) {
hasErrors = true;
@@ -2104,9 +2104,9 @@
processIdentChars, false) != ATTR_OKAY) {
hasErrors = true;
}
- } else if (strcmp16(block.getElementName(&len), service16.string()) == 0
- || strcmp16(block.getElementName(&len), receiver16.string()) == 0
- || strcmp16(block.getElementName(&len), activity16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), service16.c_str()) == 0
+ || strcmp16(block.getElementName(&len), receiver16.c_str()) == 0
+ || strcmp16(block.getElementName(&len), activity16.c_str()) == 0) {
if (validateAttr(manifestPath, finalResTable, block, RESOURCES_ANDROID_NAMESPACE,
"name", classIdentChars, true) != ATTR_OKAY) {
hasErrors = true;
@@ -2126,14 +2126,14 @@
processIdentChars, false) != ATTR_OKAY) {
hasErrors = true;
}
- } else if (strcmp16(block.getElementName(&len), action16.string()) == 0
- || strcmp16(block.getElementName(&len), category16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), action16.c_str()) == 0
+ || strcmp16(block.getElementName(&len), category16.c_str()) == 0) {
if (validateAttr(manifestPath, finalResTable, block,
RESOURCES_ANDROID_NAMESPACE, "name",
packageIdentChars, true) != ATTR_OKAY) {
hasErrors = true;
}
- } else if (strcmp16(block.getElementName(&len), data16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), data16.c_str()) == 0) {
if (validateAttr(manifestPath, finalResTable, block,
RESOURCES_ANDROID_NAMESPACE, "mimeType",
typeIdentChars, true) != ATTR_OKAY) {
@@ -2144,13 +2144,13 @@
schemeIdentChars, true) != ATTR_OKAY) {
hasErrors = true;
}
- } else if (strcmp16(block.getElementName(&len), feature_group16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), feature_group16.c_str()) == 0) {
int depth = 1;
while ((code=block.next()) != ResXMLTree::END_DOCUMENT
&& code > ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::START_TAG) {
depth++;
- if (strcmp16(block.getElementName(&len), uses_feature16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), uses_feature16.c_str()) == 0) {
ssize_t idx = block.indexOfAttribute(
RESOURCES_ANDROID_NAMESPACE, "required");
if (idx < 0) {
@@ -2162,7 +2162,7 @@
fprintf(stderr, "%s:%d: Tag <uses-feature> can not have "
"android:required=\"false\" when inside a "
"<feature-group> tag.\n",
- manifestPath.string(), block.getLineNumber());
+ manifestPath.c_str(), block.getLineNumber());
hasErrors = true;
}
}
@@ -2222,7 +2222,7 @@
static String8 getSymbolPackage(const String8& symbol, const sp<AaptAssets>& assets, bool pub) {
ssize_t colon = symbol.find(":", 0);
if (colon >= 0) {
- return String8(symbol.string(), colon);
+ return String8(symbol.c_str(), colon);
}
return pub ? assets->getPackage() : assets->getSymbolsPrivatePackage();
}
@@ -2230,7 +2230,7 @@
static String8 getSymbolName(const String8& symbol) {
ssize_t colon = symbol.find(":", 0);
if (colon >= 0) {
- return String8(symbol.string() + colon + 1);
+ return String8(symbol.c_str() + colon + 1);
}
return symbol;
}
@@ -2245,7 +2245,7 @@
asym = asym->getNestedSymbols().valueFor(String8("attr"));
if (asym != NULL) {
//printf("Got attrs symbols! comment %s=%s\n",
- // name.string(), String8(asym->getComment(name)).string());
+ // name.c_str(), String8(asym->getComment(name)).c_str());
if (outTypeComment != NULL) {
*outTypeComment = asym->getTypeComment(name);
}
@@ -2276,8 +2276,8 @@
"%sfor(int i = 0; i < styleable.%s.length; ++i) {\n"
"%sstyleable.%s[i] = (styleable.%s[i] & 0x00ffffff) | (packageId << 24);\n"
"%s}\n",
- indentStr, nclassName.string(),
- getIndentSpace(indent+1), nclassName.string(), nclassName.string(),
+ indentStr, nclassName.c_str(),
+ getIndentSpace(indent+1), nclassName.c_str(), nclassName.c_str(),
indentStr);
}
@@ -2303,8 +2303,8 @@
String8 flat_name(flattenSymbol(sym.name));
fprintf(fp,
"%s%s.%s = (%s.%s & 0x00ffffff) | (packageId << 24);\n",
- getIndentSpace(indent), className.string(), flat_name.string(),
- className.string(), flat_name.string());
+ getIndentSpace(indent), className.c_str(), flat_name.c_str(),
+ className.c_str(), flat_name.c_str());
}
N = symbols->getNestedSymbols().size();
@@ -2365,12 +2365,12 @@
String16 name16(sym.name);
uint32_t typeSpecFlags;
code = assets->getIncludedResources().identifierForName(
- name16.string(), name16.size(),
- attr16.string(), attr16.size(),
- package16.string(), package16.size(), &typeSpecFlags);
+ name16.c_str(), name16.size(),
+ attr16.c_str(), attr16.size(),
+ package16.c_str(), package16.size(), &typeSpecFlags);
if (code == 0) {
fprintf(stderr, "ERROR: In <declare-styleable> %s, unable to find attribute %s\n",
- nclassName.string(), sym.name.string());
+ nclassName.c_str(), sym.name.c_str());
hasErrors = true;
}
isPublic = (typeSpecFlags&ResTable_typeSpec::SPEC_PUBLIC) != 0;
@@ -2388,9 +2388,9 @@
if (comment.size() > 0) {
String8 cmt(comment);
ann.preprocessComment(cmt);
- fprintf(fp, "%s\n", cmt.string());
+ fprintf(fp, "%s\n", cmt.c_str());
} else {
- fprintf(fp, "Attributes that can be used with a %s.\n", nclassName.string());
+ fprintf(fp, "Attributes that can be used with a %s.\n", nclassName.c_str());
}
bool hasTable = false;
for (a=0; a<NA; a++) {
@@ -2423,7 +2423,7 @@
continue;
}
if (comment.size() > 0) {
- const char16_t* p = comment.string();
+ const char16_t* p = comment.c_str();
while (*p != 0 && *p != '.') {
if (*p == '{') {
while (*p != 0 && *p != '}') {
@@ -2436,14 +2436,14 @@
if (*p == '.') {
p++;
}
- comment = String16(comment.string(), p-comment.string());
+ comment = String16(comment.c_str(), p-comment.c_str());
}
fprintf(fp, "%s <tr><td><code>{@link #%s_%s %s:%s}</code></td><td>%s</td></tr>\n",
- indentStr, nclassName.string(),
- flattenSymbol(name8).string(),
- getSymbolPackage(name8, assets, true).string(),
- getSymbolName(name8).string(),
- String8(comment).string());
+ indentStr, nclassName.c_str(),
+ flattenSymbol(name8).c_str(),
+ getSymbolPackage(name8, assets, true).c_str(),
+ getSymbolName(name8).c_str(),
+ String8(comment).c_str());
}
}
if (hasTable) {
@@ -2457,8 +2457,8 @@
continue;
}
fprintf(fp, "%s @see #%s_%s\n",
- indentStr, nclassName.string(),
- flattenSymbol(sym.name).string());
+ indentStr, nclassName.c_str(),
+ flattenSymbol(sym.name).c_str());
}
}
fprintf(fp, "%s */\n", getIndentSpace(indent));
@@ -2468,7 +2468,7 @@
fprintf(fp,
"%spublic static final int[] %s = {\n"
"%s",
- indentStr, nclassName.string(),
+ indentStr, nclassName.c_str(),
getIndentSpace(indent+1));
for (a=0; a<NA; a++) {
@@ -2503,11 +2503,11 @@
uint32_t typeSpecFlags = 0;
String16 name16(sym.name);
assets->getIncludedResources().identifierForName(
- name16.string(), name16.size(),
- attr16.string(), attr16.size(),
- package16.string(), package16.size(), &typeSpecFlags);
- //printf("%s:%s/%s: 0x%08x\n", String8(package16).string(),
- // String8(attr16).string(), String8(name16).string(), typeSpecFlags);
+ name16.c_str(), name16.size(),
+ attr16.c_str(), attr16.size(),
+ package16.c_str(), package16.size(), &typeSpecFlags);
+ //printf("%s:%s/%s: 0x%08x\n", String8(package16).c_str(),
+ // String8(attr16).c_str(), String8(name16).c_str(), typeSpecFlags);
const bool pub = (typeSpecFlags&ResTable_typeSpec::SPEC_PUBLIC) != 0;
AnnotationProcessor ann;
@@ -2516,20 +2516,20 @@
String8 cmt(comment);
ann.preprocessComment(cmt);
fprintf(fp, "%s <p>\n%s @attr description\n", indentStr, indentStr);
- fprintf(fp, "%s %s\n", indentStr, cmt.string());
+ fprintf(fp, "%s %s\n", indentStr, cmt.c_str());
} else {
fprintf(fp,
"%s <p>This symbol is the offset where the {@link %s.R.attr#%s}\n"
"%s attribute's value can be found in the {@link #%s} array.\n",
indentStr,
- getSymbolPackage(name8, assets, pub).string(),
- getSymbolName(name8).string(),
- indentStr, nclassName.string());
+ getSymbolPackage(name8, assets, pub).c_str(),
+ getSymbolName(name8).c_str(),
+ indentStr, nclassName.c_str());
}
if (typeComment.size() > 0) {
String8 cmt(typeComment);
ann.preprocessComment(cmt);
- fprintf(fp, "\n\n%s %s\n", indentStr, cmt.string());
+ fprintf(fp, "\n\n%s %s\n", indentStr, cmt.c_str());
}
if (comment.size() > 0) {
if (pub) {
@@ -2537,16 +2537,16 @@
"%s <p>This corresponds to the global attribute\n"
"%s resource symbol {@link %s.R.attr#%s}.\n",
indentStr, indentStr,
- getSymbolPackage(name8, assets, true).string(),
- getSymbolName(name8).string());
+ getSymbolPackage(name8, assets, true).c_str(),
+ getSymbolName(name8).c_str());
} else {
fprintf(fp,
"%s <p>This is a private symbol.\n", indentStr);
}
}
fprintf(fp, "%s @attr name %s:%s\n", indentStr,
- getSymbolPackage(name8, assets, pub).string(),
- getSymbolName(name8).string());
+ getSymbolPackage(name8, assets, pub).c_str(),
+ getSymbolName(name8).c_str());
fprintf(fp, "%s*/\n", indentStr);
ann.printAnnotations(fp, indentStr);
@@ -2556,8 +2556,8 @@
fprintf(fp,
id_format,
- indentStr, nclassName.string(),
- flattenSymbol(name8).string(), (int)pos);
+ indentStr, nclassName.c_str(),
+ flattenSymbol(name8).c_str(), (int)pos);
}
}
}
@@ -2598,12 +2598,12 @@
String16 name16(sym.name);
uint32_t typeSpecFlags;
code = assets->getIncludedResources().identifierForName(
- name16.string(), name16.size(),
- attr16.string(), attr16.size(),
- package16.string(), package16.size(), &typeSpecFlags);
+ name16.c_str(), name16.size(),
+ attr16.c_str(), attr16.size(),
+ package16.c_str(), package16.size(), &typeSpecFlags);
if (code == 0) {
fprintf(stderr, "ERROR: In <declare-styleable> %s, unable to find attribute %s\n",
- nclassName.string(), sym.name.string());
+ nclassName.c_str(), sym.name.c_str());
hasErrors = true;
}
isPublic = (typeSpecFlags&ResTable_typeSpec::SPEC_PUBLIC) != 0;
@@ -2615,7 +2615,7 @@
NA = idents.size();
- fprintf(fp, "int[] styleable %s {", nclassName.string());
+ fprintf(fp, "int[] styleable %s {", nclassName.c_str());
for (a=0; a<NA; a++) {
if (a != 0) {
@@ -2645,17 +2645,17 @@
uint32_t typeSpecFlags = 0;
String16 name16(sym.name);
assets->getIncludedResources().identifierForName(
- name16.string(), name16.size(),
- attr16.string(), attr16.size(),
- package16.string(), package16.size(), &typeSpecFlags);
- //printf("%s:%s/%s: 0x%08x\n", String8(package16).string(),
- // String8(attr16).string(), String8(name16).string(), typeSpecFlags);
+ name16.c_str(), name16.size(),
+ attr16.c_str(), attr16.size(),
+ package16.c_str(), package16.size(), &typeSpecFlags);
+ //printf("%s:%s/%s: 0x%08x\n", String8(package16).c_str(),
+ // String8(attr16).c_str(), String8(name16).c_str(), typeSpecFlags);
//const bool pub = (typeSpecFlags&ResTable_typeSpec::SPEC_PUBLIC) != 0;
fprintf(fp,
"int styleable %s_%s %d\n",
- nclassName.string(),
- flattenSymbol(name8).string(), (int)pos);
+ nclassName.c_str(),
+ flattenSymbol(name8).c_str(), (int)pos);
}
}
}
@@ -2670,7 +2670,7 @@
{
fprintf(fp, "%spublic %sfinal class %s {\n",
getIndentSpace(indent),
- indent != 0 ? "static " : "", className.string());
+ indent != 0 ? "static " : "", className.c_str());
indent++;
size_t i;
@@ -2699,7 +2699,7 @@
ann.preprocessComment(cmt);
fprintf(fp,
"%s/** %s\n",
- getIndentSpace(indent), cmt.string());
+ getIndentSpace(indent), cmt.c_str());
}
String16 typeComment(sym.typeComment);
if (typeComment.size() > 0) {
@@ -2708,10 +2708,10 @@
if (!haveComment) {
haveComment = true;
fprintf(fp,
- "%s/** %s\n", getIndentSpace(indent), cmt.string());
+ "%s/** %s\n", getIndentSpace(indent), cmt.c_str());
} else {
fprintf(fp,
- "%s %s\n", getIndentSpace(indent), cmt.string());
+ "%s %s\n", getIndentSpace(indent), cmt.c_str());
}
}
if (haveComment) {
@@ -2720,7 +2720,7 @@
ann.printAnnotations(fp, getIndentSpace(indent));
fprintf(fp, id_format,
getIndentSpace(indent),
- flattenSymbol(name8).string(), (int)sym.int32Val);
+ flattenSymbol(name8).c_str(), (int)sym.int32Val);
}
for (i=0; i<N; i++) {
@@ -2740,13 +2740,13 @@
fprintf(fp,
"%s/** %s\n"
"%s */\n",
- getIndentSpace(indent), cmt.string(),
+ getIndentSpace(indent), cmt.c_str(),
getIndentSpace(indent));
}
ann.printAnnotations(fp, getIndentSpace(indent));
fprintf(fp, "%spublic static final String %s=\"%s\";\n",
getIndentSpace(indent),
- flattenSymbol(name8).string(), sym.stringVal.string());
+ flattenSymbol(name8).c_str(), sym.stringVal.c_str());
}
sp<AaptSymbols> styleableSymbols;
@@ -2805,8 +2805,8 @@
String8 name8(sym.name);
fprintf(fp, "int %s %s 0x%08x\n",
- className.string(),
- flattenSymbol(name8).string(), (int)sym.int32Val);
+ className.c_str(),
+ flattenSymbol(name8).c_str(), (int)sym.int32Val);
}
N = symbols->getNestedSymbols().size();
@@ -2844,7 +2844,7 @@
if (bundle->getMakePackageDirs()) {
const String8& pkg(package);
- const char* last = pkg.string();
+ const char* last = pkg.c_str();
const char* s = last-1;
do {
s++;
@@ -2852,9 +2852,9 @@
String8 part(last, s-last);
dest.appendPath(part);
#ifdef _WIN32
- _mkdir(dest.string());
+ _mkdir(dest.c_str());
#else
- mkdir(dest.string(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
+ mkdir(dest.c_str(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
#endif
last = s+1;
}
@@ -2862,14 +2862,14 @@
}
dest.appendPath(className);
dest.append(".java");
- FILE* fp = fopen(dest.string(), "w+");
+ FILE* fp = fopen(dest.c_str(), "w+");
if (fp == NULL) {
fprintf(stderr, "ERROR: Unable to open class file %s: %s\n",
- dest.string(), strerror(errno));
+ dest.c_str(), strerror(errno));
return UNKNOWN_ERROR;
}
if (bundle->getVerbose()) {
- printf(" Writing symbols for class %s.\n", className.string());
+ printf(" Writing symbols for class %s.\n", className.c_str());
}
fprintf(fp,
@@ -2880,7 +2880,7 @@
" * should not be modified by hand.\n"
" */\n"
"\n"
- "package %s;\n\n", package.string());
+ "package %s;\n\n", package.c_str());
status_t err = writeSymbolClass(fp, assets, includePrivate, symbols,
className, 0, bundle->getNonConstantId(), emitCallback);
@@ -2894,14 +2894,14 @@
textDest.appendPath(className);
textDest.append(".txt");
- FILE* fp = fopen(textDest.string(), "w+");
+ FILE* fp = fopen(textDest.c_str(), "w+");
if (fp == NULL) {
fprintf(stderr, "ERROR: Unable to open text symbol file %s: %s\n",
- textDest.string(), strerror(errno));
+ textDest.c_str(), strerror(errno));
return UNKNOWN_ERROR;
}
if (bundle->getVerbose()) {
- printf(" Writing text symbols for class %s.\n", className.string());
+ printf(" Writing text symbols for class %s.\n", className.c_str());
}
status_t err = writeTextSymbolClass(fp, assets, includePrivate, symbols,
@@ -2919,8 +2919,8 @@
String8 dependencyFile(bundle->getRClassDir());
dependencyFile.appendPath("R.java.d");
- FILE *fp = fopen(dependencyFile.string(), "a");
- fprintf(fp,"%s \\\n", dest.string());
+ FILE *fp = fopen(dependencyFile.c_str(), "a");
+ fprintf(fp,"%s \\\n", dest.c_str());
fclose(fp);
}
}
@@ -2956,7 +2956,7 @@
// asdf --> package.asdf
// .asdf .a.b --> package.asdf package.a.b
// asdf.adsf --> asdf.asdf
- const char* p = className.string();
+ const char* p = className.c_str();
const char* q = strchr(p, '.');
if (p == q) {
className = pkg;
@@ -3023,7 +3023,7 @@
if (assGroup->getFiles().size() != 1) {
fprintf(stderr, "warning: Multiple AndroidManifest.xml files found, using %s\n",
- assGroup->getFiles().valueAt(0)->getPrintableSource().string());
+ assGroup->getFiles().valueAt(0)->getPrintableSource().c_str());
}
assFile = assGroup->getFiles().valueAt(0);
@@ -3048,7 +3048,7 @@
}
depth++;
String8 tag(tree.getElementName(&len));
- // printf("Depth %d tag %s\n", depth, tag.string());
+ // printf("Depth %d tag %s\n", depth, tag.c_str());
bool keepTag = false;
if (depth == 1) {
if (tag != "manifest") {
@@ -3065,7 +3065,7 @@
"http://schemas.android.com/apk/res/android",
"backupAgent", &error);
if (agent.length() > 0) {
- addProguardKeepRule(keep, agent, pkg.string(),
+ addProguardKeepRule(keep, agent, pkg.c_str(),
assFile->getPrintableSource(), tree.getLineNumber());
}
@@ -3073,7 +3073,7 @@
defaultProcess = AaptXml::getAttribute(tree,
"http://schemas.android.com/apk/res/android", "process", &error);
if (error != "") {
- fprintf(stderr, "ERROR: %s\n", error.string());
+ fprintf(stderr, "ERROR: %s\n", error.c_str());
return -1;
}
}
@@ -3089,7 +3089,7 @@
String8 componentProcess = AaptXml::getAttribute(tree,
"http://schemas.android.com/apk/res/android", "process", &error);
if (error != "") {
- fprintf(stderr, "ERROR: %s\n", error.string());
+ fprintf(stderr, "ERROR: %s\n", error.c_str());
return -1;
}
@@ -3103,14 +3103,14 @@
String8 name = AaptXml::getAttribute(tree,
"http://schemas.android.com/apk/res/android", "name", &error);
if (error != "") {
- fprintf(stderr, "ERROR: %s\n", error.string());
+ fprintf(stderr, "ERROR: %s\n", error.c_str());
return -1;
}
keepTag = name.length() > 0;
if (keepTag) {
- addProguardKeepRule(keep, name, pkg.string(),
+ addProguardKeepRule(keep, name, pkg.c_str(),
assFile->getPrintableSource(), tree.getLineNumber());
}
}
@@ -3170,7 +3170,7 @@
String8 tag(tree.getElementName(&len));
// If there is no '.', we'll assume that it's one of the built in names.
- if (strchr(tag.string(), '.')) {
+ if (strchr(tag.c_str(), '.')) {
addProguardKeepRule(keep, tag, NULL,
layoutFile->getPrintableSource(), tree.getLineNumber());
} else if (tagAttrPairs != NULL) {
@@ -3183,8 +3183,8 @@
ssize_t attrIndex = tree.indexOfAttribute(nsAttr.ns, nsAttr.attr);
if (attrIndex < 0) {
// fprintf(stderr, "%s:%d: <%s> does not have attribute %s:%s.\n",
- // layoutFile->getPrintableSource().string(), tree.getLineNumber(),
- // tag.string(), nsAttr.ns, nsAttr.attr);
+ // layoutFile->getPrintableSource().c_str(), tree.getLineNumber(),
+ // tag.c_str(), nsAttr.ns, nsAttr.attr);
} else {
size_t len;
addProguardKeepRule(keep,
@@ -3242,7 +3242,7 @@
// tag:attribute pairs that should be checked in transition files.
KeyedVector<String8, Vector<NamespaceAttributePair> > kTransitionTagAttrPairs;
- addTagAttrPair(&kTransitionTagAttrPairs, kTransition.string(), NULL, kClass);
+ addTagAttrPair(&kTransitionTagAttrPairs, kTransition.c_str(), NULL, kClass);
addTagAttrPair(&kTransitionTagAttrPairs, "pathMotion", NULL, kClass);
const Vector<sp<AaptDir> >& dirs = assets->resDirs();
@@ -3252,16 +3252,16 @@
const String8& dirName = d->getLeaf();
Vector<String8> startTags;
const KeyedVector<String8, Vector<NamespaceAttributePair> >* tagAttrPairs = NULL;
- if ((dirName == String8("layout")) || (strncmp(dirName.string(), "layout-", 7) == 0)) {
+ if ((dirName == String8("layout")) || (strncmp(dirName.c_str(), "layout-", 7) == 0)) {
tagAttrPairs = &kLayoutTagAttrPairs;
- } else if ((dirName == String8("xml")) || (strncmp(dirName.string(), "xml-", 4) == 0)) {
+ } else if ((dirName == String8("xml")) || (strncmp(dirName.c_str(), "xml-", 4) == 0)) {
startTags.add(String8("PreferenceScreen"));
startTags.add(String8("preference-headers"));
tagAttrPairs = &kXmlTagAttrPairs;
- } else if ((dirName == String8("menu")) || (strncmp(dirName.string(), "menu-", 5) == 0)) {
+ } else if ((dirName == String8("menu")) || (strncmp(dirName.c_str(), "menu-", 5) == 0)) {
startTags.add(String8("menu"));
tagAttrPairs = NULL;
- } else if (dirName == kTransition || (strncmp(dirName.string(), kTransitionPrefix.string(),
+ } else if (dirName == kTransition || (strncmp(dirName.c_str(), kTransitionPrefix.c_str(),
kTransitionPrefix.size()) == 0)) {
tagAttrPairs = &kTransitionTagAttrPairs;
} else {
@@ -3307,9 +3307,9 @@
const SortedVector<String8>& locations = rules.valueAt(i);
const size_t M = locations.size();
for (size_t j=0; j<M; j++) {
- fprintf(fp, "# %s\n", locations.itemAt(j).string());
+ fprintf(fp, "# %s\n", locations.itemAt(j).c_str());
}
- fprintf(fp, "%s\n\n", rules.keyAt(i).string());
+ fprintf(fp, "%s\n\n", rules.keyAt(i).c_str());
}
fclose(fp);
@@ -3366,7 +3366,7 @@
status_t deps = -1;
for (size_t file_i = 0; file_i < files->size(); ++file_i) {
// Add the full file path to the dependency file
- fprintf(fp, "%s \\\n", files->itemAt(file_i).string());
+ fprintf(fp, "%s \\\n", files->itemAt(file_i).c_str());
deps++;
}
return deps;
diff --git a/tools/aapt/ResourceFilter.cpp b/tools/aapt/ResourceFilter.cpp
index ed06f60..cc8dce7e 100644
--- a/tools/aapt/ResourceFilter.cpp
+++ b/tools/aapt/ResourceFilter.cpp
@@ -32,7 +32,7 @@
// only specify locale in the standard 'en_US' format.
val.writeTo(&entry.first);
} else if (!AaptConfig::parse(part, &entry.first)) {
- fprintf(stderr, "Invalid configuration: %s\n", part.string());
+ fprintf(stderr, "Invalid configuration: %s\n", part.c_str());
return UNKNOWN_ERROR;
}
@@ -43,7 +43,7 @@
// Ignore any densities. Those are best handled in --preferred-density
if ((entry.second & ResTable_config::CONFIG_DENSITY) != 0) {
- fprintf(stderr, "warning: ignoring flag -c %s. Use --preferred-density instead.\n", entry.first.toString().string());
+ fprintf(stderr, "warning: ignoring flag -c %s. Use --preferred-density instead.\n", entry.first.toString().c_str());
entry.first.density = 0;
entry.second &= ~ResTable_config::CONFIG_DENSITY;
}
@@ -148,7 +148,7 @@
mConfigs.clear();
for (size_t i = 0; i < configStrs.size(); i++) {
if (!AaptConfig::parse(configStrs[i], &config)) {
- fprintf(stderr, "Invalid configuration: %s\n", configStrs[i].string());
+ fprintf(stderr, "Invalid configuration: %s\n", configStrs[i].c_str());
return UNKNOWN_ERROR;
}
mConfigs.insert(config);
diff --git a/tools/aapt/ResourceIdCache.cpp b/tools/aapt/ResourceIdCache.cpp
index 8835fb0..1c7788d 100644
--- a/tools/aapt/ResourceIdCache.cpp
+++ b/tools/aapt/ResourceIdCache.cpp
@@ -37,7 +37,7 @@
static uint32_t hash(const android::String16& hashableString) {
uint32_t hash = 5381;
- const char16_t* str = hashableString.string();
+ const char16_t* str = hashableString.c_str();
while (int c = *str++) hash = hashround(hash, c);
return hash;
}
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index 4e597fb..2344007 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -361,10 +361,10 @@
ssize_t typeIdx = block.indexOfAttribute(NULL, "format");
if (typeIdx >= 0) {
String16 typeStr = String16(block.getAttributeStringValue(typeIdx, &len));
- attr.type = parse_flags(typeStr.string(), typeStr.size(), gFormatFlags);
+ attr.type = parse_flags(typeStr.c_str(), typeStr.size(), gFormatFlags);
if (attr.type == 0) {
attr.sourcePos.error("Tag <attr> 'format' attribute value \"%s\" not valid\n",
- String8(typeStr).string());
+ String8(typeStr).c_str());
attr.hasErrors = true;
}
attr.createIfNeeded(outTable);
@@ -374,14 +374,14 @@
attr.createIfNeeded(outTable);
}
- //printf("Attribute %s: type=0x%08x\n", String8(attr.ident).string(), attr.type);
+ //printf("Attribute %s: type=0x%08x\n", String8(attr.ident).c_str(), attr.type);
ssize_t minIdx = block.indexOfAttribute(NULL, "min");
if (minIdx >= 0) {
String16 val = String16(block.getAttributeStringValue(minIdx, &len));
- if (!ResTable::stringToInt(val.string(), val.size(), NULL)) {
+ if (!ResTable::stringToInt(val.c_str(), val.size(), NULL)) {
attr.sourcePos.error("Tag <attr> 'min' attribute must be a number, not \"%s\"\n",
- String8(val).string());
+ String8(val).c_str());
attr.hasErrors = true;
}
attr.createIfNeeded(outTable);
@@ -397,9 +397,9 @@
ssize_t maxIdx = block.indexOfAttribute(NULL, "max");
if (maxIdx >= 0) {
String16 val = String16(block.getAttributeStringValue(maxIdx, &len));
- if (!ResTable::stringToInt(val.string(), val.size(), NULL)) {
+ if (!ResTable::stringToInt(val.c_str(), val.size(), NULL)) {
attr.sourcePos.error("Tag <attr> 'max' attribute must be a number, not \"%s\"\n",
- String8(val).string());
+ String8(val).c_str());
attr.hasErrors = true;
}
attr.createIfNeeded(outTable);
@@ -422,7 +422,7 @@
uint32_t l10n_required = parse_flags(str, len, l10nRequiredFlags, &error);
if (error) {
attr.sourcePos.error("Tag <attr> 'localization' attribute value \"%s\" not valid\n",
- String8(str).string());
+ String8(str).c_str());
attr.hasErrors = true;
}
attr.createIfNeeded(outTable);
@@ -442,14 +442,14 @@
while ((code=block.next()) != ResXMLTree::END_DOCUMENT && code != ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::START_TAG) {
uint32_t localType = 0;
- if (strcmp16(block.getElementName(&len), enum16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), enum16.c_str()) == 0) {
localType = ResTable_map::TYPE_ENUM;
- } else if (strcmp16(block.getElementName(&len), flag16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), flag16.c_str()) == 0) {
localType = ResTable_map::TYPE_FLAGS;
} else {
SourcePos(in->getPrintableSource(), block.getLineNumber())
.error("Tag <%s> can not appear inside <attr>, only <enum> or <flag>\n",
- String8(block.getElementName(&len)).string());
+ String8(block.getElementName(&len)).c_str());
return UNKNOWN_ERROR;
}
@@ -505,11 +505,11 @@
.error("A 'value' attribute is required for <enum> or <flag>\n");
attr.hasErrors = true;
}
- if (!attr.hasErrors && !ResTable::stringToInt(value.string(), value.size(), NULL)) {
+ if (!attr.hasErrors && !ResTable::stringToInt(value.c_str(), value.size(), NULL)) {
SourcePos(in->getPrintableSource(), block.getLineNumber())
.error("Tag <enum> or <flag> 'value' attribute must be a number,"
" not \"%s\"\n",
- String8(value).string());
+ String8(value).c_str());
attr.hasErrors = true;
}
@@ -546,21 +546,21 @@
}
}
} else if (code == ResXMLTree::END_TAG) {
- if (strcmp16(block.getElementName(&len), attr16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), attr16.c_str()) == 0) {
break;
}
if ((attr.type&ResTable_map::TYPE_ENUM) != 0) {
- if (strcmp16(block.getElementName(&len), enum16.string()) != 0) {
+ if (strcmp16(block.getElementName(&len), enum16.c_str()) != 0) {
SourcePos(in->getPrintableSource(), block.getLineNumber())
.error("Found tag </%s> where </enum> is expected\n",
- String8(block.getElementName(&len)).string());
+ String8(block.getElementName(&len)).c_str());
return UNKNOWN_ERROR;
}
} else {
- if (strcmp16(block.getElementName(&len), flag16.string()) != 0) {
+ if (strcmp16(block.getElementName(&len), flag16.c_str()) != 0) {
SourcePos(in->getPrintableSource(), block.getLineNumber())
.error("Found tag </%s> where </flag> is expected\n",
- String8(block.getElementName(&len)).string());
+ String8(block.getElementName(&len)).c_str());
return UNKNOWN_ERROR;
}
}
@@ -606,7 +606,7 @@
String16 str;
Vector<StringPool::entry_style_span> spans;
- err = parseStyledString(bundle, in->getPrintableSource().string(),
+ err = parseStyledString(bundle, in->getPrintableSource().c_str(),
block, item16, &str, &spans, isFormatted,
pseudolocalize);
if (err != NO_ERROR) {
@@ -619,10 +619,10 @@
config.language[0], config.language[1],
config.country[0], config.country[1],
config.orientation, config.density,
- String8(parentIdent).string(),
- String8(ident).string(),
- String8(itemIdent).string(),
- String8(str).string());
+ String8(parentIdent).c_str(),
+ String8(ident).c_str(),
+ String8(itemIdent).c_str(),
+ String8(str).c_str());
}
err = outTable->addBag(SourcePos(in->getPrintableSource(), block->getLineNumber()),
@@ -636,8 +636,8 @@
* haystack, false otherwise.
*/
bool isInProductList(const String16& needle, const String16& haystack) {
- const char16_t *needle2 = needle.string();
- const char16_t *haystack2 = haystack.string();
+ const char16_t *needle2 = needle.c_str();
+ const char16_t *haystack2 = haystack.c_str();
size_t needlesize = needle.size();
while (*haystack2 != '\0') {
@@ -703,7 +703,7 @@
String16 str;
Vector<StringPool::entry_style_span> spans;
- err = parseStyledString(bundle, in->getPrintableSource().string(), block,
+ err = parseStyledString(bundle, in->getPrintableSource().c_str(), block,
curTag, &str, curIsStyled ? &spans : NULL,
isFormatted, pseudolocalize);
@@ -730,7 +730,7 @@
*/
if (bundleProduct[0] == '\0') {
- if (strcmp16(String16("default").string(), product.string()) != 0) {
+ if (strcmp16(String16("default").c_str(), product.c_str()) != 0) {
/*
* This string has a product other than 'default'. Do not add it,
* but record it so that if we do not see the same string with
@@ -750,7 +750,7 @@
if (isInProductList(product, String16(bundleProduct))) {
;
- } else if (strcmp16(String16("default").string(), product.string()) == 0 &&
+ } else if (strcmp16(String16("default").c_str(), product.c_str()) == 0 &&
!outTable->hasBagOrEntry(myPackage, curType, ident, config)) {
;
} else {
@@ -764,7 +764,7 @@
config.language[0], config.language[1],
config.country[0], config.country[1],
config.orientation, config.density,
- String8(ident).string(), String8(str).string());
+ String8(ident).c_str(), String8(str).c_str());
}
err = outTable->addEntry(SourcePos(in->getPrintableSource(), block->getLineNumber()),
@@ -847,7 +847,7 @@
bool hasErrors = false;
bool fileIsTranslatable = true;
- if (strstr(in->getPrintableSource().string(), "donottranslate") != NULL) {
+ if (strstr(in->getPrintableSource().c_str(), "donottranslate") != NULL) {
fileIsTranslatable = false;
}
@@ -869,9 +869,9 @@
"No start tag found\n");
return UNKNOWN_ERROR;
}
- if (strcmp16(block.getElementName(&len), resources16.string()) != 0) {
+ if (strcmp16(block.getElementName(&len), resources16.c_str()) != 0) {
SourcePos(in->getPrintableSource(), block.getLineNumber()).error(
- "Invalid start tag %s\n", String8(block.getElementName(&len)).string());
+ "Invalid start tag %s\n", String8(block.getElementName(&len)).c_str());
return UNKNOWN_ERROR;
}
@@ -900,7 +900,7 @@
SourcePos(in->getPrintableSource(), 0).warning(
"Resource file %s is skipped as pseudolocalization"
" was done automatically.",
- in->getPrintableSource().string());
+ in->getPrintableSource().c_str());
return NO_ERROR;
}
@@ -917,29 +917,29 @@
bool curIsFormatted = fileIsTranslatable;
bool localHasErrors = false;
- if (strcmp16(block.getElementName(&len), skip16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), skip16.c_str()) == 0) {
while ((code=block.next()) != ResXMLTree::END_DOCUMENT
&& code != ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::END_TAG) {
- if (strcmp16(block.getElementName(&len), skip16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), skip16.c_str()) == 0) {
break;
}
}
}
continue;
- } else if (strcmp16(block.getElementName(&len), eat_comment16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), eat_comment16.c_str()) == 0) {
while ((code=block.next()) != ResXMLTree::END_DOCUMENT
&& code != ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::END_TAG) {
- if (strcmp16(block.getElementName(&len), eat_comment16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), eat_comment16.c_str()) == 0) {
break;
}
}
}
continue;
- } else if (strcmp16(block.getElementName(&len), public16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), public16.c_str()) == 0) {
SourcePos srcPos(in->getPrintableSource(), block.getLineNumber());
String16 type;
@@ -965,7 +965,7 @@
Res_value identValue;
if (!ResTable::stringToInt(identStr, len, &identValue)) {
srcPos.error("Given 'id' attribute is not an integer: %s\n",
- String8(block.getAttributeStringValue(identIdx, &len)).string());
+ String8(block.getAttributeStringValue(identIdx, &len)).c_str());
hasErrors = localHasErrors = true;
} else {
ident = identValue.data;
@@ -1004,14 +1004,14 @@
while ((code=block.next()) != ResXMLTree::END_DOCUMENT && code != ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::END_TAG) {
- if (strcmp16(block.getElementName(&len), public16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), public16.c_str()) == 0) {
break;
}
}
}
continue;
- } else if (strcmp16(block.getElementName(&len), public_padding16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), public_padding16.c_str()) == 0) {
SourcePos srcPos(in->getPrintableSource(), block.getLineNumber());
String16 type;
@@ -1037,7 +1037,7 @@
Res_value startValue;
if (!ResTable::stringToInt(startStr, len, &startValue)) {
srcPos.error("Given 'start' attribute is not an integer: %s\n",
- String8(block.getAttributeStringValue(startIdx, &len)).string());
+ String8(block.getAttributeStringValue(startIdx, &len)).c_str());
hasErrors = localHasErrors = true;
} else {
start = startValue.data;
@@ -1057,7 +1057,7 @@
Res_value endValue;
if (!ResTable::stringToInt(endStr, len, &endValue)) {
srcPos.error("Given 'end' attribute is not an integer: %s\n",
- String8(block.getAttributeStringValue(endIdx, &len)).string());
+ String8(block.getAttributeStringValue(endIdx, &len)).c_str());
hasErrors = localHasErrors = true;
} else {
end = endValue.data;
@@ -1114,14 +1114,14 @@
while ((code=block.next()) != ResXMLTree::END_DOCUMENT && code != ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::END_TAG) {
- if (strcmp16(block.getElementName(&len), public_padding16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), public_padding16.c_str()) == 0) {
break;
}
}
}
continue;
- } else if (strcmp16(block.getElementName(&len), private_symbols16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), private_symbols16.c_str()) == 0) {
String16 pkg;
ssize_t pkgIdx = block.indexOfAttribute(NULL, "package");
if (pkgIdx < 0) {
@@ -1144,14 +1144,14 @@
while ((code=block.next()) != ResXMLTree::END_DOCUMENT && code != ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::END_TAG) {
- if (strcmp16(block.getElementName(&len), private_symbols16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), private_symbols16.c_str()) == 0) {
break;
}
}
}
continue;
- } else if (strcmp16(block.getElementName(&len), java_symbol16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), java_symbol16.c_str()) == 0) {
SourcePos srcPos(in->getPrintableSource(), block.getLineNumber());
String16 type;
@@ -1186,7 +1186,7 @@
while ((code=block.next()) != ResXMLTree::END_DOCUMENT && code != ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::END_TAG) {
- if (strcmp16(block.getElementName(&len), java_symbol16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), java_symbol16.c_str()) == 0) {
break;
}
}
@@ -1194,7 +1194,7 @@
continue;
- } else if (strcmp16(block.getElementName(&len), add_resource16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), add_resource16.c_str()) == 0) {
SourcePos srcPos(in->getPrintableSource(), block.getLineNumber());
String16 typeName;
@@ -1217,14 +1217,14 @@
while ((code=block.next()) != ResXMLTree::END_DOCUMENT && code != ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::END_TAG) {
- if (strcmp16(block.getElementName(&len), add_resource16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), add_resource16.c_str()) == 0) {
break;
}
}
}
continue;
- } else if (strcmp16(block.getElementName(&len), declare_styleable16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), declare_styleable16.c_str()) == 0) {
SourcePos srcPos(in->getPrintableSource(), block.getLineNumber());
String16 ident;
@@ -1258,30 +1258,30 @@
while ((code=block.next()) != ResXMLTree::END_DOCUMENT && code != ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::START_TAG) {
- if (strcmp16(block.getElementName(&len), skip16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), skip16.c_str()) == 0) {
while ((code=block.next()) != ResXMLTree::END_DOCUMENT
&& code != ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::END_TAG) {
- if (strcmp16(block.getElementName(&len), skip16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), skip16.c_str()) == 0) {
break;
}
}
}
continue;
- } else if (strcmp16(block.getElementName(&len), eat_comment16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), eat_comment16.c_str()) == 0) {
while ((code=block.next()) != ResXMLTree::END_DOCUMENT
&& code != ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::END_TAG) {
- if (strcmp16(block.getElementName(&len), eat_comment16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), eat_comment16.c_str()) == 0) {
break;
}
}
}
continue;
- } else if (strcmp16(block.getElementName(&len), attr16.string()) != 0) {
+ } else if (strcmp16(block.getElementName(&len), attr16.c_str()) != 0) {
SourcePos(in->getPrintableSource(), block.getLineNumber()).error(
"Tag <%s> can not appear inside <declare-styleable>, only <attr>\n",
- String8(block.getElementName(&len)).string());
+ String8(block.getElementName(&len)).c_str());
return UNKNOWN_ERROR;
}
@@ -1297,30 +1297,30 @@
SourcePos srcPos(String8(in->getPrintableSource()), block.getLineNumber());
symbols->addSymbol(String8(itemIdent), 0, srcPos);
symbols->appendComment(String8(itemIdent), comment, srcPos);
- //printf("Attribute %s comment: %s\n", String8(itemIdent).string(),
- // String8(comment).string());
+ //printf("Attribute %s comment: %s\n", String8(itemIdent).c_str(),
+ // String8(comment).c_str());
}
} else if (code == ResXMLTree::END_TAG) {
- if (strcmp16(block.getElementName(&len), declare_styleable16.string()) == 0) {
+ if (strcmp16(block.getElementName(&len), declare_styleable16.c_str()) == 0) {
break;
}
SourcePos(in->getPrintableSource(), block.getLineNumber()).error(
"Found tag </%s> where </attr> is expected\n",
- String8(block.getElementName(&len)).string());
+ String8(block.getElementName(&len)).c_str());
return UNKNOWN_ERROR;
}
}
continue;
- } else if (strcmp16(block.getElementName(&len), attr16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), attr16.c_str()) == 0) {
err = compileAttribute(in, block, myPackage, outTable, NULL);
if (err != NO_ERROR) {
hasErrors = true;
}
continue;
- } else if (strcmp16(block.getElementName(&len), item16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), item16.c_str()) == 0) {
curTag = &item16;
ssize_t attri = block.indexOfAttribute(NULL, "type");
if (attri >= 0) {
@@ -1333,12 +1333,12 @@
if (formatIdx >= 0) {
String16 formatStr = String16(block.getAttributeStringValue(
formatIdx, &len));
- curFormat = parse_flags(formatStr.string(), formatStr.size(),
+ curFormat = parse_flags(formatStr.c_str(), formatStr.size(),
gFormatFlags);
if (curFormat == 0) {
SourcePos(in->getPrintableSource(), block.getLineNumber()).error(
"Tag <item> 'format' attribute value \"%s\" not valid\n",
- String8(formatStr).string());
+ String8(formatStr).c_str());
hasErrors = localHasErrors = true;
}
}
@@ -1348,7 +1348,7 @@
hasErrors = localHasErrors = true;
}
curIsStyled = true;
- } else if (strcmp16(block.getElementName(&len), string16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), string16.c_str()) == 0) {
// Note the existence and locale of every string we process
char rawLocale[RESTABLE_MAX_LOCALE_LEN];
curParams.getBcp47Locale(rawLocale);
@@ -1361,11 +1361,11 @@
for (size_t i = 0; i < n; i++) {
size_t length;
const char16_t* attr = block.getAttributeName(i, &length);
- if (strcmp16(attr, name16.string()) == 0) {
+ if (strcmp16(attr, name16.c_str()) == 0) {
name.setTo(block.getAttributeStringValue(i, &length));
- } else if (strcmp16(attr, translatable16.string()) == 0) {
+ } else if (strcmp16(attr, translatable16.c_str()) == 0) {
translatable.setTo(block.getAttributeStringValue(i, &length));
- } else if (strcmp16(attr, formatted16.string()) == 0) {
+ } else if (strcmp16(attr, formatted16.c_str()) == 0) {
formatted.setTo(block.getAttributeStringValue(i, &length));
}
}
@@ -1380,8 +1380,8 @@
if (locale.size() > 0) {
SourcePos(in->getPrintableSource(), block.getLineNumber()).warning(
"string '%s' marked untranslatable but exists in locale '%s'\n",
- String8(name).string(),
- locale.string());
+ String8(name).c_str(),
+ locale.c_str());
// hasErrors = localHasErrors = true;
} else {
// Intentionally empty block:
@@ -1407,31 +1407,31 @@
curFormat = ResTable_map::TYPE_REFERENCE|ResTable_map::TYPE_STRING;
curIsStyled = true;
curIsPseudolocalizable = fileIsTranslatable && (translatable != false16);
- } else if (strcmp16(block.getElementName(&len), drawable16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), drawable16.c_str()) == 0) {
curTag = &drawable16;
curType = drawable16;
curFormat = ResTable_map::TYPE_REFERENCE|ResTable_map::TYPE_COLOR;
- } else if (strcmp16(block.getElementName(&len), color16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), color16.c_str()) == 0) {
curTag = &color16;
curType = color16;
curFormat = ResTable_map::TYPE_REFERENCE|ResTable_map::TYPE_COLOR;
- } else if (strcmp16(block.getElementName(&len), bool16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), bool16.c_str()) == 0) {
curTag = &bool16;
curType = bool16;
curFormat = ResTable_map::TYPE_REFERENCE|ResTable_map::TYPE_BOOLEAN;
- } else if (strcmp16(block.getElementName(&len), integer16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), integer16.c_str()) == 0) {
curTag = &integer16;
curType = integer16;
curFormat = ResTable_map::TYPE_REFERENCE|ResTable_map::TYPE_INTEGER;
- } else if (strcmp16(block.getElementName(&len), dimen16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), dimen16.c_str()) == 0) {
curTag = &dimen16;
curType = dimen16;
curFormat = ResTable_map::TYPE_REFERENCE|ResTable_map::TYPE_DIMENSION;
- } else if (strcmp16(block.getElementName(&len), fraction16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), fraction16.c_str()) == 0) {
curTag = &fraction16;
curType = fraction16;
curFormat = ResTable_map::TYPE_REFERENCE|ResTable_map::TYPE_FRACTION;
- } else if (strcmp16(block.getElementName(&len), bag16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), bag16.c_str()) == 0) {
curTag = &bag16;
curIsBag = true;
ssize_t attri = block.indexOfAttribute(NULL, "type");
@@ -1442,16 +1442,16 @@
"A 'type' attribute is required for <bag>\n");
hasErrors = localHasErrors = true;
}
- } else if (strcmp16(block.getElementName(&len), style16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), style16.c_str()) == 0) {
curTag = &style16;
curType = style16;
curIsBag = true;
- } else if (strcmp16(block.getElementName(&len), plurals16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), plurals16.c_str()) == 0) {
curTag = &plurals16;
curType = plurals16;
curIsBag = true;
curIsPseudolocalizable = fileIsTranslatable;
- } else if (strcmp16(block.getElementName(&len), array16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), array16.c_str()) == 0) {
curTag = &array16;
curType = array16;
curIsBag = true;
@@ -1460,16 +1460,16 @@
if (formatIdx >= 0) {
String16 formatStr = String16(block.getAttributeStringValue(
formatIdx, &len));
- curFormat = parse_flags(formatStr.string(), formatStr.size(),
+ curFormat = parse_flags(formatStr.c_str(), formatStr.size(),
gFormatFlags);
if (curFormat == 0) {
SourcePos(in->getPrintableSource(), block.getLineNumber()).error(
"Tag <array> 'format' attribute value \"%s\" not valid\n",
- String8(formatStr).string());
+ String8(formatStr).c_str());
hasErrors = localHasErrors = true;
}
}
- } else if (strcmp16(block.getElementName(&len), string_array16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), string_array16.c_str()) == 0) {
// Check whether these strings need valid formats.
// (simplified form of what string16 does above)
bool isTranslatable = false;
@@ -1480,14 +1480,14 @@
for (size_t i = 0; i < n; i++) {
size_t length;
const char16_t* attr = block.getAttributeName(i, &length);
- if (strcmp16(attr, formatted16.string()) == 0) {
+ if (strcmp16(attr, formatted16.c_str()) == 0) {
const char16_t* value = block.getAttributeStringValue(i, &length);
- if (strcmp16(value, false16.string()) == 0) {
+ if (strcmp16(value, false16.c_str()) == 0) {
curIsFormatted = false;
}
- } else if (strcmp16(attr, translatable16.string()) == 0) {
+ } else if (strcmp16(attr, translatable16.c_str()) == 0) {
const char16_t* value = block.getAttributeStringValue(i, &length);
- if (strcmp16(value, false16.string()) == 0) {
+ if (strcmp16(value, false16.c_str()) == 0) {
isTranslatable = false;
}
}
@@ -1499,7 +1499,7 @@
curIsBag = true;
curIsBagReplaceOnOverwrite = true;
curIsPseudolocalizable = isTranslatable && fileIsTranslatable;
- } else if (strcmp16(block.getElementName(&len), integer_array16.string()) == 0) {
+ } else if (strcmp16(block.getElementName(&len), integer_array16.c_str()) == 0) {
curTag = &integer_array16;
curType = array16;
curFormat = ResTable_map::TYPE_REFERENCE|ResTable_map::TYPE_INTEGER;
@@ -1508,7 +1508,7 @@
} else {
SourcePos(in->getPrintableSource(), block.getLineNumber()).error(
"Found tag %s where item is expected\n",
- String8(block.getElementName(&len)).string());
+ String8(block.getElementName(&len)).c_str());
return UNKNOWN_ERROR;
}
@@ -1519,7 +1519,7 @@
} else {
SourcePos(in->getPrintableSource(), block.getLineNumber()).error(
"A 'name' attribute is required for <%s>\n",
- String8(*curTag).string());
+ String8(*curTag).c_str());
hasErrors = localHasErrors = true;
}
@@ -1560,11 +1560,11 @@
&& code != ResXMLTree::BAD_DOCUMENT) {
if (code == ResXMLTree::START_TAG) {
- if (strcmp16(block.getElementName(&len), item16.string()) != 0) {
+ if (strcmp16(block.getElementName(&len), item16.c_str()) != 0) {
SourcePos(in->getPrintableSource(), block.getLineNumber()).error(
"Tag <%s> can not appear inside <%s>, only <item>\n",
- String8(block.getElementName(&len)).string(),
- String8(*curTag).string());
+ String8(block.getElementName(&len)).c_str(),
+ String8(*curTag).c_str());
return UNKNOWN_ERROR;
}
@@ -1647,11 +1647,11 @@
hasErrors = localHasErrors = true;
}
} else if (code == ResXMLTree::END_TAG) {
- if (strcmp16(block.getElementName(&len), curTag->string()) != 0) {
+ if (strcmp16(block.getElementName(&len), curTag->c_str()) != 0) {
SourcePos(in->getPrintableSource(), block.getLineNumber()).error(
"Found tag </%s> where </%s> is expected\n",
- String8(block.getElementName(&len)).string(),
- String8(*curTag).string());
+ String8(block.getElementName(&len)).c_str(),
+ String8(*curTag).c_str());
return UNKNOWN_ERROR;
}
break;
@@ -1700,9 +1700,9 @@
#if 0
if (comment.size() > 0) {
- printf("Comment for @%s:%s/%s: %s\n", String8(myPackage).string(),
- String8(curType).string(), String8(ident).string(),
- String8(comment).string());
+ printf("Comment for @%s:%s/%s: %s\n", String8(myPackage).c_str(),
+ String8(curType).c_str(), String8(ident).c_str(),
+ String8(comment).c_str());
}
#endif
if (!localHasErrors) {
@@ -1710,9 +1710,9 @@
}
}
else if (code == ResXMLTree::END_TAG) {
- if (strcmp16(block.getElementName(&len), resources16.string()) != 0) {
+ if (strcmp16(block.getElementName(&len), resources16.c_str()) != 0) {
SourcePos(in->getPrintableSource(), block.getLineNumber()).error(
- "Unexpected end tag %s\n", String8(block.getElementName(&len)).string());
+ "Unexpected end tag %s\n", String8(block.getElementName(&len)).c_str());
return UNKNOWN_ERROR;
}
}
@@ -1724,7 +1724,7 @@
}
SourcePos(in->getPrintableSource(), block.getLineNumber()).error(
"Found text \"%s\" where item tag is expected\n",
- String8(block.getText(&len)).string());
+ String8(block.getText(&len)).c_str());
return UNKNOWN_ERROR;
}
}
@@ -1740,13 +1740,13 @@
const char* bundleProduct =
(bundle->getProduct() == NULL) ? "" : bundle->getProduct();
fprintf(stderr, "In resource file %s: %s\n",
- in->getPrintableSource().string(),
- curParams.toString().string());
+ in->getPrintableSource().c_str(),
+ curParams.toString().c_str());
fprintf(stderr, "\t%s '%s' does not match product %s.\n"
"\tYou may have forgotten to include a 'default' product variant"
" of the resource.\n",
- String8(p.type).string(), String8(p.ident).string(),
+ String8(p.type).c_str(), String8(p.ident).c_str(),
bundleProduct[0] == 0 ? "default" : bundleProduct);
return UNKNOWN_ERROR;
}
@@ -1816,7 +1816,7 @@
AssetManager featureAssetManager;
if (!featureAssetManager.addAssetPath(featureAfter, NULL)) {
fprintf(stderr, "ERROR: Feature package '%s' not found.\n",
- featureAfter.string());
+ featureAfter.c_str());
return UNKNOWN_ERROR;
}
@@ -1835,13 +1835,13 @@
const uint32_t ident)
{
uint32_t rid = mAssets->getIncludedResources()
- .identifierForName(name.string(), name.size(),
- type.string(), type.size(),
- package.string(), package.size());
+ .identifierForName(name.c_str(), name.size(),
+ type.c_str(), type.size(),
+ package.c_str(), package.size());
if (rid != 0) {
sourcePos.error("Error declaring public resource %s/%s for included package %s\n",
- String8(type).string(), String8(name).string(),
- String8(package).string());
+ String8(type).c_str(), String8(name).c_str(),
+ String8(package).c_str());
return UNKNOWN_ERROR;
}
@@ -1864,12 +1864,12 @@
const bool overwrite)
{
uint32_t rid = mAssets->getIncludedResources()
- .identifierForName(name.string(), name.size(),
- type.string(), type.size(),
- package.string(), package.size());
+ .identifierForName(name.c_str(), name.size(),
+ type.c_str(), type.size(),
+ package.c_str(), package.size());
if (rid != 0) {
sourcePos.error("Resource entry %s/%s is already defined in package %s.",
- String8(type).string(), String8(name).string(), String8(package).string());
+ String8(type).c_str(), String8(name).c_str(), String8(package).c_str());
return UNKNOWN_ERROR;
}
@@ -1899,12 +1899,12 @@
// Check for adding entries in other packages... for now we do
// nothing. We need to do the right thing here to support skinning.
uint32_t rid = mAssets->getIncludedResources()
- .identifierForName(name.string(), name.size(),
- type.string(), type.size(),
- package.string(), package.size());
+ .identifierForName(name.c_str(), name.size(),
+ type.c_str(), type.size(),
+ package.c_str(), package.size());
if (rid != 0) {
sourcePos.error("Resource entry %s/%s is already defined in package %s.",
- String8(type).string(), String8(name).string(), String8(package).string());
+ String8(type).c_str(), String8(name).c_str(), String8(package).c_str());
return UNKNOWN_ERROR;
}
@@ -1921,7 +1921,7 @@
}
if (!canAdd) {
sourcePos.error("Resource does not already exist in overlay at '%s'; use <add-resource> to add.\n",
- String8(name).string());
+ String8(name).c_str());
return UNKNOWN_ERROR;
}
}
@@ -1959,9 +1959,9 @@
// Check for adding entries in other packages... for now we do
// nothing. We need to do the right thing here to support skinning.
uint32_t rid = mAssets->getIncludedResources()
- .identifierForName(name.string(), name.size(),
- type.string(), type.size(),
- package.string(), package.size());
+ .identifierForName(name.c_str(), name.size(),
+ type.c_str(), type.size(),
+ package.c_str(), package.size());
if (rid != 0) {
return NO_ERROR;
}
@@ -1969,7 +1969,7 @@
#if 0
if (name == String16("left")) {
printf("Adding bag left: file=%s, line=%d, type=%s\n",
- sourcePos.file.striing(), sourcePos.line, String8(type).string());
+ sourcePos.file.striing(), sourcePos.line, String8(type).c_str());
}
#endif
sp<Entry> e = getEntry(package, type, name, sourcePos, replace, params);
@@ -1996,9 +1996,9 @@
{
// First look for this in the included resources...
uint32_t rid = mAssets->getIncludedResources()
- .identifierForName(name.string(), name.size(),
- type.string(), type.size(),
- package.string(), package.size());
+ .identifierForName(name.c_str(), name.size(),
+ type.c_str(), type.size(),
+ package.c_str(), package.size());
if (rid != 0) {
return true;
}
@@ -2022,9 +2022,9 @@
{
// First look for this in the included resources...
uint32_t rid = mAssets->getIncludedResources()
- .identifierForName(name.string(), name.size(),
- type.string(), type.size(),
- package.string(), package.size());
+ .identifierForName(name.c_str(), name.size(),
+ type.c_str(), type.size(),
+ package.c_str(), package.size());
if (rid != 0) {
return true;
}
@@ -2051,7 +2051,7 @@
const String16* defPackage)
{
String16 package, type, name;
- if (!ResTable::expandResourceRef(ref.string(), ref.size(), &package, &type, &name,
+ if (!ResTable::expandResourceRef(ref.c_str(), ref.size(), &package, &type, &name,
defType, defPackage ? defPackage:&mAssetsPackage, NULL)) {
return false;
}
@@ -2115,17 +2115,17 @@
// First look for this in the included resources...
uint32_t rid = mAssets->getIncludedResources()
- .identifierForName(name.string(), name.size(),
- attr16.string(), attr16.size(),
- package.string(), package.size());
+ .identifierForName(name.c_str(), name.size(),
+ attr16.c_str(), attr16.size(),
+ package.c_str(), package.size());
if (rid != 0) {
- source.error("Attribute \"%s\" has already been defined", String8(name).string());
+ source.error("Attribute \"%s\" has already been defined", String8(name).c_str());
return false;
}
sp<ResourceTable::Entry> entry = getEntry(package, attr16, name, source, false);
if (entry == NULL) {
- source.error("Failed to create entry attr/%s", String8(name).string());
+ source.error("Failed to create entry attr/%s", String8(name).c_str());
return false;
}
@@ -2146,7 +2146,7 @@
formatItem.value != formatValue16) {
source.error("Attribute \"%s\" already defined with incompatible format.\n"
"%s:%d: Original attribute defined here.",
- String8(name).string(), formatItem.sourcePos.file.string(),
+ String8(name).c_str(), formatItem.sourcePos.file.c_str(),
formatItem.sourcePos.line);
return false;
}
@@ -2207,9 +2207,9 @@
// First look for this in the included resources...
uint32_t specFlags = 0;
uint32_t rid = mAssets->getIncludedResources()
- .identifierForName(name.string(), name.size(),
- type.string(), type.size(),
- package.string(), package.size(),
+ .identifierForName(name.c_str(), name.size(),
+ type.c_str(), type.size(),
+ package.c_str(), package.size(),
&specFlags);
if (rid != 0) {
if (onlyPublic && (specFlags & ResTable_typeSpec::SPEC_PUBLIC) == 0) {
@@ -2253,27 +2253,27 @@
String16 package, type, name;
bool refOnlyPublic = true;
if (!ResTable::expandResourceRef(
- ref.string(), ref.size(), &package, &type, &name,
+ ref.c_str(), ref.size(), &package, &type, &name,
defType, defPackage ? defPackage:&mAssetsPackage,
outErrorMsg, &refOnlyPublic)) {
if (kIsDebug) {
- printf("Expanding resource: ref=%s\n", String8(ref).string());
+ printf("Expanding resource: ref=%s\n", String8(ref).c_str());
printf("Expanding resource: defType=%s\n",
- defType ? String8(*defType).string() : "NULL");
+ defType ? String8(*defType).c_str() : "NULL");
printf("Expanding resource: defPackage=%s\n",
- defPackage ? String8(*defPackage).string() : "NULL");
- printf("Expanding resource: ref=%s\n", String8(ref).string());
+ defPackage ? String8(*defPackage).c_str() : "NULL");
+ printf("Expanding resource: ref=%s\n", String8(ref).c_str());
printf("Expanded resource: p=%s, t=%s, n=%s, res=0\n",
- String8(package).string(), String8(type).string(),
- String8(name).string());
+ String8(package).c_str(), String8(type).c_str(),
+ String8(name).c_str());
}
return 0;
}
uint32_t res = getResId(package, type, name, onlyPublic && refOnlyPublic);
if (kIsDebug) {
printf("Expanded resource: p=%s, t=%s, n=%s, res=%d\n",
- String8(package).string(), String8(type).string(),
- String8(name).string(), res);
+ String8(package).c_str(), String8(type).c_str(),
+ String8(name).c_str(), res);
}
if (res == 0) {
if (outErrorMsg)
@@ -2284,7 +2284,7 @@
bool ResourceTable::isValidResourceName(const String16& s)
{
- const char16_t* p = s.string();
+ const char16_t* p = s.c_str();
bool first = true;
while (*p) {
if ((*p >= 'a' && *p <= 'z')
@@ -2315,7 +2315,7 @@
if (style == NULL || style->size() == 0) {
// Text is not styled so it can be any type... let's figure it out.
res = mAssets->getIncludedResources()
- .stringToValue(outValue, &finalStr, str.string(), str.size(), preserveSpaces,
+ .stringToValue(outValue, &finalStr, str.c_str(), str.size(), preserveSpaces,
coerceType, attrID, NULL, &mAssetsPackage, this,
accessorCookie, attrType);
} else {
@@ -2344,7 +2344,7 @@
if (kIsDebug) {
printf("Adding to pool string style #%zu config %s: %s\n",
style != NULL ? style->size() : 0U,
- configStr.string(), String8(finalStr).string());
+ configStr.c_str(), String8(finalStr).c_str());
}
if (style != NULL && style->size() > 0) {
outValue->data = pool->add(finalStr, *style, configTypeName, config);
@@ -2368,8 +2368,8 @@
uint32_t ResourceTable::getCustomResource(
const String16& package, const String16& type, const String16& name) const
{
- //printf("getCustomResource: %s %s %s\n", String8(package).string(),
- // String8(type).string(), String8(name).string());
+ //printf("getCustomResource: %s %s %s\n", String8(package).c_str(),
+ // String8(type).c_str(), String8(name).c_str());
sp<Package> p = mPackages.valueFor(package);
if (p == NULL) return 0;
sp<Type> t = p->getTypes().valueFor(type);
@@ -2400,7 +2400,7 @@
if (mAssetsPackage != package) {
mCurrentXmlPos.error("creating resource for external package %s: %s/%s.",
- String8(package).string(), String8(type).string(), String8(name).string());
+ String8(package).c_str(), String8(type).c_str(), String8(name).c_str());
if (package == String16("android")) {
mCurrentXmlPos.printf("did you mean to use @+id instead of @+android:id?");
}
@@ -2427,7 +2427,7 @@
Res_value value;
if (getItemValue(attrID, ResTable_map::ATTR_TYPE, &value)) {
//printf("getAttributeType #%08x (%s): #%08x\n", attrID,
- // String8(getEntry(attrID)->getName()).string(), value.data);
+ // String8(getEntry(attrID)->getName()).c_str(), value.data);
*outType = value.data;
return true;
}
@@ -2481,7 +2481,7 @@
vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
ac->sourcePos.error("Error: %s (at '%s' with value '%s').\n",
- buf, ac->attr.string(), ac->value.string());
+ buf, ac->attr.c_str(), ac->value.c_str());
}
}
@@ -2493,7 +2493,7 @@
const size_t N = e->getBag().size();
for (size_t i=0; i<N; i++) {
const String16& key = e->getBag().keyAt(i);
- if (key.size() > 0 && key.string()[0] != '^') {
+ if (key.size() > 0 && key.c_str()[0] != '^') {
outKeys->add(key);
}
}
@@ -2506,14 +2506,14 @@
uint32_t attrID, const char16_t* name, size_t nameLen,
Res_value* outValue)
{
- //printf("getAttributeEnum #%08x %s\n", attrID, String8(name, nameLen).string());
+ //printf("getAttributeEnum #%08x %s\n", attrID, String8(name, nameLen).c_str());
String16 nameStr(name, nameLen);
sp<const Entry> e = getEntry(attrID);
if (e != NULL) {
const size_t N = e->getBag().size();
for (size_t i=0; i<N; i++) {
- //printf("Comparing %s to %s\n", String8(name, nameLen).string(),
- // String8(e->getBag().keyAt(i)).string());
+ //printf("Comparing %s to %s\n", String8(name, nameLen).c_str(),
+ // String8(e->getBag().keyAt(i)).c_str());
if (e->getBag().keyAt(i) == nameStr) {
return getItemValue(attrID, e->getBag().valueAt(i).bagKeyId, outValue);
}
@@ -2529,7 +2529,7 @@
outValue->dataType = Res_value::TYPE_INT_HEX;
outValue->data = 0;
- //printf("getAttributeFlags #%08x %s\n", attrID, String8(name, nameLen).string());
+ //printf("getAttributeFlags #%08x %s\n", attrID, String8(name, nameLen).c_str());
String16 nameStr(name, nameLen);
sp<const Entry> e = getEntry(attrID);
if (e != NULL) {
@@ -2546,8 +2546,8 @@
String16 nameStr(start, pos-start);
size_t i;
for (i=0; i<N; i++) {
- //printf("Comparing \"%s\" to \"%s\"\n", String8(nameStr).string(),
- // String8(e->getBag().keyAt(i)).string());
+ //printf("Comparing \"%s\" to \"%s\"\n", String8(nameStr).c_str(),
+ // String8(e->getBag().keyAt(i)).c_str());
if (e->getBag().keyAt(i) == nameStr) {
Res_value val;
bool got = getItemValue(attrID, e->getBag().valueAt(i).bagKeyId, &val);
@@ -2753,7 +2753,7 @@
if (mHasDefaultLocalization.find(c->getName())
== mHasDefaultLocalization.end()) {
// printf("Skip symbol [%08x] %s\n", rid,
- // String8(c->getName()).string());
+ // String8(c->getName()).c_str());
continue;
}
}
@@ -2763,7 +2763,7 @@
String16 comment(c->getComment());
typeSymbols->appendComment(String8(c->getName()), comment, c->getPos());
//printf("Type symbol [%08x] %s comment: %s\n", rid,
- // String8(c->getName()).string(), String8(comment).string());
+ // String8(c->getName()).c_str(), String8(comment).c_str());
comment = c->getTypeComment();
typeSymbols->appendTypeComment(String8(c->getName()), comment);
}
@@ -2809,10 +2809,10 @@
// Look for strings with no default localization
if (configSrcMap.count(defaultLocale) == 0) {
SourcePos().warning("string '%s' has no default translation.",
- String8(nameIter.first).string());
+ String8(nameIter.first).c_str());
if (mBundle->getVerbose()) {
for (const auto& locale : configSrcMap) {
- locale.second.printf("locale %s found", locale.first.string());
+ locale.second.printf("locale %s found", locale.first.c_str());
}
}
// !!! TODO: throw an error here in some circumstances
@@ -2820,7 +2820,7 @@
// Check that all requested localizations are present for this string
if (mBundle->getConfigurations().size() > 0 && mBundle->getRequireLocalization()) {
- const char* allConfigs = mBundle->getConfigurations().string();
+ const char* allConfigs = mBundle->getConfigurations().c_str();
const char* start = allConfigs;
const char* comma;
@@ -2847,7 +2847,7 @@
// requiring a specific regional localization [e.g. de_DE] but there is an
// available string in the generic language localization [e.g. de];
// consider that string to have fulfilled the localization requirement.
- String8 region(config.string(), 2);
+ String8 region(config.c_str(), 2);
if (configSrcMap.find(region) == configSrcMap.end() &&
configSrcMap.count(defaultLocale) == 0) {
missingConfigs.insert(config);
@@ -2859,12 +2859,12 @@
if (!missingConfigs.empty()) {
String8 configStr;
for (const auto& iter : missingConfigs) {
- configStr.appendFormat(" %s", iter.string());
+ configStr.appendFormat(" %s", iter.c_str());
}
SourcePos().warning("string '%s' is missing %u required localizations:%s",
- String8(nameIter.first).string(),
+ String8(nameIter.first).c_str(),
(unsigned int)missingConfigs.size(),
- configStr.string());
+ configStr.c_str());
}
}
}
@@ -3021,7 +3021,7 @@
header->header.type = htods(RES_TABLE_PACKAGE_TYPE);
header->header.headerSize = htods(sizeof(*header));
header->id = htodl(static_cast<uint32_t>(p->getAssignedId()));
- strcpy16_htod(header->name, p->getName().string());
+ strcpy16_htod(header->name, p->getName().c_str());
// Write the string blocks.
const size_t typeStringsStart = data->getSize();
@@ -3061,7 +3061,7 @@
sp<Type> t = p->getTypes().valueFor(typeName);
LOG_ALWAYS_FATAL_IF(t == NULL && typeName != String16("<empty>"),
"Type name %s not found",
- String8(typeName).string());
+ String8(typeName).c_str());
if (t == NULL) {
continue;
}
@@ -3260,7 +3260,7 @@
sp<ConfigList> c = t->getOrderedConfigs().itemAt(i);
if (c != NULL) {
fprintf(stderr, "%s: no entries written for %s/%s (0x%08zx)\n", log_prefix,
- String8(typeName).string(), String8(c->getName()).string(),
+ String8(typeName).c_str(), String8(c->getName()).c_str(),
Res_MAKEID(p->getAssignedId() - 1, ti, i));
}
missing_entry = true;
@@ -3359,7 +3359,7 @@
sp<Package> libPackage = libs[i];
if (kIsDebug) {
fprintf(stderr, " Entry %s -> 0x%02x\n",
- String8(libPackage->getName()).string(),
+ String8(libPackage->getName()).c_str(),
(uint8_t)libPackage->getAssignedId());
}
@@ -3367,7 +3367,7 @@
entryStart, sizeof(ResTable_lib_entry));
memset(entry, 0, sizeof(*entry));
entry->packageId = htodl(libPackage->getAssignedId());
- strcpy16_htod(entry->packageName, libPackage->getName().string());
+ strcpy16_htod(entry->packageName, libPackage->getName().c_str());
}
}
return NO_ERROR;
@@ -3435,13 +3435,13 @@
const SourcePos& pos = c->getEntries().valueAt(k)->getPos();
if (pos.file != "") {
fprintf(fp," <!-- Declared at %s:%d -->\n",
- pos.file.string(), pos.line);
+ pos.file.c_str(), pos.line);
}
}
}
fprintf(fp, " <public type=\"%s\" name=\"%s\" id=\"0x%08x\" />\n",
- String8(t->getName()).string(),
- String8(c->getName()).string(),
+ String8(t->getName()).c_str(),
+ String8(c->getName()).c_str(),
getResId(pkg, t, c->getEntryIndex()));
}
}
@@ -3501,8 +3501,8 @@
}
sourcePos.error("Resource entry %s is already defined as a single item.\n"
"%s:%d: Originally defined here.\n",
- String8(mName).string(),
- mItem.sourcePos.file.string(), mItem.sourcePos.line);
+ String8(mName).c_str(),
+ mItem.sourcePos.file.c_str(), mItem.sourcePos.line);
return UNKNOWN_ERROR;
}
@@ -3517,21 +3517,21 @@
if (mType == TYPE_BAG) {
if (mBag.size() == 0) {
sourcePos.error("Resource entry %s is already defined as a bag.",
- String8(mName).string());
+ String8(mName).c_str());
} else {
const Item& item(mBag.valueAt(0));
sourcePos.error("Resource entry %s is already defined as a bag.\n"
"%s:%d: Originally defined here.\n",
- String8(mName).string(),
- item.sourcePos.file.string(), item.sourcePos.line);
+ String8(mName).c_str(),
+ item.sourcePos.file.c_str(), item.sourcePos.line);
}
return UNKNOWN_ERROR;
}
if ( (mType != TYPE_UNKNOWN) && (overwrite == false) ) {
sourcePos.error("Resource entry %s is already defined.\n"
"%s:%d: Originally defined here.\n",
- String8(mName).string(),
- mItem.sourcePos.file.string(), mItem.sourcePos.line);
+ String8(mName).c_str(),
+ mItem.sourcePos.file.c_str(), mItem.sourcePos.line);
return UNKNOWN_ERROR;
}
@@ -3562,12 +3562,12 @@
const Item& item(mBag.valueAt(origKey));
sourcePos.error("Resource entry %s already has bag item %s.\n"
"%s:%d: Originally defined here.\n",
- String8(mName).string(), String8(key).string(),
- item.sourcePos.file.string(), item.sourcePos.line);
+ String8(mName).c_str(), String8(key).c_str(),
+ item.sourcePos.file.c_str(), item.sourcePos.line);
return UNKNOWN_ERROR;
}
//printf("Replacing %s with %s\n",
- // String8(mBag.valueFor(key).value).string(), String8(value).string());
+ // String8(mBag.valueFor(key).value).c_str(), String8(value).c_str());
mBag.replaceValueFor(key, item);
}
@@ -3611,8 +3611,8 @@
String16 value("false");
if (kIsDebug) {
fprintf(stderr, "Generating %s:id/%s\n",
- String8(package).string(),
- String8(key).string());
+ String8(package).c_str(),
+ String8(key).c_str());
}
status_t err = table->addEntry(SourcePos(String8("<generated>"), 0), package,
id16, key, value);
@@ -3624,10 +3624,10 @@
#if 1
// fprintf(stderr, "ERROR: Bag attribute '%s' has not been defined.\n",
-// String8(key).string());
+// String8(key).c_str());
// const Item& item(mBag.valueAt(i));
// fprintf(stderr, "Referenced from file %s line %d\n",
-// item.sourcePos.file.string(), item.sourcePos.line);
+// item.sourcePos.file.c_str(), item.sourcePos.line);
// return UNKNOWN_ERROR;
#else
char numberStr[16];
@@ -3660,7 +3660,7 @@
mParentId = table->getResId(mParent, &style16, NULL, &errorMsg);
if (mParentId == 0) {
mPos.error("Error retrieving parent for item: %s '%s'.\n",
- errorMsg, String8(mParent).string());
+ errorMsg, String8(mParent).c_str());
hasErrors = true;
}
}
@@ -3670,11 +3670,11 @@
Item& it = mBag.editValueAt(i);
it.bagKeyId = table->getResId(key,
it.isId ? &id16 : &attr16, NULL, &errorMsg);
- //printf("Bag key of %s: #%08x\n", String8(key).string(), it.bagKeyId);
+ //printf("Bag key of %s: #%08x\n", String8(key).c_str(), it.bagKeyId);
if (it.bagKeyId == 0) {
it.sourcePos.error("Error: %s: %s '%s'.\n", errorMsg,
- String8(it.isId ? id16 : attr16).string(),
- String8(key).string());
+ String8(it.isId ? id16 : attr16).c_str(),
+ String8(key).c_str());
hasErrors = true;
}
}
@@ -3709,7 +3709,7 @@
}
} else {
mPos.error("Error: entry %s is not a single item or a bag.\n",
- String8(mName).string());
+ String8(mName).c_str());
return UNKNOWN_ERROR;
}
return NO_ERROR;
@@ -3732,7 +3732,7 @@
}
} else {
mPos.error("Error: entry %s is not a single item or a bag.\n",
- String8(mName).string());
+ String8(mName).c_str());
return UNKNOWN_ERROR;
}
return NO_ERROR;
@@ -3768,7 +3768,7 @@
par.data = htodl(it.parsedValue.data);
#if 0
printf("Writing item (%s): type=%d, data=0x%x, res0=0x%x\n",
- String8(mName).string(), it.parsedValue.dataType,
+ String8(mName).c_str(), it.parsedValue.dataType,
it.parsedValue.data, par.res0);
#endif
err = data->writeData(&par, it.parsedValue.size);
@@ -3852,7 +3852,7 @@
int32_t entryIdx = Res_GETENTRY(ident);
if (entryIdx < 0) {
sourcePos.error("Public resource %s/%s has an invalid 0 identifier (0x%08x).\n",
- String8(mName).string(), String8(name).string(), ident);
+ String8(mName).c_str(), String8(name).c_str(), ident);
return UNKNOWN_ERROR;
}
#endif
@@ -3863,7 +3863,7 @@
if (mPublicIndex > 0 && mPublicIndex != typeIdx) {
sourcePos.error("Public resource %s/%s has conflicting type codes for its"
" public identifiers (0x%x vs 0x%x).\n",
- String8(mName).string(), String8(name).string(),
+ String8(mName).c_str(), String8(name).c_str(),
mPublicIndex, typeIdx);
return UNKNOWN_ERROR;
}
@@ -3882,8 +3882,8 @@
sourcePos.error("Public resource %s/%s has conflicting public identifiers"
" (0x%08x vs 0x%08x).\n"
"%s:%d: Originally defined here.\n",
- String8(mName).string(), String8(name).string(), p.ident, ident,
- p.sourcePos.file.string(), p.sourcePos.line);
+ String8(mName).c_str(), String8(name).c_str(), p.ident, ident,
+ p.sourcePos.file.c_str(), p.sourcePos.line);
return UNKNOWN_ERROR;
}
}
@@ -3909,7 +3909,7 @@
if (overlay && !autoAddOverlay && mCanAddEntries.indexOf(entry) < 0) {
sourcePos.error("Resource at %s appears in overlay but not"
" in the base package; use <add-resource> to add.\n",
- String8(entry).string());
+ String8(entry).c_str());
return NULL;
}
c = new ConfigList(entry, sourcePos);
@@ -3931,7 +3931,7 @@
printf("New entry at %s:%d: imsi:%d/%d lang:%c%c cnt:%c%c "
"orien:%d touch:%d density:%d key:%d inp:%d nav:%d sz:%dx%d "
"sw%ddp w%ddp h%ddp layout:%d\n",
- sourcePos.file.string(), sourcePos.line,
+ sourcePos.file.c_str(), sourcePos.line,
config->mcc, config->mnc,
config->language[0] ? config->language[0] : '-',
config->language[1] ? config->language[1] : '-',
@@ -3951,7 +3951,7 @@
config->screenLayout);
} else {
printf("New entry at %s:%d: NULL config\n",
- sourcePos.file.string(), sourcePos.line);
+ sourcePos.file.c_str(), sourcePos.line);
}
}
e = new Entry(entry, sourcePos);
@@ -4032,11 +4032,11 @@
const Public& p = mPublic.valueAt(j);
int32_t idx = Res_GETENTRY(p.ident);
//printf("Looking for entry \"%s\"/\"%s\" (0x%08x) in %d...\n",
- // String8(mName).string(), String8(name).string(), p.ident, N);
+ // String8(mName).c_str(), String8(name).c_str(), p.ident, N);
bool found = false;
for (i=0; i<N; i++) {
sp<ConfigList> e = origOrder.itemAt(i);
- //printf("#%d: \"%s\"\n", i, String8(e->getName()).string());
+ //printf("#%d: \"%s\"\n", i, String8(e->getName()).c_str());
if (e->getName() == name) {
if (idx >= (int32_t)mOrderedConfigs.size()) {
mOrderedConfigs.resize(idx + 1);
@@ -4056,10 +4056,10 @@
p.sourcePos.error("Multiple entry names declared for public entry"
" identifier 0x%x in type %s (%s vs %s).\n"
"%s:%d: Originally defined here.",
- idx+1, String8(mName).string(),
- String8(oe->getName()).string(),
- String8(name).string(),
- oe->getPublicSourcePos().file.string(),
+ idx+1, String8(mName).c_str(),
+ String8(oe->getName()).c_str(),
+ String8(name).c_str(),
+ oe->getPublicSourcePos().file.c_str(),
oe->getPublicSourcePos().line);
hasError = true;
}
@@ -4068,7 +4068,7 @@
if (!found) {
p.sourcePos.error("Public symbol %s/%s declared here is not defined.",
- String8(mName).string(), String8(name).string());
+ String8(mName).c_str(), String8(name).c_str());
hasError = true;
}
}
@@ -4189,9 +4189,9 @@
t->getFirstPublicSourcePos().error("Multiple type names declared for public type"
" identifier 0x%x (%s vs %s).\n"
"%s:%d: Originally defined here.",
- idx, String8(ot->getName()).string(),
- String8(t->getName()).string(),
- ot->getFirstPublicSourcePos().file.string(),
+ idx, String8(ot->getName()).c_str(),
+ String8(t->getName()).c_str(),
+ ot->getFirstPublicSourcePos().file.c_str(),
ot->getFirstPublicSourcePos().line);
return UNKNOWN_ERROR;
}
@@ -4399,8 +4399,8 @@
const Item& it = e->getBag().valueAt(i);
if (it.bagKeyId == 0) {
fprintf(stderr, "warning: ID not yet assigned to '%s' in bag '%s'\n",
- String8(e->getName()).string(),
- String8(e->getBag().keyAt(i)).string());
+ String8(e->getName()).c_str(),
+ String8(e->getBag().keyAt(i)).c_str());
}
if (it.bagKeyId == attrID) {
return ⁢
@@ -4427,8 +4427,8 @@
}
}
fprintf(stderr, "warning: Circular reference detected in key '%s' of bag '%s'\n",
- String8(e->getName()).string(),
- String8(e->getBag().keyAt(i)).string());
+ String8(e->getName()).c_str(),
+ String8(e->getBag().keyAt(i)).c_str());
return false;
}
item->evaluating = true;
@@ -4436,7 +4436,7 @@
if (kIsDebug) {
if (res) {
printf("getItemValue of #%08x[#%08x] (%s): type=#%08x, data=#%08x\n",
- resID, attrID, String8(getEntry(resID)->getName()).string(),
+ resID, attrID, String8(getEntry(resID)->getName()).c_str(),
outValue->dataType, outValue->data);
} else {
printf("getItemValue of #%08x[#%08x]: failed\n",
@@ -4713,10 +4713,10 @@
entriesToAdd[i].value->getPos()
.printf("using v%d attributes; synthesizing resource %s:%s/%s for configuration %s.",
entriesToAdd[i].key.sdkVersion,
- String8(p->getName()).string(),
- String8(t->getName()).string(),
- String8(entriesToAdd[i].value->getName()).string(),
- entriesToAdd[i].key.toString().string());
+ String8(p->getName()).c_str(),
+ String8(t->getName()).c_str(),
+ String8(entriesToAdd[i].value->getName()).c_str(),
+ entriesToAdd[i].key.toString().c_str());
}
sp<Entry> newEntry = t->getEntry(c->getName(),
@@ -4801,8 +4801,8 @@
sp<AaptFile> newFile = new AaptFile(target->getSourceFile(),
AaptGroupEntry(newConfig), target->getResourceType());
String8 resPath = String8::format("res/%s/%s.xml",
- newFile->getGroupEntry().toDirName(target->getResourceType()).string(),
- String8(resourceName).string());
+ newFile->getGroupEntry().toDirName(target->getResourceType()).c_str(),
+ String8(resourceName).c_str());
resPath.convertToResPath();
// Add a resource table entry.
@@ -4893,10 +4893,10 @@
if (bundle->getVerbose()) {
SourcePos(node->getFilename(), node->getStartLineNumber()).printf(
"removing attribute %s%s%s from <%s>",
- String8(attr.ns).string(),
+ String8(attr.ns).c_str(),
(attr.ns.size() == 0 ? "" : ":"),
- String8(attr.name).string(),
- String8(node->getElementName()).string());
+ String8(attr.name).c_str(),
+ String8(node->getElementName()).c_str());
}
node->removeAttribute(i);
i--;
@@ -4925,8 +4925,8 @@
sp<AaptFile> newFile = new AaptFile(target->getSourceFile(),
AaptGroupEntry(newConfig), target->getResourceType());
String8 resPath = String8::format("res/%s/%s.xml",
- newFile->getGroupEntry().toDirName(target->getResourceType()).string(),
- String8(resourceName).string());
+ newFile->getGroupEntry().toDirName(target->getResourceType()).c_str(),
+ String8(resourceName).c_str());
resPath.convertToResPath();
// Add a resource table entry.
@@ -4934,10 +4934,10 @@
SourcePos(target->getSourceFile(), -1).printf(
"using v%d attributes; synthesizing resource %s:%s/%s for configuration %s.",
newConfig.sdkVersion,
- mAssets->getPackage().string(),
- newFile->getResourceType().string(),
- String8(resourceName).string(),
- newConfig.toString().string());
+ mAssets->getPackage().c_str(),
+ newFile->getResourceType().c_str(),
+ String8(resourceName).c_str(),
+ newConfig.toString().c_str());
}
addEntry(SourcePos(),
@@ -5114,8 +5114,8 @@
sp<XMLNode> nestedRoot = findOnlyChildElement(child);
if (nestedRoot == NULL) {
source.error("<%s:%s> must have exactly one child element",
- String8(child->getElementNamespace()).string(),
- String8(child->getElementName()).string());
+ String8(child->getElementNamespace()).c_str(),
+ String8(child->getElementName()).c_str());
return UNKNOWN_ERROR;
}
@@ -5130,7 +5130,7 @@
// Parse the attribute name.
const char* errorMsg = NULL;
String16 attrPackage, attrType, attrName;
- bool result = ResTable::expandResourceRef(attr->string.string(),
+ bool result = ResTable::expandResourceRef(attr->string.c_str(),
attr->string.size(),
&attrPackage, &attrType, &attrName,
&kAttr16, &kAssetPackage16,
@@ -5156,11 +5156,11 @@
// This child element will be extracted into its own resource file.
// Generate a name and path for it from its parent.
nestedResourceName = String8::format("%s_%d",
- String8(resourceName).string(), suffix++);
+ String8(resourceName).c_str(), suffix++);
nestedResourcePath = String8::format("res/%s/%s.xml",
target->getGroupEntry().toDirName(target->getResourceType())
- .string(),
- nestedResourceName.string());
+ .c_str(),
+ nestedResourceName.c_str());
// Lookup or create the entry for this name.
sp<Entry> entry = getEntry(kAssetPackage16,
@@ -5187,20 +5187,20 @@
if (bundle->getVerbose()) {
source.printf("generating nested resource %s:%s/%s",
- mAssets->getPackage().string(), target->getResourceType().string(),
- nestedResourceName.string());
+ mAssets->getPackage().c_str(), target->getResourceType().c_str(),
+ nestedResourceName.c_str());
}
// Build the attribute reference and assign it to the parent.
String16 nestedResourceRef = String16(String8::format("@%s:%s/%s",
- mAssets->getPackage().string(), target->getResourceType().string(),
- nestedResourceName.string()));
+ mAssets->getPackage().c_str(), target->getResourceType().c_str(),
+ nestedResourceName.c_str()));
String16 attrNs = buildNamespace(attrPackage);
if (parent->getAttribute(attrNs, attrName) != NULL) {
SourcePos(parent->getFilename(), parent->getStartLineNumber())
.error("parent of nested resource already defines attribute '%s:%s'",
- String8(attrPackage).string(), String8(attrName).string());
+ String8(attrPackage).c_str(), String8(attrName).c_str());
return UNKNOWN_ERROR;
}
diff --git a/tools/aapt/SourcePos.cpp b/tools/aapt/SourcePos.cpp
index 3864320..e130286 100644
--- a/tools/aapt/SourcePos.cpp
+++ b/tools/aapt/SourcePos.cpp
@@ -80,12 +80,12 @@
if (!this->file.isEmpty()) {
if (this->line >= 0) {
- fprintf(to, "%s:%d: %s%s\n", this->file.string(), this->line, type, this->error.string());
+ fprintf(to, "%s:%d: %s%s\n", this->file.c_str(), this->line, type, this->error.c_str());
} else {
- fprintf(to, "%s: %s%s\n", this->file.string(), type, this->error.string());
+ fprintf(to, "%s: %s%s\n", this->file.c_str(), type, this->error.c_str());
}
} else {
- fprintf(to, "%s%s\n", type, this->error.string());
+ fprintf(to, "%s%s\n", type, this->error.c_str());
}
}
diff --git a/tools/aapt/StringPool.cpp b/tools/aapt/StringPool.cpp
index 6cacd32..8d02683 100644
--- a/tools/aapt/StringPool.cpp
+++ b/tools/aapt/StringPool.cpp
@@ -67,7 +67,7 @@
const size_t NS = pool->size();
for (size_t s=0; s<NS; s++) {
auto str = pool->string8ObjectAt(s);
- printf("String #" ZD ": %s\n", (ZD_TYPE) s, (str.has_value() ? str->string() : ""));
+ printf("String #" ZD ": %s\n", (ZD_TYPE) s, (str.has_value() ? str->c_str() : ""));
}
}
@@ -139,7 +139,7 @@
if (eidx < 0) {
eidx = mEntries.add(entry(value));
if (eidx < 0) {
- fprintf(stderr, "Failure adding string %s\n", String8(value).string());
+ fprintf(stderr, "Failure adding string %s\n", String8(value).c_str());
return eidx;
}
}
@@ -148,7 +148,7 @@
entry& ent = mEntries.editItemAt(eidx);
if (kIsDebug) {
printf("*** adding config type name %s, was %s\n",
- configTypeName->string(), ent.configTypeName.string());
+ configTypeName->c_str(), ent.configTypeName.c_str());
}
if (ent.configTypeName.size() <= 0) {
ent.configTypeName = *configTypeName;
@@ -166,7 +166,7 @@
if (cmp >= 0) {
if (cmp > 0) {
if (kIsDebug) {
- printf("*** inserting config: %s\n", config->toString().string());
+ printf("*** inserting config: %s\n", config->toString().c_str());
}
ent.configs.insertAt(*config, addPos);
}
@@ -175,7 +175,7 @@
}
if (addPos >= ent.configs.size()) {
if (kIsDebug) {
- printf("*** adding config: %s\n", config->toString().string());
+ printf("*** adding config: %s\n", config->toString().c_str());
}
ent.configs.add(*config);
}
@@ -195,7 +195,7 @@
if (kIsDebug) {
printf("Adding string %s to pool: pos=%zd eidx=%zd vidx=%zd\n",
- String8(value).string(), pos, eidx, vidx);
+ String8(value).c_str(), pos, eidx, vidx);
}
return pos;
@@ -286,13 +286,13 @@
for (size_t i=0; i<N; i++) {
printf("#%d was %d: %s\n", i, newPosToOriginalPos[i],
- mEntries[mEntryArray[newPosToOriginalPos[i]]].makeConfigsString().string());
+ mEntries[mEntryArray[newPosToOriginalPos[i]]].makeConfigsString().c_str());
entries.add(mEntries[mEntryArray[i]]);
}
for (size_t i=0; i<entries.size(); i++) {
printf("Sorted config #%d: %s\n", i,
- entries[i].makeConfigsString().string());
+ entries[i].makeConfigsString().c_str());
}
#endif
@@ -363,8 +363,8 @@
printf("FINAL SORTED STRING CONFIGS:\n");
for (size_t i=0; i<mEntries.size(); i++) {
const entry& ent = mEntries[i];
- printf("#" ZD " %s: %s\n", (ZD_TYPE)i, ent.makeConfigsString().string(),
- String8(ent.value).string());
+ printf("#" ZD " %s: %s\n", (ZD_TYPE)i, ent.makeConfigsString().c_str(),
+ String8(ent.value).c_str());
}
#endif
}
@@ -415,7 +415,7 @@
ssize_t idx = add(span.name, true);
if (idx < 0) {
fprintf(stderr, "Error adding span for style tag '%s'\n",
- String8(span.name).string());
+ String8(span.name).c_str());
return idx;
}
span.span.name.index = (uint32_t)idx;
@@ -571,7 +571,7 @@
if (kIsDebug) {
printf("Writing entry #%zu: \"%s\" ent=%zu off=%zu\n",
i,
- String8(ent.value).string(),
+ String8(ent.value).c_str(),
mEntryArray[i],
ent.offset);
}
@@ -591,8 +591,8 @@
const Vector<size_t>* indices = offsetsForString(val);
ssize_t res = indices != NULL && indices->size() > 0 ? indices->itemAt(0) : -1;
if (kIsDebug) {
- printf("Offset for string %s: %zd (%s)\n", String8(val).string(), res,
- res >= 0 ? String8(mEntries[mEntryArray[res]].value).string() : String8());
+ printf("Offset for string %s: %zd (%s)\n", String8(val).c_str(), res,
+ res >= 0 ? String8(mEntries[mEntryArray[res]].value).c_str() : String8());
}
return res;
}
diff --git a/tools/aapt/Symbol.h b/tools/aapt/Symbol.h
index e157541..de1d60c 100644
--- a/tools/aapt/Symbol.h
+++ b/tools/aapt/Symbol.h
@@ -68,9 +68,9 @@
android::String8 Symbol::toString() const {
return android::String8::format("%s:%s/%s (0x%08x)",
- android::String8(package).string(),
- android::String8(type).string(),
- android::String8(name).string(),
+ android::String8(package).c_str(),
+ android::String8(type).c_str(),
+ android::String8(name).c_str(),
(int) id);
}
diff --git a/tools/aapt/XMLNode.cpp b/tools/aapt/XMLNode.cpp
index 69392d6..e270a73 100644
--- a/tools/aapt/XMLNode.cpp
+++ b/tools/aapt/XMLNode.cpp
@@ -66,14 +66,14 @@
String16 getNamespaceResourcePackage(const String16& appPackage, const String16& namespaceUri, bool* outIsPublic)
{
- //printf("%s starts with %s?\n", String8(namespaceUri).string(),
- // String8(RESOURCES_PREFIX).string());
+ //printf("%s starts with %s?\n", String8(namespaceUri).c_str(),
+ // String8(RESOURCES_PREFIX).c_str());
size_t prefixSize;
bool isPublic = true;
if(namespaceUri.startsWith(RESOURCES_PREFIX_AUTO_PACKAGE)) {
if (kIsDebug) {
- printf("Using default application package: %s -> %s\n", String8(namespaceUri).string(),
- String8(appPackage).string());
+ printf("Using default application package: %s -> %s\n", String8(namespaceUri).c_str(),
+ String8(appPackage).c_str());
}
isPublic = true;
return appPackage;
@@ -88,7 +88,7 @@
}
//printf("YES!\n");
- //printf("namespace: %s\n", String8(String16(namespaceUri, namespaceUri.size()-prefixSize, prefixSize)).string());
+ //printf("namespace: %s\n", String8(String16(namespaceUri, namespaceUri.size()-prefixSize, prefixSize)).c_str());
if (outIsPublic) *outIsPublic = isPublic;
return String16(namespaceUri, namespaceUri.size()-prefixSize, prefixSize);
}
@@ -97,7 +97,7 @@
ResXMLTree* inXml,
const String16& str16)
{
- const char16_t* str = str16.string();
+ const char16_t* str = str16.c_str();
const char16_t* p = str;
const char16_t* end = str + str16.size();
@@ -223,7 +223,7 @@
String16 text(inXml->getText(&len));
if (firstTime && text.size() > 0) {
firstTime = false;
- if (text.string()[0] == '@') {
+ if (text.c_str()[0] == '@') {
// If this is a resource reference, don't do the pseudoloc.
pseudolocalize = NO_PSEUDOLOCALIZATION;
pseudo.setMethod(pseudolocalize);
@@ -263,7 +263,7 @@
{
SourcePos(String8(fileName), inXml->getLineNumber()).error(
"Found unsupported XLIFF tag <%s>\n",
- element8.string());
+ element8.c_str());
return UNKNOWN_ERROR;
}
moveon:
@@ -272,14 +272,14 @@
if (outSpans == NULL) {
SourcePos(String8(fileName), inXml->getLineNumber()).error(
- "Found style tag <%s> where styles are not allowed\n", element8.string());
+ "Found style tag <%s> where styles are not allowed\n", element8.c_str());
return UNKNOWN_ERROR;
}
- if (!ResTable::collectString(outString, curString.string(),
+ if (!ResTable::collectString(outString, curString.c_str(),
curString.size(), false, &errorMsg, true)) {
SourcePos(String8(fileName), inXml->getLineNumber()).error("%s (in %s)\n",
- errorMsg, String8(curString).string());
+ errorMsg, String8(curString).c_str());
return UNKNOWN_ERROR;
}
rawString.append(curString);
@@ -295,7 +295,7 @@
str = inXml->getAttributeStringValue(ai, &len);
span.name.append(str, len);
}
- //printf("Span: %s\n", String8(span.name).string());
+ //printf("Span: %s\n", String8(span.name).c_str());
span.span.firstChar = span.span.lastChar = outString->size();
spanStack.push(span);
@@ -311,21 +311,21 @@
xliffDepth--;
continue;
}
- if (!ResTable::collectString(outString, curString.string(),
+ if (!ResTable::collectString(outString, curString.c_str(),
curString.size(), false, &errorMsg, true)) {
SourcePos(String8(fileName), inXml->getLineNumber()).error("%s (in %s)\n",
- errorMsg, String8(curString).string());
+ errorMsg, String8(curString).c_str());
return UNKNOWN_ERROR;
}
rawString.append(curString);
curString = String16();
if (spanStack.size() == 0) {
- if (strcmp16(inXml->getElementName(&len), endTag.string()) != 0) {
+ if (strcmp16(inXml->getElementName(&len), endTag.c_str()) != 0) {
SourcePos(String8(fileName), inXml->getLineNumber()).error(
"Found tag %s where <%s> close is expected\n",
- String8(inXml->getElementName(&len)).string(),
- String8(endTag).string());
+ String8(inXml->getElementName(&len)).c_str(),
+ String8(endTag).c_str());
return UNKNOWN_ERROR;
}
break;
@@ -334,15 +334,15 @@
String16 spanTag;
ssize_t semi = span.name.findFirst(';');
if (semi >= 0) {
- spanTag.setTo(span.name.string(), semi);
+ spanTag.setTo(span.name.c_str(), semi);
} else {
spanTag.setTo(span.name);
}
- if (strcmp16(inXml->getElementName(&len), spanTag.string()) != 0) {
+ if (strcmp16(inXml->getElementName(&len), spanTag.c_str()) != 0) {
SourcePos(String8(fileName), inXml->getLineNumber()).error(
"Found close tag %s where close tag %s is expected\n",
- String8(inXml->getElementName(&len)).string(),
- String8(spanTag).string());
+ String8(inXml->getElementName(&len)).c_str(),
+ String8(spanTag).c_str());
return UNKNOWN_ERROR;
}
bool empty = true;
@@ -363,7 +363,7 @@
if (0 && empty) {
fprintf(stderr, "%s:%d: warning: empty '%s' span found in text '%s'\n",
fileName, inXml->getLineNumber(),
- String8(spanTag).string(), String8(*outString).string());
+ String8(spanTag).c_str(), String8(*outString).c_str());
}
} else if (code == ResXMLTree::START_NAMESPACE) {
@@ -380,11 +380,11 @@
if (outSpans != NULL && outSpans->size() > 0) {
if (curString.size() > 0) {
- if (!ResTable::collectString(outString, curString.string(),
+ if (!ResTable::collectString(outString, curString.c_str(),
curString.size(), false, &errorMsg, true)) {
SourcePos(String8(fileName), inXml->getLineNumber()).error(
"%s (in %s)\n",
- errorMsg, String8(curString).string());
+ errorMsg, String8(curString).c_str());
return UNKNOWN_ERROR;
}
}
@@ -450,10 +450,10 @@
String8 elemNs = build_namespace(namespaces, ns16);
const char16_t* com16 = block->getComment(&len);
if (com16) {
- printf("%s <!-- %s -->\n", prefix.string(), String8(com16).string());
+ printf("%s <!-- %s -->\n", prefix.c_str(), String8(com16).c_str());
}
- printf("%sE: %s%s (line=%d)\n", prefix.string(), elemNs.string(),
- String8(block->getElementName(&len)).string(),
+ printf("%sE: %s%s (line=%d)\n", prefix.c_str(), elemNs.c_str(),
+ String8(block->getElementName(&len)).c_str(),
block->getLineNumber());
int N = block->getAttributeCount();
depth++;
@@ -463,11 +463,11 @@
ns16 = block->getAttributeNamespace(i, &len);
String8 ns = build_namespace(namespaces, ns16);
String8 name(block->getAttributeName(i, &len));
- printf("%sA: ", prefix.string());
+ printf("%sA: ", prefix.c_str());
if (res) {
- printf("%s%s(0x%08x)", ns.string(), name.string(), res);
+ printf("%s%s(0x%08x)", ns.c_str(), name.c_str(), res);
} else {
- printf("%s%s", ns.string(), name.string());
+ printf("%s%s", ns.c_str(), name.c_str());
}
Res_value value;
block->getAttributeValue(i, &value);
@@ -480,14 +480,14 @@
} else if (value.dataType == Res_value::TYPE_STRING) {
printf("=\"%s\"",
ResTable::normalizeForOutput(String8(block->getAttributeStringValue(i,
- &len)).string()).string());
+ &len)).c_str()).c_str());
} else {
printf("=(type 0x%x)0x%x", (int)value.dataType, (int)value.data);
}
const char16_t* val = block->getAttributeStringValue(i, &len);
if (val != NULL) {
- printf(" (Raw: \"%s\")", ResTable::normalizeForOutput(String8(val).string()).
- string());
+ printf(" (Raw: \"%s\")", ResTable::normalizeForOutput(String8(val).c_str()).
+ c_str());
}
printf("\n");
}
@@ -509,8 +509,8 @@
}
ns.uri = String8(block->getNamespaceUri(&len));
namespaces.push(ns);
- printf("%sN: %s=%s\n", prefix.string(), ns.prefix.string(),
- ns.uri.string());
+ printf("%sN: %s=%s\n", prefix.c_str(), ns.prefix.c_str(),
+ ns.uri.c_str());
depth++;
} else if (code == ResXMLTree::END_NAMESPACE) {
if (--depth < 0) {
@@ -529,19 +529,19 @@
if (ns.prefix != pr) {
prefix = make_prefix(depth);
printf("%s*** BAD END NS PREFIX: found=%s, expected=%s\n",
- prefix.string(), pr.string(), ns.prefix.string());
+ prefix.c_str(), pr.c_str(), ns.prefix.c_str());
}
String8 uri = String8(block->getNamespaceUri(&len));
if (ns.uri != uri) {
prefix = make_prefix(depth);
printf("%s *** BAD END NS URI: found=%s, expected=%s\n",
- prefix.string(), uri.string(), ns.uri.string());
+ prefix.c_str(), uri.c_str(), ns.uri.c_str());
}
namespaces.pop();
} else if (code == ResXMLTree::TEXT) {
size_t len;
- printf("%sC: \"%s\"\n", prefix.string(),
- ResTable::normalizeForOutput(String8(block->getText(&len)).string()).string());
+ printf("%sC: \"%s\"\n", prefix.c_str(),
+ ResTable::normalizeForOutput(String8(block->getText(&len)).c_str()).c_str());
}
}
@@ -583,7 +583,7 @@
sp<XMLNode> XMLNode::parse(const sp<AaptFile>& file)
{
char buf[16384];
- int fd = open(file->getSourceFile().string(), O_RDONLY | O_BINARY);
+ int fd = open(file->getSourceFile().c_str(), O_RDONLY | O_BINARY);
if (fd < 0) {
SourcePos(file->getSourceFile(), -1).error("Unable to open file for read: %s",
strerror(errno));
@@ -875,9 +875,9 @@
}
if (kIsDebug) {
printf("Elem %s %s=\"%s\": set res id = 0x%08x\n",
- String8(getElementName()).string(),
- String8(mAttributes.itemAt(attrIdx).name).string(),
- String8(mAttributes.itemAt(attrIdx).string).string(),
+ String8(getElementName()).c_str(),
+ String8(mAttributes.itemAt(attrIdx).name).c_str(),
+ String8(mAttributes.itemAt(attrIdx).string).c_str(),
resId);
}
mAttributes.editItemAt(attrIdx).nameResId = resId;
@@ -915,7 +915,7 @@
void XMLNode::removeWhitespace(bool stripAll, const char** cDataTags)
{
- //printf("Removing whitespace in %s\n", String8(mElementName).string());
+ //printf("Removing whitespace in %s\n", String8(mElementName).c_str());
size_t N = mChildren.size();
if (cDataTags) {
String8 tag(mElementName);
@@ -931,13 +931,13 @@
sp<XMLNode> node = mChildren.itemAt(i);
if (node->getType() == TYPE_CDATA) {
// This is a CDATA node...
- const char16_t* p = node->mChars.string();
+ const char16_t* p = node->mChars.c_str();
while (*p != 0 && *p < 128 && isspace(*p)) {
p++;
}
//printf("Space ends at %d in \"%s\"\n",
- // (int)(p-node->mChars.string()),
- // String8(node->mChars).string());
+ // (int)(p-node->mChars.c_str()),
+ // String8(node->mChars).c_str());
if (*p == 0) {
if (stripAll) {
// Remove this node!
@@ -949,18 +949,18 @@
}
} else {
// Compact leading/trailing whitespace.
- const char16_t* e = node->mChars.string()+node->mChars.size()-1;
+ const char16_t* e = node->mChars.c_str()+node->mChars.size()-1;
while (e > p && *e < 128 && isspace(*e)) {
e--;
}
- if (p > node->mChars.string()) {
+ if (p > node->mChars.c_str()) {
p--;
}
- if (e < (node->mChars.string()+node->mChars.size()-1)) {
+ if (e < (node->mChars.c_str()+node->mChars.size()-1)) {
e++;
}
- if (p > node->mChars.string() ||
- e < (node->mChars.string()+node->mChars.size()-1)) {
+ if (p > node->mChars.c_str() ||
+ e < (node->mChars.c_str()+node->mChars.size()-1)) {
String16 tmp(p, e-p+1);
node->mChars = tmp;
}
@@ -986,14 +986,14 @@
table->setCurrentXmlPos(SourcePos(mFilename, getStartLineNumber()));
if (!assets->getIncludedResources()
.stringToValue(&e.value, &e.string,
- e.string.string(), e.string.size(), true, true,
+ e.string.c_str(), e.string.size(), true, true,
e.nameResId, NULL, &defPackage, table, &ac)) {
hasErrors = true;
}
if (kIsDebug) {
printf("Attr %s: type=0x%x, str=%s\n",
- String8(e.name).string(), e.value.dataType,
- String8(e.string).string());
+ String8(e.name).c_str(), e.value.dataType,
+ String8(e.string).c_str());
}
}
}
@@ -1023,30 +1023,30 @@
String16 pkg(getNamespaceResourcePackage(String16(assets->getPackage()), e.ns, &nsIsPublic));
if (kIsDebug) {
printf("Elem %s %s=\"%s\": namespace(%s) %s ===> %s\n",
- String8(getElementName()).string(),
- String8(e.name).string(),
- String8(e.string).string(),
- String8(e.ns).string(),
+ String8(getElementName()).c_str(),
+ String8(e.name).c_str(),
+ String8(e.string).c_str(),
+ String8(e.ns).c_str(),
(nsIsPublic) ? "public" : "private",
- String8(pkg).string());
+ String8(pkg).c_str());
}
if (pkg.size() <= 0) continue;
uint32_t res = table != NULL
? table->getResId(e.name, &attr, &pkg, &errorMsg, nsIsPublic)
: assets->getIncludedResources().
- identifierForName(e.name.string(), e.name.size(),
- attr.string(), attr.size(),
- pkg.string(), pkg.size());
+ identifierForName(e.name.c_str(), e.name.size(),
+ attr.c_str(), attr.size(),
+ pkg.c_str(), pkg.size());
if (res != 0) {
if (kIsDebug) {
printf("XML attribute name %s: resid=0x%08x\n",
- String8(e.name).string(), res);
+ String8(e.name).c_str(), res);
}
setAttributeResID(i, res);
} else {
SourcePos(mFilename, getStartLineNumber()).error(
"No resource identifier found for attribute '%s' in package '%s'\n",
- String8(e.name).string(), String8(pkg).string());
+ String8(e.name).c_str(), String8(pkg).c_str());
hasErrors = true;
}
}
@@ -1137,7 +1137,7 @@
if (kPrintStringMetrics) {
fprintf(stderr, "**** total xml size: %zu / %zu%% strings (in %s)\n",
dest->getSize(), (stringPool->getSize()*100)/dest->getSize(),
- dest->getPath().string());
+ dest->getPath().c_str());
}
return NO_ERROR;
@@ -1155,8 +1155,8 @@
if (elemNs.size() > 0) {
elemNs.append(":");
}
- printf("%s E: %s%s", prefix.string(),
- elemNs.string(), String8(getElementName()).string());
+ printf("%s E: %s%s", prefix.c_str(),
+ elemNs.c_str(), String8(getElementName()).c_str());
int N = mAttributes.size();
for (i=0; i<N; i++) {
ssize_t idx = mAttributeOrder.valueAt(i);
@@ -1171,21 +1171,21 @@
attrNs.append(":");
}
if (attr.nameResId) {
- printf("%s%s(0x%08x)", attrNs.string(),
- String8(attr.name).string(), attr.nameResId);
+ printf("%s%s(0x%08x)", attrNs.c_str(),
+ String8(attr.name).c_str(), attr.nameResId);
} else {
- printf("%s%s", attrNs.string(), String8(attr.name).string());
+ printf("%s%s", attrNs.c_str(), String8(attr.name).c_str());
}
- printf("=%s", String8(attr.string).string());
+ printf("=%s", String8(attr.string).c_str());
}
printf("\n");
} else if (getType() == TYPE_NAMESPACE) {
- printf("%s N: %s=%s\n", prefix.string(),
+ printf("%s N: %s=%s\n", prefix.c_str(),
getNamespacePrefix().size() > 0
- ? String8(getNamespacePrefix()).string() : "<DEF>",
- String8(getNamespaceUri()).string());
+ ? String8(getNamespacePrefix()).c_str() : "<DEF>",
+ String8(getNamespaceUri()).c_str());
} else {
- printf("%s C: \"%s\"\n", prefix.string(), String8(getCData()).string());
+ printf("%s C: \"%s\"\n", prefix.c_str(), String8(getCData()).c_str());
}
int N = mChildren.size();
for (i=0; i<N; i++) {
@@ -1258,7 +1258,7 @@
XMLNode::characterData(void *userData, const XML_Char *s, int len)
{
if (kIsDebugParse) {
- printf("CDATA: \"%s\"\n", String8(s, len).string());
+ printf("CDATA: \"%s\"\n", String8(s, len).c_str());
}
ParseState* st = (ParseState*)userData;
sp<XMLNode> node = NULL;
@@ -1423,7 +1423,7 @@
idx = outPool->add(attr.name);
if (kIsDebug) {
printf("Adding attr %s (resid 0x%08x) to pool: idx=%zd\n",
- String8(attr.name).string(), id, idx);
+ String8(attr.name).c_str(), id, idx);
}
if (id != 0) {
while ((ssize_t)outResIds->size() <= idx) {
@@ -1434,7 +1434,7 @@
}
attr.namePoolIdx = idx;
if (kIsDebug) {
- printf("String %s offset=0x%08zd\n", String8(attr.name).string(), idx);
+ printf("String %s offset=0x%08zd\n", String8(attr.name).c_str(), idx);
}
}
}
@@ -1488,7 +1488,7 @@
node.comment.index = htodl(
mComment.size() > 0 ? strings.offsetForString(mComment) : -1);
//if (mComment.size() > 0) {
- // printf("Flattening comment: %s\n", String8(mComment).string());
+ // printf("Flattening comment: %s\n", String8(mComment).c_str());
//}
} else {
node.comment.index = htodl((uint32_t)-1);
diff --git a/tools/aapt/pseudolocalize.cpp b/tools/aapt/pseudolocalize.cpp
index 4e8dcb1..fc2ed98 100644
--- a/tools/aapt/pseudolocalize.cpp
+++ b/tools/aapt/pseudolocalize.cpp
@@ -42,7 +42,7 @@
size_t depth = mLastDepth;
size_t lastpos, pos;
const size_t length= text.size();
- const char16_t* str = text.string();
+ const char16_t* str = text.c_str();
bool escaped = false;
for (lastpos = pos = 0; pos < length; pos++) {
char16_t c = str[pos];
@@ -181,7 +181,7 @@
static String16 pseudo_generate_expansion(const unsigned int length) {
String16 result = k_expansion_string;
- const char16_t* s = result.string();
+ const char16_t* s = result.c_str();
if (result.size() < length) {
result += String16(" ");
result += pseudo_generate_expansion(length - result.size());
@@ -237,7 +237,7 @@
*/
String16 PseudoMethodAccent::text(const String16& source)
{
- const char16_t* s = source.string();
+ const char16_t* s = source.c_str();
String16 result;
const size_t I = source.size();
bool lastspace = true;
@@ -357,7 +357,7 @@
String16 PseudoMethodBidi::text(const String16& source)
{
- const char16_t* s = source.string();
+ const char16_t* s = source.c_str();
String16 result;
bool lastspace = true;
bool space = true;
diff --git a/tools/aapt2/Debug.cpp b/tools/aapt2/Debug.cpp
index cac4edd..6a17ef8 100644
--- a/tools/aapt2/Debug.cpp
+++ b/tools/aapt2/Debug.cpp
@@ -457,7 +457,7 @@
const size_t NS = pool->size();
for (size_t s=0; s<NS; s++) {
auto str = pool->string8ObjectAt(s);
- printer->Print(StringPrintf("String #%zd : %s\n", s, str.has_value() ? str->string() : ""));
+ printer->Print(StringPrintf("String #%zd : %s\n", s, str.has_value() ? str->c_str() : ""));
}
}
diff --git a/tools/aapt2/cmd/Util.cpp b/tools/aapt2/cmd/Util.cpp
index 1671e1e..a92f24b 100644
--- a/tools/aapt2/cmd/Util.cpp
+++ b/tools/aapt2/cmd/Util.cpp
@@ -215,7 +215,7 @@
}
std::vector<std::string> sanitized_config_names;
for (const auto &config : constraints.configs) {
- sanitized_config_names.push_back(MakePackageSafeName(config.toString().string()));
+ sanitized_config_names.push_back(MakePackageSafeName(config.toString().c_str()));
}
split_name << "config." << util::Joiner(sanitized_config_names, "_");
diff --git a/tools/aapt2/format/binary/BinaryResourceParser.cpp b/tools/aapt2/format/binary/BinaryResourceParser.cpp
index 75dcba5..2e20e81 100644
--- a/tools/aapt2/format/binary/BinaryResourceParser.cpp
+++ b/tools/aapt2/format/binary/BinaryResourceParser.cpp
@@ -453,7 +453,7 @@
const size_t count = entries.size();
for (size_t i = 0; i < count; i++) {
table_->included_packages_[entries.valueAt(i)] =
- android::util::Utf16ToUtf8(StringPiece16(entries.keyAt(i).string()));
+ android::util::Utf16ToUtf8(StringPiece16(entries.keyAt(i).c_str()));
}
return true;
}
diff --git a/tools/aapt2/trace/TraceBuffer.cpp b/tools/aapt2/trace/TraceBuffer.cpp
index da53739..0988c31 100644
--- a/tools/aapt2/trace/TraceBuffer.cpp
+++ b/tools/aapt2/trace/TraceBuffer.cpp
@@ -36,116 +36,142 @@
constexpr char kEnd = 'E';
struct TracePoint {
+ char type;
pid_t tid;
int64_t time;
std::string tag;
- char type;
};
std::vector<TracePoint> traces;
+bool enabled = true;
+constinit std::chrono::steady_clock::time_point startTime = {};
int64_t GetTime() noexcept {
auto now = std::chrono::steady_clock::now();
- return std::chrono::duration_cast<std::chrono::microseconds>(now.time_since_epoch()).count();
+ if (startTime == decltype(tracebuffer::startTime){}) {
+ startTime = now;
+ }
+ return std::chrono::duration_cast<std::chrono::microseconds>(now - startTime).count();
}
-} // namespace anonymous
-
-void AddWithTime(const std::string& tag, char type, int64_t time) noexcept {
- TracePoint t = {getpid(), time, tag, type};
- traces.emplace_back(t);
+void AddWithTime(std::string tag, char type, int64_t time) noexcept {
+ TracePoint t = {type, getpid(), time, std::move(tag)};
+ traces.emplace_back(std::move(t));
}
-void Add(const std::string& tag, char type) noexcept {
- AddWithTime(tag, type, GetTime());
+void Add(std::string tag, char type) noexcept {
+ AddWithTime(std::move(tag), type, GetTime());
}
-
-
-
void Flush(const std::string& basePath) {
- TRACE_CALL();
if (basePath.empty()) {
return;
}
+ BeginTrace(__func__); // We can't do much here, only record that it happened.
- std::stringstream s;
+ std::ostringstream s;
s << basePath << aapt::file::sDirSep << "report_aapt2_" << getpid() << ".json";
FILE* f = android::base::utf8::fopen(s.str().c_str(), "a");
if (f == nullptr) {
return;
}
- for(const TracePoint& trace : traces) {
- fprintf(f, "{\"ts\" : \"%" PRIu64 "\", \"ph\" : \"%c\", \"tid\" : \"%d\" , \"pid\" : \"%d\", "
- "\"name\" : \"%s\" },\n", trace.time, trace.type, 0, trace.tid, trace.tag.c_str());
+ // Wrap the trace in a JSON array [] to make Chrome/Perfetto UI handle it.
+ char delimiter = '[';
+ for (const TracePoint& trace : traces) {
+ fprintf(f,
+ "%c{\"ts\" : \"%" PRIu64
+ "\", \"ph\" : \"%c\", \"tid\" : \"%d\" , \"pid\" : \"%d\", \"name\" : \"%s\" }\n",
+ delimiter, trace.time, trace.type, 0, trace.tid, trace.tag.c_str());
+ delimiter = ',';
+ }
+ if (!traces.empty()) {
+ fprintf(f, "]");
}
fclose(f);
traces.clear();
}
+} // namespace
+
} // namespace tracebuffer
-void BeginTrace(const std::string& tag) {
- tracebuffer::Add(tag, tracebuffer::kBegin);
+void BeginTrace(std::string tag) {
+ if (!tracebuffer::enabled) return;
+ tracebuffer::Add(std::move(tag), tracebuffer::kBegin);
}
-void EndTrace() {
- tracebuffer::Add("", tracebuffer::kEnd);
+void EndTrace(std::string tag) {
+ if (!tracebuffer::enabled) return;
+ tracebuffer::Add(std::move(tag), tracebuffer::kEnd);
}
-Trace::Trace(const std::string& tag) {
- tracebuffer::Add(tag, tracebuffer::kBegin);
+bool Trace::enable(bool value) {
+ return tracebuffer::enabled = value;
}
-Trace::Trace(const std::string& tag, const std::vector<android::StringPiece>& args) {
- std::stringstream s;
+Trace::Trace(const char* tag) {
+ if (!tracebuffer::enabled) return;
+ tag_.assign(tag);
+ tracebuffer::Add(tag_, tracebuffer::kBegin);
+}
+
+Trace::Trace(std::string tag) : tag_(std::move(tag)) {
+ if (!tracebuffer::enabled) return;
+ tracebuffer::Add(tag_, tracebuffer::kBegin);
+}
+
+template <class SpanOfStrings>
+std::string makeTag(std::string_view tag, const SpanOfStrings& args) {
+ std::ostringstream s;
s << tag;
- s << " ";
- for (auto& arg : args) {
- s << arg;
- s << " ";
+ if (!args.empty()) {
+ for (const auto& arg : args) {
+ s << ' ';
+ s << arg;
+ }
}
- tracebuffer::Add(s.str(), tracebuffer::kBegin);
+ return std::move(s).str();
+}
+
+Trace::Trace(std::string_view tag, const std::vector<android::StringPiece>& args) {
+ if (!tracebuffer::enabled) return;
+ tag_ = makeTag(tag, args);
+ tracebuffer::Add(tag_, tracebuffer::kBegin);
}
Trace::~Trace() {
- tracebuffer::Add("", tracebuffer::kEnd);
+ if (!tracebuffer::enabled) return;
+ tracebuffer::Add(std::move(tag_), tracebuffer::kEnd);
}
-FlushTrace::FlushTrace(const std::string& basepath, const std::string& tag)
- : basepath_(basepath) {
- tracebuffer::Add(tag, tracebuffer::kBegin);
+FlushTrace::FlushTrace(std::string_view basepath, std::string_view tag) {
+ if (!Trace::enable(!basepath.empty())) return;
+ basepath_.assign(basepath);
+ tag_.assign(tag);
+ tracebuffer::Add(tag_, tracebuffer::kBegin);
}
-FlushTrace::FlushTrace(const std::string& basepath, const std::string& tag,
- const std::vector<android::StringPiece>& args) : basepath_(basepath) {
- std::stringstream s;
- s << tag;
- s << " ";
- for (auto& arg : args) {
- s << arg;
- s << " ";
- }
- tracebuffer::Add(s.str(), tracebuffer::kBegin);
+FlushTrace::FlushTrace(std::string_view basepath, std::string_view tag,
+ const std::vector<android::StringPiece>& args) {
+ if (!Trace::enable(!basepath.empty())) return;
+ basepath_.assign(basepath);
+ tag_ = makeTag(tag, args);
+ tracebuffer::Add(tag_, tracebuffer::kBegin);
}
-FlushTrace::FlushTrace(const std::string& basepath, const std::string& tag,
- const std::vector<std::string>& args) : basepath_(basepath){
- std::stringstream s;
- s << tag;
- s << " ";
- for (auto& arg : args) {
- s << arg;
- s << " ";
- }
- tracebuffer::Add(s.str(), tracebuffer::kBegin);
+FlushTrace::FlushTrace(std::string_view basepath, std::string_view tag,
+ const std::vector<std::string>& args) {
+ if (!Trace::enable(!basepath.empty())) return;
+ basepath_.assign(basepath);
+ tag_ = makeTag(tag, args);
+ tracebuffer::Add(tag_, tracebuffer::kBegin);
}
FlushTrace::~FlushTrace() {
- tracebuffer::Add("", tracebuffer::kEnd);
+ if (!tracebuffer::enabled) return;
+ tracebuffer::Add(std::move(tag_), tracebuffer::kEnd);
tracebuffer::Flush(basepath_);
}
-} // namespace aapt
-
+} // namespace aapt
diff --git a/tools/aapt2/trace/TraceBuffer.h b/tools/aapt2/trace/TraceBuffer.h
index ba751dd..f0333d1 100644
--- a/tools/aapt2/trace/TraceBuffer.h
+++ b/tools/aapt2/trace/TraceBuffer.h
@@ -17,41 +17,50 @@
#ifndef AAPT_TRACEBUFFER_H
#define AAPT_TRACEBUFFER_H
-#include <string>
-#include <vector>
-
#include <androidfw/StringPiece.h>
+#include <string>
+#include <string_view>
+#include <vector>
+
namespace aapt {
// Record timestamps for beginning and end of a task and generate systrace json fragments.
// This is an in-process ftrace which has the advantage of being platform independent.
// These methods are NOT thread-safe since aapt2 is not multi-threaded.
-// Convenience RIAA object to automatically finish an event when object goes out of scope.
+// Convenience RAII object to automatically finish an event when object goes out of scope.
class Trace {
public:
- Trace(const std::string& tag);
- Trace(const std::string& tag, const std::vector<android::StringPiece>& args);
- ~Trace();
+ Trace(const char* tag);
+ Trace(std::string tag);
+ Trace(std::string_view tag, const std::vector<android::StringPiece>& args);
+ ~Trace();
+
+ static bool enable(bool value = true);
+
+private:
+ std::string tag_;
};
// Manual markers.
-void BeginTrace(const std::string& tag);
-void EndTrace();
+void BeginTrace(std::string tag);
+void EndTrace(std::string tag);
// A main trace is required to flush events to disk. Events are formatted in systrace
// json format.
class FlushTrace {
public:
- explicit FlushTrace(const std::string& basepath, const std::string& tag);
- explicit FlushTrace(const std::string& basepath, const std::string& tag,
- const std::vector<android::StringPiece>& args);
- explicit FlushTrace(const std::string& basepath, const std::string& tag,
- const std::vector<std::string>& args);
- ~FlushTrace();
+ explicit FlushTrace(std::string_view basepath, std::string_view tag);
+ explicit FlushTrace(std::string_view basepath, std::string_view tag,
+ const std::vector<android::StringPiece>& args);
+ explicit FlushTrace(std::string_view basepath, std::string_view tag,
+ const std::vector<std::string>& args);
+ ~FlushTrace();
+
private:
std::string basepath_;
+ std::string tag_;
};
#define TRACE_CALL() Trace __t(__func__)
diff --git a/tools/hiddenapi/OWNERS b/tools/hiddenapi/OWNERS
index afbeef5..dc82aac 100644
--- a/tools/hiddenapi/OWNERS
+++ b/tools/hiddenapi/OWNERS
@@ -1,5 +1,4 @@
# compat-team@ for changes to hiddenapi files
-andreionea@google.com
mathewi@google.com
satayev@google.com
diff --git a/tools/split-select/Grouper_test.cpp b/tools/split-select/Grouper_test.cpp
index 7294a86..a8b78cd 100644
--- a/tools/split-select/Grouper_test.cpp
+++ b/tools/split-select/Grouper_test.cpp
@@ -179,7 +179,7 @@
errorMessage.append("\n");
}
}
- ADD_FAILURE() << errorMessage.string();
+ ADD_FAILURE() << errorMessage.c_str();
}
void GrouperTest::addSplit(Vector<SplitDescription>& splits, const char* str) {
diff --git a/tools/split-select/Main.cpp b/tools/split-select/Main.cpp
index e6966db..1e75117 100644
--- a/tools/split-select/Main.cpp
+++ b/tools/split-select/Main.cpp
@@ -99,8 +99,7 @@
}
masterRule = Rule::simplify(masterRule);
fprintf(stdout, " {\n \"path\": \"%s\",\n \"rules\": %s\n }",
- splits.keyAt(i).string(),
- masterRule->toJson(2).string());
+ splits.keyAt(i).c_str(), masterRule->toJson(2).c_str());
}
fprintf(stdout, "\n]\n");
}
@@ -158,25 +157,23 @@
const char16_t* name = xml.getElementName(&len);
String16 name16(name, len);
if (name16 == kManifestTag) {
- ssize_t idx = xml.indexOfAttribute(
- kAndroidNamespace.string(), kAndroidNamespace.size(),
- kVersionCodeAttr.string(), kVersionCodeAttr.size());
+ ssize_t idx = xml.indexOfAttribute(kAndroidNamespace.c_str(), kAndroidNamespace.size(),
+ kVersionCodeAttr.c_str(), kVersionCodeAttr.size());
if (idx >= 0) {
outInfo.versionCode = xml.getAttributeData(idx);
}
} else if (name16 == kApplicationTag) {
- ssize_t idx = xml.indexOfAttribute(
- kAndroidNamespace.string(), kAndroidNamespace.size(),
- kMultiArchAttr.string(), kMultiArchAttr.size());
+ ssize_t idx = xml.indexOfAttribute(kAndroidNamespace.c_str(), kAndroidNamespace.size(),
+ kMultiArchAttr.c_str(), kMultiArchAttr.size());
if (idx >= 0) {
outInfo.multiArch = xml.getAttributeData(idx) != 0;
}
} else if (name16 == kUsesSdkTag) {
- ssize_t idx = xml.indexOfAttribute(
- kAndroidNamespace.string(), kAndroidNamespace.size(),
- kMinSdkVersionAttr.string(), kMinSdkVersionAttr.size());
+ ssize_t idx =
+ xml.indexOfAttribute(kAndroidNamespace.c_str(), kAndroidNamespace.size(),
+ kMinSdkVersionAttr.c_str(), kMinSdkVersionAttr.size());
if (idx >= 0) {
uint16_t type = xml.getAttributeDataType(idx);
if (type >= Res_value::TYPE_FIRST_INT && type <= Res_value::TYPE_LAST_INT) {
@@ -187,10 +184,10 @@
fprintf(stderr, "warning: failed to retrieve android:minSdkVersion.\n");
} else {
char *endPtr;
- int minSdk = strtol(minSdk8->string(), &endPtr, 10);
- if (endPtr != minSdk8->string() + minSdk8->size()) {
+ int minSdk = strtol(minSdk8->c_str(), &endPtr, 10);
+ if (endPtr != minSdk8->c_str() + minSdk8->size()) {
fprintf(stderr, "warning: failed to parse android:minSdkVersion '%s'\n",
- minSdk8->string());
+ minSdk8->c_str());
} else {
outInfo.minSdkVersion = minSdk;
}
@@ -232,7 +229,7 @@
splits.add();
Vector<String8> parts = AaptUtil::splitAndLowerCase(dir->getFileName(i), '-');
if (parseAbi(parts, 0, &splits.editTop()) < 0) {
- fprintf(stderr, "Malformed library %s\n", dir->getFileName(i).string());
+ fprintf(stderr, "Malformed library %s\n", dir->getFileName(i).c_str());
splits.pop();
}
}
@@ -291,7 +288,7 @@
help();
return 0;
} else {
- fprintf(stderr, "error: unknown argument '%s'.\n", arg.string());
+ fprintf(stderr, "error: unknown argument '%s'.\n", arg.c_str());
usage();
return 1;
}
@@ -313,15 +310,14 @@
// Find out some details about the base APK.
AppInfo baseAppInfo;
if (!getAppInfo(baseApkPath, baseAppInfo)) {
- fprintf(stderr, "error: unable to read base APK: '%s'.\n", baseApkPath.string());
+ fprintf(stderr, "error: unable to read base APK: '%s'.\n", baseApkPath.c_str());
return 1;
}
SplitDescription targetSplit;
if (!generateFlag) {
if (!SplitDescription::parse(targetConfigStr, &targetSplit)) {
- fprintf(stderr, "error: invalid --target config: '%s'.\n",
- targetConfigStr.string());
+ fprintf(stderr, "error: invalid --target config: '%s'.\n", targetConfigStr.c_str());
usage();
return 1;
}
@@ -341,7 +337,7 @@
Vector<SplitDescription> splits = extractSplitDescriptionsFromApk(splitApkPaths[i]);
if (splits.isEmpty()) {
fprintf(stderr, "error: invalid --split path: '%s'. No splits found.\n",
- splitApkPaths[i].string());
+ splitApkPaths[i].c_str());
usage();
return 1;
}
@@ -364,7 +360,7 @@
const size_t matchingSplitApkPathCount = matchingSplitPaths.size();
for (size_t i = 0; i < matchingSplitApkPathCount; i++) {
if (matchingSplitPaths[i] != baseApkPath) {
- fprintf(stdout, "%s\n", matchingSplitPaths[i].string());
+ fprintf(stdout, "%s\n", matchingSplitPaths[i].c_str());
}
}
} else {
diff --git a/tools/split-select/Rule_test.cpp b/tools/split-select/Rule_test.cpp
index c6cff0d..c78533f 100644
--- a/tools/split-select/Rule_test.cpp
+++ b/tools/split-select/Rule_test.cpp
@@ -68,7 +68,7 @@
expected.erase(std::remove_if(expected.begin(), expected.end(), ::isspace), expected.end());
// Result
- std::string result(rule.toJson().string());
+ std::string result(rule.toJson().c_str());
result.erase(std::remove_if(result.begin(), result.end(), ::isspace), result.end());
ASSERT_EQ(expected, result);
diff --git a/tools/split-select/SplitDescription.cpp b/tools/split-select/SplitDescription.cpp
index 99bc23d..4e2b48e 100644
--- a/tools/split-select/SplitDescription.cpp
+++ b/tools/split-select/SplitDescription.cpp
@@ -134,8 +134,8 @@
String8 configStr;
String8 extensionStr;
if (index >= 0) {
- configStr.setTo(str.string(), index);
- extensionStr.setTo(str.string() + index + 1);
+ configStr.setTo(str.c_str(), index);
+ extensionStr.setTo(str.c_str() + index + 1);
} else {
configStr.setTo(str);
}
diff --git a/tools/split-select/TestRules.cpp b/tools/split-select/TestRules.cpp
index 86ccd6a..ca3c56f 100644
--- a/tools/split-select/TestRules.cpp
+++ b/tools/split-select/TestRules.cpp
@@ -78,9 +78,8 @@
const String8 actualStr(actual != NULL ? actual->toJson() : String8());
if (expectedStr != actualStr) {
- return ::testing::AssertionFailure()
- << "Expected: " << expectedStr.string() << "\n"
- << " Actual: " << actualStr.string();
+ return ::testing::AssertionFailure() << "Expected: " << expectedStr.c_str() << "\n"
+ << " Actual: " << actualStr.c_str();
}
return ::testing::AssertionSuccess();
}
diff --git a/wifi/java/src/android/net/wifi/sharedconnectivity/app/SharedConnectivitySettingsState.java b/wifi/java/src/android/net/wifi/sharedconnectivity/app/SharedConnectivitySettingsState.java
index 5ad3ede..c828de9f 100644
--- a/wifi/java/src/android/net/wifi/sharedconnectivity/app/SharedConnectivitySettingsState.java
+++ b/wifi/java/src/android/net/wifi/sharedconnectivity/app/SharedConnectivitySettingsState.java
@@ -196,7 +196,7 @@
public String toString() {
return new StringBuilder("SharedConnectivitySettingsState[")
.append("instantTetherEnabled=").append(mInstantTetherEnabled)
- .append("PendingIntent=").append(mInstantTetherSettingsPendingIntent.toString())
+ .append("PendingIntent=").append(mInstantTetherSettingsPendingIntent)
.append("extras=").append(mExtras.toString())
.append("]").toString();
}