Merge "Full teardown when the user stops background apps"
diff --git a/Android.bp b/Android.bp
index 8d82b38..8bc5d7a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -77,7 +77,6 @@
// Java/AIDL sources under frameworks/base
":framework-annotations",
":framework-blobstore-sources",
- ":framework-bluetooth-sources", // TODO(b/214988855) : Remove once framework-bluetooth jar is ready
":framework-connectivity-tiramisu-sources",
":framework-core-sources",
":framework-drm-sources",
@@ -297,6 +296,7 @@
defaults: ["framework-aidl-export-defaults"],
srcs: [
":framework-non-updatable-sources",
+ ":framework-bluetooth-sources", // TODO(b/214988855) : Remove once framework-bluetooth jar is ready
"core/java/**/*.logtags",
":apex-info-list",
],
@@ -602,6 +602,7 @@
libs: [
"art.module.public.api",
"sdk_module-lib_current_framework-tethering",
+ "sdk_public_current_framework-bluetooth",
// There are a few classes from modules used by the core that
// need to be resolved by metalava. We use a prebuilt stub of the
// full sdk to ensure we can resolve them. If a new class gets added,
diff --git a/ApiDocs.bp b/ApiDocs.bp
index 3d6b52f..c50d446 100644
--- a/ApiDocs.bp
+++ b/ApiDocs.bp
@@ -102,6 +102,7 @@
":framework-appsearch-sources",
":framework-connectivity-sources",
+ ":framework-bluetooth-sources",
":framework-connectivity-tiramisu-updatable-sources",
":framework-graphics-srcs",
":framework-mediaprovider-sources",
diff --git a/StubLibraries.bp b/StubLibraries.bp
index 8a15758..a0a426e 100644
--- a/StubLibraries.bp
+++ b/StubLibraries.bp
@@ -215,52 +215,6 @@
// from stub sources
/////////////////////////////////////////////////////////////////////
-modules_public_stubs = [
- "android.net.ipsec.ike.stubs",
- "art.module.public.api.stubs",
- "conscrypt.module.public.api.stubs",
- "framework-appsearch.stubs",
- "framework-connectivity.stubs",
- "framework-connectivity-tiramisu.stubs",
- "framework-graphics.stubs",
- "framework-media.stubs",
- "framework-mediaprovider.stubs",
- "framework-nearby.stubs",
- "framework-permission.stubs",
- "framework-permission-s.stubs",
- "framework-scheduling.stubs",
- "framework-sdkextensions.stubs",
- "framework-statsd.stubs",
- "framework-supplementalprocess.stubs",
- "framework-tethering.stubs",
- "framework-uwb.stubs",
- "framework-wifi.stubs",
- "i18n.module.public.api.stubs",
-]
-
-modules_system_stubs = [
- "android.net.ipsec.ike.stubs.system",
- "art.module.public.api.stubs.system",
- "conscrypt.module.public.api.stubs", // Only has public stubs
- "framework-appsearch.stubs.system",
- "framework-connectivity.stubs.system",
- "framework-connectivity-tiramisu.stubs.system",
- "framework-graphics.stubs.system",
- "framework-media.stubs.system",
- "framework-mediaprovider.stubs.system",
- "framework-nearby.stubs.system",
- "framework-permission.stubs.system",
- "framework-permission-s.stubs.system",
- "framework-scheduling.stubs.system",
- "framework-sdkextensions.stubs.system",
- "framework-statsd.stubs.system",
- "framework-supplementalprocess.stubs",
- "framework-tethering.stubs.system",
- "framework-uwb.stubs.system",
- "framework-wifi.stubs.system",
- "i18n.module.public.api.stubs", // Only has public stubs
-]
-
java_defaults {
name: "android-non-updatable_defaults_stubs_current",
libs: ["stub-annotations"],
@@ -282,14 +236,7 @@
name: "android-non-updatable.stubs",
defaults: ["android-non-updatable_defaults_stubs_current"],
srcs: [":api-stubs-docs-non-updatable"],
- libs: modules_public_stubs,
- soong_config_variables: {
- include_nonpublic_framework_api: {
- libs: [
- "framework-supplementalapi.stubs",
- ],
- },
- },
+ libs: ["all-modules-public-stubs"],
dist: {
dir: "apistubs/android/public",
},
@@ -299,14 +246,7 @@
name: "android-non-updatable.stubs.system",
defaults: ["android-non-updatable_defaults_stubs_current"],
srcs: [":system-api-stubs-docs-non-updatable"],
- libs: modules_system_stubs,
- soong_config_variables: {
- include_nonpublic_framework_api: {
- libs: [
- "framework-supplementalapi.stubs",
- ],
- },
- },
+ libs: ["all-modules-system-stubs"],
dist: {
dir: "apistubs/android/system",
},
@@ -318,6 +258,8 @@
srcs: [":module-lib-api-stubs-docs-non-updatable"],
libs: [
"sdk_module-lib_current_framework-tethering",
+ "sdk_public_current_framework-bluetooth",
+ // NOTE: The below can be removed once the prebuilt stub contains bluetooth.
"sdk_system_current_android",
// NOTE: The below can be removed once the prebuilt stub contains IKE.
"sdk_system_current_android.net.ipsec.ike",
@@ -331,14 +273,7 @@
name: "android-non-updatable.stubs.test",
defaults: ["android-non-updatable_defaults_stubs_current"],
srcs: [":test-api-stubs-docs-non-updatable"],
- libs: modules_system_stubs,
- soong_config_variables: {
- include_nonpublic_framework_api: {
- libs: [
- "framework-supplementalapi.stubs",
- ],
- },
- },
+ libs: ["all-modules-system-stubs"],
dist: {
dir: "apistubs/android/test",
},
@@ -356,33 +291,21 @@
java_library_with_nonpublic_deps {
name: "android_stubs_current",
- static_libs: modules_public_stubs + [
+ static_libs: [
+ "all-modules-public-stubs",
"android-non-updatable.stubs",
"private-stub-annotations-jar",
],
- soong_config_variables: {
- include_nonpublic_framework_api: {
- static_libs: [
- "framework-supplementalapi.stubs",
- ],
- },
- },
defaults: ["android.jar_defaults"],
}
java_library_with_nonpublic_deps {
name: "android_system_stubs_current",
- static_libs: modules_system_stubs + [
+ static_libs: [
+ "all-modules-system-stubs",
"android-non-updatable.stubs.system",
"private-stub-annotations-jar",
],
- soong_config_variables: {
- include_nonpublic_framework_api: {
- static_libs: [
- "framework-supplementalapi.stubs",
- ],
- },
- },
defaults: [
"android.jar_defaults",
"android_stubs_dists_default",
@@ -404,17 +327,11 @@
name: "android_test_stubs_current",
// Modules do not have test APIs, but we want to include their SystemApis, like we include
// the SystemApi of framework-non-updatable-sources.
- static_libs: modules_system_stubs + [
+ static_libs: [
+ "all-modules-system-stubs",
"android-non-updatable.stubs.test",
"private-stub-annotations-jar",
],
- soong_config_variables: {
- include_nonpublic_framework_api: {
- static_libs: [
- "framework-supplementalapi.stubs",
- ],
- },
- },
defaults: [
"android.jar_defaults",
"android_stubs_dists_default",
diff --git a/apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java b/apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java
index 9fb1227..6dd79e8 100644
--- a/apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java
+++ b/apex/jobscheduler/framework/java/android/os/PowerExemptionManager.java
@@ -350,6 +350,21 @@
* @hide
*/
public static final int REASON_MEDIA_SESSION_CALLBACK = 317;
+ /**
+ * Dialer app.
+ * @hide
+ */
+ public static final int REASON_ROLE_DIALER = 318;
+ /**
+ * Emergency app.
+ * @hide
+ */
+ public static final int REASON_ROLE_EMERGENCY = 319;
+ /**
+ * System Module.
+ * @hide
+ */
+ public static final int REASON_SYSTEM_MODULE = 320;
/** @hide The app requests out-out. */
public static final int REASON_OPT_OUT_REQUESTED = 1000;
@@ -423,6 +438,9 @@
REASON_EVENT_MMS,
REASON_SHELL,
REASON_MEDIA_SESSION_CALLBACK,
+ REASON_ROLE_DIALER,
+ REASON_ROLE_EMERGENCY,
+ REASON_SYSTEM_MODULE,
REASON_OPT_OUT_REQUESTED,
})
@Retention(RetentionPolicy.SOURCE)
@@ -726,6 +744,12 @@
return "SHELL";
case REASON_MEDIA_SESSION_CALLBACK:
return "MEDIA_SESSION_CALLBACK";
+ case REASON_ROLE_DIALER:
+ return "ROLE_DIALER";
+ case REASON_ROLE_EMERGENCY:
+ return "ROLE_EMERGENCY";
+ case REASON_SYSTEM_MODULE:
+ return "SYSTEM_MODULE";
case REASON_OPT_OUT_REQUESTED:
return "REASON_OPT_OUT_REQUESTED";
default:
diff --git a/apex/jobscheduler/framework/java/com/android/server/usage/AppStandbyInternal.java b/apex/jobscheduler/framework/java/com/android/server/usage/AppStandbyInternal.java
index 0f36d32..9b1f2d0 100644
--- a/apex/jobscheduler/framework/java/com/android/server/usage/AppStandbyInternal.java
+++ b/apex/jobscheduler/framework/java/com/android/server/usage/AppStandbyInternal.java
@@ -4,8 +4,8 @@
import android.annotation.NonNull;
import android.annotation.UserIdInt;
import android.app.usage.AppStandbyInfo;
+import android.app.usage.UsageStatsManager.ForcedReasons;
import android.app.usage.UsageStatsManager.StandbyBuckets;
-import android.app.usage.UsageStatsManager.SystemForcedReasons;
import android.content.Context;
import android.util.IndentingPrintWriter;
@@ -152,7 +152,7 @@
* UsageStatsManager.REASON_SUB_FORCED_SYSTEM_FLAG_* reasons.
*/
void restrictApp(@NonNull String packageName, int userId,
- @SystemForcedReasons int restrictReason);
+ @ForcedReasons int restrictReason);
/**
* Put the specified app in the
@@ -169,7 +169,29 @@
* UsageStatsManager.REASON_SUB_FORCED_SYSTEM_FLAG_* reasons.
*/
void restrictApp(@NonNull String packageName, int userId, int mainReason,
- @SystemForcedReasons int restrictReason);
+ @ForcedReasons int restrictReason);
+
+ /**
+ * Unrestrict an app if there is no other reason to restrict it.
+ *
+ * <p>
+ * The {@code prevMainReasonRestrict} and {@code prevSubReasonRestrict} are the previous
+ * reasons of why it was restricted, but the caller knows that these conditions are not true
+ * anymore; therefore if there is no other reasons to restrict it (as there could bemultiple
+ * reasons to restrict it), lift the restriction.
+ * </p>
+ *
+ * @param packageName The package name of the app.
+ * @param userId The user id that this app runs in.
+ * @param prevMainReasonRestrict The main reason that why it was restricted, must be either
+ * {@link android.app.usage.UsageStatsManager#REASON_MAIN_FORCED_BY_SYSTEM}
+ * or {@link android.app.usage.UsageStatsManager#REASON_MAIN_FORCED_BY_USER}.
+ * @param prevSubReasonRestrict The subreason that why it was restricted before.
+ * @param mainReasonUnrestrict The main reason that why it could be unrestricted now.
+ * @param subReasonUnrestrict The subreason that why it could be unrestricted now.
+ */
+ void maybeUnrestrictApp(@NonNull String packageName, int userId, int prevMainReasonRestrict,
+ int prevSubReasonRestrict, int mainReasonUnrestrict, int subReasonUnrestrict);
void addActiveDeviceAdmin(String adminPkg, int userId);
diff --git a/apex/jobscheduler/service/java/com/android/server/AppStateTrackerImpl.java b/apex/jobscheduler/service/java/com/android/server/AppStateTrackerImpl.java
index d21a0ea..70d5038 100644
--- a/apex/jobscheduler/service/java/com/android/server/AppStateTrackerImpl.java
+++ b/apex/jobscheduler/service/java/com/android/server/AppStateTrackerImpl.java
@@ -18,6 +18,7 @@
import android.annotation.NonNull;
import android.app.ActivityManager;
import android.app.ActivityManagerInternal;
+import android.app.ActivityManagerInternal.AppBackgroundRestrictionListener;
import android.app.AppOpsManager;
import android.app.AppOpsManager.PackageOps;
import android.app.IActivityManager;
@@ -280,6 +281,14 @@
}
}
+ private final AppBackgroundRestrictionListener mAppBackgroundRestrictionListener =
+ new AppBackgroundRestrictionListener() {
+ @Override
+ public void onAutoRestrictedBucketFeatureFlagChanged(boolean autoRestrictedBucket) {
+ mHandler.notifyAutoRestrictedBucketFeatureFlagChanged(autoRestrictedBucket);
+ }
+ };
+
/**
* Listener for any state changes that affect any app's eligibility to run.
*/
@@ -370,6 +379,18 @@
}
/**
+ * Called when toggling the feature flag of moving to restricted standby bucket
+ * automatically on background-restricted.
+ */
+ private void onAutoRestrictedBucketFeatureFlagChanged(AppStateTrackerImpl sender,
+ boolean autoRestrictedBucket) {
+ updateAllJobs();
+ if (autoRestrictedBucket) {
+ unblockAllUnrestrictedAlarms();
+ }
+ }
+
+ /**
* Called when the job restrictions for multiple UIDs might have changed, so the job
* scheduler should re-evaluate all restrictions for all jobs.
*/
@@ -499,6 +520,8 @@
mFlagsObserver.isForcedAppStandbyForSmallBatteryEnabled();
mStandbyTracker = new StandbyTracker();
mAppStandbyInternal.addListener(mStandbyTracker);
+ mActivityManagerInternal.addAppBackgroundRestrictionListener(
+ mAppBackgroundRestrictionListener);
try {
mIActivityManager.registerUidObserver(new UidObserver(),
@@ -802,6 +825,7 @@
private static final int MSG_USER_REMOVED = 8;
private static final int MSG_FORCE_APP_STANDBY_FEATURE_FLAG_CHANGED = 9;
private static final int MSG_EXEMPTED_BUCKET_CHANGED = 10;
+ private static final int MSG_AUTO_RESTRICTED_BUCKET_FEATURE_FLAG_CHANGED = 11;
private static final int MSG_ON_UID_ACTIVE = 12;
private static final int MSG_ON_UID_GONE = 13;
@@ -849,6 +873,12 @@
obtainMessage(MSG_EXEMPTED_BUCKET_CHANGED).sendToTarget();
}
+ public void notifyAutoRestrictedBucketFeatureFlagChanged(boolean autoRestrictedBucket) {
+ removeMessages(MSG_AUTO_RESTRICTED_BUCKET_FEATURE_FLAG_CHANGED);
+ obtainMessage(MSG_AUTO_RESTRICTED_BUCKET_FEATURE_FLAG_CHANGED,
+ autoRestrictedBucket ? 1 : 0, 0).sendToTarget();
+ }
+
public void doUserRemoved(int userId) {
obtainMessage(MSG_USER_REMOVED, userId, 0).sendToTarget();
}
@@ -952,6 +982,13 @@
handleUserRemoved(msg.arg1);
return;
+ case MSG_AUTO_RESTRICTED_BUCKET_FEATURE_FLAG_CHANGED:
+ final boolean autoRestrictedBucket = msg.arg1 == 1;
+ for (Listener l : cloneListeners()) {
+ l.onAutoRestrictedBucketFeatureFlagChanged(sender, autoRestrictedBucket);
+ }
+ return;
+
case MSG_ON_UID_ACTIVE:
handleUidActive(msg.arg1);
return;
@@ -1120,7 +1157,12 @@
if (ArrayUtils.contains(mPowerExemptAllAppIds, appId)) {
return false;
}
- return (mForcedAppStandbyEnabled && isRunAnyRestrictedLocked(uid, packageName));
+ // If apps will be put into restricted standby bucket automatically on user-forced
+ // app standby, instead of blocking alarms completely, let the restricted standby bucket
+ // policy take care of it.
+ return (mForcedAppStandbyEnabled
+ && !mActivityManagerInternal.isBgAutoRestrictedBucketFeatureFlagEnabled()
+ && isRunAnyRestrictedLocked(uid, packageName));
}
}
@@ -1161,7 +1203,12 @@
|| ArrayUtils.contains(mTempExemptAppIds, appId)) {
return false;
}
- if (mForcedAppStandbyEnabled && isRunAnyRestrictedLocked(uid, packageName)) {
+ // If apps will be put into restricted standby bucket automatically on user-forced
+ // app standby, instead of blocking jobs completely, let the restricted standby bucket
+ // policy take care of it.
+ if (mForcedAppStandbyEnabled
+ && !mActivityManagerInternal.isBgAutoRestrictedBucketFeatureFlagEnabled()
+ && isRunAnyRestrictedLocked(uid, packageName)) {
return true;
}
if (hasForegroundExemption) {
diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java
index 0ceab35..65d7121 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java
@@ -19,6 +19,7 @@
import static com.android.server.job.JobSchedulerService.NEVER_INDEX;
import static com.android.server.job.JobSchedulerService.sElapsedRealtimeClock;
+import android.app.ActivityManagerInternal;
import android.os.SystemClock;
import android.os.UserHandle;
import android.util.ArraySet;
@@ -59,6 +60,7 @@
static final int KNOWN_ACTIVE = 1;
static final int KNOWN_INACTIVE = 2;
+ private final ActivityManagerInternal mActivityManagerInternal;
private final AppStateTrackerImpl mAppStateTracker;
private final UpdateJobFunctor mUpdateJobFunctor = new UpdateJobFunctor();
@@ -66,6 +68,8 @@
public BackgroundJobsController(JobSchedulerService service) {
super(service);
+ mActivityManagerInternal = (ActivityManagerInternal) Objects.requireNonNull(
+ LocalServices.getService(ActivityManagerInternal.class));
mAppStateTracker = (AppStateTrackerImpl) Objects.requireNonNull(
LocalServices.getService(AppStateTracker.class));
mAppStateTracker.addListener(mForceAppStandbyListener);
@@ -216,7 +220,8 @@
}
boolean didChange =
jobStatus.setBackgroundNotRestrictedConstraintSatisfied(nowElapsed, canRun,
- !mAppStateTracker.isRunAnyInBackgroundAppOpsAllowed(uid, packageName));
+ !mActivityManagerInternal.isBgAutoRestrictedBucketFeatureFlagEnabled()
+ && !mAppStateTracker.isRunAnyInBackgroundAppOpsAllowed(uid, packageName));
didChange |= jobStatus.setUidActive(isActive);
return didChange;
}
diff --git a/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java b/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java
index ebf42b8..8b26397 100644
--- a/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java
+++ b/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java
@@ -63,8 +63,8 @@
import android.app.ActivityManager;
import android.app.usage.AppStandbyInfo;
import android.app.usage.UsageEvents;
+import android.app.usage.UsageStatsManager.ForcedReasons;
import android.app.usage.UsageStatsManager.StandbyBuckets;
-import android.app.usage.UsageStatsManager.SystemForcedReasons;
import android.app.usage.UsageStatsManagerInternal;
import android.appwidget.AppWidgetManager;
import android.content.BroadcastReceiver;
@@ -1406,13 +1406,13 @@
@Override
public void restrictApp(@NonNull String packageName, int userId,
- @SystemForcedReasons int restrictReason) {
+ @ForcedReasons int restrictReason) {
restrictApp(packageName, userId, REASON_MAIN_FORCED_BY_SYSTEM, restrictReason);
}
@Override
public void restrictApp(@NonNull String packageName, int userId, int mainReason,
- @SystemForcedReasons int restrictReason) {
+ @ForcedReasons int restrictReason) {
if (mainReason != REASON_MAIN_FORCED_BY_SYSTEM
&& mainReason != REASON_MAIN_FORCED_BY_USER) {
Slog.e(TAG, "Tried to restrict app " + packageName + " for an unsupported reason");
@@ -1799,27 +1799,36 @@
* bucket if it was forced into the bucket by the system because it was buggy.
*/
@VisibleForTesting
- void maybeUnrestrictBuggyApp(String packageName, int userId) {
+ void maybeUnrestrictBuggyApp(@NonNull String packageName, int userId) {
+ maybeUnrestrictApp(packageName, userId,
+ REASON_MAIN_FORCED_BY_SYSTEM, REASON_SUB_FORCED_SYSTEM_FLAG_BUGGY,
+ REASON_MAIN_DEFAULT, REASON_SUB_DEFAULT_APP_UPDATE);
+ }
+
+ @Override
+ public void maybeUnrestrictApp(@NonNull String packageName, int userId,
+ int prevMainReasonRestrict, int prevSubReasonRestrict,
+ int mainReasonUnrestrict, int subReasonUnrestrict) {
synchronized (mAppIdleLock) {
final long elapsedRealtime = mInjector.elapsedRealtime();
final AppIdleHistory.AppUsageHistory app =
mAppIdleHistory.getAppUsageHistory(packageName, userId, elapsedRealtime);
if (app.currentBucket != STANDBY_BUCKET_RESTRICTED
- || (app.bucketingReason & REASON_MAIN_MASK) != REASON_MAIN_FORCED_BY_SYSTEM) {
+ || (app.bucketingReason & REASON_MAIN_MASK) != prevMainReasonRestrict) {
return;
}
final int newBucket;
final int newReason;
- if ((app.bucketingReason & REASON_SUB_MASK) == REASON_SUB_FORCED_SYSTEM_FLAG_BUGGY) {
- // If bugginess was the only reason the app should be restricted, then lift it out.
+ if ((app.bucketingReason & REASON_SUB_MASK) == prevSubReasonRestrict) {
+ // If it was the only reason the app should be restricted, then lift it out.
newBucket = STANDBY_BUCKET_RARE;
- newReason = REASON_MAIN_DEFAULT | REASON_SUB_DEFAULT_APP_UPDATE;
+ newReason = mainReasonUnrestrict | subReasonUnrestrict;
} else {
- // There's another reason the app was restricted. Remove the buggy bit and call
+ // There's another reason the app was restricted. Remove the subreason bit and call
// it a day.
newBucket = STANDBY_BUCKET_RESTRICTED;
- newReason = app.bucketingReason & ~REASON_SUB_FORCED_SYSTEM_FLAG_BUGGY;
+ newReason = app.bucketingReason & ~prevSubReasonRestrict;
}
mAppIdleHistory.setAppStandbyBucket(
packageName, userId, elapsedRealtime, newBucket, newReason);
diff --git a/api/Android.bp b/api/Android.bp
index a22c2f6..d8727f9 100644
--- a/api/Android.bp
+++ b/api/Android.bp
@@ -110,6 +110,7 @@
"art.module.public.api",
"conscrypt.module.public.api",
"framework-appsearch",
+ "framework-bluetooth",
"framework-connectivity",
"framework-connectivity-tiramisu",
"framework-graphics",
diff --git a/api/api.go b/api/api.go
index 4b6ebc1..aa9e399e 100644
--- a/api/api.go
+++ b/api/api.go
@@ -27,6 +27,7 @@
const art = "art.module.public.api"
const conscrypt = "conscrypt.module.public.api"
const i18n = "i18n.module.public.api"
+var modules_with_only_public_scope = []string{i18n, conscrypt}
// The intention behind this soong plugin is to generate a number of "merged"
// API-related modules that would otherwise require a large amount of very
@@ -183,6 +184,27 @@
ctx.CreateModule(genrule.GenRuleFactory, &props)
}
+func createMergedPublicStubs(ctx android.LoadHookContext, modules []string) {
+ props := libraryProps{}
+ props.Name = proptools.StringPtr("all-modules-public-stubs")
+ props.Static_libs = transformArray(modules, "", ".stubs")
+ props.Sdk_version = proptools.StringPtr("module_current")
+ props.Visibility = []string{"//frameworks/base"}
+ ctx.CreateModule(java.LibraryFactory, &props)
+}
+
+func createMergedSystemStubs(ctx android.LoadHookContext, modules []string) {
+ props := libraryProps{}
+ modules_with_system_stubs := removeAll(modules, modules_with_only_public_scope)
+ props.Name = proptools.StringPtr("all-modules-system-stubs")
+ props.Static_libs = append(
+ transformArray(modules_with_only_public_scope, "", ".stubs"),
+ transformArray(modules_with_system_stubs, "", ".stubs.system")...)
+ props.Sdk_version = proptools.StringPtr("module_current")
+ props.Visibility = []string{"//frameworks/base"}
+ ctx.CreateModule(java.LibraryFactory, &props)
+}
+
func createMergedModuleLibStubs(ctx android.LoadHookContext, modules []string) {
// The user of this module compiles against the "core" SDK, so remove core libraries to avoid dupes.
modules = removeAll(modules, []string{art, conscrypt, i18n})
@@ -205,7 +227,7 @@
func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_classpath []string) {
var textFiles []MergedTxtDefinition
// Two module libraries currently do not support @SystemApi so only have the public scope.
- bcpWithSystemApi := removeAll(bootclasspath, []string{conscrypt, i18n})
+ bcpWithSystemApi := removeAll(bootclasspath, modules_with_only_public_scope)
tagSuffix := []string{".api.txt}", ".removed-api.txt}"}
for i, f := range []string{"current.txt", "removed.txt"} {
@@ -253,6 +275,8 @@
createMergedStubsSrcjar(ctx, bootclasspath)
+ createMergedPublicStubs(ctx, bootclasspath)
+ createMergedSystemStubs(ctx, bootclasspath)
createMergedModuleLibStubs(ctx, bootclasspath)
createMergedAnnotations(ctx, bootclasspath)
diff --git a/boot/hiddenapi/hiddenapi-max-target-q.txt b/boot/hiddenapi/hiddenapi-max-target-q.txt
index 4832dd1..f70473c 100644
--- a/boot/hiddenapi/hiddenapi-max-target-q.txt
+++ b/boot/hiddenapi/hiddenapi-max-target-q.txt
@@ -398,7 +398,7 @@
Lcom/android/internal/R$layout;->select_dialog_singlechoice:I
Lcom/android/internal/R$layout;->webview_find:I
Lcom/android/internal/R$layout;->zoom_magnify:I
-Lcom/android/internal/R$plurals;->matches_found:I
+Lcom/android/internal/R$string;->matches_found:I
Lcom/android/internal/R$raw;->loaderror:I
Lcom/android/internal/R$raw;->nodomain:I
Lcom/android/internal/R$string;->byteShort:I
diff --git a/core/api/current.txt b/core/api/current.txt
index 7363c26..e0b25c3 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -50,6 +50,7 @@
field public static final String BIND_TELECOM_CONNECTION_SERVICE = "android.permission.BIND_TELECOM_CONNECTION_SERVICE";
field public static final String BIND_TEXT_SERVICE = "android.permission.BIND_TEXT_SERVICE";
field public static final String BIND_TV_INPUT = "android.permission.BIND_TV_INPUT";
+ field public static final String BIND_TV_INTERACTIVE_APP = "android.permission.BIND_TV_INTERACTIVE_APP";
field public static final String BIND_VISUAL_VOICEMAIL_SERVICE = "android.permission.BIND_VISUAL_VOICEMAIL_SERVICE";
field public static final String BIND_VOICE_INTERACTION = "android.permission.BIND_VOICE_INTERACTION";
field public static final String BIND_VPN_SERVICE = "android.permission.BIND_VPN_SERVICE";
@@ -152,8 +153,12 @@
field public static final String RECEIVE_WAP_PUSH = "android.permission.RECEIVE_WAP_PUSH";
field public static final String RECORD_AUDIO = "android.permission.RECORD_AUDIO";
field public static final String REORDER_TASKS = "android.permission.REORDER_TASKS";
+ field public static final String REQUEST_COMPANION_PROFILE_APP_STREAMING = "android.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING";
+ field public static final String REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION = "android.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION";
+ field public static final String REQUEST_COMPANION_PROFILE_COMPUTER = "android.permission.REQUEST_COMPANION_PROFILE_COMPUTER";
field public static final String REQUEST_COMPANION_PROFILE_WATCH = "android.permission.REQUEST_COMPANION_PROFILE_WATCH";
field public static final String REQUEST_COMPANION_RUN_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND";
+ field public static final String REQUEST_COMPANION_SELF_MANAGED = "android.permission.REQUEST_COMPANION_SELF_MANAGED";
field public static final String REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND = "android.permission.REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND";
field public static final String REQUEST_COMPANION_USE_DATA_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND";
field public static final String REQUEST_DELETE_PACKAGES = "android.permission.REQUEST_DELETE_PACKAGES";
@@ -361,6 +366,7 @@
field public static final int authorities = 16842776; // 0x1010018
field public static final int autoAdvanceViewId = 16843535; // 0x101030f
field public static final int autoCompleteTextViewStyle = 16842859; // 0x101006b
+ field public static final int autoHandwritingEnabled;
field public static final int autoLink = 16842928; // 0x10100b0
field public static final int autoMirrored = 16843754; // 0x10103ea
field public static final int autoRemoveFromRecents = 16843847; // 0x1010447
@@ -3144,22 +3150,22 @@
public static final class AccessibilityService.MagnificationController {
method public void addListener(@NonNull android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener);
method public void addListener(@NonNull android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener, @Nullable android.os.Handler);
- method public float getCenterX();
- method public float getCenterY();
+ method @Deprecated public float getCenterX();
+ method @Deprecated public float getCenterY();
method @NonNull public android.graphics.Region getCurrentMagnificationRegion();
method @Nullable public android.accessibilityservice.MagnificationConfig getMagnificationConfig();
- method @NonNull public android.graphics.Region getMagnificationRegion();
- method public float getScale();
+ method @Deprecated @NonNull public android.graphics.Region getMagnificationRegion();
+ method @Deprecated public float getScale();
method public boolean removeListener(@NonNull android.accessibilityservice.AccessibilityService.MagnificationController.OnMagnificationChangedListener);
method public boolean reset(boolean);
method public boolean resetCurrentMagnification(boolean);
- method public boolean setCenter(float, float, boolean);
+ method @Deprecated public boolean setCenter(float, float, boolean);
method public boolean setMagnificationConfig(@NonNull android.accessibilityservice.MagnificationConfig, boolean);
- method public boolean setScale(float, boolean);
+ method @Deprecated public boolean setScale(float, boolean);
}
public static interface AccessibilityService.MagnificationController.OnMagnificationChangedListener {
- method public void onMagnificationChanged(@NonNull android.accessibilityservice.AccessibilityService.MagnificationController, @NonNull android.graphics.Region, float, float, float);
+ method @Deprecated public void onMagnificationChanged(@NonNull android.accessibilityservice.AccessibilityService.MagnificationController, @NonNull android.graphics.Region, float, float, float);
method public default void onMagnificationChanged(@NonNull android.accessibilityservice.AccessibilityService.MagnificationController, @NonNull android.graphics.Region, @NonNull android.accessibilityservice.MagnificationConfig);
}
@@ -8873,1365 +8879,6 @@
}
-package android.bluetooth {
-
- public final class BluetoothA2dp implements android.bluetooth.BluetoothProfile {
- method public void finalize();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean isA2dpPlaying(android.bluetooth.BluetoothDevice);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.a2dp.profile.action.CONNECTION_STATE_CHANGED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_PLAYING_STATE_CHANGED = "android.bluetooth.a2dp.profile.action.PLAYING_STATE_CHANGED";
- field public static final int STATE_NOT_PLAYING = 11; // 0xb
- field public static final int STATE_PLAYING = 10; // 0xa
- }
-
- public final class BluetoothAdapter {
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public boolean cancelDiscovery();
- method public static boolean checkBluetoothAddress(String);
- method public void closeProfileProxy(int, android.bluetooth.BluetoothProfile);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean disable();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean enable();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, "android.permission.LOCAL_MAC_ADDRESS"}) public String getAddress();
- method public android.bluetooth.le.BluetoothLeAdvertiser getBluetoothLeAdvertiser();
- method public android.bluetooth.le.BluetoothLeScanner getBluetoothLeScanner();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.Set<android.bluetooth.BluetoothDevice> getBondedDevices();
- method @Deprecated public static android.bluetooth.BluetoothAdapter getDefaultAdapter();
- method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public java.time.Duration getDiscoverableTimeout();
- method public int getLeMaximumAdvertisingDataLength();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getMaxConnectedAudioDevices();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public String getName();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getProfileConnectionState(int);
- method public boolean getProfileProxy(android.content.Context, android.bluetooth.BluetoothProfile.ServiceListener, int);
- method public android.bluetooth.BluetoothDevice getRemoteDevice(String);
- method public android.bluetooth.BluetoothDevice getRemoteDevice(byte[]);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public int getScanMode();
- method public int getState();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public boolean isDiscovering();
- method public boolean isEnabled();
- method public boolean isLe2MPhySupported();
- method public int isLeAudioBroadcastAssistantSupported();
- method public int isLeAudioBroadcastSourceSupported();
- method public int isLeAudioSupported();
- method public boolean isLeCodedPhySupported();
- method public boolean isLeExtendedAdvertisingSupported();
- method public boolean isLePeriodicAdvertisingSupported();
- method public boolean isMultipleAdvertisementSupported();
- method public boolean isOffloadedFilteringSupported();
- method public boolean isOffloadedScanBatchingSupported();
- method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothServerSocket listenUsingInsecureL2capChannel() throws java.io.IOException;
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothServerSocket listenUsingInsecureRfcommWithServiceRecord(String, java.util.UUID) throws java.io.IOException;
- method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothServerSocket listenUsingL2capChannel() throws java.io.IOException;
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothServerSocket listenUsingRfcommWithServiceRecord(String, java.util.UUID) throws java.io.IOException;
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean setName(String);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public boolean startDiscovery();
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public boolean startLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback);
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public boolean startLeScan(java.util.UUID[], android.bluetooth.BluetoothAdapter.LeScanCallback);
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public void stopLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.adapter.action.CONNECTION_STATE_CHANGED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public static final String ACTION_DISCOVERY_FINISHED = "android.bluetooth.adapter.action.DISCOVERY_FINISHED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public static final String ACTION_DISCOVERY_STARTED = "android.bluetooth.adapter.action.DISCOVERY_STARTED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_LOCAL_NAME_CHANGED = "android.bluetooth.adapter.action.LOCAL_NAME_CHANGED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public static final String ACTION_REQUEST_DISCOVERABLE = "android.bluetooth.adapter.action.REQUEST_DISCOVERABLE";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_REQUEST_ENABLE = "android.bluetooth.adapter.action.REQUEST_ENABLE";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public static final String ACTION_SCAN_MODE_CHANGED = "android.bluetooth.adapter.action.SCAN_MODE_CHANGED";
- field public static final String ACTION_STATE_CHANGED = "android.bluetooth.adapter.action.STATE_CHANGED";
- field public static final int ERROR = -2147483648; // 0x80000000
- field public static final String EXTRA_CONNECTION_STATE = "android.bluetooth.adapter.extra.CONNECTION_STATE";
- field public static final String EXTRA_DISCOVERABLE_DURATION = "android.bluetooth.adapter.extra.DISCOVERABLE_DURATION";
- field public static final String EXTRA_LOCAL_NAME = "android.bluetooth.adapter.extra.LOCAL_NAME";
- field public static final String EXTRA_PREVIOUS_CONNECTION_STATE = "android.bluetooth.adapter.extra.PREVIOUS_CONNECTION_STATE";
- field public static final String EXTRA_PREVIOUS_SCAN_MODE = "android.bluetooth.adapter.extra.PREVIOUS_SCAN_MODE";
- field public static final String EXTRA_PREVIOUS_STATE = "android.bluetooth.adapter.extra.PREVIOUS_STATE";
- field public static final String EXTRA_SCAN_MODE = "android.bluetooth.adapter.extra.SCAN_MODE";
- field public static final String EXTRA_STATE = "android.bluetooth.adapter.extra.STATE";
- field public static final int SCAN_MODE_CONNECTABLE = 21; // 0x15
- field public static final int SCAN_MODE_CONNECTABLE_DISCOVERABLE = 23; // 0x17
- field public static final int SCAN_MODE_NONE = 20; // 0x14
- field public static final int STATE_CONNECTED = 2; // 0x2
- field public static final int STATE_CONNECTING = 1; // 0x1
- field public static final int STATE_DISCONNECTED = 0; // 0x0
- field public static final int STATE_DISCONNECTING = 3; // 0x3
- field public static final int STATE_OFF = 10; // 0xa
- field public static final int STATE_ON = 12; // 0xc
- field public static final int STATE_TURNING_OFF = 13; // 0xd
- field public static final int STATE_TURNING_ON = 11; // 0xb
- }
-
- public static interface BluetoothAdapter.LeScanCallback {
- method public void onLeScan(android.bluetooth.BluetoothDevice, int, byte[]);
- }
-
- public class BluetoothAssignedNumbers {
- field public static final int AAMP_OF_AMERICA = 190; // 0xbe
- field public static final int ACCEL_SEMICONDUCTOR = 74; // 0x4a
- field public static final int ACE_SENSOR = 188; // 0xbc
- field public static final int ADIDAS = 195; // 0xc3
- field public static final int ADVANCED_PANMOBIL_SYSTEMS = 145; // 0x91
- field public static final int AIROHA_TECHNOLOGY = 148; // 0x94
- field public static final int ALCATEL = 36; // 0x24
- field public static final int ALPWISE = 154; // 0x9a
- field public static final int AMICCOM_ELECTRONICS = 192; // 0xc0
- field public static final int APLIX = 189; // 0xbd
- field public static final int APPLE = 76; // 0x4c
- field public static final int APT_LICENSING = 79; // 0x4f
- field public static final int ARCHOS = 207; // 0xcf
- field public static final int ARP_DEVICES = 168; // 0xa8
- field public static final int ATHEROS_COMMUNICATIONS = 69; // 0x45
- field public static final int ATMEL = 19; // 0x13
- field public static final int AUSTCO_COMMUNICATION_SYSTEMS = 213; // 0xd5
- field public static final int AUTONET_MOBILE = 127; // 0x7f
- field public static final int AVAGO = 78; // 0x4e
- field public static final int AVM_BERLIN = 31; // 0x1f
- field public static final int A_AND_D_ENGINEERING = 105; // 0x69
- field public static final int A_AND_R_CAMBRIDGE = 124; // 0x7c
- field public static final int BANDSPEED = 32; // 0x20
- field public static final int BAND_XI_INTERNATIONAL = 100; // 0x64
- field public static final int BDE_TECHNOLOGY = 180; // 0xb4
- field public static final int BEATS_ELECTRONICS = 204; // 0xcc
- field public static final int BEAUTIFUL_ENTERPRISE = 108; // 0x6c
- field public static final int BEKEY = 178; // 0xb2
- field public static final int BELKIN_INTERNATIONAL = 92; // 0x5c
- field public static final int BINAURIC = 203; // 0xcb
- field public static final int BIOSENTRONICS = 219; // 0xdb
- field public static final int BLUEGIGA = 71; // 0x47
- field public static final int BLUERADIOS = 133; // 0x85
- field public static final int BLUETOOTH_SIG = 63; // 0x3f
- field public static final int BLUETREK_TECHNOLOGIES = 151; // 0x97
- field public static final int BOSE = 158; // 0x9e
- field public static final int BRIARTEK = 109; // 0x6d
- field public static final int BROADCOM = 15; // 0xf
- field public static final int CAEN_RFID = 170; // 0xaa
- field public static final int CAMBRIDGE_SILICON_RADIO = 10; // 0xa
- field public static final int CATC = 52; // 0x34
- field public static final int CINETIX = 175; // 0xaf
- field public static final int CLARINOX_TECHNOLOGIES = 179; // 0xb3
- field public static final int COLORFY = 156; // 0x9c
- field public static final int COMMIL = 51; // 0x33
- field public static final int CONEXANT_SYSTEMS = 28; // 0x1c
- field public static final int CONNECTBLUE = 113; // 0x71
- field public static final int CONTINENTAL_AUTOMOTIVE = 75; // 0x4b
- field public static final int CONWISE_TECHNOLOGY = 66; // 0x42
- field public static final int CREATIVE_TECHNOLOGY = 118; // 0x76
- field public static final int C_TECHNOLOGIES = 38; // 0x26
- field public static final int DANLERS = 225; // 0xe1
- field public static final int DELORME_PUBLISHING_COMPANY = 128; // 0x80
- field public static final int DEXCOM = 208; // 0xd0
- field public static final int DIALOG_SEMICONDUCTOR = 210; // 0xd2
- field public static final int DIGIANSWER = 12; // 0xc
- field public static final int ECLIPSE = 53; // 0x35
- field public static final int ECOTEST = 136; // 0x88
- field public static final int ELGATO_SYSTEMS = 206; // 0xce
- field public static final int EM_MICROELECTRONIC_MARIN = 90; // 0x5a
- field public static final int EQUINOX_AG = 134; // 0x86
- field public static final int ERICSSON_TECHNOLOGY = 0; // 0x0
- field public static final int EVLUMA = 201; // 0xc9
- field public static final int FREE2MOVE = 83; // 0x53
- field public static final int FUNAI_ELECTRIC = 144; // 0x90
- field public static final int GARMIN_INTERNATIONAL = 135; // 0x87
- field public static final int GCT_SEMICONDUCTOR = 45; // 0x2d
- field public static final int GELO = 200; // 0xc8
- field public static final int GENEQ = 194; // 0xc2
- field public static final int GENERAL_MOTORS = 104; // 0x68
- field public static final int GENNUM = 59; // 0x3b
- field public static final int GEOFORCE = 157; // 0x9d
- field public static final int GIBSON_GUITARS = 98; // 0x62
- field public static final int GN_NETCOM = 103; // 0x67
- field public static final int GN_RESOUND = 137; // 0x89
- field public static final int GOOGLE = 224; // 0xe0
- field public static final int GREEN_THROTTLE_GAMES = 172; // 0xac
- field public static final int GROUP_SENSE = 115; // 0x73
- field public static final int HANLYNN_TECHNOLOGIES = 123; // 0x7b
- field public static final int HARMAN_INTERNATIONAL = 87; // 0x57
- field public static final int HEWLETT_PACKARD = 101; // 0x65
- field public static final int HITACHI = 41; // 0x29
- field public static final int HOSIDEN = 221; // 0xdd
- field public static final int IBM = 3; // 0x3
- field public static final int INFINEON_TECHNOLOGIES = 9; // 0x9
- field public static final int INGENIEUR_SYSTEMGRUPPE_ZAHN = 171; // 0xab
- field public static final int INTEGRATED_SILICON_SOLUTION = 65; // 0x41
- field public static final int INTEGRATED_SYSTEM_SOLUTION = 57; // 0x39
- field public static final int INTEL = 2; // 0x2
- field public static final int INVENTEL = 30; // 0x1e
- field public static final int IPEXTREME = 61; // 0x3d
- field public static final int I_TECH_DYNAMIC_GLOBAL_DISTRIBUTION = 153; // 0x99
- field public static final int JAWBONE = 138; // 0x8a
- field public static final int JIANGSU_TOPPOWER_AUTOMOTIVE_ELECTRONICS = 155; // 0x9b
- field public static final int JOHNSON_CONTROLS = 185; // 0xb9
- field public static final int J_AND_M = 82; // 0x52
- field public static final int KAWANTECH = 212; // 0xd4
- field public static final int KC_TECHNOLOGY = 22; // 0x16
- field public static final int KENSINGTON_COMPUTER_PRODUCTS_GROUP = 160; // 0xa0
- field public static final int LAIRD_TECHNOLOGIES = 119; // 0x77
- field public static final int LESSWIRE = 121; // 0x79
- field public static final int LG_ELECTRONICS = 196; // 0xc4
- field public static final int LINAK = 164; // 0xa4
- field public static final int LUCENT = 7; // 0x7
- field public static final int LUDUS_HELSINKI = 132; // 0x84
- field public static final int MACRONIX = 44; // 0x2c
- field public static final int MAGNETI_MARELLI = 169; // 0xa9
- field public static final int MANSELLA = 33; // 0x21
- field public static final int MARVELL = 72; // 0x48
- field public static final int MATSUSHITA_ELECTRIC = 58; // 0x3a
- field public static final int MC10 = 202; // 0xca
- field public static final int MEDIATEK = 70; // 0x46
- field public static final int MESO_INTERNATIONAL = 182; // 0xb6
- field public static final int META_WATCH = 163; // 0xa3
- field public static final int MEWTEL_TECHNOLOGY = 47; // 0x2f
- field public static final int MICOMMAND = 99; // 0x63
- field public static final int MICROCHIP_TECHNOLOGY = 205; // 0xcd
- field public static final int MICROSOFT = 6; // 0x6
- field public static final int MINDTREE = 106; // 0x6a
- field public static final int MISFIT_WEARABLES = 223; // 0xdf
- field public static final int MITEL_SEMICONDUCTOR = 16; // 0x10
- field public static final int MITSUBISHI_ELECTRIC = 20; // 0x14
- field public static final int MOBILIAN_CORPORATION = 55; // 0x37
- field public static final int MONSTER = 112; // 0x70
- field public static final int MOTOROLA = 8; // 0x8
- field public static final int MSTAR_SEMICONDUCTOR = 122; // 0x7a
- field public static final int MUZIK = 222; // 0xde
- field public static final int NEC = 34; // 0x22
- field public static final int NEC_LIGHTING = 149; // 0x95
- field public static final int NEWLOGIC = 23; // 0x17
- field public static final int NIKE = 120; // 0x78
- field public static final int NINE_SOLUTIONS = 102; // 0x66
- field public static final int NOKIA_MOBILE_PHONES = 1; // 0x1
- field public static final int NORDIC_SEMICONDUCTOR = 89; // 0x59
- field public static final int NORWOOD_SYSTEMS = 46; // 0x2e
- field public static final int ODM_TECHNOLOGY = 150; // 0x96
- field public static final int OMEGAWAVE = 174; // 0xae
- field public static final int ONSET_COMPUTER = 197; // 0xc5
- field public static final int OPEN_INTERFACE = 39; // 0x27
- field public static final int OTL_DYNAMICS = 165; // 0xa5
- field public static final int PANDA_OCEAN = 166; // 0xa6
- field public static final int PARROT = 67; // 0x43
- field public static final int PARTHUS_TECHNOLOGIES = 14; // 0xe
- field public static final int PASSIF_SEMICONDUCTOR = 176; // 0xb0
- field public static final int PETER_SYSTEMTECHNIK = 173; // 0xad
- field public static final int PHILIPS_SEMICONDUCTORS = 37; // 0x25
- field public static final int PLANTRONICS = 85; // 0x55
- field public static final int POLAR_ELECTRO = 107; // 0x6b
- field public static final int POLAR_ELECTRO_EUROPE = 209; // 0xd1
- field public static final int PROCTER_AND_GAMBLE = 220; // 0xdc
- field public static final int QUALCOMM = 29; // 0x1d
- field public static final int QUALCOMM_CONNECTED_EXPERIENCES = 216; // 0xd8
- field public static final int QUALCOMM_INNOVATION_CENTER = 184; // 0xb8
- field public static final int QUALCOMM_LABS = 140; // 0x8c
- field public static final int QUALCOMM_TECHNOLOGIES = 215; // 0xd7
- field public static final int QUINTIC = 142; // 0x8e
- field public static final int QUUPPA = 199; // 0xc7
- field public static final int RALINK_TECHNOLOGY = 91; // 0x5b
- field public static final int RDA_MICROELECTRONICS = 97; // 0x61
- field public static final int REALTEK_SEMICONDUCTOR = 93; // 0x5d
- field public static final int RED_M = 50; // 0x32
- field public static final int RENESAS_TECHNOLOGY = 54; // 0x36
- field public static final int RESEARCH_IN_MOTION = 60; // 0x3c
- field public static final int RF_MICRO_DEVICES = 40; // 0x28
- field public static final int RIVIERAWAVES = 96; // 0x60
- field public static final int ROHDE_AND_SCHWARZ = 25; // 0x19
- field public static final int RTX_TELECOM = 21; // 0x15
- field public static final int SAMSUNG_ELECTRONICS = 117; // 0x75
- field public static final int SARIS_CYCLING_GROUP = 177; // 0xb1
- field public static final int SEERS_TECHNOLOGY = 125; // 0x7d
- field public static final int SEIKO_EPSON = 64; // 0x40
- field public static final int SELFLY = 198; // 0xc6
- field public static final int SEMILINK = 226; // 0xe2
- field public static final int SENNHEISER_COMMUNICATIONS = 130; // 0x82
- field public static final int SHANGHAI_SUPER_SMART_ELECTRONICS = 114; // 0x72
- field public static final int SHENZHEN_EXCELSECU_DATA_TECHNOLOGY = 193; // 0xc1
- field public static final int SIGNIA_TECHNOLOGIES = 27; // 0x1b
- field public static final int SILICON_WAVE = 11; // 0xb
- field public static final int SIRF_TECHNOLOGY = 80; // 0x50
- field public static final int SOCKET_MOBILE = 68; // 0x44
- field public static final int SONY_ERICSSON = 86; // 0x56
- field public static final int SOUND_ID = 111; // 0x6f
- field public static final int SPORTS_TRACKING_TECHNOLOGIES = 126; // 0x7e
- field public static final int SR_MEDIZINELEKTRONIK = 161; // 0xa1
- field public static final int STACCATO_COMMUNICATIONS = 77; // 0x4d
- field public static final int STALMART_TECHNOLOGY = 191; // 0xbf
- field public static final int STARKEY_LABORATORIES = 186; // 0xba
- field public static final int STOLLMAN_E_PLUS_V = 143; // 0x8f
- field public static final int STONESTREET_ONE = 94; // 0x5e
- field public static final int ST_MICROELECTRONICS = 48; // 0x30
- field public static final int SUMMIT_DATA_COMMUNICATIONS = 110; // 0x6e
- field public static final int SUUNTO = 159; // 0x9f
- field public static final int SWIRL_NETWORKS = 181; // 0xb5
- field public static final int SYMBOL_TECHNOLOGIES = 42; // 0x2a
- field public static final int SYNOPSYS = 49; // 0x31
- field public static final int SYSTEMS_AND_CHIPS = 62; // 0x3e
- field public static final int S_POWER_ELECTRONICS = 187; // 0xbb
- field public static final int TAIXINGBANG_TECHNOLOGY = 211; // 0xd3
- field public static final int TENOVIS = 43; // 0x2b
- field public static final int TERAX = 56; // 0x38
- field public static final int TEXAS_INSTRUMENTS = 13; // 0xd
- field public static final int THINKOPTICS = 146; // 0x92
- field public static final int THREECOM = 5; // 0x5
- field public static final int THREE_DIJOY = 84; // 0x54
- field public static final int THREE_DSP = 73; // 0x49
- field public static final int TIMEKEEPING_SYSTEMS = 131; // 0x83
- field public static final int TIMEX_GROUP_USA = 214; // 0xd6
- field public static final int TOPCORN_POSITIONING_SYSTEMS = 139; // 0x8b
- field public static final int TOSHIBA = 4; // 0x4
- field public static final int TRANSILICA = 24; // 0x18
- field public static final int TRELAB = 183; // 0xb7
- field public static final int TTPCOM = 26; // 0x1a
- field public static final int TXTR = 218; // 0xda
- field public static final int TZERO_TECHNOLOGIES = 81; // 0x51
- field public static final int UNIVERSAL_ELECTRONICS = 147; // 0x93
- field public static final int VERTU = 162; // 0xa2
- field public static final int VISTEON = 167; // 0xa7
- field public static final int VIZIO = 88; // 0x58
- field public static final int VOYETRA_TURTLE_BEACH = 217; // 0xd9
- field public static final int WAVEPLUS_TECHNOLOGY = 35; // 0x23
- field public static final int WICENTRIC = 95; // 0x5f
- field public static final int WIDCOMM = 17; // 0x11
- field public static final int WUXI_VIMICRO = 129; // 0x81
- field public static final int ZEEVO = 18; // 0x12
- field public static final int ZER01_TV = 152; // 0x98
- field public static final int ZOMM = 116; // 0x74
- field public static final int ZSCAN_SOFTWARE = 141; // 0x8d
- }
-
- public final class BluetoothClass implements android.os.Parcelable {
- method public int describeContents();
- method public boolean doesClassMatch(int);
- method public int getDeviceClass();
- method public int getMajorDeviceClass();
- method public boolean hasService(int);
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothClass> CREATOR;
- field public static final int PROFILE_A2DP = 1; // 0x1
- field public static final int PROFILE_HEADSET = 0; // 0x0
- field public static final int PROFILE_HID = 3; // 0x3
- }
-
- public static class BluetoothClass.Device {
- ctor public BluetoothClass.Device();
- field public static final int AUDIO_VIDEO_CAMCORDER = 1076; // 0x434
- field public static final int AUDIO_VIDEO_CAR_AUDIO = 1056; // 0x420
- field public static final int AUDIO_VIDEO_HANDSFREE = 1032; // 0x408
- field public static final int AUDIO_VIDEO_HEADPHONES = 1048; // 0x418
- field public static final int AUDIO_VIDEO_HIFI_AUDIO = 1064; // 0x428
- field public static final int AUDIO_VIDEO_LOUDSPEAKER = 1044; // 0x414
- field public static final int AUDIO_VIDEO_MICROPHONE = 1040; // 0x410
- field public static final int AUDIO_VIDEO_PORTABLE_AUDIO = 1052; // 0x41c
- field public static final int AUDIO_VIDEO_SET_TOP_BOX = 1060; // 0x424
- field public static final int AUDIO_VIDEO_UNCATEGORIZED = 1024; // 0x400
- field public static final int AUDIO_VIDEO_VCR = 1068; // 0x42c
- field public static final int AUDIO_VIDEO_VIDEO_CAMERA = 1072; // 0x430
- field public static final int AUDIO_VIDEO_VIDEO_CONFERENCING = 1088; // 0x440
- field public static final int AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER = 1084; // 0x43c
- field public static final int AUDIO_VIDEO_VIDEO_GAMING_TOY = 1096; // 0x448
- field public static final int AUDIO_VIDEO_VIDEO_MONITOR = 1080; // 0x438
- field public static final int AUDIO_VIDEO_WEARABLE_HEADSET = 1028; // 0x404
- field public static final int COMPUTER_DESKTOP = 260; // 0x104
- field public static final int COMPUTER_HANDHELD_PC_PDA = 272; // 0x110
- field public static final int COMPUTER_LAPTOP = 268; // 0x10c
- field public static final int COMPUTER_PALM_SIZE_PC_PDA = 276; // 0x114
- field public static final int COMPUTER_SERVER = 264; // 0x108
- field public static final int COMPUTER_UNCATEGORIZED = 256; // 0x100
- field public static final int COMPUTER_WEARABLE = 280; // 0x118
- field public static final int HEALTH_BLOOD_PRESSURE = 2308; // 0x904
- field public static final int HEALTH_DATA_DISPLAY = 2332; // 0x91c
- field public static final int HEALTH_GLUCOSE = 2320; // 0x910
- field public static final int HEALTH_PULSE_OXIMETER = 2324; // 0x914
- field public static final int HEALTH_PULSE_RATE = 2328; // 0x918
- field public static final int HEALTH_THERMOMETER = 2312; // 0x908
- field public static final int HEALTH_UNCATEGORIZED = 2304; // 0x900
- field public static final int HEALTH_WEIGHING = 2316; // 0x90c
- field public static final int PHONE_CELLULAR = 516; // 0x204
- field public static final int PHONE_CORDLESS = 520; // 0x208
- field public static final int PHONE_ISDN = 532; // 0x214
- field public static final int PHONE_MODEM_OR_GATEWAY = 528; // 0x210
- field public static final int PHONE_SMART = 524; // 0x20c
- field public static final int PHONE_UNCATEGORIZED = 512; // 0x200
- field public static final int TOY_CONTROLLER = 2064; // 0x810
- field public static final int TOY_DOLL_ACTION_FIGURE = 2060; // 0x80c
- field public static final int TOY_GAME = 2068; // 0x814
- field public static final int TOY_ROBOT = 2052; // 0x804
- field public static final int TOY_UNCATEGORIZED = 2048; // 0x800
- field public static final int TOY_VEHICLE = 2056; // 0x808
- field public static final int WEARABLE_GLASSES = 1812; // 0x714
- field public static final int WEARABLE_HELMET = 1808; // 0x710
- field public static final int WEARABLE_JACKET = 1804; // 0x70c
- field public static final int WEARABLE_PAGER = 1800; // 0x708
- field public static final int WEARABLE_UNCATEGORIZED = 1792; // 0x700
- field public static final int WEARABLE_WRIST_WATCH = 1796; // 0x704
- }
-
- public static class BluetoothClass.Device.Major {
- ctor public BluetoothClass.Device.Major();
- field public static final int AUDIO_VIDEO = 1024; // 0x400
- field public static final int COMPUTER = 256; // 0x100
- field public static final int HEALTH = 2304; // 0x900
- field public static final int IMAGING = 1536; // 0x600
- field public static final int MISC = 0; // 0x0
- field public static final int NETWORKING = 768; // 0x300
- field public static final int PERIPHERAL = 1280; // 0x500
- field public static final int PHONE = 512; // 0x200
- field public static final int TOY = 2048; // 0x800
- field public static final int UNCATEGORIZED = 7936; // 0x1f00
- field public static final int WEARABLE = 1792; // 0x700
- }
-
- public static final class BluetoothClass.Service {
- ctor public BluetoothClass.Service();
- field public static final int AUDIO = 2097152; // 0x200000
- field public static final int CAPTURE = 524288; // 0x80000
- field public static final int INFORMATION = 8388608; // 0x800000
- field public static final int LE_AUDIO = 16384; // 0x4000
- field public static final int LIMITED_DISCOVERABILITY = 8192; // 0x2000
- field public static final int NETWORKING = 131072; // 0x20000
- field public static final int OBJECT_TRANSFER = 1048576; // 0x100000
- field public static final int POSITIONING = 65536; // 0x10000
- field public static final int RENDER = 262144; // 0x40000
- field public static final int TELEPHONY = 4194304; // 0x400000
- }
-
- public final class BluetoothCodecConfig implements android.os.Parcelable {
- ctor public BluetoothCodecConfig(int);
- method public int describeContents();
- method public int getBitsPerSample();
- method public int getChannelMode();
- method public int getCodecPriority();
- method public long getCodecSpecific1();
- method public long getCodecSpecific2();
- method public long getCodecSpecific3();
- method public long getCodecSpecific4();
- method public int getCodecType();
- method public static int getMaxCodecType();
- method public int getSampleRate();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final int BITS_PER_SAMPLE_16 = 1; // 0x1
- field public static final int BITS_PER_SAMPLE_24 = 2; // 0x2
- field public static final int BITS_PER_SAMPLE_32 = 4; // 0x4
- field public static final int BITS_PER_SAMPLE_NONE = 0; // 0x0
- field public static final int CHANNEL_MODE_MONO = 1; // 0x1
- field public static final int CHANNEL_MODE_NONE = 0; // 0x0
- field public static final int CHANNEL_MODE_STEREO = 2; // 0x2
- field public static final int CODEC_PRIORITY_DEFAULT = 0; // 0x0
- field public static final int CODEC_PRIORITY_DISABLED = -1; // 0xffffffff
- field public static final int CODEC_PRIORITY_HIGHEST = 1000000; // 0xf4240
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothCodecConfig> CREATOR;
- field public static final int SAMPLE_RATE_176400 = 16; // 0x10
- field public static final int SAMPLE_RATE_192000 = 32; // 0x20
- field public static final int SAMPLE_RATE_44100 = 1; // 0x1
- field public static final int SAMPLE_RATE_48000 = 2; // 0x2
- field public static final int SAMPLE_RATE_88200 = 4; // 0x4
- field public static final int SAMPLE_RATE_96000 = 8; // 0x8
- field public static final int SAMPLE_RATE_NONE = 0; // 0x0
- field public static final int SOURCE_CODEC_TYPE_AAC = 1; // 0x1
- field public static final int SOURCE_CODEC_TYPE_APTX = 2; // 0x2
- field public static final int SOURCE_CODEC_TYPE_APTX_HD = 3; // 0x3
- field public static final int SOURCE_CODEC_TYPE_INVALID = 1000000; // 0xf4240
- field public static final int SOURCE_CODEC_TYPE_LC3 = 5; // 0x5
- field public static final int SOURCE_CODEC_TYPE_LDAC = 4; // 0x4
- field public static final int SOURCE_CODEC_TYPE_SBC = 0; // 0x0
- }
-
- public static final class BluetoothCodecConfig.Builder {
- ctor public BluetoothCodecConfig.Builder();
- method @NonNull public android.bluetooth.BluetoothCodecConfig build();
- method @NonNull public android.bluetooth.BluetoothCodecConfig.Builder setBitsPerSample(int);
- method @NonNull public android.bluetooth.BluetoothCodecConfig.Builder setChannelMode(int);
- method @NonNull public android.bluetooth.BluetoothCodecConfig.Builder setCodecPriority(int);
- method @NonNull public android.bluetooth.BluetoothCodecConfig.Builder setCodecSpecific1(long);
- method @NonNull public android.bluetooth.BluetoothCodecConfig.Builder setCodecSpecific2(long);
- method @NonNull public android.bluetooth.BluetoothCodecConfig.Builder setCodecSpecific3(long);
- method @NonNull public android.bluetooth.BluetoothCodecConfig.Builder setCodecSpecific4(long);
- method @NonNull public android.bluetooth.BluetoothCodecConfig.Builder setCodecType(int);
- method @NonNull public android.bluetooth.BluetoothCodecConfig.Builder setSampleRate(int);
- }
-
- public final class BluetoothCodecStatus implements android.os.Parcelable {
- ctor public BluetoothCodecStatus(@Nullable android.bluetooth.BluetoothCodecConfig, @Nullable java.util.List<android.bluetooth.BluetoothCodecConfig>, @Nullable java.util.List<android.bluetooth.BluetoothCodecConfig>);
- method public int describeContents();
- method @Nullable public android.bluetooth.BluetoothCodecConfig getCodecConfig();
- method @NonNull public java.util.List<android.bluetooth.BluetoothCodecConfig> getCodecsLocalCapabilities();
- method @NonNull public java.util.List<android.bluetooth.BluetoothCodecConfig> getCodecsSelectableCapabilities();
- method public boolean isCodecConfigSelectable(@Nullable android.bluetooth.BluetoothCodecConfig);
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothCodecStatus> CREATOR;
- field public static final String EXTRA_CODEC_STATUS = "android.bluetooth.extra.CODEC_STATUS";
- }
-
- public final class BluetoothCsipSetCoordinator implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
- method public void close();
- method protected void finalize();
- method @NonNull public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method public int getConnectionState(@Nullable android.bluetooth.BluetoothDevice);
- method @NonNull public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CSIS_CONNECTION_STATE_CHANGED = "android.bluetooth.action.CSIS_CONNECTION_STATE_CHANGED";
- }
-
- public final class BluetoothDevice implements android.os.Parcelable {
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothGatt connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothGatt connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothGatt connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int, int);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothGatt connectGatt(android.content.Context, boolean, android.bluetooth.BluetoothGattCallback, int, int, android.os.Handler);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean createBond();
- method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothSocket createInsecureL2capChannel(int) throws java.io.IOException;
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothSocket createInsecureRfcommSocketToServiceRecord(java.util.UUID) throws java.io.IOException;
- method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothSocket createL2capChannel(int) throws java.io.IOException;
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothSocket createRfcommSocketToServiceRecord(java.util.UUID) throws java.io.IOException;
- method public int describeContents();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean fetchUuidsWithSdp();
- method public String getAddress();
- method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public String getAlias();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothClass getBluetoothClass();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getBondState();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public String getName();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getType();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.os.ParcelUuid[] getUuids();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int setAlias(@Nullable String);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setPairingConfirmation(boolean);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean setPin(byte[]);
- method public void writeToParcel(android.os.Parcel, int);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_ACL_CONNECTED = "android.bluetooth.device.action.ACL_CONNECTED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_ACL_DISCONNECTED = "android.bluetooth.device.action.ACL_DISCONNECTED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_ACL_DISCONNECT_REQUESTED = "android.bluetooth.device.action.ACL_DISCONNECT_REQUESTED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_ALIAS_CHANGED = "android.bluetooth.device.action.ALIAS_CHANGED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_BOND_STATE_CHANGED = "android.bluetooth.device.action.BOND_STATE_CHANGED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CLASS_CHANGED = "android.bluetooth.device.action.CLASS_CHANGED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public static final String ACTION_FOUND = "android.bluetooth.device.action.FOUND";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_NAME_CHANGED = "android.bluetooth.device.action.NAME_CHANGED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_PAIRING_REQUEST = "android.bluetooth.device.action.PAIRING_REQUEST";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_UUID = "android.bluetooth.device.action.UUID";
- field public static final int ADDRESS_TYPE_PUBLIC = 0; // 0x0
- field public static final int ADDRESS_TYPE_RANDOM = 1; // 0x1
- field public static final int BOND_BONDED = 12; // 0xc
- field public static final int BOND_BONDING = 11; // 0xb
- field public static final int BOND_NONE = 10; // 0xa
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothDevice> CREATOR;
- field public static final int DEVICE_TYPE_CLASSIC = 1; // 0x1
- field public static final int DEVICE_TYPE_DUAL = 3; // 0x3
- field public static final int DEVICE_TYPE_LE = 2; // 0x2
- field public static final int DEVICE_TYPE_UNKNOWN = 0; // 0x0
- field public static final int ERROR = -2147483648; // 0x80000000
- field public static final String EXTRA_BOND_STATE = "android.bluetooth.device.extra.BOND_STATE";
- field public static final String EXTRA_CLASS = "android.bluetooth.device.extra.CLASS";
- field public static final String EXTRA_DEVICE = "android.bluetooth.device.extra.DEVICE";
- field public static final String EXTRA_IS_COORDINATED_SET_MEMBER = "android.bluetooth.extra.IS_COORDINATED_SET_MEMBER";
- field public static final String EXTRA_NAME = "android.bluetooth.device.extra.NAME";
- field public static final String EXTRA_PAIRING_KEY = "android.bluetooth.device.extra.PAIRING_KEY";
- field public static final String EXTRA_PAIRING_VARIANT = "android.bluetooth.device.extra.PAIRING_VARIANT";
- field public static final String EXTRA_PREVIOUS_BOND_STATE = "android.bluetooth.device.extra.PREVIOUS_BOND_STATE";
- field public static final String EXTRA_RSSI = "android.bluetooth.device.extra.RSSI";
- field public static final String EXTRA_TRANSPORT = "android.bluetooth.device.extra.TRANSPORT";
- field public static final String EXTRA_UUID = "android.bluetooth.device.extra.UUID";
- field public static final int PAIRING_VARIANT_PASSKEY_CONFIRMATION = 2; // 0x2
- field public static final int PAIRING_VARIANT_PIN = 0; // 0x0
- field public static final int PHY_LE_1M = 1; // 0x1
- field public static final int PHY_LE_1M_MASK = 1; // 0x1
- field public static final int PHY_LE_2M = 2; // 0x2
- field public static final int PHY_LE_2M_MASK = 2; // 0x2
- field public static final int PHY_LE_CODED = 3; // 0x3
- field public static final int PHY_LE_CODED_MASK = 4; // 0x4
- field public static final int PHY_OPTION_NO_PREFERRED = 0; // 0x0
- field public static final int PHY_OPTION_S2 = 1; // 0x1
- field public static final int PHY_OPTION_S8 = 2; // 0x2
- field public static final int TRANSPORT_AUTO = 0; // 0x0
- field public static final int TRANSPORT_BREDR = 1; // 0x1
- field public static final int TRANSPORT_LE = 2; // 0x2
- }
-
- public final class BluetoothGatt implements android.bluetooth.BluetoothProfile {
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void abortReliableWrite();
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void abortReliableWrite(android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean beginReliableWrite();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void close();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean connect();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void disconnect();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean discoverServices();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean executeReliableWrite();
- method @Deprecated public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @Deprecated public int getConnectionState(android.bluetooth.BluetoothDevice);
- method public android.bluetooth.BluetoothDevice getDevice();
- method @Deprecated public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
- method public android.bluetooth.BluetoothGattService getService(java.util.UUID);
- method public java.util.List<android.bluetooth.BluetoothGattService> getServices();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean readCharacteristic(android.bluetooth.BluetoothGattCharacteristic);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean readDescriptor(android.bluetooth.BluetoothGattDescriptor);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void readPhy();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean readRemoteRssi();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean requestConnectionPriority(int);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean requestMtu(int);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean setCharacteristicNotification(android.bluetooth.BluetoothGattCharacteristic, boolean);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void setPreferredPhy(int, int, int);
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean writeCharacteristic(android.bluetooth.BluetoothGattCharacteristic);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int writeCharacteristic(@NonNull android.bluetooth.BluetoothGattCharacteristic, @NonNull byte[], int);
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean writeDescriptor(android.bluetooth.BluetoothGattDescriptor);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int writeDescriptor(@NonNull android.bluetooth.BluetoothGattDescriptor, @NonNull byte[]);
- field public static final int CONNECTION_PRIORITY_BALANCED = 0; // 0x0
- field public static final int CONNECTION_PRIORITY_HIGH = 1; // 0x1
- field public static final int CONNECTION_PRIORITY_LOW_POWER = 2; // 0x2
- field public static final int GATT_CONNECTION_CONGESTED = 143; // 0x8f
- field public static final int GATT_FAILURE = 257; // 0x101
- field public static final int GATT_INSUFFICIENT_AUTHENTICATION = 5; // 0x5
- field public static final int GATT_INSUFFICIENT_AUTHORIZATION = 8; // 0x8
- field public static final int GATT_INSUFFICIENT_ENCRYPTION = 15; // 0xf
- field public static final int GATT_INVALID_ATTRIBUTE_LENGTH = 13; // 0xd
- field public static final int GATT_INVALID_OFFSET = 7; // 0x7
- field public static final int GATT_READ_NOT_PERMITTED = 2; // 0x2
- field public static final int GATT_REQUEST_NOT_SUPPORTED = 6; // 0x6
- field public static final int GATT_SUCCESS = 0; // 0x0
- field public static final int GATT_WRITE_NOT_PERMITTED = 3; // 0x3
- }
-
- public abstract class BluetoothGattCallback {
- ctor public BluetoothGattCallback();
- method @Deprecated public void onCharacteristicChanged(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattCharacteristic);
- method public void onCharacteristicChanged(@NonNull android.bluetooth.BluetoothGatt, @NonNull android.bluetooth.BluetoothGattCharacteristic, @NonNull byte[]);
- method @Deprecated public void onCharacteristicRead(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattCharacteristic, int);
- method public void onCharacteristicRead(@NonNull android.bluetooth.BluetoothGatt, @NonNull android.bluetooth.BluetoothGattCharacteristic, @NonNull byte[], int);
- method public void onCharacteristicWrite(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattCharacteristic, int);
- method public void onConnectionStateChange(android.bluetooth.BluetoothGatt, int, int);
- method @Deprecated public void onDescriptorRead(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattDescriptor, int);
- method public void onDescriptorRead(@NonNull android.bluetooth.BluetoothGatt, @NonNull android.bluetooth.BluetoothGattDescriptor, int, @NonNull byte[]);
- method public void onDescriptorWrite(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattDescriptor, int);
- method public void onMtuChanged(android.bluetooth.BluetoothGatt, int, int);
- method public void onPhyRead(android.bluetooth.BluetoothGatt, int, int, int);
- method public void onPhyUpdate(android.bluetooth.BluetoothGatt, int, int, int);
- method public void onReadRemoteRssi(android.bluetooth.BluetoothGatt, int, int);
- method public void onReliableWriteCompleted(android.bluetooth.BluetoothGatt, int);
- method public void onServiceChanged(@NonNull android.bluetooth.BluetoothGatt);
- method public void onServicesDiscovered(android.bluetooth.BluetoothGatt, int);
- }
-
- public class BluetoothGattCharacteristic implements android.os.Parcelable {
- ctor public BluetoothGattCharacteristic(java.util.UUID, int, int);
- method public boolean addDescriptor(android.bluetooth.BluetoothGattDescriptor);
- method public int describeContents();
- method public android.bluetooth.BluetoothGattDescriptor getDescriptor(java.util.UUID);
- method public java.util.List<android.bluetooth.BluetoothGattDescriptor> getDescriptors();
- method @Deprecated public Float getFloatValue(int, int);
- method public int getInstanceId();
- method @Deprecated public Integer getIntValue(int, int);
- method public int getPermissions();
- method public int getProperties();
- method public android.bluetooth.BluetoothGattService getService();
- method @Deprecated public String getStringValue(int);
- method public java.util.UUID getUuid();
- method @Deprecated public byte[] getValue();
- method public int getWriteType();
- method @Deprecated public boolean setValue(byte[]);
- method @Deprecated public boolean setValue(int, int, int);
- method @Deprecated public boolean setValue(int, int, int, int);
- method @Deprecated public boolean setValue(String);
- method public void setWriteType(int);
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothGattCharacteristic> CREATOR;
- field public static final int FORMAT_FLOAT = 52; // 0x34
- field public static final int FORMAT_SFLOAT = 50; // 0x32
- field public static final int FORMAT_SINT16 = 34; // 0x22
- field public static final int FORMAT_SINT32 = 36; // 0x24
- field public static final int FORMAT_SINT8 = 33; // 0x21
- field public static final int FORMAT_UINT16 = 18; // 0x12
- field public static final int FORMAT_UINT32 = 20; // 0x14
- field public static final int FORMAT_UINT8 = 17; // 0x11
- field public static final int PERMISSION_READ = 1; // 0x1
- field public static final int PERMISSION_READ_ENCRYPTED = 2; // 0x2
- field public static final int PERMISSION_READ_ENCRYPTED_MITM = 4; // 0x4
- field public static final int PERMISSION_WRITE = 16; // 0x10
- field public static final int PERMISSION_WRITE_ENCRYPTED = 32; // 0x20
- field public static final int PERMISSION_WRITE_ENCRYPTED_MITM = 64; // 0x40
- field public static final int PERMISSION_WRITE_SIGNED = 128; // 0x80
- field public static final int PERMISSION_WRITE_SIGNED_MITM = 256; // 0x100
- field public static final int PROPERTY_BROADCAST = 1; // 0x1
- field public static final int PROPERTY_EXTENDED_PROPS = 128; // 0x80
- field public static final int PROPERTY_INDICATE = 32; // 0x20
- field public static final int PROPERTY_NOTIFY = 16; // 0x10
- field public static final int PROPERTY_READ = 2; // 0x2
- field public static final int PROPERTY_SIGNED_WRITE = 64; // 0x40
- field public static final int PROPERTY_WRITE = 8; // 0x8
- field public static final int PROPERTY_WRITE_NO_RESPONSE = 4; // 0x4
- field public static final int WRITE_TYPE_DEFAULT = 2; // 0x2
- field public static final int WRITE_TYPE_NO_RESPONSE = 1; // 0x1
- field public static final int WRITE_TYPE_SIGNED = 4; // 0x4
- field protected java.util.List<android.bluetooth.BluetoothGattDescriptor> mDescriptors;
- }
-
- public class BluetoothGattDescriptor implements android.os.Parcelable {
- ctor public BluetoothGattDescriptor(java.util.UUID, int);
- method public int describeContents();
- method public android.bluetooth.BluetoothGattCharacteristic getCharacteristic();
- method public int getPermissions();
- method public java.util.UUID getUuid();
- method @Deprecated public byte[] getValue();
- method @Deprecated public boolean setValue(byte[]);
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothGattDescriptor> CREATOR;
- field public static final byte[] DISABLE_NOTIFICATION_VALUE;
- field public static final byte[] ENABLE_INDICATION_VALUE;
- field public static final byte[] ENABLE_NOTIFICATION_VALUE;
- field public static final int PERMISSION_READ = 1; // 0x1
- field public static final int PERMISSION_READ_ENCRYPTED = 2; // 0x2
- field public static final int PERMISSION_READ_ENCRYPTED_MITM = 4; // 0x4
- field public static final int PERMISSION_WRITE = 16; // 0x10
- field public static final int PERMISSION_WRITE_ENCRYPTED = 32; // 0x20
- field public static final int PERMISSION_WRITE_ENCRYPTED_MITM = 64; // 0x40
- field public static final int PERMISSION_WRITE_SIGNED = 128; // 0x80
- field public static final int PERMISSION_WRITE_SIGNED_MITM = 256; // 0x100
- }
-
- public final class BluetoothGattServer implements android.bluetooth.BluetoothProfile {
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean addService(android.bluetooth.BluetoothGattService);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void cancelConnection(android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void clearServices();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void close();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean connect(android.bluetooth.BluetoothDevice, boolean);
- method public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method public int getConnectionState(android.bluetooth.BluetoothDevice);
- method public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
- method public android.bluetooth.BluetoothGattService getService(java.util.UUID);
- method public java.util.List<android.bluetooth.BluetoothGattService> getServices();
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean notifyCharacteristicChanged(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothGattCharacteristic, boolean);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int notifyCharacteristicChanged(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.bluetooth.BluetoothGattCharacteristic, boolean, @NonNull byte[]);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void readPhy(android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean removeService(android.bluetooth.BluetoothGattService);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean sendResponse(android.bluetooth.BluetoothDevice, int, int, int, byte[]);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void setPreferredPhy(android.bluetooth.BluetoothDevice, int, int, int);
- }
-
- public abstract class BluetoothGattServerCallback {
- ctor public BluetoothGattServerCallback();
- method public void onCharacteristicReadRequest(android.bluetooth.BluetoothDevice, int, int, android.bluetooth.BluetoothGattCharacteristic);
- method public void onCharacteristicWriteRequest(android.bluetooth.BluetoothDevice, int, android.bluetooth.BluetoothGattCharacteristic, boolean, boolean, int, byte[]);
- method public void onConnectionStateChange(android.bluetooth.BluetoothDevice, int, int);
- method public void onDescriptorReadRequest(android.bluetooth.BluetoothDevice, int, int, android.bluetooth.BluetoothGattDescriptor);
- method public void onDescriptorWriteRequest(android.bluetooth.BluetoothDevice, int, android.bluetooth.BluetoothGattDescriptor, boolean, boolean, int, byte[]);
- method public void onExecuteWrite(android.bluetooth.BluetoothDevice, int, boolean);
- method public void onMtuChanged(android.bluetooth.BluetoothDevice, int);
- method public void onNotificationSent(android.bluetooth.BluetoothDevice, int);
- method public void onPhyRead(android.bluetooth.BluetoothDevice, int, int, int);
- method public void onPhyUpdate(android.bluetooth.BluetoothDevice, int, int, int);
- method public void onServiceAdded(int, android.bluetooth.BluetoothGattService);
- }
-
- public class BluetoothGattService implements android.os.Parcelable {
- ctor public BluetoothGattService(java.util.UUID, int);
- method public boolean addCharacteristic(android.bluetooth.BluetoothGattCharacteristic);
- method public boolean addService(android.bluetooth.BluetoothGattService);
- method public int describeContents();
- method public android.bluetooth.BluetoothGattCharacteristic getCharacteristic(java.util.UUID);
- method public java.util.List<android.bluetooth.BluetoothGattCharacteristic> getCharacteristics();
- method public java.util.List<android.bluetooth.BluetoothGattService> getIncludedServices();
- method public int getInstanceId();
- method public int getType();
- method public java.util.UUID getUuid();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothGattService> CREATOR;
- field public static final int SERVICE_TYPE_PRIMARY = 0; // 0x0
- field public static final int SERVICE_TYPE_SECONDARY = 1; // 0x1
- field protected java.util.List<android.bluetooth.BluetoothGattCharacteristic> mCharacteristics;
- field protected java.util.List<android.bluetooth.BluetoothGattService> mIncludedServices;
- }
-
- public final class BluetoothHeadset implements android.bluetooth.BluetoothProfile {
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean isAudioConnected(android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean isNoiseReductionSupported(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean isVoiceRecognitionSupported(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean sendVendorSpecificResultCode(android.bluetooth.BluetoothDevice, String, String);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean startVoiceRecognition(android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean stopVoiceRecognition(android.bluetooth.BluetoothDevice);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_AUDIO_STATE_CHANGED = "android.bluetooth.headset.profile.action.AUDIO_STATE_CHANGED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.headset.profile.action.CONNECTION_STATE_CHANGED";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_VENDOR_SPECIFIC_HEADSET_EVENT = "android.bluetooth.headset.action.VENDOR_SPECIFIC_HEADSET_EVENT";
- field public static final int AT_CMD_TYPE_ACTION = 4; // 0x4
- field public static final int AT_CMD_TYPE_BASIC = 3; // 0x3
- field public static final int AT_CMD_TYPE_READ = 0; // 0x0
- field public static final int AT_CMD_TYPE_SET = 2; // 0x2
- field public static final int AT_CMD_TYPE_TEST = 1; // 0x1
- field public static final String EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_ARGS = "android.bluetooth.headset.extra.VENDOR_SPECIFIC_HEADSET_EVENT_ARGS";
- field public static final String EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD = "android.bluetooth.headset.extra.VENDOR_SPECIFIC_HEADSET_EVENT_CMD";
- field public static final String EXTRA_VENDOR_SPECIFIC_HEADSET_EVENT_CMD_TYPE = "android.bluetooth.headset.extra.VENDOR_SPECIFIC_HEADSET_EVENT_CMD_TYPE";
- field public static final int STATE_AUDIO_CONNECTED = 12; // 0xc
- field public static final int STATE_AUDIO_CONNECTING = 11; // 0xb
- field public static final int STATE_AUDIO_DISCONNECTED = 10; // 0xa
- field public static final String VENDOR_RESULT_CODE_COMMAND_ANDROID = "+ANDROID";
- field public static final String VENDOR_SPECIFIC_HEADSET_EVENT_COMPANY_ID_CATEGORY = "android.bluetooth.headset.intent.category.companyid";
- }
-
- @Deprecated public final class BluetoothHealth implements android.bluetooth.BluetoothProfile {
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean connectChannelToSource(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothHealthAppConfiguration);
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean disconnectChannel(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothHealthAppConfiguration, int);
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(android.bluetooth.BluetoothDevice);
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.os.ParcelFileDescriptor getMainChannelFd(android.bluetooth.BluetoothDevice, android.bluetooth.BluetoothHealthAppConfiguration);
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean registerSinkAppConfiguration(String, int, android.bluetooth.BluetoothHealthCallback);
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean unregisterAppConfiguration(android.bluetooth.BluetoothHealthAppConfiguration);
- field @Deprecated public static final int APP_CONFIG_REGISTRATION_FAILURE = 1; // 0x1
- field @Deprecated public static final int APP_CONFIG_REGISTRATION_SUCCESS = 0; // 0x0
- field @Deprecated public static final int APP_CONFIG_UNREGISTRATION_FAILURE = 3; // 0x3
- field @Deprecated public static final int APP_CONFIG_UNREGISTRATION_SUCCESS = 2; // 0x2
- field @Deprecated public static final int CHANNEL_TYPE_RELIABLE = 10; // 0xa
- field @Deprecated public static final int CHANNEL_TYPE_STREAMING = 11; // 0xb
- field @Deprecated public static final int SINK_ROLE = 2; // 0x2
- field @Deprecated public static final int SOURCE_ROLE = 1; // 0x1
- field @Deprecated public static final int STATE_CHANNEL_CONNECTED = 2; // 0x2
- field @Deprecated public static final int STATE_CHANNEL_CONNECTING = 1; // 0x1
- field @Deprecated public static final int STATE_CHANNEL_DISCONNECTED = 0; // 0x0
- field @Deprecated public static final int STATE_CHANNEL_DISCONNECTING = 3; // 0x3
- }
-
- @Deprecated public final class BluetoothHealthAppConfiguration implements android.os.Parcelable {
- method @Deprecated public int describeContents();
- method @Deprecated public int getDataType();
- method @Deprecated public String getName();
- method @Deprecated public int getRole();
- method @Deprecated public void writeToParcel(android.os.Parcel, int);
- field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHealthAppConfiguration> CREATOR;
- }
-
- @Deprecated public abstract class BluetoothHealthCallback {
- ctor @Deprecated public BluetoothHealthCallback();
- method @Deprecated @BinderThread public void onHealthAppConfigurationStatusChange(android.bluetooth.BluetoothHealthAppConfiguration, int);
- method @Deprecated @BinderThread public void onHealthChannelStateChange(android.bluetooth.BluetoothHealthAppConfiguration, android.bluetooth.BluetoothDevice, int, int, android.os.ParcelFileDescriptor, int);
- }
-
- public final class BluetoothHearingAid implements android.bluetooth.BluetoothProfile {
- method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
- method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.hearingaid.profile.action.CONNECTION_STATE_CHANGED";
- }
-
- public final class BluetoothHidDevice implements android.bluetooth.BluetoothProfile {
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean connect(android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean disconnect(android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings, android.bluetooth.BluetoothHidDeviceAppQosSettings, android.bluetooth.BluetoothHidDeviceAppQosSettings, java.util.concurrent.Executor, android.bluetooth.BluetoothHidDevice.Callback);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean replyReport(android.bluetooth.BluetoothDevice, byte, byte, byte[]);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean reportError(android.bluetooth.BluetoothDevice, byte);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean sendReport(android.bluetooth.BluetoothDevice, int, byte[]);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean unregisterApp();
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.hiddevice.profile.action.CONNECTION_STATE_CHANGED";
- field public static final byte ERROR_RSP_INVALID_PARAM = 4; // 0x4
- field public static final byte ERROR_RSP_INVALID_RPT_ID = 2; // 0x2
- field public static final byte ERROR_RSP_NOT_READY = 1; // 0x1
- field public static final byte ERROR_RSP_SUCCESS = 0; // 0x0
- field public static final byte ERROR_RSP_UNKNOWN = 14; // 0xe
- field public static final byte ERROR_RSP_UNSUPPORTED_REQ = 3; // 0x3
- field public static final byte PROTOCOL_BOOT_MODE = 0; // 0x0
- field public static final byte PROTOCOL_REPORT_MODE = 1; // 0x1
- field public static final byte REPORT_TYPE_FEATURE = 3; // 0x3
- field public static final byte REPORT_TYPE_INPUT = 1; // 0x1
- field public static final byte REPORT_TYPE_OUTPUT = 2; // 0x2
- field public static final byte SUBCLASS1_COMBO = -64; // 0xffffffc0
- field public static final byte SUBCLASS1_KEYBOARD = 64; // 0x40
- field public static final byte SUBCLASS1_MOUSE = -128; // 0xffffff80
- field public static final byte SUBCLASS1_NONE = 0; // 0x0
- field public static final byte SUBCLASS2_CARD_READER = 6; // 0x6
- field public static final byte SUBCLASS2_DIGITIZER_TABLET = 5; // 0x5
- field public static final byte SUBCLASS2_GAMEPAD = 2; // 0x2
- field public static final byte SUBCLASS2_JOYSTICK = 1; // 0x1
- field public static final byte SUBCLASS2_REMOTE_CONTROL = 3; // 0x3
- field public static final byte SUBCLASS2_SENSING_DEVICE = 4; // 0x4
- field public static final byte SUBCLASS2_UNCATEGORIZED = 0; // 0x0
- }
-
- public abstract static class BluetoothHidDevice.Callback {
- ctor public BluetoothHidDevice.Callback();
- method public void onAppStatusChanged(android.bluetooth.BluetoothDevice, boolean);
- method public void onConnectionStateChanged(android.bluetooth.BluetoothDevice, int);
- method public void onGetReport(android.bluetooth.BluetoothDevice, byte, byte, int);
- method public void onInterruptData(android.bluetooth.BluetoothDevice, byte, byte[]);
- method public void onSetProtocol(android.bluetooth.BluetoothDevice, byte);
- method public void onSetReport(android.bluetooth.BluetoothDevice, byte, byte, byte[]);
- method public void onVirtualCableUnplug(android.bluetooth.BluetoothDevice);
- }
-
- public final class BluetoothHidDeviceAppQosSettings implements android.os.Parcelable {
- ctor public BluetoothHidDeviceAppQosSettings(int, int, int, int, int, int);
- method public int describeContents();
- method public int getDelayVariation();
- method public int getLatency();
- method public int getPeakBandwidth();
- method public int getServiceType();
- method public int getTokenBucketSize();
- method public int getTokenRate();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHidDeviceAppQosSettings> CREATOR;
- field public static final int MAX = -1; // 0xffffffff
- field public static final int SERVICE_BEST_EFFORT = 1; // 0x1
- field public static final int SERVICE_GUARANTEED = 2; // 0x2
- field public static final int SERVICE_NO_TRAFFIC = 0; // 0x0
- }
-
- public final class BluetoothHidDeviceAppSdpSettings implements android.os.Parcelable {
- ctor public BluetoothHidDeviceAppSdpSettings(String, String, String, byte, byte[]);
- method public int describeContents();
- method public String getDescription();
- method public byte[] getDescriptors();
- method public String getName();
- method public String getProvider();
- method public byte getSubclass();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHidDeviceAppSdpSettings> CREATOR;
- }
-
- public final class BluetoothLeAudio implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
- method public void close();
- method protected void finalize();
- method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothDevice getConnectedGroupLeadDevice(int);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
- method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getGroupId(@NonNull android.bluetooth.BluetoothDevice);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_LE_AUDIO_CONNECTION_STATE_CHANGED = "android.bluetooth.action.LE_AUDIO_CONNECTION_STATE_CHANGED";
- }
-
- public final class BluetoothLeAudioCodecConfig implements android.os.Parcelable {
- method public int describeContents();
- method public int getBitsPerSample();
- method public int getChannelMode();
- method @NonNull public String getCodecName();
- method public int getCodecPriority();
- method public int getCodecType();
- method public int getFrameDuration();
- method public static int getMaxCodecType();
- method public int getOctetsPerFrame();
- method public int getSampleRate();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field public static final int BITS_PER_SAMPLE_16 = 1; // 0x1
- field public static final int BITS_PER_SAMPLE_24 = 2; // 0x2
- field public static final int BITS_PER_SAMPLE_32 = 3; // 0x3
- field public static final int BITS_PER_SAMPLE_NONE = 0; // 0x0
- field public static final int CHANNEL_MODE_MONO = 1; // 0x1
- field public static final int CHANNEL_MODE_NONE = 0; // 0x0
- field public static final int CHANNEL_MODE_STEREO = 2; // 0x2
- field public static final int CODEC_PRIORITY_DEFAULT = 0; // 0x0
- field public static final int CODEC_PRIORITY_DISABLED = -1; // 0xffffffff
- field public static final int CODEC_PRIORITY_HIGHEST = 1000000; // 0xf4240
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothLeAudioCodecConfig> CREATOR;
- field public static final int FRAME_DURATION_10000 = 2; // 0x2
- field public static final int FRAME_DURATION_7500 = 1; // 0x1
- field public static final int FRAME_DURATION_NONE = 0; // 0x0
- field public static final int SAMPLE_RATE_16000 = 2; // 0x2
- field public static final int SAMPLE_RATE_24000 = 3; // 0x3
- field public static final int SAMPLE_RATE_32000 = 4; // 0x4
- field public static final int SAMPLE_RATE_44100 = 5; // 0x5
- field public static final int SAMPLE_RATE_48000 = 6; // 0x6
- field public static final int SAMPLE_RATE_8000 = 1; // 0x1
- field public static final int SAMPLE_RATE_NONE = 0; // 0x0
- field public static final int SOURCE_CODEC_TYPE_INVALID = 1000000; // 0xf4240
- field public static final int SOURCE_CODEC_TYPE_LC3 = 0; // 0x0
- }
-
- public static final class BluetoothLeAudioCodecConfig.Builder {
- ctor public BluetoothLeAudioCodecConfig.Builder();
- ctor public BluetoothLeAudioCodecConfig.Builder(@NonNull android.bluetooth.BluetoothLeAudioCodecConfig);
- method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfig build();
- method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfig.Builder setBitsPerSample(int);
- method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfig.Builder setChannelMode(int);
- method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfig.Builder setCodecPriority(int);
- method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfig.Builder setCodecType(int);
- method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfig.Builder setFrameDuration(int);
- method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfig.Builder setOctetsPerFrame(int);
- method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfig.Builder setSampleRate(int);
- }
-
- public final class BluetoothManager {
- method public android.bluetooth.BluetoothAdapter getAdapter();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices(int);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(android.bluetooth.BluetoothDevice, int);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int, int[]);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.bluetooth.BluetoothGattServer openGattServer(android.content.Context, android.bluetooth.BluetoothGattServerCallback);
- }
-
- public interface BluetoothProfile {
- method public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method public int getConnectionState(android.bluetooth.BluetoothDevice);
- method public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
- field public static final int A2DP = 2; // 0x2
- field public static final int CSIP_SET_COORDINATOR = 25; // 0x19
- field public static final String EXTRA_PREVIOUS_STATE = "android.bluetooth.profile.extra.PREVIOUS_STATE";
- field public static final String EXTRA_STATE = "android.bluetooth.profile.extra.STATE";
- field public static final int GATT = 7; // 0x7
- field public static final int GATT_SERVER = 8; // 0x8
- field public static final int HAP_CLIENT = 28; // 0x1c
- field public static final int HEADSET = 1; // 0x1
- field @Deprecated public static final int HEALTH = 3; // 0x3
- field public static final int HEARING_AID = 21; // 0x15
- field public static final int HID_DEVICE = 19; // 0x13
- field public static final int LE_AUDIO = 22; // 0x16
- field public static final int SAP = 10; // 0xa
- field public static final int STATE_CONNECTED = 2; // 0x2
- field public static final int STATE_CONNECTING = 1; // 0x1
- field public static final int STATE_DISCONNECTED = 0; // 0x0
- field public static final int STATE_DISCONNECTING = 3; // 0x3
- }
-
- public static interface BluetoothProfile.ServiceListener {
- method public void onServiceConnected(int, android.bluetooth.BluetoothProfile);
- method public void onServiceDisconnected(int);
- }
-
- public final class BluetoothServerSocket implements java.io.Closeable {
- method public android.bluetooth.BluetoothSocket accept() throws java.io.IOException;
- method public android.bluetooth.BluetoothSocket accept(int) throws java.io.IOException;
- method public void close() throws java.io.IOException;
- method public int getPsm();
- }
-
- public final class BluetoothSocket implements java.io.Closeable {
- method public void close() throws java.io.IOException;
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void connect() throws java.io.IOException;
- method public int getConnectionType();
- method public java.io.InputStream getInputStream() throws java.io.IOException;
- method public int getMaxReceivePacketSize();
- method public int getMaxTransmitPacketSize();
- method public java.io.OutputStream getOutputStream() throws java.io.IOException;
- method public android.bluetooth.BluetoothDevice getRemoteDevice();
- method public boolean isConnected();
- field public static final int TYPE_L2CAP = 3; // 0x3
- field public static final int TYPE_RFCOMM = 1; // 0x1
- field public static final int TYPE_SCO = 2; // 0x2
- }
-
- public final class BluetoothStatusCodes {
- field public static final int ERROR_BLUETOOTH_NOT_ALLOWED = 2; // 0x2
- field public static final int ERROR_BLUETOOTH_NOT_ENABLED = 1; // 0x1
- field public static final int ERROR_DEVICE_NOT_BONDED = 3; // 0x3
- field public static final int ERROR_GATT_WRITE_NOT_ALLOWED = 200; // 0xc8
- field public static final int ERROR_GATT_WRITE_REQUEST_BUSY = 201; // 0xc9
- field public static final int ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION = 6; // 0x6
- field public static final int ERROR_MISSING_BLUETOOTH_PRIVILEGED_PERMISSION = 8; // 0x8
- field public static final int ERROR_PROFILE_SERVICE_NOT_BOUND = 9; // 0x9
- field public static final int ERROR_UNKNOWN = 2147483647; // 0x7fffffff
- field public static final int FEATURE_NOT_SUPPORTED = 11; // 0xb
- field public static final int FEATURE_SUPPORTED = 10; // 0xa
- field public static final int SUCCESS = 0; // 0x0
- }
-
-}
-
-package android.bluetooth.le {
-
- public abstract class AdvertiseCallback {
- ctor public AdvertiseCallback();
- method public void onStartFailure(int);
- method public void onStartSuccess(android.bluetooth.le.AdvertiseSettings);
- field public static final int ADVERTISE_FAILED_ALREADY_STARTED = 3; // 0x3
- field public static final int ADVERTISE_FAILED_DATA_TOO_LARGE = 1; // 0x1
- field public static final int ADVERTISE_FAILED_FEATURE_UNSUPPORTED = 5; // 0x5
- field public static final int ADVERTISE_FAILED_INTERNAL_ERROR = 4; // 0x4
- field public static final int ADVERTISE_FAILED_TOO_MANY_ADVERTISERS = 2; // 0x2
- }
-
- public final class AdvertiseData implements android.os.Parcelable {
- method public int describeContents();
- method public boolean getIncludeDeviceName();
- method public boolean getIncludeTxPowerLevel();
- method public android.util.SparseArray<byte[]> getManufacturerSpecificData();
- method public java.util.Map<android.os.ParcelUuid,byte[]> getServiceData();
- method @NonNull public java.util.List<android.os.ParcelUuid> getServiceSolicitationUuids();
- method public java.util.List<android.os.ParcelUuid> getServiceUuids();
- method @NonNull public java.util.List<android.bluetooth.le.TransportDiscoveryData> getTransportDiscoveryData();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.AdvertiseData> CREATOR;
- }
-
- public static final class AdvertiseData.Builder {
- ctor public AdvertiseData.Builder();
- method public android.bluetooth.le.AdvertiseData.Builder addManufacturerData(int, byte[]);
- method public android.bluetooth.le.AdvertiseData.Builder addServiceData(android.os.ParcelUuid, byte[]);
- method @NonNull public android.bluetooth.le.AdvertiseData.Builder addServiceSolicitationUuid(@NonNull android.os.ParcelUuid);
- method public android.bluetooth.le.AdvertiseData.Builder addServiceUuid(android.os.ParcelUuid);
- method @NonNull public android.bluetooth.le.AdvertiseData.Builder addTransportDiscoveryData(@NonNull android.bluetooth.le.TransportDiscoveryData);
- method public android.bluetooth.le.AdvertiseData build();
- method public android.bluetooth.le.AdvertiseData.Builder setIncludeDeviceName(boolean);
- method public android.bluetooth.le.AdvertiseData.Builder setIncludeTxPowerLevel(boolean);
- }
-
- public final class AdvertiseSettings implements android.os.Parcelable {
- method public int describeContents();
- method public int getMode();
- method public int getTimeout();
- method public int getTxPowerLevel();
- method public boolean isConnectable();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final int ADVERTISE_MODE_BALANCED = 1; // 0x1
- field public static final int ADVERTISE_MODE_LOW_LATENCY = 2; // 0x2
- field public static final int ADVERTISE_MODE_LOW_POWER = 0; // 0x0
- field public static final int ADVERTISE_TX_POWER_HIGH = 3; // 0x3
- field public static final int ADVERTISE_TX_POWER_LOW = 1; // 0x1
- field public static final int ADVERTISE_TX_POWER_MEDIUM = 2; // 0x2
- field public static final int ADVERTISE_TX_POWER_ULTRA_LOW = 0; // 0x0
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.AdvertiseSettings> CREATOR;
- }
-
- public static final class AdvertiseSettings.Builder {
- ctor public AdvertiseSettings.Builder();
- method public android.bluetooth.le.AdvertiseSettings build();
- method public android.bluetooth.le.AdvertiseSettings.Builder setAdvertiseMode(int);
- method public android.bluetooth.le.AdvertiseSettings.Builder setConnectable(boolean);
- method public android.bluetooth.le.AdvertiseSettings.Builder setTimeout(int);
- method public android.bluetooth.le.AdvertiseSettings.Builder setTxPowerLevel(int);
- }
-
- public final class AdvertisingSet {
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void enableAdvertising(boolean, int, int);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void setAdvertisingData(android.bluetooth.le.AdvertiseData);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void setAdvertisingParameters(android.bluetooth.le.AdvertisingSetParameters);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void setPeriodicAdvertisingData(android.bluetooth.le.AdvertiseData);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void setPeriodicAdvertisingEnabled(boolean);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void setPeriodicAdvertisingParameters(android.bluetooth.le.PeriodicAdvertisingParameters);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void setScanResponseData(android.bluetooth.le.AdvertiseData);
- }
-
- public abstract class AdvertisingSetCallback {
- ctor public AdvertisingSetCallback();
- method public void onAdvertisingDataSet(android.bluetooth.le.AdvertisingSet, int);
- method public void onAdvertisingEnabled(android.bluetooth.le.AdvertisingSet, boolean, int);
- method public void onAdvertisingParametersUpdated(android.bluetooth.le.AdvertisingSet, int, int);
- method public void onAdvertisingSetStarted(android.bluetooth.le.AdvertisingSet, int, int);
- method public void onAdvertisingSetStopped(android.bluetooth.le.AdvertisingSet);
- method public void onPeriodicAdvertisingDataSet(android.bluetooth.le.AdvertisingSet, int);
- method public void onPeriodicAdvertisingEnabled(android.bluetooth.le.AdvertisingSet, boolean, int);
- method public void onPeriodicAdvertisingParametersUpdated(android.bluetooth.le.AdvertisingSet, int);
- method public void onScanResponseDataSet(android.bluetooth.le.AdvertisingSet, int);
- field public static final int ADVERTISE_FAILED_ALREADY_STARTED = 3; // 0x3
- field public static final int ADVERTISE_FAILED_DATA_TOO_LARGE = 1; // 0x1
- field public static final int ADVERTISE_FAILED_FEATURE_UNSUPPORTED = 5; // 0x5
- field public static final int ADVERTISE_FAILED_INTERNAL_ERROR = 4; // 0x4
- field public static final int ADVERTISE_FAILED_TOO_MANY_ADVERTISERS = 2; // 0x2
- field public static final int ADVERTISE_SUCCESS = 0; // 0x0
- }
-
- public final class AdvertisingSetParameters implements android.os.Parcelable {
- method public int describeContents();
- method public int getInterval();
- method public int getPrimaryPhy();
- method public int getSecondaryPhy();
- method public int getTxPowerLevel();
- method public boolean includeTxPower();
- method public boolean isAnonymous();
- method public boolean isConnectable();
- method public boolean isLegacy();
- method public boolean isScannable();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.AdvertisingSetParameters> CREATOR;
- field public static final int INTERVAL_HIGH = 1600; // 0x640
- field public static final int INTERVAL_LOW = 160; // 0xa0
- field public static final int INTERVAL_MAX = 16777215; // 0xffffff
- field public static final int INTERVAL_MEDIUM = 400; // 0x190
- field public static final int INTERVAL_MIN = 160; // 0xa0
- field public static final int TX_POWER_HIGH = 1; // 0x1
- field public static final int TX_POWER_LOW = -15; // 0xfffffff1
- field public static final int TX_POWER_MAX = 1; // 0x1
- field public static final int TX_POWER_MEDIUM = -7; // 0xfffffff9
- field public static final int TX_POWER_MIN = -127; // 0xffffff81
- field public static final int TX_POWER_ULTRA_LOW = -21; // 0xffffffeb
- }
-
- public static final class AdvertisingSetParameters.Builder {
- ctor public AdvertisingSetParameters.Builder();
- method public android.bluetooth.le.AdvertisingSetParameters build();
- method public android.bluetooth.le.AdvertisingSetParameters.Builder setAnonymous(boolean);
- method public android.bluetooth.le.AdvertisingSetParameters.Builder setConnectable(boolean);
- method public android.bluetooth.le.AdvertisingSetParameters.Builder setIncludeTxPower(boolean);
- method public android.bluetooth.le.AdvertisingSetParameters.Builder setInterval(int);
- method public android.bluetooth.le.AdvertisingSetParameters.Builder setLegacyMode(boolean);
- method public android.bluetooth.le.AdvertisingSetParameters.Builder setPrimaryPhy(int);
- method public android.bluetooth.le.AdvertisingSetParameters.Builder setScannable(boolean);
- method public android.bluetooth.le.AdvertisingSetParameters.Builder setSecondaryPhy(int);
- method public android.bluetooth.le.AdvertisingSetParameters.Builder setTxPowerLevel(int);
- }
-
- public final class BluetoothLeAdvertiser {
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void startAdvertisingSet(android.bluetooth.le.AdvertisingSetParameters, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseData, android.bluetooth.le.PeriodicAdvertisingParameters, android.bluetooth.le.AdvertiseData, int, int, android.bluetooth.le.AdvertisingSetCallback, android.os.Handler);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void stopAdvertising(android.bluetooth.le.AdvertiseCallback);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE) public void stopAdvertisingSet(android.bluetooth.le.AdvertisingSetCallback);
- }
-
- public final class BluetoothLeScanner {
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public void flushPendingScanResults(android.bluetooth.le.ScanCallback);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public void startScan(android.bluetooth.le.ScanCallback);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public void startScan(java.util.List<android.bluetooth.le.ScanFilter>, android.bluetooth.le.ScanSettings, android.bluetooth.le.ScanCallback);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public int startScan(@Nullable java.util.List<android.bluetooth.le.ScanFilter>, @Nullable android.bluetooth.le.ScanSettings, @NonNull android.app.PendingIntent);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public void stopScan(android.bluetooth.le.ScanCallback);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public void stopScan(android.app.PendingIntent);
- field public static final String EXTRA_CALLBACK_TYPE = "android.bluetooth.le.extra.CALLBACK_TYPE";
- field public static final String EXTRA_ERROR_CODE = "android.bluetooth.le.extra.ERROR_CODE";
- field public static final String EXTRA_LIST_SCAN_RESULT = "android.bluetooth.le.extra.LIST_SCAN_RESULT";
- }
-
- public final class PeriodicAdvertisingParameters implements android.os.Parcelable {
- method public int describeContents();
- method public boolean getIncludeTxPower();
- method public int getInterval();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.bluetooth.le.PeriodicAdvertisingParameters> CREATOR;
- }
-
- public static final class PeriodicAdvertisingParameters.Builder {
- ctor public PeriodicAdvertisingParameters.Builder();
- method public android.bluetooth.le.PeriodicAdvertisingParameters build();
- method public android.bluetooth.le.PeriodicAdvertisingParameters.Builder setIncludeTxPower(boolean);
- method public android.bluetooth.le.PeriodicAdvertisingParameters.Builder setInterval(int);
- }
-
- public abstract class ScanCallback {
- ctor public ScanCallback();
- method public void onBatchScanResults(java.util.List<android.bluetooth.le.ScanResult>);
- method public void onScanFailed(int);
- method public void onScanResult(int, android.bluetooth.le.ScanResult);
- field public static final int SCAN_FAILED_ALREADY_STARTED = 1; // 0x1
- field public static final int SCAN_FAILED_APPLICATION_REGISTRATION_FAILED = 2; // 0x2
- field public static final int SCAN_FAILED_FEATURE_UNSUPPORTED = 4; // 0x4
- field public static final int SCAN_FAILED_INTERNAL_ERROR = 3; // 0x3
- }
-
- public final class ScanFilter implements android.os.Parcelable {
- method public int describeContents();
- method @Nullable public String getDeviceAddress();
- method @Nullable public String getDeviceName();
- method @Nullable public byte[] getManufacturerData();
- method @Nullable public byte[] getManufacturerDataMask();
- method public int getManufacturerId();
- method @Nullable public byte[] getServiceData();
- method @Nullable public byte[] getServiceDataMask();
- method @Nullable public android.os.ParcelUuid getServiceDataUuid();
- method @Nullable public android.os.ParcelUuid getServiceSolicitationUuid();
- method @Nullable public android.os.ParcelUuid getServiceSolicitationUuidMask();
- method @Nullable public android.os.ParcelUuid getServiceUuid();
- method @Nullable public android.os.ParcelUuid getServiceUuidMask();
- method public boolean matches(android.bluetooth.le.ScanResult);
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.ScanFilter> CREATOR;
- }
-
- public static final class ScanFilter.Builder {
- ctor public ScanFilter.Builder();
- method public android.bluetooth.le.ScanFilter build();
- method public android.bluetooth.le.ScanFilter.Builder setDeviceAddress(String);
- method public android.bluetooth.le.ScanFilter.Builder setDeviceName(String);
- method public android.bluetooth.le.ScanFilter.Builder setManufacturerData(int, byte[]);
- method public android.bluetooth.le.ScanFilter.Builder setManufacturerData(int, byte[], byte[]);
- method public android.bluetooth.le.ScanFilter.Builder setServiceData(android.os.ParcelUuid, byte[]);
- method public android.bluetooth.le.ScanFilter.Builder setServiceData(android.os.ParcelUuid, byte[], byte[]);
- method @NonNull public android.bluetooth.le.ScanFilter.Builder setServiceSolicitationUuid(@Nullable android.os.ParcelUuid);
- method @NonNull public android.bluetooth.le.ScanFilter.Builder setServiceSolicitationUuid(@Nullable android.os.ParcelUuid, @Nullable android.os.ParcelUuid);
- method public android.bluetooth.le.ScanFilter.Builder setServiceUuid(android.os.ParcelUuid);
- method public android.bluetooth.le.ScanFilter.Builder setServiceUuid(android.os.ParcelUuid, android.os.ParcelUuid);
- }
-
- public final class ScanRecord {
- method public int getAdvertiseFlags();
- method public byte[] getBytes();
- method @Nullable public String getDeviceName();
- method public android.util.SparseArray<byte[]> getManufacturerSpecificData();
- method @Nullable public byte[] getManufacturerSpecificData(int);
- method public java.util.Map<android.os.ParcelUuid,byte[]> getServiceData();
- method @Nullable public byte[] getServiceData(android.os.ParcelUuid);
- method @NonNull public java.util.List<android.os.ParcelUuid> getServiceSolicitationUuids();
- method public java.util.List<android.os.ParcelUuid> getServiceUuids();
- method public int getTxPowerLevel();
- }
-
- public final class ScanResult implements android.os.Parcelable {
- ctor @Deprecated public ScanResult(android.bluetooth.BluetoothDevice, android.bluetooth.le.ScanRecord, int, long);
- ctor public ScanResult(android.bluetooth.BluetoothDevice, int, int, int, int, int, int, int, android.bluetooth.le.ScanRecord, long);
- method public int describeContents();
- method public int getAdvertisingSid();
- method public int getDataStatus();
- method public android.bluetooth.BluetoothDevice getDevice();
- method public int getPeriodicAdvertisingInterval();
- method public int getPrimaryPhy();
- method public int getRssi();
- method @Nullable public android.bluetooth.le.ScanRecord getScanRecord();
- method public int getSecondaryPhy();
- method public long getTimestampNanos();
- method public int getTxPower();
- method public boolean isConnectable();
- method public boolean isLegacy();
- method public void writeToParcel(android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.ScanResult> CREATOR;
- field public static final int DATA_COMPLETE = 0; // 0x0
- field public static final int DATA_TRUNCATED = 2; // 0x2
- field public static final int PERIODIC_INTERVAL_NOT_PRESENT = 0; // 0x0
- field public static final int PHY_UNUSED = 0; // 0x0
- field public static final int SID_NOT_PRESENT = 255; // 0xff
- field public static final int TX_POWER_NOT_PRESENT = 127; // 0x7f
- }
-
- public final class ScanSettings implements android.os.Parcelable {
- method public int describeContents();
- method public int getCallbackType();
- method public boolean getLegacy();
- method public int getPhy();
- method public long getReportDelayMillis();
- method public int getScanMode();
- method public int getScanResultType();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final int CALLBACK_TYPE_ALL_MATCHES = 1; // 0x1
- field public static final int CALLBACK_TYPE_FIRST_MATCH = 2; // 0x2
- field public static final int CALLBACK_TYPE_MATCH_LOST = 4; // 0x4
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.ScanSettings> CREATOR;
- field public static final int MATCH_MODE_AGGRESSIVE = 1; // 0x1
- field public static final int MATCH_MODE_STICKY = 2; // 0x2
- field public static final int MATCH_NUM_FEW_ADVERTISEMENT = 2; // 0x2
- field public static final int MATCH_NUM_MAX_ADVERTISEMENT = 3; // 0x3
- field public static final int MATCH_NUM_ONE_ADVERTISEMENT = 1; // 0x1
- field public static final int PHY_LE_ALL_SUPPORTED = 255; // 0xff
- field public static final int SCAN_MODE_BALANCED = 1; // 0x1
- field public static final int SCAN_MODE_LOW_LATENCY = 2; // 0x2
- field public static final int SCAN_MODE_LOW_POWER = 0; // 0x0
- field public static final int SCAN_MODE_OPPORTUNISTIC = -1; // 0xffffffff
- }
-
- public static final class ScanSettings.Builder {
- ctor public ScanSettings.Builder();
- method public android.bluetooth.le.ScanSettings build();
- method public android.bluetooth.le.ScanSettings.Builder setCallbackType(int);
- method public android.bluetooth.le.ScanSettings.Builder setLegacy(boolean);
- method public android.bluetooth.le.ScanSettings.Builder setMatchMode(int);
- method public android.bluetooth.le.ScanSettings.Builder setNumOfMatches(int);
- method public android.bluetooth.le.ScanSettings.Builder setPhy(int);
- method public android.bluetooth.le.ScanSettings.Builder setReportDelay(long);
- method public android.bluetooth.le.ScanSettings.Builder setScanMode(int);
- }
-
- public final class TransportBlock implements android.os.Parcelable {
- ctor public TransportBlock(int, int, int, @Nullable byte[]);
- method public int describeContents();
- method public int getOrgId();
- method public int getTdsFlags();
- method @Nullable public byte[] getTransportData();
- method public int getTransportDataLength();
- method @Nullable public byte[] toByteArray();
- method public int totalBytes();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.TransportBlock> CREATOR;
- }
-
- public final class TransportDiscoveryData implements android.os.Parcelable {
- ctor public TransportDiscoveryData(int, @NonNull java.util.List<android.bluetooth.le.TransportBlock>);
- ctor public TransportDiscoveryData(@NonNull byte[]);
- method public int describeContents();
- method @NonNull public java.util.List<android.bluetooth.le.TransportBlock> getTransportBlocks();
- method public int getTransportDataType();
- method @Nullable public byte[] toByteArray();
- method public int totalBytes();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.TransportDiscoveryData> CREATOR;
- }
-
-}
-
package android.companion {
public final class AssociationInfo implements android.os.Parcelable {
@@ -10248,9 +8895,14 @@
method public int describeContents();
method @Nullable public String getDeviceProfile();
method @Nullable public CharSequence getDisplayName();
+ method public boolean isForceConfirmation();
+ method public boolean isSelfManaged();
method public boolean isSingleDevice();
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.companion.AssociationRequest> CREATOR;
+ field @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING) public static final String DEVICE_PROFILE_APP_STREAMING = "android.app.role.COMPANION_DEVICE_APP_STREAMING";
+ field @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION) public static final String DEVICE_PROFILE_AUTOMOTIVE_PROJECTION = "android.app.role.SYSTEM_AUTOMOTIVE_PROJECTION";
+ field @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_PROFILE_COMPUTER) public static final String DEVICE_PROFILE_COMPUTER = "android.app.role.COMPANION_DEVICE_COMPUTER";
field public static final String DEVICE_PROFILE_WATCH = "android.app.role.COMPANION_DEVICE_WATCH";
}
@@ -10260,6 +8912,8 @@
method @NonNull public android.companion.AssociationRequest build();
method @NonNull public android.companion.AssociationRequest.Builder setDeviceProfile(@NonNull String);
method @NonNull public android.companion.AssociationRequest.Builder setDisplayName(@NonNull CharSequence);
+ method @NonNull @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_SELF_MANAGED) public android.companion.AssociationRequest.Builder setForceConfirmation(boolean);
+ method @NonNull @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_SELF_MANAGED) public android.companion.AssociationRequest.Builder setSelfManaged(boolean);
method @NonNull public android.companion.AssociationRequest.Builder setSingleDevice(boolean);
}
@@ -10295,8 +8949,8 @@
}
public final class CompanionDeviceManager {
- method @RequiresPermission(anyOf={android.Manifest.permission.REQUEST_COMPANION_PROFILE_WATCH, "android.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING", "android.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION"}, conditional=true) public void associate(@NonNull android.companion.AssociationRequest, @NonNull android.companion.CompanionDeviceManager.Callback, @Nullable android.os.Handler);
- method @RequiresPermission(anyOf={android.Manifest.permission.REQUEST_COMPANION_PROFILE_WATCH, "android.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING", "android.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION"}, conditional=true) public void associate(@NonNull android.companion.AssociationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.companion.CompanionDeviceManager.Callback);
+ method @RequiresPermission(anyOf={android.Manifest.permission.REQUEST_COMPANION_PROFILE_WATCH, android.Manifest.permission.REQUEST_COMPANION_PROFILE_COMPUTER, android.Manifest.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING, android.Manifest.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION}, conditional=true) public void associate(@NonNull android.companion.AssociationRequest, @NonNull android.companion.CompanionDeviceManager.Callback, @Nullable android.os.Handler);
+ method @RequiresPermission(anyOf={android.Manifest.permission.REQUEST_COMPANION_PROFILE_WATCH, android.Manifest.permission.REQUEST_COMPANION_PROFILE_COMPUTER, android.Manifest.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING, android.Manifest.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION}, conditional=true) public void associate(@NonNull android.companion.AssociationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.companion.CompanionDeviceManager.Callback);
method @Deprecated public void disassociate(@NonNull String);
method public void disassociate(int);
method @Deprecated @NonNull public java.util.List<java.lang.String> getAssociations();
@@ -10319,13 +8973,11 @@
public abstract class CompanionDeviceService extends android.app.Service {
ctor public CompanionDeviceService();
- method @RequiresPermission(android.Manifest.permission.DELIVER_COMPANION_MESSAGES) public final void dispatchMessage(int, int, @NonNull byte[]);
method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
method @Deprecated @MainThread public void onDeviceAppeared(@NonNull String);
method @MainThread public void onDeviceAppeared(@NonNull android.companion.AssociationInfo);
method @Deprecated @MainThread public void onDeviceDisappeared(@NonNull String);
method @MainThread public void onDeviceDisappeared(@NonNull android.companion.AssociationInfo);
- method @MainThread public void onDispatchMessage(int, int, @NonNull byte[]);
field public static final String SERVICE_INTERFACE = "android.companion.CompanionDeviceService";
}
@@ -13574,6 +12226,7 @@
}
public final class ShortcutInfo implements android.os.Parcelable {
+ method @NonNull public static android.content.pm.ShortcutInfo createFromGenericDocument(@NonNull android.content.Context, @NonNull android.app.appsearch.GenericDocument);
method public int describeContents();
method @Nullable public android.content.ComponentName getActivity();
method @NonNull public java.util.List<java.lang.String> getCapabilityParameterValues(@NonNull String, @NonNull String);
@@ -18155,7 +16808,7 @@
field public static final long USAGE_CPU_READ_RARELY = 2L; // 0x2L
field public static final long USAGE_CPU_WRITE_OFTEN = 48L; // 0x30L
field public static final long USAGE_CPU_WRITE_RARELY = 32L; // 0x20L
- field public static final long USAGE_FRONT_BUFFER = 1L; // 0x1L
+ field public static final long USAGE_FRONT_BUFFER = 4294967296L; // 0x100000000L
field public static final long USAGE_GPU_COLOR_OUTPUT = 512L; // 0x200L
field public static final long USAGE_GPU_CUBE_MAP = 33554432L; // 0x2000000L
field public static final long USAGE_GPU_DATA_BUFFER = 16777216L; // 0x1000000L
@@ -19929,7 +18582,6 @@
public abstract class AbstractInputMethodService extends android.app.Service implements android.view.KeyEvent.Callback {
ctor public AbstractInputMethodService();
method public android.view.KeyEvent.DispatcherState getKeyDispatcherState();
- method public final boolean isUiContext();
method public final android.os.IBinder onBind(android.content.Intent);
method public abstract android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl onCreateInputMethodInterface();
method public abstract android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodSessionImpl onCreateInputMethodSessionInterface();
@@ -21217,6 +19869,7 @@
method @Nullable public android.media.AudioDeviceInfo getCommunicationDevice();
method public android.media.AudioDeviceInfo[] getDevices(int);
method public static int getDirectPlaybackSupport(@NonNull android.media.AudioFormat, @NonNull android.media.AudioAttributes);
+ method @NonNull public java.util.List<android.media.AudioProfile> getDirectProfilesForAttributes(@NonNull android.media.AudioAttributes);
method public int getEncodedSurroundMode();
method public java.util.List<android.media.MicrophoneInfo> getMicrophones() throws java.io.IOException;
method public int getMode();
@@ -22579,9 +21232,11 @@
field public static final int COLOR_Format24bitBGR888 = 12; // 0xc
field @Deprecated public static final int COLOR_Format24bitRGB888 = 11; // 0xb
field @Deprecated public static final int COLOR_Format25bitARGB1888 = 14; // 0xe
+ field public static final int COLOR_Format32bitABGR2101010 = 2130750114; // 0x7f00aaa2
field public static final int COLOR_Format32bitABGR8888 = 2130747392; // 0x7f00a000
field @Deprecated public static final int COLOR_Format32bitARGB8888 = 16; // 0x10
field @Deprecated public static final int COLOR_Format32bitBGRA8888 = 15; // 0xf
+ field public static final int COLOR_Format64bitABGRFloat = 2130710294; // 0x7f000f16
field @Deprecated public static final int COLOR_Format8bitRGB332 = 2; // 0x2
field @Deprecated public static final int COLOR_FormatCbYCrY = 27; // 0x1b
field @Deprecated public static final int COLOR_FormatCrYCbY = 28; // 0x1c
@@ -22614,12 +21269,14 @@
field @Deprecated public static final int COLOR_FormatYUV422SemiPlanar = 24; // 0x18
field public static final int COLOR_FormatYUV444Flexible = 2135181448; // 0x7f444888
field @Deprecated public static final int COLOR_FormatYUV444Interleaved = 29; // 0x1d
+ field public static final int COLOR_FormatYUVP010 = 54; // 0x36
field @Deprecated public static final int COLOR_QCOM_FormatYUV420SemiPlanar = 2141391872; // 0x7fa30c00
field @Deprecated public static final int COLOR_TI_FormatYUV420PackedSemiPlanar = 2130706688; // 0x7f000100
field public static final String FEATURE_AdaptivePlayback = "adaptive-playback";
field public static final String FEATURE_DynamicTimestamp = "dynamic-timestamp";
field public static final String FEATURE_EncodingStatistics = "encoding-statistics";
field public static final String FEATURE_FrameParsing = "frame-parsing";
+ field public static final String FEATURE_HdrEditing = "hdr-editing";
field public static final String FEATURE_IntraRefresh = "intra-refresh";
field public static final String FEATURE_LowLatency = "low-latency";
field public static final String FEATURE_MultipleFrames = "multiple-frames";
@@ -23005,9 +21662,9 @@
method @NonNull public byte[] getPropertyByteArray(String);
method @NonNull public String getPropertyString(@NonNull String);
method @NonNull public android.media.MediaDrm.ProvisionRequest getProvisionRequest();
- method @NonNull public byte[] getSecureStop(@NonNull byte[]);
- method @NonNull public java.util.List<byte[]> getSecureStopIds();
- method @NonNull public java.util.List<byte[]> getSecureStops();
+ method @Deprecated @NonNull public byte[] getSecureStop(@NonNull byte[]);
+ method @Deprecated @NonNull public java.util.List<byte[]> getSecureStopIds();
+ method @Deprecated @NonNull public java.util.List<byte[]> getSecureStops();
method @android.media.MediaDrm.SecurityLevel public int getSecurityLevel(@NonNull byte[]);
method @NonNull public static java.util.List<java.util.UUID> getSupportedCryptoSchemes();
method public static boolean isCryptoSchemeSupported(@NonNull java.util.UUID);
@@ -23020,11 +21677,11 @@
method @NonNull public java.util.HashMap<java.lang.String,java.lang.String> queryKeyStatus(@NonNull byte[]);
method @Deprecated public void release();
method @Deprecated public void releaseAllSecureStops();
- method public void releaseSecureStops(@NonNull byte[]);
- method public void removeAllSecureStops();
+ method @Deprecated public void releaseSecureStops(@NonNull byte[]);
+ method @Deprecated public void removeAllSecureStops();
method public void removeKeys(@NonNull byte[]);
method public void removeOfflineLicense(@NonNull byte[]);
- method public void removeSecureStop(@NonNull byte[]);
+ method @Deprecated public void removeSecureStop(@NonNull byte[]);
method public boolean requiresSecureDecoder(@NonNull String);
method public boolean requiresSecureDecoder(@NonNull String, @android.media.MediaDrm.SecurityLevel int);
method public void restoreKeys(@NonNull byte[], @NonNull byte[]);
@@ -24573,6 +23230,7 @@
method public static android.net.Uri getValidRingtoneUri(android.content.Context);
method public boolean hasHapticChannels(int);
method public static boolean hasHapticChannels(@NonNull android.net.Uri);
+ method public static boolean hasHapticChannels(@NonNull android.content.Context, @NonNull android.net.Uri);
method public int inferStreamType();
method public static boolean isDefault(android.net.Uri);
method @Nullable public static android.content.res.AssetFileDescriptor openDefaultRingtoneUri(@NonNull android.content.Context, @NonNull android.net.Uri) throws java.io.FileNotFoundException;
@@ -26248,6 +24906,37 @@
package android.media.tv {
+ public final class AdRequest implements android.os.Parcelable {
+ ctor public AdRequest(int, int, @Nullable android.os.ParcelFileDescriptor, long, long, long, @Nullable String, @NonNull android.os.Bundle);
+ method public int describeContents();
+ method public long getEchoIntervalMillis();
+ method @Nullable public android.os.ParcelFileDescriptor getFileDescriptor();
+ method public int getId();
+ method @Nullable public String getMediaFileType();
+ method @NonNull public android.os.Bundle getMetadata();
+ method public int getRequestType();
+ method public long getStartTimeMillis();
+ method public long getStopTimeMillis();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.AdRequest> CREATOR;
+ field public static final int REQUEST_TYPE_START = 1; // 0x1
+ field public static final int REQUEST_TYPE_STOP = 2; // 0x2
+ }
+
+ public final class AdResponse implements android.os.Parcelable {
+ ctor public AdResponse(int, int, long);
+ method public int describeContents();
+ method public long getElapsedTimeMillis();
+ method public int getId();
+ method public int getResponseType();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.AdResponse> CREATOR;
+ field public static final int RESPONSE_TYPE_ERROR = 4; // 0x4
+ field public static final int RESPONSE_TYPE_FINISHED = 2; // 0x2
+ field public static final int RESPONSE_TYPE_PLAYING = 1; // 0x1
+ field public static final int RESPONSE_TYPE_STOPPED = 3; // 0x3
+ }
+
public final class AitInfo implements android.os.Parcelable {
ctor public AitInfo(int, int);
method public int describeContents();
@@ -26257,6 +24946,156 @@
field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.AitInfo> CREATOR;
}
+ public abstract class BroadcastInfoRequest implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getOption();
+ method public int getRequestId();
+ method public int getType();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.BroadcastInfoRequest> CREATOR;
+ field public static final int REQUEST_OPTION_AUTO_UPDATE = 1; // 0x1
+ field public static final int REQUEST_OPTION_REPEAT = 0; // 0x0
+ }
+
+ public abstract class BroadcastInfoResponse implements android.os.Parcelable {
+ method public int describeContents();
+ method public int getRequestId();
+ method public int getResponseResult();
+ method public int getSequence();
+ method public int getType();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.BroadcastInfoResponse> CREATOR;
+ field public static final int RESPONSE_RESULT_CANCEL = 3; // 0x3
+ field public static final int RESPONSE_RESULT_ERROR = 1; // 0x1
+ field public static final int RESPONSE_RESULT_OK = 2; // 0x2
+ }
+
+ public final class CommandRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
+ ctor public CommandRequest(int, int, @NonNull String, @NonNull String, @NonNull String);
+ method @NonNull public String getArguments();
+ method @NonNull public String getName();
+ method @NonNull public String getNameSpace();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.CommandRequest> CREATOR;
+ }
+
+ public final class CommandResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
+ ctor public CommandResponse(int, int, int, @Nullable String);
+ method @Nullable public String getResponse();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.CommandResponse> CREATOR;
+ }
+
+ public final class DsmccRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
+ ctor public DsmccRequest(int, int, @NonNull android.net.Uri);
+ method @NonNull public android.net.Uri getUri();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.DsmccRequest> CREATOR;
+ }
+
+ public final class DsmccResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
+ ctor public DsmccResponse(int, int, int, @Nullable android.os.ParcelFileDescriptor);
+ ctor public DsmccResponse(int, int, int, boolean, @Nullable java.util.List<java.lang.String>);
+ ctor public DsmccResponse(int, int, int, @Nullable int[], @Nullable String[]);
+ method @NonNull public String getBiopMessageType();
+ method @NonNull public java.util.List<java.lang.String> getChildList();
+ method @NonNull public android.os.ParcelFileDescriptor getFile();
+ method @NonNull public int[] getStreamEventIds();
+ method @NonNull public String[] getStreamEventNames();
+ field public static final String BIOP_MESSAGE_TYPE_DIRECTORY = "directory";
+ field public static final String BIOP_MESSAGE_TYPE_FILE = "file";
+ field public static final String BIOP_MESSAGE_TYPE_SERVICE_GATEWAY = "service_gateway";
+ field public static final String BIOP_MESSAGE_TYPE_STREAM = "stream";
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.DsmccResponse> CREATOR;
+ }
+
+ public final class PesRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
+ ctor public PesRequest(int, int, int, int);
+ method public int getStreamId();
+ method public int getTsPid();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.PesRequest> CREATOR;
+ }
+
+ public final class PesResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
+ ctor public PesResponse(int, int, int, @Nullable String);
+ method @Nullable public String getSharedFilterToken();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.PesResponse> CREATOR;
+ }
+
+ public final class SectionRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
+ ctor public SectionRequest(int, int, int, int, int);
+ method public int getTableId();
+ method public int getTsPid();
+ method public int getVersion();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.SectionRequest> CREATOR;
+ }
+
+ public final class SectionResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
+ ctor public SectionResponse(int, int, int, int, int, @Nullable android.os.Bundle);
+ method @NonNull public android.os.Bundle getSessionData();
+ method public int getSessionId();
+ method public int getVersion();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.SectionResponse> CREATOR;
+ }
+
+ public final class StreamEventRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
+ ctor public StreamEventRequest(int, int, @NonNull android.net.Uri, @NonNull String);
+ method @NonNull public String getEventName();
+ method @NonNull public android.net.Uri getTargetUri();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.StreamEventRequest> CREATOR;
+ }
+
+ public final class StreamEventResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
+ ctor public StreamEventResponse(int, int, int, int, long, @Nullable byte[]);
+ method @Nullable public byte[] getData();
+ method public int getEventId();
+ method public long getNpt();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.StreamEventResponse> CREATOR;
+ }
+
+ public final class TableRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
+ ctor public TableRequest(int, int, int, int, int);
+ method public int getTableId();
+ method public int getTableName();
+ method public int getVersion();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TableRequest> CREATOR;
+ field public static final int TABLE_NAME_PAT = 0; // 0x0
+ field public static final int TABLE_NAME_PMT = 1; // 0x1
+ }
+
+ public final class TableResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
+ ctor public TableResponse(int, int, int, @Nullable android.net.Uri, int, int);
+ method public int getSize();
+ method @Nullable public android.net.Uri getTableUri();
+ method public int getVersion();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TableResponse> CREATOR;
+ }
+
+ public final class TimelineRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
+ ctor public TimelineRequest(int, int, int);
+ method public int getIntervalMillis();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TimelineRequest> CREATOR;
+ }
+
+ public final class TimelineResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
+ ctor public TimelineResponse(int, int, int, @Nullable String, int, int, long, long);
+ method @Nullable public String getSelector();
+ method public long getTicks();
+ method public int getUnitsPerSecond();
+ method public int getUnitsPerTick();
+ method public long getWallClock();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TimelineResponse> CREATOR;
+ }
+
+ public final class TsRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable {
+ ctor public TsRequest(int, int, int);
+ method public int getTsPid();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TsRequest> CREATOR;
+ }
+
+ public final class TsResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable {
+ ctor public TsResponse(int, int, int, @Nullable String);
+ method @Nullable public String getSharedFilterToken();
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.TsResponse> CREATOR;
+ }
+
public final class TvContentRating {
method public boolean contains(@NonNull android.media.tv.TvContentRating);
method public static android.media.tv.TvContentRating createRating(String, String, String, java.lang.String...);
@@ -26743,6 +25582,14 @@
field public static final String ACTION_QUERY_CONTENT_RATING_SYSTEMS = "android.media.tv.action.QUERY_CONTENT_RATING_SYSTEMS";
field public static final String ACTION_SETUP_INPUTS = "android.media.tv.action.SETUP_INPUTS";
field public static final String ACTION_VIEW_RECORDING_SCHEDULES = "android.media.tv.action.VIEW_RECORDING_SCHEDULES";
+ field public static final int BROADCAST_INFO_STREAM_EVENT = 5; // 0x5
+ field public static final int BROADCAST_INFO_TYPE_COMMAND = 7; // 0x7
+ field public static final int BROADCAST_INFO_TYPE_DSMCC = 6; // 0x6
+ field public static final int BROADCAST_INFO_TYPE_PES = 4; // 0x4
+ field public static final int BROADCAST_INFO_TYPE_SECTION = 3; // 0x3
+ field public static final int BROADCAST_INFO_TYPE_TABLE = 2; // 0x2
+ field public static final int BROADCAST_INFO_TYPE_TIMELINE = 8; // 0x8
+ field public static final int BROADCAST_INFO_TYPE_TS = 1; // 0x1
field public static final int INPUT_STATE_CONNECTED = 0; // 0x0
field public static final int INPUT_STATE_CONNECTED_STANDBY = 1; // 0x1
field public static final int INPUT_STATE_DISCONNECTED = 2; // 0x2
@@ -26750,6 +25597,9 @@
field public static final int RECORDING_ERROR_INSUFFICIENT_SPACE = 1; // 0x1
field public static final int RECORDING_ERROR_RESOURCE_BUSY = 2; // 0x2
field public static final int RECORDING_ERROR_UNKNOWN = 0; // 0x0
+ field public static final int SIGNAL_STRENGTH_LOST = 1; // 0x1
+ field public static final int SIGNAL_STRENGTH_STRONG = 3; // 0x3
+ field public static final int SIGNAL_STRENGTH_WEAK = 2; // 0x2
field public static final long TIME_SHIFT_INVALID_TIME = -9223372036854775808L; // 0x8000000000000000L
field public static final int TIME_SHIFT_STATUS_AVAILABLE = 3; // 0x3
field public static final int TIME_SHIFT_STATUS_UNAVAILABLE = 2; // 0x2
@@ -26827,10 +25677,13 @@
public abstract static class TvInputService.Session implements android.view.KeyEvent.Callback {
ctor public TvInputService.Session(android.content.Context);
method public void layoutSurface(int, int, int, int);
+ method public void notifyAdResponse(@NonNull android.media.tv.AdResponse);
method public void notifyAitInfoUpdated(@NonNull android.media.tv.AitInfo);
+ method public void notifyBroadcastInfoResponse(@NonNull android.media.tv.BroadcastInfoResponse);
method public void notifyChannelRetuned(android.net.Uri);
method public void notifyContentAllowed();
method public void notifyContentBlocked(@NonNull android.media.tv.TvContentRating);
+ method public void notifySignalStrength(int);
method public void notifyTimeShiftStatusChanged(int);
method public void notifyTrackSelected(int, String);
method public void notifyTracksChanged(java.util.List<android.media.tv.TvTrackInfo>);
@@ -26846,6 +25699,9 @@
method public boolean onKeyUp(int, android.view.KeyEvent);
method public void onOverlayViewSizeChanged(int, int);
method public abstract void onRelease();
+ method public void onRemoveBroadcastInfo(int);
+ method public void onRequestAd(@NonNull android.media.tv.AdRequest);
+ method public void onRequestBroadcastInfo(@NonNull android.media.tv.BroadcastInfoRequest);
method public boolean onSelectTrack(int, @Nullable String);
method public abstract void onSetCaptionEnabled(boolean);
method public void onSetInteractiveAppNotificationEnabled(boolean);
@@ -26983,9 +25839,11 @@
method public void onContentAllowed(String);
method public void onContentBlocked(String, android.media.tv.TvContentRating);
method public void onDisconnected(String);
+ method public void onSignalStrength(@NonNull String, int);
method public void onTimeShiftStatusChanged(String, int);
method public void onTrackSelected(String, int, String);
method public void onTracksChanged(String, java.util.List<android.media.tv.TvTrackInfo>);
+ method public void onTuned(@NonNull String, @NonNull android.net.Uri);
method public void onVideoAvailable(String);
method public void onVideoSizeChanged(String, int, int);
method public void onVideoUnavailable(String, int);
@@ -26995,6 +25853,27 @@
package android.media.tv.interactive {
+ public final class AppLinkInfo implements android.os.Parcelable {
+ method public int describeContents();
+ method @NonNull public String getClassName();
+ method @NonNull public String getPackageName();
+ method @Nullable public String getUriHost();
+ method @Nullable public String getUriPrefix();
+ method @Nullable public String getUriScheme();
+ method public void writeToParcel(@NonNull android.os.Parcel, int);
+ field @NonNull public static final android.os.Parcelable.Creator<android.media.tv.interactive.AppLinkInfo> CREATOR;
+ }
+
+ public static final class AppLinkInfo.Builder {
+ ctor public AppLinkInfo.Builder(@NonNull String, @NonNull String);
+ method @NonNull public android.media.tv.interactive.AppLinkInfo build();
+ method @NonNull public android.media.tv.interactive.AppLinkInfo.Builder setClassName(@NonNull String);
+ method @NonNull public android.media.tv.interactive.AppLinkInfo.Builder setPackageName(@NonNull String);
+ method @NonNull public android.media.tv.interactive.AppLinkInfo.Builder setUriHost(@Nullable String);
+ method @NonNull public android.media.tv.interactive.AppLinkInfo.Builder setUriPrefix(@Nullable String);
+ method @NonNull public android.media.tv.interactive.AppLinkInfo.Builder setUriScheme(@Nullable String);
+ }
+
public final class TvInteractiveAppInfo implements android.os.Parcelable {
ctor public TvInteractiveAppInfo(@NonNull android.content.Context, @NonNull android.content.ComponentName);
method public int describeContents();
@@ -27010,8 +25889,18 @@
public final class TvInteractiveAppManager {
method @NonNull public java.util.List<android.media.tv.interactive.TvInteractiveAppInfo> getTvInteractiveAppServiceList();
+ method public void prepare(@NonNull String, int);
+ method public void registerAppLinkInfo(@NonNull String, @NonNull android.media.tv.interactive.AppLinkInfo);
method public void registerCallback(@NonNull android.media.tv.interactive.TvInteractiveAppManager.TvInteractiveAppCallback, @NonNull java.util.concurrent.Executor);
+ method public void sendAppLinkCommand(@NonNull String, @NonNull android.os.Bundle);
+ method public void unregisterAppLinkInfo(@NonNull String, @NonNull android.media.tv.interactive.AppLinkInfo);
method public void unregisterCallback(@NonNull android.media.tv.interactive.TvInteractiveAppManager.TvInteractiveAppCallback);
+ field public static final String ACTION_APP_LINK_COMMAND = "android.media.tv.interactive.action.APP_LINK_COMMAND";
+ field public static final String APP_LINK_KEY_BACK_URI = "back_uri";
+ field public static final String APP_LINK_KEY_CLASS_NAME = "class_name";
+ field public static final String APP_LINK_KEY_COMMAND_TYPE = "command_type";
+ field public static final String APP_LINK_KEY_PACKAGE_NAME = "package_name";
+ field public static final String APP_LINK_KEY_SERVICE_ID = "service_id";
field public static final int ERROR_BLOCKED = 5; // 0x5
field public static final int ERROR_ENCRYPTED = 6; // 0x6
field public static final int ERROR_NONE = 0; // 0x0
@@ -27020,6 +25909,11 @@
field public static final int ERROR_UNKNOWN = 1; // 0x1
field public static final int ERROR_UNKNOWN_CHANNEL = 7; // 0x7
field public static final int ERROR_WEAK_SIGNAL = 3; // 0x3
+ field public static final String INTENT_KEY_BI_INTERACTIVE_APP_TYPE = "bi_interactive_app_type";
+ field public static final String INTENT_KEY_BI_INTERACTIVE_APP_URI = "bi_interactive_app_uri";
+ field public static final String INTENT_KEY_CHANNEL_URI = "channel_uri";
+ field public static final String INTENT_KEY_INTERACTIVE_APP_SERVICE_ID = "interactive_app_id";
+ field public static final String INTENT_KEY_TV_INPUT_ID = "tv_input_id";
field public static final int INTERACTIVE_APP_STATE_ERROR = 3; // 0x3
field public static final int INTERACTIVE_APP_STATE_RUNNING = 2; // 0x2
field public static final int INTERACTIVE_APP_STATE_STOPPED = 1; // 0x1
@@ -27027,19 +25921,40 @@
field public static final int SERVICE_STATE_PREPARING = 2; // 0x2
field public static final int SERVICE_STATE_READY = 3; // 0x3
field public static final int SERVICE_STATE_UNREALIZED = 1; // 0x1
+ field public static final int TELETEXT_APP_STATE_ERROR = 3; // 0x3
+ field public static final int TELETEXT_APP_STATE_HIDE = 2; // 0x2
+ field public static final int TELETEXT_APP_STATE_SHOW = 1; // 0x1
}
public abstract static class TvInteractiveAppManager.TvInteractiveAppCallback {
ctor public TvInteractiveAppManager.TvInteractiveAppCallback();
+ method public void onInteractiveAppServiceAdded(@NonNull String);
+ method public void onInteractiveAppServiceRemoved(@NonNull String);
+ method public void onInteractiveAppServiceUpdated(@NonNull String);
method public void onTvInteractiveAppServiceStateChanged(@NonNull String, int, int, int);
}
public abstract class TvInteractiveAppService extends android.app.Service {
ctor public TvInteractiveAppService();
method public final void notifyStateChanged(int, int, int);
- method public final android.os.IBinder onBind(android.content.Intent);
+ method public void onAppLinkCommand(@NonNull android.os.Bundle);
+ method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
method @Nullable public abstract android.media.tv.interactive.TvInteractiveAppService.Session onCreateSession(@NonNull String, int);
method public abstract void onPrepare(int);
+ method public void onRegisterAppLinkInfo(@NonNull android.media.tv.interactive.AppLinkInfo);
+ method public void onUnregisterAppLinkInfo(@NonNull android.media.tv.interactive.AppLinkInfo);
+ field public static final String COMMAND_PARAMETER_KEY_CHANGE_CHANNEL_QUIETLY = "command_change_channel_quietly";
+ field public static final String COMMAND_PARAMETER_KEY_CHANNEL_URI = "command_channel_uri";
+ field public static final String COMMAND_PARAMETER_KEY_INPUT_ID = "command_input_id";
+ field public static final String COMMAND_PARAMETER_KEY_TRACK_ID = "command_track_id";
+ field public static final String COMMAND_PARAMETER_KEY_TRACK_TYPE = "command_track_type";
+ field public static final String COMMAND_PARAMETER_KEY_VOLUME = "command_volume";
+ field public static final String PLAYBACK_COMMAND_TYPE_SELECT_TRACK = "select_track";
+ field public static final String PLAYBACK_COMMAND_TYPE_SET_STREAM_VOLUME = "set_stream_volume";
+ field public static final String PLAYBACK_COMMAND_TYPE_STOP = "stop";
+ field public static final String PLAYBACK_COMMAND_TYPE_TUNE = "tune";
+ field public static final String PLAYBACK_COMMAND_TYPE_TUNE_NEXT = "tune_next";
+ field public static final String PLAYBACK_COMMAND_TYPE_TUNE_PREV = "tune_previous";
field public static final String SERVICE_INTERFACE = "android.media.tv.interactive.TvInteractiveAppService";
field public static final String SERVICE_META_DATA = "android.media.tv.interactive.app";
}
@@ -27049,17 +25964,51 @@
method public void layoutSurface(int, int, int, int);
method public final void notifyBiInteractiveAppCreated(@NonNull android.net.Uri, @Nullable String);
method public void notifySessionStateChanged(int, int);
+ method public final void notifyTeletextAppStateChanged(int);
+ method public void onAdResponse(@NonNull android.media.tv.AdResponse);
+ method public void onBroadcastInfoResponse(@NonNull android.media.tv.BroadcastInfoResponse);
+ method public void onContentAllowed();
+ method public void onContentBlocked(@NonNull android.media.tv.TvContentRating);
method public void onCreateBiInteractiveApp(@NonNull android.net.Uri, @Nullable android.os.Bundle);
+ method @Nullable public android.view.View onCreateMediaView();
+ method public void onCurrentChannelLcn(int);
+ method public void onCurrentChannelUri(@Nullable android.net.Uri);
+ method public void onCurrentTvInputId(@Nullable String);
method public void onDestroyBiInteractiveApp(@NonNull String);
+ method public boolean onGenericMotionEvent(@NonNull android.view.MotionEvent);
method public boolean onKeyDown(int, @NonNull android.view.KeyEvent);
method public boolean onKeyLongPress(int, @NonNull android.view.KeyEvent);
method public boolean onKeyMultiple(int, int, @NonNull android.view.KeyEvent);
method public boolean onKeyUp(int, @NonNull android.view.KeyEvent);
+ method public void onMediaViewSizeChanged(int, int);
+ method public abstract void onRelease();
+ method public void onResetInteractiveApp();
method public abstract boolean onSetSurface(@Nullable android.view.Surface);
+ method public void onSetTeletextAppEnabled(boolean);
+ method public void onSignalStrength(int);
method public void onStartInteractiveApp();
method public void onStopInteractiveApp();
+ method public void onStreamVolume(float);
method public void onSurfaceChanged(int, int, int);
+ method public boolean onTouchEvent(@NonNull android.view.MotionEvent);
+ method public void onTrackInfoList(@NonNull java.util.List<android.media.tv.TvTrackInfo>);
+ method public void onTrackSelected(int, @NonNull String);
+ method public boolean onTrackballEvent(@NonNull android.view.MotionEvent);
+ method public void onTracksChanged(@NonNull java.util.List<android.media.tv.TvTrackInfo>);
method public void onTuned(@NonNull android.net.Uri);
+ method public void onVideoAvailable();
+ method public void onVideoUnavailable(int);
+ method public void removeBroadcastInfo(int);
+ method public void requestAd(@NonNull android.media.tv.AdRequest);
+ method public void requestBroadcastInfo(@NonNull android.media.tv.BroadcastInfoRequest);
+ method public void requestCurrentChannelLcn();
+ method public void requestCurrentChannelUri();
+ method public void requestCurrentTvInputId();
+ method public void requestStreamVolume();
+ method public void requestTrackInfoList();
+ method public void sendPlaybackCommandRequest(@NonNull String, @Nullable android.os.Bundle);
+ method public void setMediaViewEnabled(boolean);
+ method public void setVideoBounds(@NonNull android.graphics.Rect);
}
public class TvInteractiveAppView extends android.view.ViewGroup {
@@ -27067,19 +26016,48 @@
ctor public TvInteractiveAppView(@NonNull android.content.Context, @Nullable android.util.AttributeSet);
ctor public TvInteractiveAppView(@NonNull android.content.Context, @Nullable android.util.AttributeSet, int);
method public void clearCallback();
+ method public void clearOnUnhandledInputEventListener();
method public void createBiInteractiveApp(@NonNull android.net.Uri, @Nullable android.os.Bundle);
method public void destroyBiInteractiveApp(@NonNull String);
+ method public boolean dispatchUnhandledInputEvent(@NonNull android.view.InputEvent);
+ method public void onAttachedToWindow();
+ method public void onDetachedFromWindow();
+ method public void onLayout(boolean, int, int, int, int);
+ method public void onMeasure(int, int);
+ method public boolean onUnhandledInputEvent(@NonNull android.view.InputEvent);
+ method public void onVisibilityChanged(@NonNull android.view.View, int);
method public void prepareInteractiveApp(@NonNull String, int);
+ method public void reset();
+ method public void resetInteractiveApp();
+ method public void sendCurrentChannelLcn(int);
+ method public void sendCurrentChannelUri(@Nullable android.net.Uri);
+ method public void sendCurrentTvInputId(@Nullable String);
+ method public void sendStreamVolume(float);
+ method public void sendTrackInfoList(@Nullable java.util.List<android.media.tv.TvTrackInfo>);
method public void setCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.interactive.TvInteractiveAppView.TvInteractiveAppCallback);
+ method public void setOnUnhandledInputEventListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.interactive.TvInteractiveAppView.OnUnhandledInputEventListener);
+ method public void setTeletextAppEnabled(boolean);
method public int setTvView(@Nullable android.media.tv.TvView);
method public void startInteractiveApp();
method public void stopInteractiveApp();
}
+ public static interface TvInteractiveAppView.OnUnhandledInputEventListener {
+ method public boolean onUnhandledInputEvent(@NonNull android.view.InputEvent);
+ }
+
public abstract static class TvInteractiveAppView.TvInteractiveAppCallback {
ctor public TvInteractiveAppView.TvInteractiveAppCallback();
method public void onBiInteractiveAppCreated(@NonNull String, @NonNull android.net.Uri, @Nullable String);
+ method public void onPlaybackCommandRequest(@NonNull String, @NonNull String, @NonNull android.os.Bundle);
+ method public void onRequestCurrentChannelLcn(@NonNull String);
+ method public void onRequestCurrentChannelUri(@NonNull String);
+ method public void onRequestCurrentTvInputId(@NonNull String);
+ method public void onRequestStreamVolume(@NonNull String);
+ method public void onRequestTrackInfoList(@NonNull String);
+ method public void onSetVideoBounds(@NonNull String, @NonNull android.graphics.Rect);
method public void onStateChanged(@NonNull String, int, int);
+ method public void onTeletextAppStateChanged(@NonNull String, int);
}
}
@@ -31644,6 +30622,7 @@
field public static final int BATTERY_HEALTH_UNKNOWN = 1; // 0x1
field public static final int BATTERY_HEALTH_UNSPECIFIED_FAILURE = 6; // 0x6
field public static final int BATTERY_PLUGGED_AC = 1; // 0x1
+ field public static final int BATTERY_PLUGGED_DOCK = 8; // 0x8
field public static final int BATTERY_PLUGGED_USB = 2; // 0x2
field public static final int BATTERY_PLUGGED_WIRELESS = 4; // 0x4
field public static final int BATTERY_PROPERTY_CAPACITY = 4; // 0x4
@@ -33151,6 +32130,9 @@
method public static android.os.VibrationEffect createWaveform(long[], int[], int);
method public int describeContents();
method @NonNull public static android.os.VibrationEffect.Composition startComposition();
+ method @NonNull public static android.os.VibrationEffect.WaveformBuilder startWaveform();
+ method @NonNull public static android.os.VibrationEffect.WaveformBuilder startWaveform(@NonNull android.os.VibrationEffect.VibrationParameter);
+ method @NonNull public static android.os.VibrationEffect.WaveformBuilder startWaveform(@NonNull android.os.VibrationEffect.VibrationParameter, @NonNull android.os.VibrationEffect.VibrationParameter);
field @NonNull public static final android.os.Parcelable.Creator<android.os.VibrationEffect> CREATOR;
field public static final int DEFAULT_AMPLITUDE = -1; // 0xffffffff
field public static final int EFFECT_CLICK = 0; // 0x0
@@ -33160,10 +32142,13 @@
}
public static final class VibrationEffect.Composition {
+ method @NonNull public android.os.VibrationEffect.Composition addEffect(@NonNull android.os.VibrationEffect);
+ method @NonNull public android.os.VibrationEffect.Composition addOffDuration(@NonNull java.time.Duration);
method @NonNull public android.os.VibrationEffect.Composition addPrimitive(int);
method @NonNull public android.os.VibrationEffect.Composition addPrimitive(int, @FloatRange(from=0.0f, to=1.0f) float);
method @NonNull public android.os.VibrationEffect.Composition addPrimitive(int, @FloatRange(from=0.0f, to=1.0f) float, @IntRange(from=0) int);
method @NonNull public android.os.VibrationEffect compose();
+ method @NonNull public android.os.VibrationEffect.Composition repeatEffectIndefinitely(@NonNull android.os.VibrationEffect);
field public static final int PRIMITIVE_CLICK = 1; // 0x1
field public static final int PRIMITIVE_LOW_TICK = 8; // 0x8
field public static final int PRIMITIVE_QUICK_FALL = 6; // 0x6
@@ -33174,6 +32159,21 @@
field public static final int PRIMITIVE_TICK = 7; // 0x7
}
+ public static final class VibrationEffect.Composition.UnreachableAfterRepeatingIndefinitelyException extends java.lang.IllegalStateException {
+ }
+
+ public static class VibrationEffect.VibrationParameter {
+ method @NonNull public static android.os.VibrationEffect.VibrationParameter targetAmplitude(@FloatRange(from=0, to=1) float);
+ method @NonNull public static android.os.VibrationEffect.VibrationParameter targetFrequency(@FloatRange(from=1) float);
+ }
+
+ public static final class VibrationEffect.WaveformBuilder {
+ method @NonNull public android.os.VibrationEffect.WaveformBuilder addSustain(@NonNull java.time.Duration);
+ method @NonNull public android.os.VibrationEffect.WaveformBuilder addTransition(@NonNull java.time.Duration, @NonNull android.os.VibrationEffect.VibrationParameter);
+ method @NonNull public android.os.VibrationEffect.WaveformBuilder addTransition(@NonNull java.time.Duration, @NonNull android.os.VibrationEffect.VibrationParameter, @NonNull android.os.VibrationEffect.VibrationParameter);
+ method @NonNull public android.os.VibrationEffect build();
+ }
+
public abstract class Vibrator {
method public final int areAllEffectsSupported(@NonNull int...);
method public final boolean areAllPrimitivesSupported(@NonNull int...);
@@ -41403,8 +40403,10 @@
field public static final int CAPABILITY_SELF_MANAGED = 2048; // 0x800
field public static final int CAPABILITY_SIM_SUBSCRIPTION = 4; // 0x4
field public static final int CAPABILITY_SUPPORTS_VIDEO_CALLING = 1024; // 0x400
+ field public static final int CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS = 65536; // 0x10000
field public static final int CAPABILITY_VIDEO_CALLING = 8; // 0x8
field public static final int CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE = 256; // 0x100
+ field public static final int CAPABILITY_VOICE_CALLING_AVAILABLE = 131072; // 0x20000
field @NonNull public static final android.os.Parcelable.Creator<android.telecom.PhoneAccount> CREATOR;
field public static final String EXTRA_ADD_SELF_MANAGED_CALLS_TO_INCALLSERVICE = "android.telecom.extra.ADD_SELF_MANAGED_CALLS_TO_INCALLSERVICE";
field public static final String EXTRA_ALWAYS_USE_VOIP_AUDIO_MODE = "android.telecom.extra.ALWAYS_USE_VOIP_AUDIO_MODE";
@@ -42344,6 +41346,7 @@
field public static final String KEY_SIP_TIMER_T1_MILLIS_INT = "ims.sip_timer_t1_millis_int";
field public static final String KEY_SIP_TIMER_T2_MILLIS_INT = "ims.sip_timer_t2_millis_int";
field public static final String KEY_SIP_TIMER_T4_MILLIS_INT = "ims.sip_timer_t4_millis_int";
+ field public static final String KEY_SUPPORTED_RATS_INT_ARRAY = "ims.supported_rats_int_array";
field public static final String KEY_WIFI_OFF_DEFERRING_TIME_MILLIS_INT = "ims.wifi_off_deferring_time_millis_int";
field public static final int NETWORK_TYPE_HOME = 0; // 0x0
field public static final int NETWORK_TYPE_ROAMING = 1; // 0x1
@@ -42364,6 +41367,7 @@
field public static final String KEY_EMERGENCY_QOS_PRECONDITION_SUPPORTED_BOOL = "imsemergency.emergency_qos_precondition_supported_bool";
field public static final String KEY_EMERGENCY_REGISTRATION_TIMER_MILLIS_INT = "imsemergency.emergency_registration_timer_millis_int";
field public static final String KEY_PREFIX = "imsemergency.";
+ field public static final String KEY_REFRESH_GEOLOCATION_TIMEOUT_MILLIS_INT = "imsemergency.refresh_geolocation_timeout_millis_int";
field public static final String KEY_RETRY_EMERGENCY_ON_IMS_PDN_BOOL = "imsemergency.retry_emergency_on_ims_pdn_bool";
}
@@ -42373,7 +41377,6 @@
field public static final String KEY_T140_PAYLOAD_TYPE_INT = "imsrtt.t140_payload_type_int";
field public static final String KEY_TEXT_AS_BANDWIDTH_KBPS_INT = "imsrtt.text_as_bandwidth_kbps_int";
field public static final String KEY_TEXT_CODEC_CAPABILITY_PAYLOAD_TYPES_BUNDLE = "imsrtt.text_codec_capability_payload_types_bundle";
- field public static final String KEY_TEXT_INACTIVITY_CALL_END_REASONS_INT_ARRAY = "imsrtt.text_inactivity_call_end_reasons_int_array";
field public static final String KEY_TEXT_ON_DEFAULT_BEARER_SUPPORTED_BOOL = "imsrtt.text_on_default_bearer_supported_bool";
field public static final String KEY_TEXT_QOS_PRECONDITION_SUPPORTED_BOOL = "imsrtt.text_qos_precondition_supported_bool";
field public static final String KEY_TEXT_RR_BANDWIDTH_BPS_INT = "imsrtt.text_rr_bandwidth_bps_int";
@@ -42409,6 +41412,7 @@
field public static final String KEY_UT_REQUIRES_IMS_REGISTRATION_BOOL = "imsss.ut_requires_ims_registration_bool";
field public static final String KEY_UT_SERVER_BASED_SERVICES_INT_ARRAY = "imsss.ut_server_based_services_int_array";
field public static final String KEY_UT_SUPPORTED_WHEN_PS_DATA_OFF_BOOL = "imsss.ut_supported_when_ps_data_off_bool";
+ field public static final String KEY_UT_SUPPORTED_WHEN_ROAMING_BOOL = "imsss.ut_supported_when_roaming_bool";
field public static final String KEY_UT_TERMINAL_BASED_SERVICES_INT_ARRAY = "imsss.ut_terminal_based_services_int_array";
field public static final String KEY_UT_TRANSPORT_TYPE_INT = "imsss.ut_transport_type_int";
field public static final String KEY_XCAP_OVER_UT_SUPPORTED_RATS_INT_ARRAY = "imsss.xcap_over_ut_supported_rats_int_array";
@@ -42508,6 +41512,7 @@
field public static final String KEY_RINGBACK_TIMER_MILLIS_INT = "imsvoice.ringback_timer_millis_int";
field public static final String KEY_RINGING_TIMER_MILLIS_INT = "imsvoice.ringing_timer_millis_int";
field public static final String KEY_SESSION_EXPIRES_TIMER_SEC_INT = "imsvoice.session_expires_timer_sec_int";
+ field public static final String KEY_SESSION_PRIVACY_TYPE_INT = "imsvoice.session_privacy_type_int";
field public static final String KEY_SESSION_REFRESHER_TYPE_INT = "imsvoice.session_refresher_type_int";
field public static final String KEY_SESSION_REFRESH_METHOD_INT = "imsvoice.session_refresh_method_int";
field public static final String KEY_SESSION_TIMER_SUPPORTED_BOOL = "imsvoice.session_timer_supported_bool";
@@ -42517,6 +41522,9 @@
field public static final int MIDCALL_SRVCC_SUPPORT = 3; // 0x3
field public static final int OCTET_ALIGNED = 1; // 0x1
field public static final int PREALERTING_SRVCC_SUPPORT = 2; // 0x2
+ field public static final int SESSION_PRIVACY_TYPE_HEADER = 0; // 0x0
+ field public static final int SESSION_PRIVACY_TYPE_ID = 2; // 0x2
+ field public static final int SESSION_PRIVACY_TYPE_NONE = 1; // 0x1
field public static final int SESSION_REFRESHER_TYPE_UAC = 1; // 0x1
field public static final int SESSION_REFRESHER_TYPE_UAS = 2; // 0x2
field public static final int SESSION_REFRESHER_TYPE_UNKNOWN = 0; // 0x0
@@ -50589,6 +49597,7 @@
method public boolean isAccessibilityHeading();
method public boolean isActivated();
method public boolean isAttachedToWindow();
+ method public boolean isAutoHandwritingEnabled();
method public boolean isClickable();
method public boolean isContextClickable();
method public boolean isDirty();
@@ -50772,6 +49781,7 @@
method public void setAlpha(@FloatRange(from=0.0, to=1.0) float);
method public void setAnimation(android.view.animation.Animation);
method public void setAnimationMatrix(@Nullable android.graphics.Matrix);
+ method public void setAutoHandwritingEnabled(boolean);
method public void setAutofillHints(@Nullable java.lang.String...);
method public void setAutofillId(@Nullable android.view.autofill.AutofillId);
method public void setBackground(android.graphics.drawable.Drawable);
diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt
index ee31e13..6c2db43 100644
--- a/core/api/module-lib-current.txt
+++ b/core/api/module-lib-current.txt
@@ -63,8 +63,8 @@
public class DevicePolicyManager {
method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void acknowledgeNewUserDisclaimer();
- method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void clearLogoutUser();
- method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public android.os.UserHandle getLogoutUser();
+ method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.INTERACT_ACROSS_USERS}) public android.os.UserHandle getLogoutUser();
+ method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public int logoutUser();
field public static final String ACTION_SHOW_NEW_USER_DISCLAIMER = "android.app.action.SHOW_NEW_USER_DISCLAIMER";
}
@@ -93,20 +93,6 @@
}
-package android.bluetooth {
-
- public class BluetoothFrameworkInitializer {
- method public static void registerServiceWrappers();
- method public static void setBinderCallsStatsInitializer(@NonNull java.util.function.Consumer<android.content.Context>);
- method public static void setBluetoothServiceManager(@NonNull android.os.BluetoothServiceManager);
- }
-
- public final class BluetoothPan implements android.bluetooth.BluetoothProfile {
- method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.TETHER_PRIVILEGED}) public android.net.TetheringManager.TetheredInterfaceRequest requestTetheredInterface(@NonNull java.util.concurrent.Executor, @NonNull android.net.TetheringManager.TetheredInterfaceCallback);
- }
-
-}
-
package android.content {
public abstract class ContentProvider implements android.content.ComponentCallbacks2 {
@@ -384,6 +370,7 @@
method public int getRoaming();
method @NonNull public java.util.Set<java.lang.String> getSubscriberIds();
method @NonNull public java.util.Set<java.lang.String> getWifiNetworkKeys();
+ method public boolean matches(@NonNull android.net.NetworkIdentity);
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkTemplate> CREATOR;
field public static final int MATCH_BLUETOOTH = 8; // 0x8
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index ea2a641..a9fb159 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -269,9 +269,6 @@
field public static final String REMOVE_DRM_CERTIFICATES = "android.permission.REMOVE_DRM_CERTIFICATES";
field public static final String REMOVE_TASKS = "android.permission.REMOVE_TASKS";
field public static final String RENOUNCE_PERMISSIONS = "android.permission.RENOUNCE_PERMISSIONS";
- field public static final String REQUEST_COMPANION_PROFILE_APP_STREAMING = "android.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING";
- field public static final String REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION = "android.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION";
- field public static final String REQUEST_COMPANION_SELF_MANAGED = "android.permission.REQUEST_COMPANION_SELF_MANAGED";
field @Deprecated public static final String REQUEST_NETWORK_SCORES = "android.permission.REQUEST_NETWORK_SCORES";
field public static final String REQUEST_NOTIFICATION_ASSISTANT_SERVICE = "android.permission.REQUEST_NOTIFICATION_ASSISTANT_SERVICE";
field public static final String RESET_PASSWORD = "android.permission.RESET_PASSWORD";
@@ -744,6 +741,7 @@
method public void clearRequireCompatChange();
method public boolean isPendingIntentBackgroundActivityLaunchAllowed();
method public static android.app.BroadcastOptions makeBasic();
+ method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public void recordResponseEventWhileInBackground(@IntRange(from=0) long);
method @RequiresPermission(android.Manifest.permission.START_ACTIVITIES_FROM_BACKGROUND) public void setBackgroundActivityStartsAllowed(boolean);
method public void setDontSendToRestrictedApps(boolean);
method public void setPendingIntentBackgroundActivityLaunchAllowed(boolean);
@@ -2257,475 +2255,6 @@
}
-package android.bluetooth {
-
- public final class BluetoothA2dp implements android.bluetooth.BluetoothProfile {
- method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.bluetooth.BufferConstraints getBufferConstraints();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getDynamicBufferSupport();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setBufferLengthMillis(int, int);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
- field public static final int DYNAMIC_BUFFER_SUPPORT_A2DP_OFFLOAD = 1; // 0x1
- field public static final int DYNAMIC_BUFFER_SUPPORT_A2DP_SOFTWARE_ENCODING = 2; // 0x2
- field public static final int DYNAMIC_BUFFER_SUPPORT_NONE = 0; // 0x0
- field public static final int OPTIONAL_CODECS_NOT_SUPPORTED = 0; // 0x0
- field public static final int OPTIONAL_CODECS_PREF_DISABLED = 0; // 0x0
- field public static final int OPTIONAL_CODECS_PREF_ENABLED = 1; // 0x1
- field public static final int OPTIONAL_CODECS_PREF_UNKNOWN = -1; // 0xffffffff
- field public static final int OPTIONAL_CODECS_SUPPORTED = 1; // 0x1
- field public static final int OPTIONAL_CODECS_SUPPORT_UNKNOWN = -1; // 0xffffffff
- }
-
- public final class BluetoothA2dpSink implements android.bluetooth.BluetoothProfile {
- method public void finalize();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isAudioPlaying(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.a2dp-sink.profile.action.CONNECTION_STATE_CHANGED";
- }
-
- public final class BluetoothActivityEnergyInfo implements android.os.Parcelable {
- method public int getBluetoothStackState();
- method public long getControllerEnergyUsed();
- method public long getControllerIdleTimeMillis();
- method public long getControllerRxTimeMillis();
- method public long getControllerTxTimeMillis();
- method public long getTimestampMillis();
- method @NonNull public java.util.List<android.bluetooth.UidTraffic> getUidTraffic();
- method public boolean isValid();
- field public static final int BT_STACK_STATE_INVALID = 0; // 0x0
- field public static final int BT_STACK_STATE_STATE_ACTIVE = 1; // 0x1
- field public static final int BT_STACK_STATE_STATE_IDLE = 3; // 0x3
- field public static final int BT_STACK_STATE_STATE_SCANNING = 2; // 0x2
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothActivityEnergyInfo> CREATOR;
- }
-
- public final class BluetoothAdapter {
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean addOnMetadataChangedListener(@NonNull android.bluetooth.BluetoothDevice, @NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothAdapter.OnMetadataChangedListener);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean disable(boolean);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean disableBLE();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean enableBLE();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean enableNoAutoConnect();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void generateLocalOobData(int, @NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothAdapter.OobDataCallback);
- method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getActiveDevices(int);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public long getDiscoveryEndMillis();
- method public boolean isBleScanAlwaysAvailable();
- method public boolean isLeEnabled();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean removeActiveDevice(int);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean removeOnMetadataChangedListener(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.bluetooth.BluetoothAdapter.OnMetadataChangedListener);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean setActiveDevice(@NonNull android.bluetooth.BluetoothDevice, int);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int setDiscoverableTimeout(@NonNull java.time.Duration);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int setScanMode(int);
- field public static final String ACTION_BLE_STATE_CHANGED = "android.bluetooth.adapter.action.BLE_STATE_CHANGED";
- field public static final String ACTION_REQUEST_BLE_SCAN_ALWAYS_AVAILABLE = "android.bluetooth.adapter.action.REQUEST_BLE_SCAN_ALWAYS_AVAILABLE";
- field public static final int ACTIVE_DEVICE_ALL = 2; // 0x2
- field public static final int ACTIVE_DEVICE_AUDIO = 0; // 0x0
- field public static final int ACTIVE_DEVICE_PHONE_CALL = 1; // 0x1
- }
-
- public static interface BluetoothAdapter.OnMetadataChangedListener {
- method public void onMetadataChanged(@NonNull android.bluetooth.BluetoothDevice, int, @Nullable byte[]);
- }
-
- public static interface BluetoothAdapter.OobDataCallback {
- method public void onError(int);
- method public void onOobData(int, @NonNull android.bluetooth.OobData);
- }
-
- public final class BluetoothClass implements android.os.Parcelable {
- field public static final int PROFILE_A2DP_SINK = 6; // 0x6
- field public static final int PROFILE_NAP = 5; // 0x5
- field public static final int PROFILE_OPP = 2; // 0x2
- field public static final int PROFILE_PANU = 4; // 0x4
- }
-
- public final class BluetoothCsipSetCoordinator implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
- method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public java.util.List<java.lang.Integer> getAllGroupIds(@Nullable android.os.ParcelUuid);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice);
- method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public java.util.Map getGroupUuidMapByDevice(@Nullable android.bluetooth.BluetoothDevice);
- method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public java.util.UUID groupLock(int, @Nullable java.util.concurrent.Executor, @Nullable android.bluetooth.BluetoothCsipSetCoordinator.ClientLockCallback);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean groupUnlock(@NonNull java.util.UUID);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice, int);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static final String ACTION_CSIS_DEVICE_AVAILABLE = "android.bluetooth.action.CSIS_DEVICE_AVAILABLE";
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static final String ACTION_CSIS_SET_MEMBER_AVAILABLE = "android.bluetooth.action.CSIS_SET_MEMBER_AVAILABLE";
- }
-
- public static interface BluetoothCsipSetCoordinator.ClientLockCallback {
- method public void onGroupLockSet(int, int, boolean);
- }
-
- public final class BluetoothDevice implements android.os.Parcelable {
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean canBondWithoutDialog();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean cancelBondProcess();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.MODIFY_PHONE_STATE}) public int connect();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean createBond(int);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean createBondOutOfBand(int, @Nullable android.bluetooth.OobData, @Nullable android.bluetooth.OobData);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int disconnect();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean fetchUuidsWithSdp(int);
- method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public byte[] getMetadata(int);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getSimAccessPermission();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean isConnected();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean isEncrypted();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isInSilenceMode();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean removeBond();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setLowLatencyAudioAllowed(boolean);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setMessageAccessPermission(int);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setMetadata(int, @NonNull byte[]);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setPhonebookAccessPermission(int);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setSilenceMode(boolean);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setSimAccessPermission(int);
- field public static final int ACCESS_ALLOWED = 1; // 0x1
- field public static final int ACCESS_REJECTED = 2; // 0x2
- field public static final int ACCESS_UNKNOWN = 0; // 0x0
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_SILENCE_MODE_CHANGED = "android.bluetooth.device.action.SILENCE_MODE_CHANGED";
- field @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_SWITCH_BUFFER_SIZE = "android.bluetooth.device.action.SWITCH_BUFFER_SIZE";
- field public static final String DEVICE_TYPE_DEFAULT = "Default";
- field public static final String DEVICE_TYPE_UNTETHERED_HEADSET = "Untethered Headset";
- field public static final String DEVICE_TYPE_WATCH = "Watch";
- field public static final String EXTRA_LOW_LATENCY_BUFFER_SIZE = "android.bluetooth.device.extra.LOW_LATENCY_BUFFER_SIZE";
- field public static final int METADATA_COMPANION_APP = 4; // 0x4
- field public static final int METADATA_DEVICE_TYPE = 17; // 0x11
- field public static final int METADATA_ENHANCED_SETTINGS_UI_URI = 16; // 0x10
- field public static final int METADATA_HARDWARE_VERSION = 3; // 0x3
- field public static final int METADATA_IS_UNTETHERED_HEADSET = 6; // 0x6
- field public static final int METADATA_MAIN_BATTERY = 18; // 0x12
- field public static final int METADATA_MAIN_CHARGING = 19; // 0x13
- field public static final int METADATA_MAIN_ICON = 5; // 0x5
- field public static final int METADATA_MAIN_LOW_BATTERY_THRESHOLD = 20; // 0x14
- field public static final int METADATA_MANUFACTURER_NAME = 0; // 0x0
- field public static final int METADATA_MAX_LENGTH = 2048; // 0x800
- field public static final int METADATA_MODEL_NAME = 1; // 0x1
- field public static final int METADATA_SOFTWARE_VERSION = 2; // 0x2
- field public static final int METADATA_UNTETHERED_CASE_BATTERY = 12; // 0xc
- field public static final int METADATA_UNTETHERED_CASE_CHARGING = 15; // 0xf
- field public static final int METADATA_UNTETHERED_CASE_ICON = 9; // 0x9
- field public static final int METADATA_UNTETHERED_CASE_LOW_BATTERY_THRESHOLD = 23; // 0x17
- field public static final int METADATA_UNTETHERED_LEFT_BATTERY = 10; // 0xa
- field public static final int METADATA_UNTETHERED_LEFT_CHARGING = 13; // 0xd
- field public static final int METADATA_UNTETHERED_LEFT_ICON = 7; // 0x7
- field public static final int METADATA_UNTETHERED_LEFT_LOW_BATTERY_THRESHOLD = 21; // 0x15
- field public static final int METADATA_UNTETHERED_RIGHT_BATTERY = 11; // 0xb
- field public static final int METADATA_UNTETHERED_RIGHT_CHARGING = 14; // 0xe
- field public static final int METADATA_UNTETHERED_RIGHT_ICON = 8; // 0x8
- field public static final int METADATA_UNTETHERED_RIGHT_LOW_BATTERY_THRESHOLD = 22; // 0x16
- }
-
- public final class BluetoothHeadset implements android.bluetooth.BluetoothProfile {
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean connect(android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int connectAudio();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean disconnect(android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int disconnectAudio();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getAudioState(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isInbandRingingEnabled();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean startScoUsingVirtualVoiceCall();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean stopScoUsingVirtualVoiceCall();
- }
-
- public final class BluetoothHeadsetClient implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
- method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
- method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
- field @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.headsetprofile.action.CONNECTION_STATE_CHANGED";
- }
-
- public final class BluetoothHearingAid implements android.bluetooth.BluetoothProfile {
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public long getHiSyncId(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
- }
-
- public final class BluetoothHidDevice implements android.bluetooth.BluetoothProfile {
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
- }
-
- public final class BluetoothHidHost implements android.bluetooth.BluetoothProfile {
- method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.input.profile.action.CONNECTION_STATE_CHANGED";
- }
-
- public final class BluetoothLeAudio implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getAudioLocation(@NonNull android.bluetooth.BluetoothDevice);
- }
-
- public final class BluetoothMap implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
- method public void close();
- method protected void finalize();
- method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.map.profile.action.CONNECTION_STATE_CHANGED";
- }
-
- public final class BluetoothMapClient implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
- method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
- method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.SEND_SMS}) public boolean sendMessage(@NonNull android.bluetooth.BluetoothDevice, @NonNull java.util.Collection<android.net.Uri>, @NonNull String, @Nullable android.app.PendingIntent, @Nullable android.app.PendingIntent);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
- field @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.mapmce.profile.action.CONNECTION_STATE_CHANGED";
- }
-
- public final class BluetoothPan implements android.bluetooth.BluetoothProfile {
- method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean isTetheringOn();
- method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.TETHER_PRIVILEGED}) public void setBluetoothTethering(boolean);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pan.profile.action.CONNECTION_STATE_CHANGED";
- field public static final String ACTION_TETHERING_STATE_CHANGED = "android.bluetooth.action.TETHERING_STATE_CHANGED";
- field public static final String EXTRA_LOCAL_ROLE = "android.bluetooth.pan.extra.LOCAL_ROLE";
- field public static final String EXTRA_TETHERING_STATE = "android.bluetooth.extra.TETHERING_STATE";
- field public static final int LOCAL_NAP_ROLE = 1; // 0x1
- field public static final int LOCAL_PANU_ROLE = 2; // 0x2
- field public static final int PAN_ROLE_NONE = 0; // 0x0
- field public static final int REMOTE_NAP_ROLE = 1; // 0x1
- field public static final int REMOTE_PANU_ROLE = 2; // 0x2
- field public static final int TETHERING_STATE_OFF = 1; // 0x1
- field public static final int TETHERING_STATE_ON = 2; // 0x2
- }
-
- public class BluetoothPbap implements android.bluetooth.BluetoothProfile {
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pbap.profile.action.CONNECTION_STATE_CHANGED";
- }
-
- public final class BluetoothPbapClient implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
- method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
- method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
- field @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pbapclient.profile.action.CONNECTION_STATE_CHANGED";
- }
-
- public interface BluetoothProfile {
- field public static final int A2DP_SINK = 11; // 0xb
- field public static final int AVRCP_CONTROLLER = 12; // 0xc
- field public static final int CONNECTION_POLICY_ALLOWED = 100; // 0x64
- field public static final int CONNECTION_POLICY_FORBIDDEN = 0; // 0x0
- field public static final int CONNECTION_POLICY_UNKNOWN = -1; // 0xffffffff
- field public static final int HEADSET_CLIENT = 16; // 0x10
- field public static final int MAP_CLIENT = 18; // 0x12
- field public static final int PAN = 5; // 0x5
- field public static final int PBAP_CLIENT = 17; // 0x11
- field @Deprecated public static final int PRIORITY_OFF = 0; // 0x0
- field @Deprecated public static final int PRIORITY_ON = 100; // 0x64
- field public static final int VOLUME_CONTROL = 23; // 0x17
- }
-
- public final class BluetoothStatusCodes {
- field public static final int ERROR_ANOTHER_ACTIVE_OOB_REQUEST = 1000; // 0x3e8
- field public static final int ERROR_AUDIO_DEVICE_ALREADY_CONNECTED = 1116; // 0x45c
- field public static final int ERROR_AUDIO_DEVICE_ALREADY_DISCONNECTED = 1117; // 0x45d
- field public static final int ERROR_AUDIO_ROUTE_BLOCKED = 1118; // 0x45e
- field public static final int ERROR_CALL_ACTIVE = 1119; // 0x45f
- field public static final int ERROR_NOT_ACTIVE_DEVICE = 12; // 0xc
- field public static final int ERROR_NO_ACTIVE_DEVICES = 13; // 0xd
- field public static final int ERROR_PROFILE_NOT_CONNECTED = 14; // 0xe
- field public static final int ERROR_TIMEOUT = 15; // 0xf
- }
-
- public final class BluetoothUuid {
- method public static boolean containsAnyUuid(@Nullable android.os.ParcelUuid[], @Nullable android.os.ParcelUuid[]);
- method @NonNull public static android.os.ParcelUuid parseUuidFrom(@Nullable byte[]);
- field @NonNull public static final android.os.ParcelUuid A2DP_SINK;
- field @NonNull public static final android.os.ParcelUuid A2DP_SOURCE;
- field @NonNull public static final android.os.ParcelUuid ADV_AUDIO_DIST;
- field @NonNull public static final android.os.ParcelUuid AVRCP_CONTROLLER;
- field @NonNull public static final android.os.ParcelUuid AVRCP_TARGET;
- field @NonNull public static final android.os.ParcelUuid BASE_UUID;
- field @NonNull public static final android.os.ParcelUuid BNEP;
- field @NonNull public static final android.os.ParcelUuid CAP;
- field @NonNull public static final android.os.ParcelUuid COORDINATED_SET;
- field @NonNull public static final android.os.ParcelUuid DIP;
- field @NonNull public static final android.os.ParcelUuid GENERIC_MEDIA_CONTROL;
- field @NonNull public static final android.os.ParcelUuid HAS;
- field @NonNull public static final android.os.ParcelUuid HEARING_AID;
- field @NonNull public static final android.os.ParcelUuid HFP;
- field @NonNull public static final android.os.ParcelUuid HFP_AG;
- field @NonNull public static final android.os.ParcelUuid HID;
- field @NonNull public static final android.os.ParcelUuid HOGP;
- field @NonNull public static final android.os.ParcelUuid HSP;
- field @NonNull public static final android.os.ParcelUuid HSP_AG;
- field @NonNull public static final android.os.ParcelUuid LE_AUDIO;
- field @NonNull public static final android.os.ParcelUuid MAP;
- field @NonNull public static final android.os.ParcelUuid MAS;
- field @NonNull public static final android.os.ParcelUuid MEDIA_CONTROL;
- field @NonNull public static final android.os.ParcelUuid MNS;
- field @NonNull public static final android.os.ParcelUuid NAP;
- field @NonNull public static final android.os.ParcelUuid OBEX_OBJECT_PUSH;
- field @NonNull public static final android.os.ParcelUuid PANU;
- field @NonNull public static final android.os.ParcelUuid PBAP_PCE;
- field @NonNull public static final android.os.ParcelUuid PBAP_PSE;
- field @NonNull public static final android.os.ParcelUuid SAP;
- field public static final int UUID_BYTES_128_BIT = 16; // 0x10
- field public static final int UUID_BYTES_16_BIT = 2; // 0x2
- field public static final int UUID_BYTES_32_BIT = 4; // 0x4
- field @NonNull public static final android.os.ParcelUuid VOLUME_CONTROL;
- }
-
- public final class BluetoothVolumeControl implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void close();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) protected void finalize();
- method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setVolume(@Nullable android.bluetooth.BluetoothDevice, @IntRange(from=0, to=255) int);
- field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.volume-control.profile.action.CONNECTION_STATE_CHANGED";
- }
-
- public final class BufferConstraint implements android.os.Parcelable {
- ctor public BufferConstraint(int, int, int);
- method public int describeContents();
- method public int getDefaultMillis();
- method public int getMaxMillis();
- method public int getMinMillis();
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BufferConstraint> CREATOR;
- }
-
- public final class BufferConstraints implements android.os.Parcelable {
- ctor public BufferConstraints(@NonNull java.util.List<android.bluetooth.BufferConstraint>);
- method public int describeContents();
- method @Nullable public android.bluetooth.BufferConstraint forCodec(int);
- method public void writeToParcel(@NonNull android.os.Parcel, int);
- field public static final int BUFFER_CODEC_MAX_NUM = 32; // 0x20
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BufferConstraints> CREATOR;
- }
-
- public final class OobData implements android.os.Parcelable {
- method @NonNull public byte[] getClassOfDevice();
- method @NonNull public byte[] getClassicLength();
- method @NonNull public byte[] getConfirmationHash();
- method @NonNull public byte[] getDeviceAddressWithType();
- method @Nullable public byte[] getDeviceName();
- method @Nullable public byte[] getLeAppearance();
- method @NonNull public int getLeDeviceRole();
- method @NonNull public int getLeFlags();
- method @Nullable public byte[] getLeTemporaryKey();
- method @NonNull public byte[] getRandomizerHash();
- field public static final int CLASS_OF_DEVICE_OCTETS = 3; // 0x3
- field public static final int CONFIRMATION_OCTETS = 16; // 0x10
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.OobData> CREATOR;
- field public static final int DEVICE_ADDRESS_OCTETS = 7; // 0x7
- field public static final int LE_APPEARANCE_OCTETS = 2; // 0x2
- field public static final int LE_DEVICE_FLAG_OCTETS = 1; // 0x1
- field public static final int LE_DEVICE_ROLE_BOTH_PREFER_CENTRAL = 3; // 0x3
- field public static final int LE_DEVICE_ROLE_BOTH_PREFER_PERIPHERAL = 2; // 0x2
- field public static final int LE_DEVICE_ROLE_CENTRAL_ONLY = 1; // 0x1
- field public static final int LE_DEVICE_ROLE_OCTETS = 1; // 0x1
- field public static final int LE_DEVICE_ROLE_PERIPHERAL_ONLY = 0; // 0x0
- field public static final int LE_FLAG_BREDR_NOT_SUPPORTED = 2; // 0x2
- field public static final int LE_FLAG_GENERAL_DISCOVERY_MODE = 1; // 0x1
- field public static final int LE_FLAG_LIMITED_DISCOVERY_MODE = 0; // 0x0
- field public static final int LE_FLAG_SIMULTANEOUS_CONTROLLER = 3; // 0x3
- field public static final int LE_FLAG_SIMULTANEOUS_HOST = 4; // 0x4
- field public static final int LE_TK_OCTETS = 16; // 0x10
- field public static final int OOB_LENGTH_OCTETS = 2; // 0x2
- field public static final int RANDOMIZER_OCTETS = 16; // 0x10
- }
-
- public static final class OobData.ClassicBuilder {
- ctor public OobData.ClassicBuilder(@NonNull byte[], @NonNull byte[], @NonNull byte[]);
- method @NonNull public android.bluetooth.OobData build();
- method @NonNull public android.bluetooth.OobData.ClassicBuilder setClassOfDevice(@NonNull byte[]);
- method @NonNull public android.bluetooth.OobData.ClassicBuilder setDeviceName(@NonNull byte[]);
- method @NonNull public android.bluetooth.OobData.ClassicBuilder setRandomizerHash(@NonNull byte[]);
- }
-
- public static final class OobData.LeBuilder {
- ctor public OobData.LeBuilder(@NonNull byte[], @NonNull byte[], int);
- method @NonNull public android.bluetooth.OobData build();
- method @NonNull public android.bluetooth.OobData.LeBuilder setDeviceName(@NonNull byte[]);
- method @NonNull public android.bluetooth.OobData.LeBuilder setLeFlags(int);
- method @NonNull public android.bluetooth.OobData.LeBuilder setLeTemporaryKey(@NonNull byte[]);
- method @NonNull public android.bluetooth.OobData.LeBuilder setRandomizerHash(@NonNull byte[]);
- }
-
- public final class UidTraffic implements java.lang.Cloneable android.os.Parcelable {
- method public long getRxBytes();
- method public long getTxBytes();
- method public int getUid();
- field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.UidTraffic> CREATOR;
- }
-
-}
-
-package android.bluetooth.le {
-
- public final class AdvertiseSettings implements android.os.Parcelable {
- method public int getOwnAddressType();
- }
-
- public static final class AdvertiseSettings.Builder {
- method @NonNull public android.bluetooth.le.AdvertiseSettings.Builder setOwnAddressType(int);
- }
-
- public final class AdvertisingSetParameters implements android.os.Parcelable {
- method public int getOwnAddressType();
- field public static final int ADDRESS_TYPE_DEFAULT = -1; // 0xffffffff
- field public static final int ADDRESS_TYPE_PUBLIC = 0; // 0x0
- field public static final int ADDRESS_TYPE_RANDOM = 1; // 0x1
- }
-
- public static final class AdvertisingSetParameters.Builder {
- method @NonNull public android.bluetooth.le.AdvertisingSetParameters.Builder setOwnAddressType(int);
- }
-
- public final class BluetoothLeScanner {
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.UPDATE_DEVICE_STATS}) public void startScanFromSource(android.os.WorkSource, android.bluetooth.le.ScanCallback);
- method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.UPDATE_DEVICE_STATS}) public void startScanFromSource(java.util.List<android.bluetooth.le.ScanFilter>, android.bluetooth.le.ScanSettings, android.os.WorkSource, android.bluetooth.le.ScanCallback);
- method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public void startTruncatedScan(java.util.List<android.bluetooth.le.TruncatedFilter>, android.bluetooth.le.ScanSettings, android.bluetooth.le.ScanCallback);
- }
-
- @Deprecated public final class ResultStorageDescriptor implements android.os.Parcelable {
- ctor @Deprecated public ResultStorageDescriptor(int, int, int);
- method @Deprecated public int describeContents();
- method @Deprecated public int getLength();
- method @Deprecated public int getOffset();
- method @Deprecated public int getType();
- method @Deprecated public void writeToParcel(android.os.Parcel, int);
- field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.ResultStorageDescriptor> CREATOR;
- }
-
- public final class ScanFilter implements android.os.Parcelable {
- method public int getAddressType();
- method @Nullable public byte[] getIrk();
- }
-
- public static final class ScanFilter.Builder {
- method @NonNull public android.bluetooth.le.ScanFilter.Builder setDeviceAddress(@NonNull String, int);
- method @NonNull public android.bluetooth.le.ScanFilter.Builder setDeviceAddress(@NonNull String, int, @NonNull byte[]);
- field public static final int LEN_IRK_OCTETS = 16; // 0x10
- }
-
- public final class ScanSettings implements android.os.Parcelable {
- field public static final int SCAN_MODE_AMBIENT_DISCOVERY = 3; // 0x3
- field public static final int SCAN_RESULT_TYPE_ABBREVIATED = 1; // 0x1
- field public static final int SCAN_RESULT_TYPE_FULL = 0; // 0x0
- }
-
- public static final class ScanSettings.Builder {
- method public android.bluetooth.le.ScanSettings.Builder setScanResultType(int);
- }
-
- @Deprecated public final class TruncatedFilter {
- ctor @Deprecated public TruncatedFilter(android.bluetooth.le.ScanFilter, java.util.List<android.bluetooth.le.ResultStorageDescriptor>);
- method @Deprecated public android.bluetooth.le.ScanFilter getFilter();
- method @Deprecated public java.util.List<android.bluetooth.le.ResultStorageDescriptor> getStorageDescriptors();
- }
-
-}
-
package android.companion {
public final class AssociationInfo implements android.os.Parcelable {
@@ -2733,18 +2262,6 @@
method public boolean isSelfManaged();
}
- public final class AssociationRequest implements android.os.Parcelable {
- method @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_SELF_MANAGED) public boolean isForceConfirmation();
- method @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_SELF_MANAGED) public boolean isSelfManaged();
- field @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING) public static final String DEVICE_PROFILE_APP_STREAMING = "android.app.role.COMPANION_DEVICE_APP_STREAMING";
- field @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION) public static final String DEVICE_PROFILE_AUTOMOTIVE_PROJECTION = "android.app.role.SYSTEM_AUTOMOTIVE_PROJECTION";
- }
-
- public static final class AssociationRequest.Builder {
- method @NonNull @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_SELF_MANAGED) public android.companion.AssociationRequest.Builder setForceConfirmation(boolean);
- method @NonNull @RequiresPermission(android.Manifest.permission.REQUEST_COMPANION_SELF_MANAGED) public android.companion.AssociationRequest.Builder setSelfManaged(boolean);
- }
-
public final class CompanionDeviceManager {
method @RequiresPermission("android.permission.MANAGE_COMPANION_DEVICES") public void addOnAssociationsChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.companion.CompanionDeviceManager.OnAssociationsChangedListener);
method @RequiresPermission(android.Manifest.permission.ASSOCIATE_COMPANION_DEVICES) public void associate(@NonNull String, @NonNull android.net.MacAddress, @NonNull byte[]);
@@ -2768,12 +2285,26 @@
method @Nullable @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.companion.virtual.VirtualDeviceManager.VirtualDevice createVirtualDevice(int, @NonNull android.companion.virtual.VirtualDeviceParams);
}
+ public static interface VirtualDeviceManager.ActivityListener {
+ method public void onDisplayEmpty(int);
+ method public void onTopActivityChanged(int, @NonNull android.content.ComponentName);
+ }
+
+ public static interface VirtualDeviceManager.LaunchCallback {
+ method public void onLaunchFailed();
+ method public void onLaunchSuccess();
+ }
+
public static class VirtualDeviceManager.VirtualDevice implements java.lang.AutoCloseable {
+ method public void addActivityListener(@NonNull android.companion.virtual.VirtualDeviceManager.ActivityListener);
+ method public void addActivityListener(@NonNull android.companion.virtual.VirtualDeviceManager.ActivityListener, @NonNull java.util.concurrent.Executor);
method public void close();
method @Nullable public android.hardware.display.VirtualDisplay createVirtualDisplay(int, int, int, @Nullable android.view.Surface, int, @Nullable android.os.Handler, @Nullable android.hardware.display.VirtualDisplay.Callback);
method @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.hardware.input.VirtualKeyboard createVirtualKeyboard(@NonNull android.hardware.display.VirtualDisplay, @NonNull String, int, int);
method @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.hardware.input.VirtualMouse createVirtualMouse(@NonNull android.hardware.display.VirtualDisplay, @NonNull String, int, int);
method @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.hardware.input.VirtualTouchscreen createVirtualTouchscreen(@NonNull android.hardware.display.VirtualDisplay, @NonNull String, int, int);
+ method public void launchPendingIntent(int, @NonNull android.app.PendingIntent, @NonNull java.util.concurrent.Executor, @NonNull android.companion.virtual.VirtualDeviceManager.LaunchCallback);
+ method public void removeActivityListener(@NonNull android.companion.virtual.VirtualDeviceManager.ActivityListener);
}
public final class VirtualDeviceParams implements android.os.Parcelable {
@@ -5245,6 +4776,7 @@
method @CheckResult @RequiresPermission(android.Manifest.permission.MANAGE_USB) public int enableUsbData(boolean);
method @CheckResult @RequiresPermission(android.Manifest.permission.MANAGE_USB) public int enableUsbDataWhileDocked();
method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USB) public android.hardware.usb.UsbPortStatus getStatus();
+ method @CheckResult @RequiresPermission(android.Manifest.permission.MANAGE_USB) public int resetUsbPort();
method @RequiresPermission(android.Manifest.permission.MANAGE_USB) public void setRoles(int, int);
field public static final int ENABLE_LIMIT_POWER_TRANSFER_ERROR_INTERNAL = 1; // 0x1
field public static final int ENABLE_LIMIT_POWER_TRANSFER_ERROR_NOT_SUPPORTED = 2; // 0x2
@@ -5797,23 +5329,41 @@
public final class SatellitePvt implements android.os.Parcelable {
method public int describeContents();
method @Nullable public android.location.SatellitePvt.ClockInfo getClockInfo();
+ method public int getEphemerisSource();
method @FloatRange public double getIonoDelayMeters();
+ method @IntRange(from=0, to=1023) public int getIssueOfDataClock();
+ method @IntRange(from=0, to=255) public int getIssueOfDataEphemeris();
method @Nullable public android.location.SatellitePvt.PositionEcef getPositionEcef();
+ method @IntRange(from=0, to=604784) public int getTimeOfClock();
+ method @IntRange(from=0, to=604784) public int getTimeOfEphemeris();
method @FloatRange public double getTropoDelayMeters();
method @Nullable public android.location.SatellitePvt.VelocityEcef getVelocityEcef();
method public boolean hasIono();
+ method public boolean hasIssueOfDataClock();
+ method public boolean hasIssueOfDataEphemeris();
method public boolean hasPositionVelocityClockInfo();
+ method public boolean hasTimeOfClock();
+ method public boolean hasTimeOfEphemeris();
method public boolean hasTropo();
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.location.SatellitePvt> CREATOR;
+ field public static final int EPHEMERIS_SOURCE_DEMODULATED = 0; // 0x0
+ field public static final int EPHEMERIS_SOURCE_OTHER = 3; // 0x3
+ field public static final int EPHEMERIS_SOURCE_SERVER_LONG_TERM = 2; // 0x2
+ field public static final int EPHEMERIS_SOURCE_SERVER_NORMAL = 1; // 0x1
}
public static final class SatellitePvt.Builder {
ctor public SatellitePvt.Builder();
method @NonNull public android.location.SatellitePvt build();
method @NonNull public android.location.SatellitePvt.Builder setClockInfo(@NonNull android.location.SatellitePvt.ClockInfo);
+ method @NonNull public android.location.SatellitePvt.Builder setEphemerisSource(int);
method @NonNull public android.location.SatellitePvt.Builder setIonoDelayMeters(@FloatRange(from=0.0f, to=100.0f) double);
+ method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataClock(@IntRange(from=0, to=1023) int);
+ method @NonNull public android.location.SatellitePvt.Builder setIssueOfDataEphemeris(@IntRange(from=0, to=255) int);
method @NonNull public android.location.SatellitePvt.Builder setPositionEcef(@NonNull android.location.SatellitePvt.PositionEcef);
+ method @NonNull public android.location.SatellitePvt.Builder setTimeOfClock(@IntRange(from=0, to=604784) int);
+ method @NonNull public android.location.SatellitePvt.Builder setTimeOfEphemeris(@IntRange(from=0, to=604784) int);
method @NonNull public android.location.SatellitePvt.Builder setTropoDelayMeters(@FloatRange(from=0.0f, to=100.0f) double);
method @NonNull public android.location.SatellitePvt.Builder setVelocityEcef(@NonNull android.location.SatellitePvt.VelocityEcef);
}
@@ -5998,6 +5548,7 @@
method public boolean isAudioServerRunning();
method public boolean isHdmiSystemAudioSupported();
method @RequiresPermission(android.Manifest.permission.CALL_AUDIO_INTERCEPTION) public boolean isPstnCallAudioInterceptable();
+ method public static boolean isUltrasoundSupported();
method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void muteAwaitConnection(@NonNull int[], @NonNull android.media.AudioDeviceAttributes, long, @NonNull java.util.concurrent.TimeUnit) throws java.lang.IllegalStateException;
method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int registerAudioPolicy(@NonNull android.media.audiopolicy.AudioPolicy);
method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void registerMuteAwaitConnectionCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.AudioManager.MuteAwaitConnectionCallback);
@@ -11184,6 +10735,7 @@
method public void onCreate();
method public void onDestroy();
method public void onGameTaskFocusChanged(boolean);
+ method @RequiresPermission(android.Manifest.permission.FORCE_STOP_PACKAGES) public final boolean restartGame();
method public void setTaskOverlayView(@NonNull android.view.View, @NonNull android.view.ViewGroup.LayoutParams);
method public void takeScreenshot(@NonNull java.util.concurrent.Executor, @NonNull android.service.games.GameSession.ScreenshotCallback);
}
@@ -13403,6 +12955,7 @@
}
public static class TelephonyManager.ModemActivityInfoException extends java.lang.Exception {
+ ctor public TelephonyManager.ModemActivityInfoException(int);
method public int getErrorCode();
field public static final int ERROR_INVALID_INFO_RECEIVED = 2; // 0x2
field public static final int ERROR_MODEM_RESPONSE_ERROR = 3; // 0x3
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index ff26ae8..2303ddb 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -103,6 +103,7 @@
package android.app {
@UiContext public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.OnBackInvokedDispatcherOwner android.view.View.OnCreateContextMenuListener android.view.Window.Callback {
+ method public final boolean addDumpable(@NonNull android.util.Dumpable);
method public void onMovedToDisplay(int, android.content.res.Configuration);
}
@@ -617,14 +618,6 @@
}
-package android.bluetooth {
-
- public final class BluetoothClass implements android.os.Parcelable {
- method public int getClassOfDevice();
- }
-
-}
-
package android.companion {
public abstract class CompanionDeviceService extends android.app.Service {
@@ -1801,7 +1794,6 @@
method public static android.os.VibrationEffect get(int, boolean);
method @Nullable public static android.os.VibrationEffect get(android.net.Uri, android.content.Context);
method public abstract long getDuration();
- method @NonNull public static android.os.VibrationEffect.WaveformBuilder startWaveform();
field public static final int EFFECT_POP = 4; // 0x4
field public static final int EFFECT_STRENGTH_LIGHT = 0; // 0x0
field public static final int EFFECT_STRENGTH_MEDIUM = 1; // 0x1
@@ -1819,20 +1811,6 @@
field @NonNull public static final android.os.Parcelable.Creator<android.os.VibrationEffect.Composed> CREATOR;
}
- public static final class VibrationEffect.Composition {
- method @NonNull public android.os.VibrationEffect.Composition addEffect(@NonNull android.os.VibrationEffect);
- method @NonNull public android.os.VibrationEffect.Composition addEffect(@NonNull android.os.VibrationEffect, @IntRange(from=0) int);
- }
-
- public static final class VibrationEffect.WaveformBuilder {
- method @NonNull public android.os.VibrationEffect.WaveformBuilder addRamp(@FloatRange(from=0.0f, to=1.0f) float, @IntRange(from=0) int);
- method @NonNull public android.os.VibrationEffect.WaveformBuilder addRamp(@FloatRange(from=0.0f, to=1.0f) float, @FloatRange(from=1.0f) float, @IntRange(from=0) int);
- method @NonNull public android.os.VibrationEffect.WaveformBuilder addStep(@FloatRange(from=0.0f, to=1.0f) float, @IntRange(from=0) int);
- method @NonNull public android.os.VibrationEffect.WaveformBuilder addStep(@FloatRange(from=0.0f, to=1.0f) float, @FloatRange(from=1.0f) float, @IntRange(from=0) int);
- method @NonNull public android.os.VibrationEffect build();
- method @NonNull public android.os.VibrationEffect build(int);
- }
-
public abstract class Vibrator {
method public int getDefaultVibrationIntensity(int);
field public static final int VIBRATION_INTENSITY_HIGH = 3; // 0x3
@@ -2507,6 +2485,7 @@
method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void refreshUiccProfile();
method @Deprecated public void setCarrierTestOverride(String, String, String, String, String, String, String);
method public void setCarrierTestOverride(String, String, String, String, String, String, String, String, String);
+ method @RequiresPermission(android.Manifest.permission.BIND_TELECOM_CONNECTION_SERVICE) public void setVoiceServiceStateOverride(boolean);
field public static final int UNKNOWN_CARRIER_ID_LIST_VERSION = -1; // 0xffffffff
}
diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java
index 479e6bf..6b0aef8 100644
--- a/core/java/android/accessibilityservice/AccessibilityService.java
+++ b/core/java/android/accessibilityservice/AccessibilityService.java
@@ -1400,7 +1400,9 @@
* </p>
*
* @return the current magnification scale
+ * @deprecated Use {@link #getMagnificationConfig()} instead
*/
+ @Deprecated
public float getScale() {
final IAccessibilityServiceConnection connection =
AccessibilityInteractionClient.getInstance(mService).getConnection(
@@ -1435,7 +1437,9 @@
*
* @return the unscaled screen-relative X coordinate of the center of
* the magnified region
+ * @deprecated Use {@link #getMagnificationConfig()} instead
*/
+ @Deprecated
public float getCenterX() {
final IAccessibilityServiceConnection connection =
AccessibilityInteractionClient.getInstance(mService).getConnection(
@@ -1470,7 +1474,9 @@
*
* @return the unscaled screen-relative Y coordinate of the center of
* the magnified region
+ * @deprecated Use {@link #getMagnificationConfig()} instead
*/
+ @Deprecated
public float getCenterY() {
final IAccessibilityServiceConnection connection =
AccessibilityInteractionClient.getInstance(mService).getConnection(
@@ -1509,7 +1515,9 @@
*
* @return the region of the screen currently active for magnification, or an empty region
* if magnification is not active.
+ * @deprecated Use {@link #getCurrentMagnificationRegion()} instead
*/
+ @Deprecated
@NonNull
public Region getMagnificationRegion() {
final IAccessibilityServiceConnection connection =
@@ -1677,7 +1685,9 @@
* @param animate {@code true} to animate from the current scale or
* {@code false} to set the scale immediately
* @return {@code true} on success, {@code false} on failure
+ * @deprecated Use {@link #setMagnificationConfig(MagnificationConfig, boolean)} instead
*/
+ @Deprecated
public boolean setScale(float scale, boolean animate) {
final IAccessibilityServiceConnection connection =
AccessibilityInteractionClient.getInstance(mService).getConnection(
@@ -1717,7 +1727,9 @@
* @param animate {@code true} to animate from the current viewport
* center or {@code false} to set the center immediately
* @return {@code true} on success, {@code false} on failure
+ * @deprecated Use {@link #setMagnificationConfig(MagnificationConfig, boolean)} instead
*/
+ @Deprecated
public boolean setCenter(float centerX, float centerY, boolean animate) {
final IAccessibilityServiceConnection connection =
AccessibilityInteractionClient.getInstance(mService).getConnection(
@@ -1754,7 +1766,11 @@
* magnification is focused
* @param centerY the new Y coordinate, in unscaled coordinates, around which
* magnification is focused
+ * @deprecated Override
+ * {@link #onMagnificationChanged(MagnificationController, Region, MagnificationConfig)}
+ * instead
*/
+ @Deprecated
void onMagnificationChanged(@NonNull MagnificationController controller,
@NonNull Region region, float scale, float centerX, float centerY);
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index a7b96a6..38138d8 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -7098,6 +7098,7 @@
* @hide
*/
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
+ @TestApi
public final boolean addDumpable(@NonNull Dumpable dumpable) {
if (mDumpableContainer == null) {
mDumpableContainer = new DumpableContainerImpl();
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index a140983..89dd9ef 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -65,6 +65,8 @@
import android.os.LocaleList;
import android.os.Parcel;
import android.os.Parcelable;
+import android.os.PowerExemptionManager;
+import android.os.PowerExemptionManager.ReasonCode;
import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -937,6 +939,121 @@
@EnabledSince(targetSdkVersion = VERSION_CODES.S)
public static final long LOCK_DOWN_CLOSE_SYSTEM_DIALOGS = 174664365L;
+ // The background process restriction levels. The definitions here are meant for internal
+ // bookkeeping only.
+
+ /**
+ * Not a valid restriction level.
+ *
+ * @hide
+ */
+ public static final int RESTRICTION_LEVEL_UNKNOWN = 0;
+
+ /**
+ * No background restrictions at all, this should NEVER be used
+ * for any process other than selected system processes, currently it's reserved.
+ *
+ * <p>In the future, apps in {@link #RESTRICTION_LEVEL_EXEMPTED} would receive permissive
+ * background restrictions to protect the system from buggy behaviors; in other words,
+ * the {@link #RESTRICTION_LEVEL_EXEMPTED} would not be the truly "unrestricted" state, while
+ * the {@link #RESTRICTION_LEVEL_UNRESTRICTED} here would be the last resort if there is
+ * a strong reason to grant such a capability to a system app. </p>
+ *
+ * @hide
+ */
+ public static final int RESTRICTION_LEVEL_UNRESTRICTED = 10;
+
+ /**
+ * The default background restriction level for the "unrestricted" apps set by the user,
+ * where it'll have the {@link android.app.AppOpsManager#OP_RUN_ANY_IN_BACKGROUND} set to
+ * ALLOWED, being added into the device idle allow list; however there will be still certain
+ * restrictions to apps in this level.
+ *
+ * @hide
+ */
+ public static final int RESTRICTION_LEVEL_EXEMPTED = 20;
+
+ /**
+ * The default background restriction level for all other apps, they'll be moved between
+ * various standby buckets, including
+ * {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_ACTIVE},
+ * {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_WORKING_SET},
+ * {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_FREQUENT},
+ * {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_RARE}.
+ *
+ * @hide
+ */
+ public static final int RESTRICTION_LEVEL_ADAPTIVE_BUCKET = 30;
+
+ /**
+ * The background restriction level where the apps will be placed in the restricted bucket
+ * {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_RESTRICTED}.
+ *
+ * @hide
+ */
+ public static final int RESTRICTION_LEVEL_RESTRICTED_BUCKET = 40;
+
+ /**
+ * The background restricted level, where apps would get more restrictions,
+ * such as not allowed to launch foreground services besides on TOP.
+ *
+ * @hide
+ */
+ public static final int RESTRICTION_LEVEL_BACKGROUND_RESTRICTED = 50;
+
+ /**
+ * The most restricted level where the apps are considered "in-hibernation",
+ * its package visibility to the rest of the system is limited.
+ *
+ * @hide
+ */
+ public static final int RESTRICTION_LEVEL_HIBERNATION = 60;
+
+ /**
+ * Not a valid restriction level, it defines the maximum numerical value of restriction level.
+ *
+ * @hide
+ */
+ public static final int RESTRICTION_LEVEL_MAX = 100;
+
+ /** @hide */
+ @IntDef(prefix = { "RESTRICTION_LEVEL_" }, value = {
+ RESTRICTION_LEVEL_UNKNOWN,
+ RESTRICTION_LEVEL_UNRESTRICTED,
+ RESTRICTION_LEVEL_EXEMPTED,
+ RESTRICTION_LEVEL_ADAPTIVE_BUCKET,
+ RESTRICTION_LEVEL_RESTRICTED_BUCKET,
+ RESTRICTION_LEVEL_BACKGROUND_RESTRICTED,
+ RESTRICTION_LEVEL_HIBERNATION,
+ RESTRICTION_LEVEL_MAX,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface RestrictionLevel{}
+
+ /** @hide */
+ public static String restrictionLevelToName(@RestrictionLevel int level) {
+ switch (level) {
+ case RESTRICTION_LEVEL_UNKNOWN:
+ return "unknown";
+ case RESTRICTION_LEVEL_UNRESTRICTED:
+ return "unrestricted";
+ case RESTRICTION_LEVEL_EXEMPTED:
+ return "exempted";
+ case RESTRICTION_LEVEL_ADAPTIVE_BUCKET:
+ return "adaptive_bucket";
+ case RESTRICTION_LEVEL_RESTRICTED_BUCKET:
+ return "restricted_bucket";
+ case RESTRICTION_LEVEL_BACKGROUND_RESTRICTED:
+ return "background_restricted";
+ case RESTRICTION_LEVEL_HIBERNATION:
+ return "hibernation";
+ case RESTRICTION_LEVEL_MAX:
+ return "max";
+ default:
+ return "";
+ }
+ }
+
/** @hide */
public int getFrontActivityScreenCompatMode() {
try {
@@ -4950,6 +5067,27 @@
}
/**
+ * @return The reason code of whether or not the given UID should be exempted from background
+ * restrictions here.
+ *
+ * <p>
+ * Note: Call it with caution as it'll try to acquire locks in other services.
+ * </p>
+ *
+ * @hide
+ */
+ @RequiresPermission(android.Manifest.permission.DEVICE_POWER)
+ @ReasonCode
+ public int getBackgroundRestrictionExemptionReason(int uid) {
+ try {
+ return getService().getBackgroundRestrictionExemptionReason(uid);
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ return PowerExemptionManager.REASON_DENIED;
+ }
+
+ /**
* A subset of immutable pending intent information suitable for caching on the client side.
*
* @hide
diff --git a/core/java/android/app/ActivityManagerInternal.java b/core/java/android/app/ActivityManagerInternal.java
index 74a5526..cce7dd3 100644
--- a/core/java/android/app/ActivityManagerInternal.java
+++ b/core/java/android/app/ActivityManagerInternal.java
@@ -22,6 +22,7 @@
import android.annotation.Nullable;
import android.annotation.UserIdInt;
import android.app.ActivityManager.ProcessCapability;
+import android.app.ActivityManager.RestrictionLevel;
import android.content.ComponentName;
import android.content.IIntentReceiver;
import android.content.IIntentSender;
@@ -714,4 +715,97 @@
*/
void notifyActivityEventChanged();
}
+
+ /**
+ * Get the restriction level of the given UID, if it hosts multiple packages,
+ * return least restricted level.
+ */
+ public abstract @RestrictionLevel int getRestrictionLevel(int uid);
+
+ /**
+ * Get the restriction level of the given package for given user id.
+ */
+ public abstract @RestrictionLevel int getRestrictionLevel(String pkg, @UserIdInt int userId);
+
+ /**
+ * Get whether or not apps would be put into restricted standby bucket automatically
+ * when it's background-restricted.
+ */
+ public abstract boolean isBgAutoRestrictedBucketFeatureFlagEnabled();
+
+ /**
+ * A listener interface, which will be notified on background restriction changes.
+ */
+ public interface AppBackgroundRestrictionListener {
+ /**
+ * Called when the background restriction level of given uid/package is changed.
+ */
+ default void onRestrictionLevelChanged(int uid, String packageName,
+ @RestrictionLevel int newLevel) {
+ }
+
+ /**
+ * Called when toggling the feature flag of moving to restricted standby bucket
+ * automatically on background-restricted.
+ */
+ default void onAutoRestrictedBucketFeatureFlagChanged(boolean autoRestrictedBucket) {
+ }
+ }
+
+ /**
+ * Register the background restriction listener callback.
+ */
+ public abstract void addAppBackgroundRestrictionListener(
+ @NonNull AppBackgroundRestrictionListener listener);
+
+ /**
+ * A listener interface, which will be notified on foreground service state changes.
+ */
+ public interface ForegroundServiceStateListener {
+ /**
+ * Call when the given process's foreground service state changes.
+ *
+ * @param packageName The package name of the process.
+ * @param uid The UID of the process.
+ * @param pid The pid of the process.
+ * @param started {@code true} if the process transits from non-FGS state to FGS state.
+ */
+ void onForegroundServiceStateChanged(String packageName, int uid, int pid, boolean started);
+ }
+
+ /**
+ * Register the foreground service state change listener callback.
+ */
+ public abstract void addForegroundServiceStateListener(
+ @NonNull ForegroundServiceStateListener listener);
+
+ /**
+ * A listener interface, which will be notified on the package sends a broadcast.
+ */
+ public interface BroadcastEventListener {
+ /**
+ * Called when the given package/uid is sending a broadcast.
+ */
+ void onSendingBroadcast(String packageName, int uid);
+ }
+
+ /**
+ * Register the broadcast event listener callback.
+ */
+ public abstract void addBroadcastEventListener(@NonNull BroadcastEventListener listener);
+
+ /**
+ * A listener interface, which will be notified on the package binding to a service.
+ */
+ public interface BindServiceEventListener {
+ /**
+ * Called when the given package/uid is binding to a service
+ */
+ void onBindingService(String packageName, int uid);
+ }
+
+ /**
+ * Register the bind service event listener callback.
+ */
+ public abstract void addBindServiceEventListener(@NonNull BindServiceEventListener listener);
}
diff --git a/core/java/android/app/ActivityTransitionState.java b/core/java/android/app/ActivityTransitionState.java
index 6261950..877e7d3 100644
--- a/core/java/android/app/ActivityTransitionState.java
+++ b/core/java/android/app/ActivityTransitionState.java
@@ -119,7 +119,7 @@
for (int i = mExitTransitionCoordinators.size() - 1; i >= 0; i--) {
WeakReference<ExitTransitionCoordinator> oldRef
= mExitTransitionCoordinators.valueAt(i);
- if (oldRef.get() == null) {
+ if (oldRef.refersTo(null)) {
mExitTransitionCoordinators.removeAt(i);
}
}
diff --git a/core/java/android/app/BroadcastOptions.java b/core/java/android/app/BroadcastOptions.java
index 7812aba..e31a566 100644
--- a/core/java/android/app/BroadcastOptions.java
+++ b/core/java/android/app/BroadcastOptions.java
@@ -16,6 +16,7 @@
package android.app;
+import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
@@ -52,6 +53,7 @@
private String[] mRequireNoneOfPermissions;
private long mRequireCompatChangeId = CHANGE_INVALID;
private boolean mRequireCompatChangeEnabled = true;
+ private long mIdForResponseEvent;
/**
* Change ID which is invalid.
@@ -164,6 +166,12 @@
public static final int TEMPORARY_WHITELIST_TYPE_FOREGROUND_SERVICE_NOT_ALLOWED =
PowerExemptionManager.TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_NOT_ALLOWED;
+ /**
+ * Corresponds to {@link #recordResponseEventWhileInBackground(long)}.
+ */
+ private static final String KEY_ID_FOR_RESPONSE_EVENT =
+ "android:broadcast.idForResponseEvent";
+
public static BroadcastOptions makeBasic() {
BroadcastOptions opts = new BroadcastOptions();
return opts;
@@ -198,6 +206,7 @@
mRequireNoneOfPermissions = opts.getStringArray(KEY_REQUIRE_NONE_OF_PERMISSIONS);
mRequireCompatChangeId = opts.getLong(KEY_REQUIRE_COMPAT_CHANGE_ID, CHANGE_INVALID);
mRequireCompatChangeEnabled = opts.getBoolean(KEY_REQUIRE_COMPAT_CHANGE_ENABLED, true);
+ mIdForResponseEvent = opts.getLong(KEY_ID_FOR_RESPONSE_EVENT);
}
/**
@@ -511,6 +520,28 @@
}
/**
+ * Sets whether events (such as posting a notification) originating from an app after it
+ * receives the broadcast while in background should be recorded as responses to the broadcast.
+ *
+ * @param id ID to be used for the response events corresponding to this broadcast. If the
+ * value is {@code 0} (default), then response events will not be recorded. Otherwise,
+ * they will be recorded with the ID provided.
+ *
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS)
+ public void recordResponseEventWhileInBackground(@IntRange(from = 0) long id) {
+ mIdForResponseEvent = id;
+ }
+
+ /** @hide */
+ @IntRange(from = 0)
+ public long getIdForResponseEvent() {
+ return mIdForResponseEvent;
+ }
+
+ /**
* Returns the created options as a Bundle, which can be passed to
* {@link android.content.Context#sendBroadcast(android.content.Intent)
* Context.sendBroadcast(Intent)} and related methods.
@@ -549,6 +580,9 @@
b.putLong(KEY_REQUIRE_COMPAT_CHANGE_ID, mRequireCompatChangeId);
b.putBoolean(KEY_REQUIRE_COMPAT_CHANGE_ENABLED, mRequireCompatChangeEnabled);
}
+ if (mIdForResponseEvent != 0) {
+ b.putLong(KEY_ID_FOR_RESPONSE_EVENT, mIdForResponseEvent);
+ }
return b.isEmpty() ? null : b;
}
}
diff --git a/core/java/android/app/IActivityManager.aidl b/core/java/android/app/IActivityManager.aidl
index bdcec42..82c419a 100644
--- a/core/java/android/app/IActivityManager.aidl
+++ b/core/java/android/app/IActivityManager.aidl
@@ -743,4 +743,14 @@
/** Blocks until all broadcast queues become idle. */
void waitForBroadcastIdle();
+
+ /**
+ * @return The reason code of whether or not the given UID should be exempted from background
+ * restrictions here.
+ *
+ * <p>
+ * Note: Call it with caution as it'll try to acquire locks in other services.
+ * </p>
+ */
+ int getBackgroundRestrictionExemptionReason(int uid);
}
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 779552f1..d57c288 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -6712,6 +6712,18 @@
return;
}
boolean isLowRam = ActivityManager.isLowRamDeviceStatic();
+
+ if (mSmallIcon != null
+ // Only bitmap icons can be downscaled.
+ && (mSmallIcon.getType() == Icon.TYPE_BITMAP
+ || mSmallIcon.getType() == Icon.TYPE_ADAPTIVE_BITMAP)) {
+ Resources resources = context.getResources();
+ int maxSize = resources.getDimensionPixelSize(
+ isLowRam ? R.dimen.notification_small_icon_size_low_ram
+ : R.dimen.notification_small_icon_size);
+ mSmallIcon.scaleDownIfNecessary(maxSize, maxSize);
+ }
+
if (mLargeIcon != null || largeIcon != null) {
Resources resources = context.getResources();
Class<? extends Style> style = getNotificationStyle();
diff --git a/core/java/android/app/ResourcesManager.java b/core/java/android/app/ResourcesManager.java
index bf3778d..f360bbed 100644
--- a/core/java/android/app/ResourcesManager.java
+++ b/core/java/android/app/ResourcesManager.java
@@ -678,8 +678,7 @@
int refCount = mResourceImpls.size();
for (int i = 0; i < refCount; i++) {
WeakReference<ResourcesImpl> weakImplRef = mResourceImpls.valueAt(i);
- ResourcesImpl impl = weakImplRef != null ? weakImplRef.get() : null;
- if (resourceImpl == impl) {
+ if (weakImplRef != null && weakImplRef.refersTo(resourceImpl)) {
return mResourceImpls.keyAt(i);
}
}
@@ -1671,7 +1670,7 @@
for (int i = mResourceImpls.size() - 1; i >= 0; i--) {
final ResourcesKey key = mResourceImpls.keyAt(i);
final WeakReference<ResourcesImpl> impl = mResourceImpls.valueAt(i);
- if (impl == null || impl.get() == null
+ if (impl == null || impl.refersTo(null)
|| !ArrayUtils.contains(key.mLoaders, loader)) {
continue;
}
diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java
index 64d3a9f..56c301f 100644
--- a/core/java/android/app/StatusBarManager.java
+++ b/core/java/android/app/StatusBarManager.java
@@ -44,6 +44,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Objects;
+import java.util.Set;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
@@ -214,6 +215,34 @@
public static final int CAMERA_LAUNCH_SOURCE_LIFT_TRIGGER = 2;
/**
+ * Session flag for {@link #registerSessionListener} indicating the listener
+ * is interested in sessions on the keygaurd
+ * @hide
+ */
+ public static final int SESSION_KEYGUARD = 1 << 0;
+
+ /**
+ * Session flag for {@link #registerSessionListener} indicating the current session
+ * is interested in session on the biometric prompt.
+ * @hide
+ */
+ public static final int SESSION_BIOMETRIC_PROMPT = 1 << 1;
+
+ /** @hide */
+ public static final Set<Integer> ALL_SESSIONS = Set.of(
+ SESSION_KEYGUARD,
+ SESSION_BIOMETRIC_PROMPT
+ );
+
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(flag = true, prefix = { "SESSION_KEYGUARD" }, value = {
+ SESSION_KEYGUARD,
+ SESSION_BIOMETRIC_PROMPT,
+ })
+ public @interface SessionFlags {}
+
+ /**
* Response indicating that the tile was not added.
*/
public static final int TILE_ADD_REQUEST_RESULT_TILE_NOT_ADDED = 0;
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index cbce8ac..3960f4e 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -10091,12 +10091,29 @@
}
/**
+ * Same as {@link #logoutUser(ComponentName)}, but called by system (like Settings), not admin.
+ *
+ * @hide
+ */
+ @RequiresPermission(anyOf = {android.Manifest.permission.MANAGE_USERS,
+ android.Manifest.permission.CREATE_USERS})
+ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
+ public @UserOperationResult int logoutUser() {
+ // TODO(b/214336184): add CTS test
+ try {
+ return mService.logoutUserInternal();
+ } catch (RemoteException re) {
+ throw re.rethrowFromSystemServer();
+ }
+ }
+ /**
* Gets the user a {@link #logoutUser(ComponentName)} call would switch to,
* or {@code null} if the current user is not in a session.
*
* @hide
*/
- @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
+ @RequiresPermission(anyOf = {android.Manifest.permission.MANAGE_USERS,
+ android.Manifest.permission.INTERACT_ACROSS_USERS})
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
public @Nullable UserHandle getLogoutUser() {
// TODO(b/214336184): add CTS test
@@ -10109,24 +10126,6 @@
}
/**
- * Clears the user that {@link #logoutUser(ComponentName)} would switch to.
- *
- * <p>Typically used by system UI after it logout a session.
- *
- * @hide
- */
- @RequiresPermission(android.Manifest.permission.MANAGE_USERS)
- @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
- public void clearLogoutUser() {
- // TODO(b/214336184): add CTS test
- try {
- mService.clearLogoutUser();
- } catch (RemoteException re) {
- throw re.rethrowFromSystemServer();
- }
- }
-
- /**
* Called by a device owner to list all secondary users on the device. Managed profiles are not
* considered as secondary users.
* <p> Used for various user management APIs, including {@link #switchUser}, {@link #removeUser}
diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl
index 7525d54..927ee0c 100644
--- a/core/java/android/app/admin/IDevicePolicyManager.aidl
+++ b/core/java/android/app/admin/IDevicePolicyManager.aidl
@@ -268,8 +268,8 @@
int startUserInBackground(in ComponentName who, in UserHandle userHandle);
int stopUser(in ComponentName who, in UserHandle userHandle);
int logoutUser(in ComponentName who);
+ int logoutUserInternal(); // AIDL doesn't allow overloading name (logoutUser())
int getLogoutUserId();
- void clearLogoutUser();
List<UserHandle> getSecondaryUsers(in ComponentName who);
void acknowledgeNewUserDisclaimer();
diff --git a/core/java/android/app/usage/UsageStatsManager.java b/core/java/android/app/usage/UsageStatsManager.java
index d7e197e..33efa01 100644
--- a/core/java/android/app/usage/UsageStatsManager.java
+++ b/core/java/android/app/usage/UsageStatsManager.java
@@ -320,6 +320,17 @@
* @hide
*/
public static final int REASON_SUB_FORCED_SYSTEM_FLAG_BUGGY = 1 << 2;
+ /**
+ * The app was moved to restricted bucket due to user interaction, i.e., toggling FAS.
+ *
+ * <p>
+ * Note: This should be coming from the more end-user facing UX, not from developer
+ * options nor adb command.
+ </p>
+ *
+ * @hide
+ */
+ public static final int REASON_SUB_FORCED_USER_FLAG_INTERACTION = 1 << 1;
/** @hide */
@@ -336,14 +347,15 @@
public @interface StandbyBuckets {}
/** @hide */
- @IntDef(flag = true, prefix = {"REASON_SUB_FORCED_SYSTEM_FLAG_FLAG_"}, value = {
+ @IntDef(flag = true, prefix = {"REASON_SUB_FORCED_"}, value = {
REASON_SUB_FORCED_SYSTEM_FLAG_UNDEFINED,
REASON_SUB_FORCED_SYSTEM_FLAG_BACKGROUND_RESOURCE_USAGE,
REASON_SUB_FORCED_SYSTEM_FLAG_ABUSE,
REASON_SUB_FORCED_SYSTEM_FLAG_BUGGY,
+ REASON_SUB_FORCED_USER_FLAG_INTERACTION,
})
@Retention(RetentionPolicy.SOURCE)
- public @interface SystemForcedReasons {
+ public @interface ForcedReasons {
}
/**
@@ -1188,11 +1200,6 @@
case REASON_MAIN_FORCED_BY_USER:
sb.append("f");
if (subReason > 0) {
- // Although not expected and shouldn't happen, this could potentially have a
- // sub-reason if the system tries to give a reason when applying the
- // FORCED_BY_USER reason. The sub-reason is undefined (though most likely a
- // REASON_SUB_FORCED_SYSTEM_FLAG_ sub-reason), but it's better to note it in the
- // log than to exclude it altogether.
sb.append("-").append(Integer.toBinaryString(subReason));
}
break;
diff --git a/core/java/android/companion/AssociationRequest.java b/core/java/android/companion/AssociationRequest.java
index 1d2f06d..bd8ba9e 100644
--- a/core/java/android/companion/AssociationRequest.java
+++ b/core/java/android/companion/AssociationRequest.java
@@ -27,7 +27,6 @@
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.StringDef;
-import android.annotation.SystemApi;
import android.annotation.UserIdInt;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
@@ -38,6 +37,8 @@
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.DataClass;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@@ -88,10 +89,8 @@
* request to be associated with such devices.
*
* @see AssociationRequest.Builder#setDeviceProfile
- * @hide
*/
@RequiresPermission(Manifest.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING)
- @SystemApi
public static final String DEVICE_PROFILE_APP_STREAMING =
"android.app.role.COMPANION_DEVICE_APP_STREAMING";
@@ -103,15 +102,29 @@
* allowed to request to be associated with such devices.
*
* @see AssociationRequest.Builder#setDeviceProfile
- * @hide
*/
@RequiresPermission(Manifest.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION)
- @SystemApi
public static final String DEVICE_PROFILE_AUTOMOTIVE_PROJECTION =
"android.app.role.SYSTEM_AUTOMOTIVE_PROJECTION";
+ /**
+ * Device profile: Allows the companion app to access notification, recent photos and media for
+ * computer cross-device features.
+ *
+ * Only applications that have been granted
+ * {@link android.Manifest.permission#REQUEST_COMPANION_PROFILE_COMPUTER} are allowed to
+ * request to be associated with such devices.
+ *
+ * @see AssociationRequest.Builder#setDeviceProfile
+ */
+ @RequiresPermission(Manifest.permission.REQUEST_COMPANION_PROFILE_COMPUTER)
+ public static final String DEVICE_PROFILE_COMPUTER =
+ "android.app.role.COMPANION_DEVICE_COMPUTER";
+
/** @hide */
- @StringDef(value = { DEVICE_PROFILE_WATCH })
+ @Retention(RetentionPolicy.SOURCE)
+ @StringDef(value = { DEVICE_PROFILE_WATCH, DEVICE_PROFILE_COMPUTER,
+ DEVICE_PROFILE_AUTOMOTIVE_PROJECTION, DEVICE_PROFILE_APP_STREAMING })
public @interface DeviceProfile {}
/**
@@ -241,10 +254,7 @@
* Whether the association is to be managed by the companion application.
*
* @see Builder#setSelfManaged(boolean)
- * @hide
*/
- @SystemApi
- @RequiresPermission(REQUEST_COMPANION_SELF_MANAGED)
public boolean isSelfManaged() {
return mSelfManaged;
}
@@ -255,10 +265,7 @@
* required.
*
* @see Builder#setForceConfirmation(boolean)
- * @hide
*/
- @SystemApi
- @RequiresPermission(REQUEST_COMPANION_SELF_MANAGED)
public boolean isForceConfirmation() {
return mForceConfirmation;
}
@@ -374,9 +381,7 @@
* Requests for creating "self-managed" association MUST provide a Display name.
*
* @see #setDisplayName(CharSequence)
- * @hide
*/
- @SystemApi
@RequiresPermission(REQUEST_COMPANION_SELF_MANAGED)
@NonNull
public Builder setSelfManaged(boolean selfManaged) {
@@ -389,10 +394,7 @@
* Indicates whether the application would prefer the CompanionDeviceManager to collect an
* explicit confirmation from the user before creating an association, even if such
* confirmation is not required.
- *
- * @hide
*/
- @SystemApi
@RequiresPermission(REQUEST_COMPANION_SELF_MANAGED)
@NonNull
public Builder setForceConfirmation(boolean forceConfirmation) {
@@ -639,10 +641,10 @@
};
@DataClass.Generated(
- time = 1638962248060L,
+ time = 1643238443303L,
codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/companion/AssociationRequest.java",
- inputSignatures = "public static final java.lang.String DEVICE_PROFILE_WATCH\npublic static final @android.annotation.RequiresPermission @android.annotation.SystemApi java.lang.String DEVICE_PROFILE_APP_STREAMING\npublic static final @android.annotation.RequiresPermission @android.annotation.SystemApi java.lang.String DEVICE_PROFILE_AUTOMOTIVE_PROJECTION\nprivate final boolean mSingleDevice\nprivate final @com.android.internal.util.DataClass.PluralOf(\"deviceFilter\") @android.annotation.NonNull java.util.List<android.companion.DeviceFilter<?>> mDeviceFilters\nprivate final @android.annotation.Nullable @android.companion.AssociationRequest.DeviceProfile java.lang.String mDeviceProfile\nprivate final @android.annotation.Nullable java.lang.CharSequence mDisplayName\nprivate final boolean mSelfManaged\nprivate final boolean mForceConfirmation\nprivate @android.annotation.Nullable java.lang.String mPackageName\nprivate @android.annotation.UserIdInt int mUserId\nprivate @android.annotation.Nullable java.lang.String mDeviceProfilePrivilegesDescription\nprivate final long mCreationTime\nprivate boolean mSkipPrompt\npublic @android.annotation.Nullable @android.companion.AssociationRequest.DeviceProfile java.lang.String getDeviceProfile()\npublic @android.annotation.Nullable java.lang.CharSequence getDisplayName()\npublic @android.annotation.SystemApi @android.annotation.RequiresPermission boolean isSelfManaged()\npublic @android.annotation.SystemApi @android.annotation.RequiresPermission boolean isForceConfirmation()\npublic boolean isSingleDevice()\npublic void setPackageName(java.lang.String)\npublic void setUserId(int)\npublic void setDeviceProfilePrivilegesDescription(java.lang.String)\npublic void setSkipPrompt(boolean)\npublic @android.annotation.NonNull @android.compat.annotation.UnsupportedAppUsage java.util.List<android.companion.DeviceFilter<?>> getDeviceFilters()\nclass AssociationRequest extends java.lang.Object implements [android.os.Parcelable]\nprivate boolean mSingleDevice\nprivate @android.annotation.Nullable java.util.ArrayList<android.companion.DeviceFilter<?>> mDeviceFilters\nprivate @android.annotation.Nullable java.lang.String mDeviceProfile\nprivate @android.annotation.Nullable java.lang.CharSequence mDisplayName\nprivate boolean mSelfManaged\nprivate boolean mForceConfirmation\npublic @android.annotation.NonNull android.companion.AssociationRequest.Builder setSingleDevice(boolean)\npublic @android.annotation.NonNull android.companion.AssociationRequest.Builder addDeviceFilter(android.companion.DeviceFilter<?>)\npublic @android.annotation.NonNull android.companion.AssociationRequest.Builder setDeviceProfile(java.lang.String)\npublic @android.annotation.NonNull android.companion.AssociationRequest.Builder setDisplayName(java.lang.CharSequence)\npublic @android.annotation.SystemApi @android.annotation.RequiresPermission @android.annotation.NonNull android.companion.AssociationRequest.Builder setSelfManaged(boolean)\npublic @android.annotation.SystemApi @android.annotation.RequiresPermission @android.annotation.NonNull android.companion.AssociationRequest.Builder setForceConfirmation(boolean)\npublic @android.annotation.NonNull @java.lang.Override android.companion.AssociationRequest build()\nclass Builder extends android.provider.OneTimeUseBuilder<android.companion.AssociationRequest> implements []\n@com.android.internal.util.DataClass(genConstructor=false, genToString=true, genEqualsHashCode=true, genHiddenGetters=true, genParcelable=true, genConstDefs=false)")
+ inputSignatures = "public static final java.lang.String DEVICE_PROFILE_WATCH\npublic static final @android.annotation.RequiresPermission java.lang.String DEVICE_PROFILE_APP_STREAMING\npublic static final @android.annotation.RequiresPermission java.lang.String DEVICE_PROFILE_AUTOMOTIVE_PROJECTION\npublic static final @android.annotation.RequiresPermission java.lang.String DEVICE_PROFILE_COMPUTER\nprivate final boolean mSingleDevice\nprivate final @com.android.internal.util.DataClass.PluralOf(\"deviceFilter\") @android.annotation.NonNull java.util.List<android.companion.DeviceFilter<?>> mDeviceFilters\nprivate final @android.annotation.Nullable @android.companion.AssociationRequest.DeviceProfile java.lang.String mDeviceProfile\nprivate final @android.annotation.Nullable java.lang.CharSequence mDisplayName\nprivate final boolean mSelfManaged\nprivate final boolean mForceConfirmation\nprivate @android.annotation.Nullable java.lang.String mPackageName\nprivate @android.annotation.UserIdInt int mUserId\nprivate @android.annotation.Nullable java.lang.String mDeviceProfilePrivilegesDescription\nprivate final long mCreationTime\nprivate boolean mSkipPrompt\npublic @android.annotation.Nullable @android.companion.AssociationRequest.DeviceProfile java.lang.String getDeviceProfile()\npublic @android.annotation.Nullable java.lang.CharSequence getDisplayName()\npublic boolean isSelfManaged()\npublic boolean isForceConfirmation()\npublic boolean isSingleDevice()\npublic void setPackageName(java.lang.String)\npublic void setUserId(int)\npublic void setDeviceProfilePrivilegesDescription(java.lang.String)\npublic void setSkipPrompt(boolean)\npublic @android.annotation.NonNull @android.compat.annotation.UnsupportedAppUsage java.util.List<android.companion.DeviceFilter<?>> getDeviceFilters()\nclass AssociationRequest extends java.lang.Object implements [android.os.Parcelable]\nprivate boolean mSingleDevice\nprivate @android.annotation.Nullable java.util.ArrayList<android.companion.DeviceFilter<?>> mDeviceFilters\nprivate @android.annotation.Nullable java.lang.String mDeviceProfile\nprivate @android.annotation.Nullable java.lang.CharSequence mDisplayName\nprivate boolean mSelfManaged\nprivate boolean mForceConfirmation\npublic @android.annotation.NonNull android.companion.AssociationRequest.Builder setSingleDevice(boolean)\npublic @android.annotation.NonNull android.companion.AssociationRequest.Builder addDeviceFilter(android.companion.DeviceFilter<?>)\npublic @android.annotation.NonNull android.companion.AssociationRequest.Builder setDeviceProfile(java.lang.String)\npublic @android.annotation.NonNull android.companion.AssociationRequest.Builder setDisplayName(java.lang.CharSequence)\npublic @android.annotation.RequiresPermission @android.annotation.NonNull android.companion.AssociationRequest.Builder setSelfManaged(boolean)\npublic @android.annotation.RequiresPermission @android.annotation.NonNull android.companion.AssociationRequest.Builder setForceConfirmation(boolean)\npublic @android.annotation.NonNull @java.lang.Override android.companion.AssociationRequest build()\nclass Builder extends android.provider.OneTimeUseBuilder<android.companion.AssociationRequest> implements []\n@com.android.internal.util.DataClass(genConstructor=false, genToString=true, genEqualsHashCode=true, genHiddenGetters=true, genParcelable=true, genConstDefs=false)")
@Deprecated
private void __metadata() {}
diff --git a/core/java/android/companion/CompanionDeviceManager.java b/core/java/android/companion/CompanionDeviceManager.java
index ae13425..36802eabe 100644
--- a/core/java/android/companion/CompanionDeviceManager.java
+++ b/core/java/android/companion/CompanionDeviceManager.java
@@ -18,6 +18,7 @@
import static android.Manifest.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING;
import static android.Manifest.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION;
+import static android.Manifest.permission.REQUEST_COMPANION_PROFILE_COMPUTER;
import static android.Manifest.permission.REQUEST_COMPANION_PROFILE_WATCH;
import android.annotation.NonNull;
@@ -264,6 +265,7 @@
@UserHandleAware
@RequiresPermission(anyOf = {
REQUEST_COMPANION_PROFILE_WATCH,
+ REQUEST_COMPANION_PROFILE_COMPUTER,
REQUEST_COMPANION_PROFILE_APP_STREAMING,
REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION,
}, conditional = true)
@@ -318,6 +320,7 @@
@UserHandleAware
@RequiresPermission(anyOf = {
REQUEST_COMPANION_PROFILE_WATCH,
+ REQUEST_COMPANION_PROFILE_COMPUTER,
REQUEST_COMPANION_PROFILE_APP_STREAMING,
REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION
}, conditional = true)
diff --git a/core/java/android/companion/CompanionDeviceService.java b/core/java/android/companion/CompanionDeviceService.java
index 610b7ee..cb96ebe 100644
--- a/core/java/android/companion/CompanionDeviceService.java
+++ b/core/java/android/companion/CompanionDeviceService.java
@@ -36,11 +36,6 @@
* See {@link #onDeviceAppeared(AssociationInfo)}/{@link #onDeviceDisappeared(AssociationInfo)}.
*
* <p>
- * Additionally, the service will receive a call from the system, if and when the system needs to
- * transfer data to the companion device.
- * See {@link #dispatchMessage(int, int, byte[])}).
- *
- * <p>
* Companion applications must create a service that {@code extends}
* {@link CompanionDeviceService}, and declare it in their AndroidManifest.xml with the
* "android.permission.BIND_COMPANION_DEVICE_SERVICE" permission
@@ -79,8 +74,8 @@
* <p>
* It is possible for an application to declare multiple {@link CompanionDeviceService}-s.
* In such case, the system will bind all declared services, but will deliver
- * {@link #onDeviceAppeared(AssociationInfo)}, {@link #onDeviceDisappeared(AssociationInfo)} and
- * {@link #dispatchMessage(int, int, byte[])} only to one "primary" services.
+ * {@link #onDeviceAppeared(AssociationInfo)} and {@link #onDeviceDisappeared(AssociationInfo)}
+ * only to one "primary" services.
* Applications that declare multiple {@link CompanionDeviceService}-s should indicate the "primary"
* service using "android.companion.primary" tag.
* <pre>{@code
@@ -156,6 +151,8 @@
* @param messageId system assigned id of the message to be sent
* @param associationId association id of the associated device
* @param message message to be sent
+ *
+ * @hide
*/
@MainThread
public void onDispatchMessage(int messageId, int associationId, @NonNull byte[] message) {
@@ -172,6 +169,8 @@
* @param messageId id of the message
* @param associationId id of the associated device
* @param message messaged received from the associated device
+ *
+ * @hide
*/
@RequiresPermission(android.Manifest.permission.DELIVER_COMPANION_MESSAGES)
public final void dispatchMessage(int messageId, int associationId, @NonNull byte[] message) {
diff --git a/core/java/android/companion/virtual/IVirtualDeviceActivityListener.aidl b/core/java/android/companion/virtual/IVirtualDeviceActivityListener.aidl
index 53af4c5..a46dc53 100644
--- a/core/java/android/companion/virtual/IVirtualDeviceActivityListener.aidl
+++ b/core/java/android/companion/virtual/IVirtualDeviceActivityListener.aidl
@@ -23,7 +23,7 @@
*
* @hide
*/
-interface IVirtualDeviceActivityListener {
+oneway interface IVirtualDeviceActivityListener {
/**
* Called when the top activity is changed.
diff --git a/core/java/android/companion/virtual/VirtualDeviceManager.java b/core/java/android/companion/virtual/VirtualDeviceManager.java
index 64f16ac..bb9bb09 100644
--- a/core/java/android/companion/virtual/VirtualDeviceManager.java
+++ b/core/java/android/companion/virtual/VirtualDeviceManager.java
@@ -164,8 +164,6 @@
* @param executor The executor to run {@code launchCallback} on.
* @param launchCallback Callback that is called when the pending intent launching is
* complete.
- *
- * @hide
*/
public void launchPendingIntent(
int displayId,
@@ -196,9 +194,7 @@
/**
* Creates a virtual display for this virtual device. All displays created on the same
- * device belongs to the same display group. Requires the ADD_TRUSTED_DISPLAY permission
- * to create a virtual display which is not in the default DisplayGroup, and to create
- * trusted displays.
+ * device belongs to the same display group.
*
* @param width The width of the virtual display in pixels, must be greater than 0.
* @param height The height of the virtual display in pixels, must be greater than 0.
@@ -369,9 +365,7 @@
*
* @param listener The listener to add.
* @see #removeActivityListener(ActivityListener)
- * @hide
*/
- // TODO(b/194949534): Unhide this API
public void addActivityListener(@NonNull ActivityListener listener) {
addActivityListener(listener, mContext.getMainExecutor());
}
@@ -383,9 +377,7 @@
* @param listener The listener to add.
* @param executor The executor where the callback is executed on.
* @see #removeActivityListener(ActivityListener)
- * @hide
*/
- // TODO(b/194949534): Unhide this API
public void addActivityListener(
@NonNull ActivityListener listener, @NonNull Executor executor) {
mActivityListeners.put(listener, new ActivityListenerDelegate(listener, executor));
@@ -397,9 +389,7 @@
*
* @param listener The listener to remove.
* @see #addActivityListener(ActivityListener, Executor)
- * @hide
*/
- // TODO(b/194949534): Unhide this API
public void removeActivityListener(@NonNull ActivityListener listener) {
mActivityListeners.remove(listener);
}
@@ -407,10 +397,7 @@
/**
* Callback for launching pending intents on the virtual device.
- *
- * @hide
*/
- // TODO(b/194949534): Unhide this API
public interface LaunchCallback {
/**
* Called when the pending intent launched successfully.
@@ -425,10 +412,7 @@
/**
* Listener for activity changes in this virtual device.
- *
- * @hide
*/
- // TODO(b/194949534): Unhide this API
public interface ActivityListener {
/**
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 7f00bcb..1f83207 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -2385,6 +2385,10 @@
* {@link android.Manifest.permission#START_VIEW_APP_FEATURES} permission to ensure that
* only the system can launch this activity. The system will not launch activities
* that are not properly protected.
+ *
+ * An optional <meta-data> tag in the activity's manifest with
+ * android:name=app_features_preference_summary and android:resource=@string/<string name> will
+ * be used to add a summary line for the "All Services" preference in settings.
* </p>
* @hide
*/
@@ -5053,6 +5057,17 @@
public static final String ACTION_PACKAGE_NEEDS_INTEGRITY_VERIFICATION =
"android.intent.action.PACKAGE_NEEDS_INTEGRITY_VERIFICATION";
+ /**
+ * Broadcast Action: Start the foreground service manager.
+ *
+ * <p class="note">
+ * This is a protected intent that can only be sent by the system.
+ * </p>
+ *
+ * @hide
+ */
+ public static final String ACTION_SHOW_FOREGROUND_SERVICE_MANAGER =
+ "android.intent.action.SHOW_FOREGROUND_SERVICE_MANAGER";
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
diff --git a/core/java/android/content/pm/AppSearchShortcutInfo.java b/core/java/android/content/pm/AppSearchShortcutInfo.java
index 8d9ef853..f20d1e6 100644
--- a/core/java/android/content/pm/AppSearchShortcutInfo.java
+++ b/core/java/android/content/pm/AppSearchShortcutInfo.java
@@ -29,6 +29,7 @@
import android.os.Bundle;
import android.os.PersistableBundle;
import android.text.TextUtils;
+import android.util.ArrayMap;
import android.util.ArraySet;
import com.android.internal.annotations.VisibleForTesting;
@@ -42,43 +43,125 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
/**
+ * A {@link GenericDocument} representation of {@link ShortcutInfo} object.
* @hide
*/
public class AppSearchShortcutInfo extends GenericDocument {
+ /** The TTL (time-to-live) of the shortcut, in milli-second. */
+ public static final long SHORTCUT_TTL = TimeUnit.DAYS.toMillis(90);
+
/** The name of the schema type for {@link ShortcutInfo} documents.*/
public static final String SCHEMA_TYPE = "Shortcut";
- public static final int SCHEMA_VERSION = 2;
+ /** @hide */
+ public static final int SCHEMA_VERSION = 3;
+
+ /**
+ * Property name of the activity this {@link ShortcutInfo} is associated with.
+ * See {@link ShortcutInfo#getActivity()}.
+ */
public static final String KEY_ACTIVITY = "activity";
+
+ /**
+ * Property name of the short description of this {@link ShortcutInfo}.
+ * See {@link ShortcutInfo#getShortLabel()}.
+ */
public static final String KEY_SHORT_LABEL = "shortLabel";
- public static final String KEY_SHORT_LABEL_RES_ID = "shortLabelResId";
- public static final String KEY_SHORT_LABEL_RES_NAME = "shortLabelResName";
+
+ /**
+ * Property name of the long description of this {@link ShortcutInfo}.
+ * See {@link ShortcutInfo#getLongLabel()}.
+ */
public static final String KEY_LONG_LABEL = "longLabel";
- public static final String KEY_LONG_LABEL_RES_ID = "longLabelResId";
- public static final String KEY_LONG_LABEL_RES_NAME = "longLabelResName";
+
+ /**
+ * @hide
+ */
public static final String KEY_DISABLED_MESSAGE = "disabledMessage";
- public static final String KEY_DISABLED_MESSAGE_RES_ID = "disabledMessageResId";
- public static final String KEY_DISABLED_MESSAGE_RES_NAME = "disabledMessageResName";
+
+ /**
+ * Property name of the categories this {@link ShortcutInfo} is associated with.
+ * See {@link ShortcutInfo#getCategories()}.
+ */
public static final String KEY_CATEGORIES = "categories";
+
+ /**
+ * Property name of the intents this {@link ShortcutInfo} is associated with.
+ * See {@link ShortcutInfo#getIntents()}.
+ */
public static final String KEY_INTENTS = "intents";
+
+ /**
+ * @hide
+ */
public static final String KEY_INTENT_PERSISTABLE_EXTRAS = "intentPersistableExtras";
+
+ /**
+ * Property name of {@link Person} objects this {@link ShortcutInfo} is associated with.
+ * See {@link ShortcutInfo#getPersons()}.
+ */
public static final String KEY_PERSON = "person";
+
+ /**
+ * Property name of {@link LocusId} this {@link ShortcutInfo} is associated with.
+ * See {@link ShortcutInfo#getLocusId()}.
+ */
public static final String KEY_LOCUS_ID = "locusId";
- public static final String KEY_RANK = "rank";
- public static final String KEY_IMPLICIT_RANK = "implicitRank";
+
+ /**
+ * @hide
+ */
public static final String KEY_EXTRAS = "extras";
+
+ /**
+ * Property name of the states this {@link ShortcutInfo} is currently in.
+ * Possible values are one or more of the following:
+ * {@link #IS_DYNAMIC}, {@link #NOT_DYNAMIC}, {@link #IS_MANIFEST}, {@link #NOT_MANIFEST},
+ * {@link #IS_DISABLED}, {@link #NOT_DISABLED}, {@link #IS_IMMUTABLE},
+ * {@link #NOT_IMMUTABLE}
+ *
+ */
public static final String KEY_FLAGS = "flags";
+
+ /**
+ * @hide
+ */
public static final String KEY_ICON_RES_ID = "iconResId";
+
+ /**
+ * @hide
+ */
public static final String KEY_ICON_RES_NAME = "iconResName";
+
+ /**
+ * @hide
+ */
public static final String KEY_ICON_URI = "iconUri";
- public static final String KEY_BITMAP_PATH = "bitmapPath";
+
+ /**
+ * @hide
+ */
public static final String KEY_DISABLED_REASON = "disabledReason";
+ /**
+ * Property name of capability this {@link ShortcutInfo} is associated with.
+ * See {@link ShortcutInfo#hasCapability(String)}.
+ */
+ public static final String KEY_CAPABILITY = "capability";
+
+ /**
+ * Property name of capability binding this {@link ShortcutInfo} is associated with.
+ * See {@link ShortcutInfo#getCapabilityParameters(String, String)}.
+ */
+ public static final String KEY_CAPABILITY_BINDINGS = "capabilityBindings";
+
public static final AppSearchSchema SCHEMA = new AppSearchSchema.Builder(SCHEMA_TYPE)
.addProperty(new AppSearchSchema.StringPropertyConfig.Builder(KEY_ACTIVITY)
.setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
@@ -92,50 +175,18 @@
.setIndexingType(AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_PREFIXES)
.build()
- ).addProperty(new AppSearchSchema.LongPropertyConfig.Builder(KEY_SHORT_LABEL_RES_ID)
- .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
- .build()
-
- ).addProperty(new AppSearchSchema.StringPropertyConfig.Builder(KEY_SHORT_LABEL_RES_NAME)
- .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
- .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_NONE)
- .setIndexingType(AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_NONE)
- .build()
-
).addProperty(new AppSearchSchema.StringPropertyConfig.Builder(KEY_LONG_LABEL)
.setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
.setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
.setIndexingType(AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_PREFIXES)
.build()
- ).addProperty(new AppSearchSchema.LongPropertyConfig.Builder(KEY_LONG_LABEL_RES_ID)
- .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
- .build()
-
- ).addProperty(new AppSearchSchema.StringPropertyConfig.Builder(KEY_LONG_LABEL_RES_NAME)
- .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
- .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_NONE)
- .setIndexingType(AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_NONE)
- .build()
-
).addProperty(new AppSearchSchema.StringPropertyConfig.Builder(KEY_DISABLED_MESSAGE)
.setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
.setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_NONE)
.setIndexingType(AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_NONE)
.build()
- ).addProperty(new AppSearchSchema.LongPropertyConfig.Builder(
- KEY_DISABLED_MESSAGE_RES_ID)
- .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
- .build()
-
- ).addProperty(new AppSearchSchema.StringPropertyConfig.Builder(
- KEY_DISABLED_MESSAGE_RES_NAME)
- .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
- .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_NONE)
- .setIndexingType(AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_NONE)
- .build()
-
).addProperty(new AppSearchSchema.StringPropertyConfig.Builder(KEY_CATEGORIES)
.setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_REPEATED)
.setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
@@ -154,7 +205,7 @@
.build()
).addProperty(new AppSearchSchema.DocumentPropertyConfig.Builder(
- KEY_PERSON, AppSearchPerson.SCHEMA_TYPE)
+ KEY_PERSON, AppSearchShortcutPerson.SCHEMA_TYPE)
.setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_REPEATED)
.build()
@@ -164,16 +215,6 @@
.setIndexingType(AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_EXACT_TERMS)
.build()
- ).addProperty(new AppSearchSchema.StringPropertyConfig.Builder(KEY_RANK)
- .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
- .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
- .setIndexingType(AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_EXACT_TERMS)
- .build()
-
- ).addProperty(new AppSearchSchema.LongPropertyConfig.Builder(KEY_IMPLICIT_RANK)
- .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
- .build()
-
).addProperty(new AppSearchSchema.BytesPropertyConfig.Builder(KEY_EXTRAS)
.setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
.build()
@@ -200,18 +241,24 @@
.setIndexingType(AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_NONE)
.build()
- ).addProperty(new AppSearchSchema.StringPropertyConfig.Builder(KEY_BITMAP_PATH)
- .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
- .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_NONE)
- .setIndexingType(AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_NONE)
- .build()
-
).addProperty(new AppSearchSchema.StringPropertyConfig.Builder(KEY_DISABLED_REASON)
.setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_REQUIRED)
.setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
.setIndexingType(AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_EXACT_TERMS)
.build()
+ ).addProperty(new AppSearchSchema.StringPropertyConfig.Builder(KEY_CAPABILITY)
+ .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_REPEATED)
+ .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
+ .setIndexingType(AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_EXACT_TERMS)
+ .build()
+
+ ).addProperty(new AppSearchSchema.StringPropertyConfig.Builder(KEY_CAPABILITY_BINDINGS)
+ .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_REPEATED)
+ .setTokenizerType(AppSearchSchema.StringPropertyConfig.TOKENIZER_TYPE_PLAIN)
+ .setIndexingType(AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_PREFIXES)
+ .build()
+
).build();
/**
@@ -219,97 +266,62 @@
* needs to be camelCase since AppSearch's tokenizer will break the word when it sees
* underscore.
*/
- private static final String IS_DYNAMIC = "Dyn";
- private static final String NOT_DYNAMIC = "nDyn";
- private static final String IS_PINNED = "Pin";
- private static final String NOT_PINNED = "nPin";
- private static final String HAS_ICON_RES = "IcR";
- private static final String NO_ICON_RES = "nIcR";
- private static final String HAS_ICON_FILE = "IcF";
- private static final String NO_ICON_FILE = "nIcF";
- private static final String IS_KEY_FIELD_ONLY = "Key";
- private static final String NOT_KEY_FIELD_ONLY = "nKey";
- private static final String IS_MANIFEST = "Man";
- private static final String NOT_MANIFEST = "nMan";
- private static final String IS_DISABLED = "Dis";
- private static final String NOT_DISABLED = "nDis";
- private static final String ARE_STRINGS_RESOLVED = "Str";
- private static final String NOT_STRINGS_RESOLVED = "nStr";
- private static final String IS_IMMUTABLE = "Im";
- private static final String NOT_IMMUTABLE = "nIm";
- private static final String HAS_ADAPTIVE_BITMAP = "IcA";
- private static final String NO_ADAPTIVE_BITMAP = "nIcA";
- private static final String IS_RETURNED_BY_SERVICE = "Rets";
- private static final String NOT_RETURNED_BY_SERVICE = "nRets";
- private static final String HAS_ICON_FILE_PENDING_SAVE = "Pens";
- private static final String NO_ICON_FILE_PENDING_SAVE = "nPens";
- private static final String IS_SHADOW = "Sdw";
- private static final String NOT_SHADOW = "nSdw";
- private static final String IS_LONG_LIVED = "Liv";
- private static final String NOT_LONG_LIVED = "nLiv";
- private static final String HAS_ICON_URI = "IcU";
- private static final String NO_ICON_URI = "nIcU";
- private static final String IS_CACHED_NOTIFICATION = "CaN";
- private static final String NOT_CACHED_NOTIFICATION = "nCaN";
- private static final String IS_CACHED_BUBBLE = "CaB";
- private static final String NOT_CACHED_BUBBLE = "nCaB";
- private static final String IS_CACHED_PEOPLE_TITLE = "CaPT";
- private static final String NOT_CACHED_PEOPLE_TITLE = "nCaPT";
/**
- * Following flags are not store within ShortcutInfo, but book-keeping states to reduce search
- * space when performing queries against AppSearch.
+ * Indicates the {@link ShortcutInfo} is dynamic shortcut.
+ * See {@link #KEY_FLAGS}
+ * See {@link ShortcutInfo#isDynamic()}.
*/
- private static final String HAS_BITMAP_PATH = "hBiP";
- private static final String HAS_STRING_RESOURCE = "hStr";
- private static final String HAS_NON_ZERO_RANK = "hRan";
+ public static final String IS_DYNAMIC = "Dyn";
- public static final String QUERY_IS_DYNAMIC = KEY_FLAGS + ":" + IS_DYNAMIC;
- public static final String QUERY_IS_NOT_DYNAMIC = KEY_FLAGS + ":" + NOT_DYNAMIC;
- public static final String QUERY_IS_PINNED = KEY_FLAGS + ":" + IS_PINNED;
- public static final String QUERY_IS_NOT_PINNED = KEY_FLAGS + ":" + NOT_PINNED;
- public static final String QUERY_IS_MANIFEST = KEY_FLAGS + ":" + IS_MANIFEST;
- public static final String QUERY_IS_NOT_MANIFEST = KEY_FLAGS + ":" + NOT_MANIFEST;
- public static final String QUERY_IS_PINNED_AND_ENABLED =
- "(" + KEY_FLAGS + ":" + IS_PINNED + " " + KEY_FLAGS + ":" + NOT_DISABLED + ")";
- public static final String QUERY_IS_CACHED =
- "(" + KEY_FLAGS + ":" + IS_CACHED_NOTIFICATION + " OR "
- + KEY_FLAGS + ":" + IS_CACHED_BUBBLE + " OR "
- + KEY_FLAGS + ":" + IS_CACHED_PEOPLE_TITLE + ")";
- public static final String QUERY_IS_NOT_CACHED =
- "(" + KEY_FLAGS + ":" + NOT_CACHED_NOTIFICATION + " "
- + KEY_FLAGS + ":" + NOT_CACHED_BUBBLE + " "
- + KEY_FLAGS + ":" + NOT_CACHED_PEOPLE_TITLE + ")";
- public static final String QUERY_IS_FLOATING =
- "((" + IS_PINNED + " OR " + QUERY_IS_CACHED + ") "
- + QUERY_IS_NOT_DYNAMIC + " " + QUERY_IS_NOT_MANIFEST + ")";
- public static final String QUERY_IS_NOT_FLOATING =
- "((" + QUERY_IS_NOT_PINNED + " " + QUERY_IS_NOT_CACHED + ") OR "
- + QUERY_IS_DYNAMIC + " OR " + QUERY_IS_MANIFEST + ")";
- public static final String QUERY_IS_VISIBLE_TO_PUBLISHER =
- "(" + KEY_DISABLED_REASON + ":" + ShortcutInfo.DISABLED_REASON_NOT_DISABLED
- + " OR " + KEY_DISABLED_REASON + ":"
- + ShortcutInfo.DISABLED_REASON_BY_APP
- + " OR " + KEY_DISABLED_REASON + ":"
- + ShortcutInfo.DISABLED_REASON_APP_CHANGED
- + " OR " + KEY_DISABLED_REASON + ":"
- + ShortcutInfo.DISABLED_REASON_UNKNOWN + ")";
- public static final String QUERY_DISABLED_REASON_VERSION_LOWER =
- KEY_DISABLED_REASON + ":" + ShortcutInfo.DISABLED_REASON_VERSION_LOWER;
- public static final String QUERY_IS_NON_MANIFEST_VISIBLE =
- "(" + QUERY_IS_NOT_MANIFEST + " " + QUERY_IS_VISIBLE_TO_PUBLISHER + " ("
- + QUERY_IS_PINNED + " OR " + QUERY_IS_CACHED + " OR " + QUERY_IS_DYNAMIC + "))";
- public static final String QUERY_IS_VISIBLE_CACHED_OR_PINNED =
- "(" + QUERY_IS_VISIBLE_TO_PUBLISHER + " " + QUERY_IS_DYNAMIC
- + " (" + QUERY_IS_CACHED + " OR " + QUERY_IS_PINNED + "))";
- public static final String QUERY_IS_VISIBLE_PINNED_ONLY =
- "(" + QUERY_IS_VISIBLE_TO_PUBLISHER + " " + QUERY_IS_PINNED + " " + QUERY_IS_NOT_CACHED
- + " " + QUERY_IS_NOT_DYNAMIC + " " + QUERY_IS_NOT_MANIFEST + ")";
- public static final String QUERY_HAS_BITMAP_PATH = KEY_FLAGS + ":" + HAS_BITMAP_PATH;
- public static final String QUERY_HAS_STRING_RESOURCE = KEY_FLAGS + ":" + HAS_STRING_RESOURCE;
- public static final String QUERY_HAS_NON_ZERO_RANK = KEY_FLAGS + ":" + HAS_NON_ZERO_RANK;
- public static final String QUERY_IS_FLOATING_AND_HAS_RANK =
- "(" + QUERY_IS_FLOATING + " " + QUERY_HAS_NON_ZERO_RANK + ")";
+ /**
+ * Indicates the {@link ShortcutInfo} is not a dynamic shortcut.
+ * See {@link #KEY_FLAGS}
+ * See {@link ShortcutInfo#isDynamic()}.
+ */
+ public static final String NOT_DYNAMIC = "nDyn";
+
+ /**
+ * Indicates the {@link ShortcutInfo} is manifest shortcut.
+ * See {@link #KEY_FLAGS}
+ * See {@link ShortcutInfo#isDeclaredInManifest()}.
+ */
+ public static final String IS_MANIFEST = "Man";
+
+ /**
+ * Indicates the {@link ShortcutInfo} is manifest shortcut.
+ * See {@link #KEY_FLAGS}
+ * See {@link ShortcutInfo#isDeclaredInManifest()}.
+ */
+ public static final String NOT_MANIFEST = "nMan";
+
+ /**
+ * Indicates the {@link ShortcutInfo} is disabled.
+ * See {@link #KEY_FLAGS}
+ * See {@link ShortcutInfo#isEnabled()}.
+ */
+ public static final String IS_DISABLED = "Dis";
+
+ /**
+ * Indicates the {@link ShortcutInfo} is enabled.
+ * See {@link #KEY_FLAGS}
+ * See {@link ShortcutInfo#isEnabled()}.
+ */
+ public static final String NOT_DISABLED = "nDis";
+
+ /**
+ * Indicates the {@link ShortcutInfo} was originally from manifest, but currently disabled.
+ * See {@link #KEY_FLAGS}
+ * See {@link ShortcutInfo#isOriginallyFromManifest()}.
+ */
+ public static final String IS_IMMUTABLE = "Im";
+
+ /**
+ * Indicates the {@link ShortcutInfo} was not originally from manifest.
+ * See {@link #KEY_FLAGS}
+ * See {@link ShortcutInfo#isOriginallyFromManifest()}.
+ */
+ public static final String NOT_IMMUTABLE = "nIm";
public AppSearchShortcutInfo(@NonNull GenericDocument document) {
super(document);
@@ -324,34 +336,27 @@
return new Builder(shortcutInfo.getPackage(), shortcutInfo.getId())
.setActivity(shortcutInfo.getActivity())
.setShortLabel(shortcutInfo.getShortLabel())
- .setShortLabelResId(shortcutInfo.getShortLabelResourceId())
- .setShortLabelResName(shortcutInfo.getTitleResName())
.setLongLabel(shortcutInfo.getLongLabel())
- .setLongLabelResId(shortcutInfo.getLongLabelResourceId())
- .setLongLabelResName(shortcutInfo.getTextResName())
.setDisabledMessage(shortcutInfo.getDisabledMessage())
- .setDisabledMessageResId(shortcutInfo.getDisabledMessageResourceId())
- .setDisabledMessageResName(shortcutInfo.getDisabledMessageResName())
.setCategories(shortcutInfo.getCategories())
.setIntents(shortcutInfo.getIntents())
- .setRank(shortcutInfo.getRank())
- .setImplicitRank(shortcutInfo.getImplicitRank()
- | (shortcutInfo.isRankChanged() ? ShortcutInfo.RANK_CHANGED_BIT : 0))
.setExtras(shortcutInfo.getExtras())
.setCreationTimestampMillis(shortcutInfo.getLastChangedTimestamp())
.setFlags(shortcutInfo.getFlags())
.setIconResId(shortcutInfo.getIconResourceId())
.setIconResName(shortcutInfo.getIconResName())
- .setBitmapPath(shortcutInfo.getBitmapPath())
.setIconUri(shortcutInfo.getIconUri())
.setDisabledReason(shortcutInfo.getDisabledReason())
.setPersons(shortcutInfo.getPersons())
.setLocusId(shortcutInfo.getLocusId())
+ .setCapabilityBindings(shortcutInfo.getCapabilityBindings())
+ .setTtlMillis(SHORTCUT_TTL)
.build();
}
/**
- * @hide
+ * Converts this {@link GenericDocument} object into {@link ShortcutInfo} to read the
+ * information.
*/
@NonNull
public ShortcutInfo toShortcutInfo(@UserIdInt int userId) {
@@ -367,14 +372,8 @@
// LauncherApps#getShortcutIconDrawable instead.
final Icon icon = null;
final String shortLabel = getPropertyString(KEY_SHORT_LABEL);
- final int shortLabelResId = (int) getPropertyLong(KEY_SHORT_LABEL_RES_ID);
- final String shortLabelResName = getPropertyString(KEY_SHORT_LABEL_RES_NAME);
final String longLabel = getPropertyString(KEY_LONG_LABEL);
- final int longLabelResId = (int) getPropertyLong(KEY_LONG_LABEL_RES_ID);
- final String longLabelResName = getPropertyString(KEY_LONG_LABEL_RES_NAME);
final String disabledMessage = getPropertyString(KEY_DISABLED_MESSAGE);
- final int disabledMessageResId = (int) getPropertyLong(KEY_DISABLED_MESSAGE_RES_ID);
- final String disabledMessageResName = getPropertyString(KEY_DISABLED_MESSAGE_RES_NAME);
final String[] categories = getPropertyStringArray(KEY_CATEGORIES);
final Set<String> categoriesSet = categories == null
? null : new ArraySet<>(Arrays.asList(categories));
@@ -408,27 +407,22 @@
final Person[] persons = parsePerson(getPropertyDocumentArray(KEY_PERSON));
final String locusIdString = getPropertyString(KEY_LOCUS_ID);
final LocusId locusId = locusIdString == null ? null : new LocusId(locusIdString);
- final int rank = Integer.parseInt(getPropertyString(KEY_RANK));
- final int implicitRank = (int) getPropertyLong(KEY_IMPLICIT_RANK);
final byte[] extrasByte = getPropertyBytes(KEY_EXTRAS);
final PersistableBundle extras = transformToPersistableBundle(extrasByte);
final int flags = parseFlags(getPropertyStringArray(KEY_FLAGS));
final int iconResId = (int) getPropertyLong(KEY_ICON_RES_ID);
final String iconResName = getPropertyString(KEY_ICON_RES_NAME);
final String iconUri = getPropertyString(KEY_ICON_URI);
- final String bitmapPath = getPropertyString(KEY_BITMAP_PATH);
final int disabledReason = Integer.parseInt(getPropertyString(KEY_DISABLED_REASON));
- final ShortcutInfo si = new ShortcutInfo(
- userId, getId(), packageName, activity, icon, shortLabel, shortLabelResId,
- shortLabelResName, longLabel, longLabelResId, longLabelResName, disabledMessage,
- disabledMessageResId, disabledMessageResName, categoriesSet, intents, rank, extras,
- getCreationTimestampMillis(), flags, iconResId, iconResName, bitmapPath, iconUri,
- disabledReason, persons, locusId, null, null);
- si.setImplicitRank(implicitRank);
- if ((implicitRank & ShortcutInfo.RANK_CHANGED_BIT) != 0) {
- si.setRankChanged();
- }
- return si;
+ final Map<String, Map<String, List<String>>> capabilityBindings =
+ parseCapabilityBindings(getPropertyStringArray(KEY_CAPABILITY_BINDINGS));
+ return new ShortcutInfo(
+ userId, getId(), packageName, activity, icon, shortLabel, 0,
+ null, longLabel, 0, null, disabledMessage,
+ 0, null, categoriesSet, intents,
+ ShortcutInfo.RANK_NOT_SET, extras, getCreationTimestampMillis(), flags, iconResId,
+ iconResName, null, iconUri, disabledReason, persons, locusId,
+ null, capabilityBindings);
}
/**
@@ -449,7 +443,6 @@
public static class Builder extends GenericDocument.Builder<Builder> {
private List<String> mFlags = new ArrayList<>(1);
- private boolean mHasStringResource = false;
public Builder(String packageName, String id) {
super(/*namespace=*/ packageName, id, SCHEMA_TYPE);
@@ -493,28 +486,6 @@
* @hide
*/
@NonNull
- public Builder setShortLabelResId(final int shortLabelResId) {
- setPropertyLong(KEY_SHORT_LABEL_RES_ID, shortLabelResId);
- if (shortLabelResId != 0) {
- mHasStringResource = true;
- }
- return this;
- }
-
- /**
- * @hide
- */
- public Builder setShortLabelResName(@Nullable final String shortLabelResName) {
- if (!TextUtils.isEmpty(shortLabelResName)) {
- setPropertyString(KEY_SHORT_LABEL_RES_NAME, shortLabelResName);
- }
- return this;
- }
-
- /**
- * @hide
- */
- @NonNull
public Builder setLongLabel(@Nullable final CharSequence longLabel) {
if (!TextUtils.isEmpty(longLabel)) {
setPropertyString(KEY_LONG_LABEL, Preconditions.checkStringNotEmpty(
@@ -527,28 +498,6 @@
* @hide
*/
@NonNull
- public Builder setLongLabelResId(final int longLabelResId) {
- setPropertyLong(KEY_LONG_LABEL_RES_ID, longLabelResId);
- if (longLabelResId != 0) {
- mHasStringResource = true;
- }
- return this;
- }
-
- /**
- * @hide
- */
- public Builder setLongLabelResName(@Nullable final String longLabelResName) {
- if (!TextUtils.isEmpty(longLabelResName)) {
- setPropertyString(KEY_LONG_LABEL_RES_NAME, longLabelResName);
- }
- return this;
- }
-
- /**
- * @hide
- */
- @NonNull
public Builder setDisabledMessage(@Nullable final CharSequence disabledMessage) {
if (!TextUtils.isEmpty(disabledMessage)) {
setPropertyString(KEY_DISABLED_MESSAGE, Preconditions.checkStringNotEmpty(
@@ -561,28 +510,6 @@
* @hide
*/
@NonNull
- public Builder setDisabledMessageResId(final int disabledMessageResId) {
- setPropertyLong(KEY_DISABLED_MESSAGE_RES_ID, disabledMessageResId);
- if (disabledMessageResId != 0) {
- mHasStringResource = true;
- }
- return this;
- }
-
- /**
- * @hide
- */
- public Builder setDisabledMessageResName(@Nullable final String disabledMessageResName) {
- if (!TextUtils.isEmpty(disabledMessageResName)) {
- setPropertyString(KEY_DISABLED_MESSAGE_RES_NAME, disabledMessageResName);
- }
- return this;
- }
-
- /**
- * @hide
- */
- @NonNull
public Builder setCategories(@Nullable final Set<String> categories) {
if (categories != null && !categories.isEmpty()) {
setPropertyString(KEY_CATEGORIES, categories.stream().toArray(String[]::new));
@@ -649,8 +576,9 @@
for (int i = 0; i < persons.length; i++) {
final Person person = persons[i];
if (person == null) continue;
- final AppSearchPerson appSearchPerson = AppSearchPerson.instance(person);
- documents[i] = appSearchPerson;
+ final AppSearchShortcutPerson personEntity =
+ AppSearchShortcutPerson.instance(person);
+ documents[i] = personEntity;
}
setPropertyDocument(KEY_PERSON, documents);
return this;
@@ -660,28 +588,6 @@
* @hide
*/
@NonNull
- public Builder setRank(final int rank) {
- Preconditions.checkArgument((0 <= rank), "Rank cannot be negative");
- setPropertyString(KEY_RANK, String.valueOf(rank));
- if (rank != 0) {
- mFlags.add(HAS_NON_ZERO_RANK);
- }
- return this;
- }
-
- /**
- * @hide
- */
- @NonNull
- public Builder setImplicitRank(final int rank) {
- setPropertyLong(KEY_IMPLICIT_RANK, rank);
- return this;
- }
-
- /**
- * @hide
- */
- @NonNull
public Builder setExtras(@Nullable final PersistableBundle extras) {
if (extras != null) {
setPropertyBytes(KEY_EXTRAS, transformToByteArray(extras));
@@ -722,17 +628,6 @@
/**
* @hide
*/
- public Builder setBitmapPath(@Nullable final String bitmapPath) {
- if (!TextUtils.isEmpty(bitmapPath)) {
- setPropertyString(KEY_BITMAP_PATH, bitmapPath);
- mFlags.add(HAS_BITMAP_PATH);
- }
- return this;
- }
-
- /**
- * @hide
- */
public Builder setIconUri(@Nullable final String iconUri) {
if (!TextUtils.isEmpty(iconUri)) {
setPropertyString(KEY_ICON_URI, iconUri);
@@ -751,12 +646,33 @@
/**
* @hide
*/
+ public Builder setCapabilityBindings(
+ @Nullable final Map<String, Map<String, List<String>>> bindings) {
+ if (bindings != null && !bindings.isEmpty()) {
+ final Set<String> capabilityNames = bindings.keySet();
+ final Set<String> capabilityBindings = new ArraySet<>(1);
+ for (String capabilityName: capabilityNames) {
+ final Map<String, List<String>> params =
+ bindings.get(capabilityName);
+ for (String paramName: params.keySet()) {
+ params.get(paramName).stream()
+ .map(v -> capabilityName + "/" + paramName + "/" + v)
+ .forEach(capabilityBindings::add);
+ }
+ }
+ setPropertyString(KEY_CAPABILITY, capabilityNames.toArray(new String[0]));
+ setPropertyString(KEY_CAPABILITY_BINDINGS,
+ capabilityBindings.toArray(new String[0]));
+ }
+ return this;
+ }
+
+ /**
+ * @hide
+ */
@NonNull
@Override
public AppSearchShortcutInfo build() {
- if (mHasStringResource) {
- mFlags.add(HAS_STRING_RESOURCE);
- }
setPropertyString(KEY_FLAGS, mFlags.toArray(new String[0]));
return new AppSearchShortcutInfo(super.build());
}
@@ -827,40 +743,12 @@
switch (mask) {
case ShortcutInfo.FLAG_DYNAMIC:
return (flags & mask) != 0 ? IS_DYNAMIC : NOT_DYNAMIC;
- case ShortcutInfo.FLAG_PINNED:
- return (flags & mask) != 0 ? IS_PINNED : NOT_PINNED;
- case ShortcutInfo.FLAG_HAS_ICON_RES:
- return (flags & mask) != 0 ? HAS_ICON_RES : NO_ICON_RES;
- case ShortcutInfo.FLAG_HAS_ICON_FILE:
- return (flags & mask) != 0 ? HAS_ICON_FILE : NO_ICON_FILE;
- case ShortcutInfo.FLAG_KEY_FIELDS_ONLY:
- return (flags & mask) != 0 ? IS_KEY_FIELD_ONLY : NOT_KEY_FIELD_ONLY;
case ShortcutInfo.FLAG_MANIFEST:
return (flags & mask) != 0 ? IS_MANIFEST : NOT_MANIFEST;
case ShortcutInfo.FLAG_DISABLED:
return (flags & mask) != 0 ? IS_DISABLED : NOT_DISABLED;
- case ShortcutInfo.FLAG_STRINGS_RESOLVED:
- return (flags & mask) != 0 ? ARE_STRINGS_RESOLVED : NOT_STRINGS_RESOLVED;
case ShortcutInfo.FLAG_IMMUTABLE:
return (flags & mask) != 0 ? IS_IMMUTABLE : NOT_IMMUTABLE;
- case ShortcutInfo.FLAG_ADAPTIVE_BITMAP:
- return (flags & mask) != 0 ? HAS_ADAPTIVE_BITMAP : NO_ADAPTIVE_BITMAP;
- case ShortcutInfo.FLAG_RETURNED_BY_SERVICE:
- return (flags & mask) != 0 ? IS_RETURNED_BY_SERVICE : NOT_RETURNED_BY_SERVICE;
- case ShortcutInfo.FLAG_ICON_FILE_PENDING_SAVE:
- return (flags & mask) != 0 ? HAS_ICON_FILE_PENDING_SAVE : NO_ICON_FILE_PENDING_SAVE;
- case ShortcutInfo.FLAG_SHADOW:
- return (flags & mask) != 0 ? IS_SHADOW : NOT_SHADOW;
- case ShortcutInfo.FLAG_LONG_LIVED:
- return (flags & mask) != 0 ? IS_LONG_LIVED : NOT_LONG_LIVED;
- case ShortcutInfo.FLAG_HAS_ICON_URI:
- return (flags & mask) != 0 ? HAS_ICON_URI : NO_ICON_URI;
- case ShortcutInfo.FLAG_CACHED_NOTIFICATIONS:
- return (flags & mask) != 0 ? IS_CACHED_NOTIFICATION : NOT_CACHED_NOTIFICATION;
- case ShortcutInfo.FLAG_CACHED_BUBBLES:
- return (flags & mask) != 0 ? IS_CACHED_BUBBLE : NOT_CACHED_BUBBLE;
- case ShortcutInfo.FLAG_CACHED_PEOPLE_TILE:
- return (flags & mask) != 0 ? IS_CACHED_PEOPLE_TITLE : NOT_CACHED_PEOPLE_TITLE;
default:
return null;
}
@@ -881,40 +769,12 @@
switch (value) {
case IS_DYNAMIC:
return ShortcutInfo.FLAG_DYNAMIC;
- case IS_PINNED:
- return ShortcutInfo.FLAG_PINNED;
- case HAS_ICON_RES:
- return ShortcutInfo.FLAG_HAS_ICON_RES;
- case HAS_ICON_FILE:
- return ShortcutInfo.FLAG_HAS_ICON_FILE;
- case IS_KEY_FIELD_ONLY:
- return ShortcutInfo.FLAG_KEY_FIELDS_ONLY;
case IS_MANIFEST:
return ShortcutInfo.FLAG_MANIFEST;
case IS_DISABLED:
return ShortcutInfo.FLAG_DISABLED;
- case ARE_STRINGS_RESOLVED:
- return ShortcutInfo.FLAG_STRINGS_RESOLVED;
case IS_IMMUTABLE:
return ShortcutInfo.FLAG_IMMUTABLE;
- case HAS_ADAPTIVE_BITMAP:
- return ShortcutInfo.FLAG_ADAPTIVE_BITMAP;
- case IS_RETURNED_BY_SERVICE:
- return ShortcutInfo.FLAG_RETURNED_BY_SERVICE;
- case HAS_ICON_FILE_PENDING_SAVE:
- return ShortcutInfo.FLAG_ICON_FILE_PENDING_SAVE;
- case IS_SHADOW:
- return ShortcutInfo.FLAG_SHADOW;
- case IS_LONG_LIVED:
- return ShortcutInfo.FLAG_LONG_LIVED;
- case HAS_ICON_URI:
- return ShortcutInfo.FLAG_HAS_ICON_URI;
- case IS_CACHED_NOTIFICATION:
- return ShortcutInfo.FLAG_CACHED_NOTIFICATIONS;
- case IS_CACHED_BUBBLE:
- return ShortcutInfo.FLAG_CACHED_BUBBLES;
- case IS_CACHED_PEOPLE_TITLE:
- return ShortcutInfo.FLAG_CACHED_PEOPLE_TILE;
default:
return 0;
}
@@ -927,9 +787,43 @@
for (int i = 0; i < persons.length; i++) {
final GenericDocument document = persons[i];
if (document == null) continue;
- final AppSearchPerson person = new AppSearchPerson(document);
+ final AppSearchShortcutPerson person = new AppSearchShortcutPerson(document);
ret[i] = person.toPerson();
}
return ret;
}
+
+ @Nullable
+ private static Map<String, Map<String, List<String>>> parseCapabilityBindings(
+ @Nullable final String[] capabilityBindings) {
+ if (capabilityBindings == null || capabilityBindings.length == 0) {
+ return null;
+ }
+ final Map<String, Map<String, List<String>>> ret = new ArrayMap<>(1);
+ Arrays.stream(capabilityBindings).forEach(binding -> {
+ if (TextUtils.isEmpty(binding)) {
+ return;
+ }
+ final int capabilityStopIndex = binding.indexOf("/");
+ if (capabilityStopIndex == -1 || capabilityStopIndex == binding.length() - 1) {
+ return;
+ }
+ final String capabilityName = binding.substring(0, capabilityStopIndex);
+ final int paramStopIndex = binding.indexOf("/", capabilityStopIndex + 1);
+ if (paramStopIndex == -1 || paramStopIndex == binding.length() - 1) {
+ return;
+ }
+ final String paramName = binding.substring(capabilityStopIndex + 1, paramStopIndex);
+ final String paramValue = binding.substring(paramStopIndex + 1);
+ if (!ret.containsKey(capabilityName)) {
+ ret.put(capabilityName, new ArrayMap<>(1));
+ }
+ final Map<String, List<String>> params = ret.get(capabilityName);
+ if (!params.containsKey(paramName)) {
+ params.put(paramName, new ArrayList<>(1));
+ }
+ params.get(paramName).add(paramValue);
+ });
+ return ret;
+ }
}
diff --git a/core/java/android/content/pm/AppSearchPerson.java b/core/java/android/content/pm/AppSearchShortcutPerson.java
similarity index 63%
rename from core/java/android/content/pm/AppSearchPerson.java
rename to core/java/android/content/pm/AppSearchShortcutPerson.java
index 98d150b..ff8a3b6 100644
--- a/core/java/android/content/pm/AppSearchPerson.java
+++ b/core/java/android/content/pm/AppSearchShortcutPerson.java
@@ -21,28 +21,38 @@
import android.app.Person;
import android.app.appsearch.AppSearchSchema;
import android.app.appsearch.GenericDocument;
+import android.graphics.drawable.Icon;
import android.net.UriCodec;
import com.android.internal.annotations.VisibleForTesting;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.UUID;
/**
+ * A {@link GenericDocument} representation of {@link Person} object.
+ *
* @hide
*/
-public class AppSearchPerson extends GenericDocument {
+public class AppSearchShortcutPerson extends GenericDocument {
- /** The name of the schema type for {@link Person} documents.*/
- public static final String SCHEMA_TYPE = "Person";
+ /**
+ * The name of the schema type for {@link Person} documents.
+ * @hide
+ */
+ public static final String SCHEMA_TYPE = "ShortcutPerson";
- public static final String KEY_NAME = "name";
- public static final String KEY_KEY = "key";
- public static final String KEY_IS_BOT = "isBot";
- public static final String KEY_IS_IMPORTANT = "isImportant";
+ private static final String KEY_NAME = "name";
+ private static final String KEY_KEY = "key";
+ private static final String KEY_IS_BOT = "isBot";
+ private static final String KEY_IS_IMPORTANT = "isImportant";
+ private static final String KEY_ICON = "icon";
- public AppSearchPerson(@NonNull GenericDocument document) {
+ public AppSearchShortcutPerson(@NonNull GenericDocument document) {
super(document);
}
@@ -67,11 +77,15 @@
.setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_REQUIRED)
.build()
+ ).addProperty(new AppSearchSchema.BytesPropertyConfig.Builder(KEY_ICON)
+ .setCardinality(AppSearchSchema.PropertyConfig.CARDINALITY_OPTIONAL)
+ .build()
+
).build();
- /** hide */
+ /** @hide */
@NonNull
- public static AppSearchPerson instance(@NonNull final Person person) {
+ public static AppSearchShortcutPerson instance(@NonNull final Person person) {
Objects.requireNonNull(person);
final String id;
if (person.getUri() != null) {
@@ -82,10 +96,13 @@
}
return new Builder(id).setName(person.getName())
.setKey(person.getKey()).setIsBot(person.isBot())
- .setIsImportant(person.isImportant()).build();
+ .setIsImportant(person.isImportant())
+ .setIcon(transformToByteArray(person.getIcon())).build();
}
- /** hide */
+ /**
+ * Convert this {@link GenericDocument} into {@link Person}.
+ */
@NonNull
public Person toPerson() {
String uri;
@@ -99,7 +116,9 @@
return new Person.Builder().setName(getPropertyString(KEY_NAME))
.setUri(uri).setKey(getPropertyString(KEY_KEY))
.setBot(getPropertyBoolean(KEY_IS_BOT))
- .setImportant(getPropertyBoolean(KEY_IS_IMPORTANT)).build();
+ .setImportant(getPropertyBoolean(KEY_IS_IMPORTANT))
+ .setIcon(transformToIcon(getPropertyBytes(KEY_ICON)))
+ .build();
}
/** @hide */
@@ -142,10 +161,51 @@
return this;
}
+ /** @hide */
+ @NonNull
+ public Builder setIcon(@Nullable final byte[] icon) {
+ if (icon != null) {
+ setPropertyBytes(KEY_ICON, icon);
+ }
+ return this;
+ }
+
+ /** @hide */
@NonNull
@Override
- public AppSearchPerson build() {
- return new AppSearchPerson(super.build());
+ public AppSearchShortcutPerson build() {
+ return new AppSearchShortcutPerson(super.build());
+ }
+ }
+
+ /**
+ * Convert {@link Icon} into byte[].
+ */
+ @Nullable
+ private static byte[] transformToByteArray(@Nullable final Icon icon) {
+ if (icon == null) {
+ return null;
+ }
+ try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
+ icon.writeToStream(baos);
+ return baos.toByteArray();
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ /**
+ * Convert byte[] into {@link Icon}.
+ */
+ @Nullable
+ private Icon transformToIcon(@Nullable final byte[] icon) {
+ if (icon == null) {
+ return null;
+ }
+ try (ByteArrayInputStream bais = new ByteArrayInputStream(icon)) {
+ return Icon.createFromStream(bais);
+ } catch (IOException e) {
+ return null;
}
}
}
diff --git a/core/java/android/content/pm/ServiceInfo.java b/core/java/android/content/pm/ServiceInfo.java
index 7fc242c..88d7004 100644
--- a/core/java/android/content/pm/ServiceInfo.java
+++ b/core/java/android/content/pm/ServiceInfo.java
@@ -170,6 +170,15 @@
public static final int FOREGROUND_SERVICE_TYPE_MICROPHONE = 1 << 7;
/**
+ * The number of foreground service types, this doesn't include
+ * the {@link #FOREGROUND_SERVICE_TYPE_MANIFEST} and {@link #FOREGROUND_SERVICE_TYPE_NONE}
+ * as they're not real service types.
+ *
+ * @hide
+ */
+ public static final int NUM_OF_FOREGROUND_SERVICE_TYPES = 8;
+
+ /**
* A special value indicates to use all types set in manifest file.
*/
public static final int FOREGROUND_SERVICE_TYPE_MANIFEST = -1;
@@ -239,6 +248,38 @@
+ " " + name + "}";
}
+ /**
+ * @return The label for the given foreground service type.
+ *
+ * @hide
+ */
+ public static String foregroundServiceTypeToLabel(@ForegroundServiceType int type) {
+ switch (type) {
+ case FOREGROUND_SERVICE_TYPE_MANIFEST:
+ return "manifest";
+ case FOREGROUND_SERVICE_TYPE_NONE:
+ return "none";
+ case FOREGROUND_SERVICE_TYPE_DATA_SYNC:
+ return "dataSync";
+ case FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK:
+ return "mediaPlayback";
+ case FOREGROUND_SERVICE_TYPE_PHONE_CALL:
+ return "phoneCall";
+ case FOREGROUND_SERVICE_TYPE_LOCATION:
+ return "location";
+ case FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE:
+ return "connectedDevice";
+ case FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION:
+ return "mediaProjection";
+ case FOREGROUND_SERVICE_TYPE_CAMERA:
+ return "camera";
+ case FOREGROUND_SERVICE_TYPE_MICROPHONE:
+ return "microphone";
+ default:
+ return "unknown";
+ }
+ }
+
public int describeContents() {
return 0;
}
diff --git a/core/java/android/content/pm/ShortcutInfo.java b/core/java/android/content/pm/ShortcutInfo.java
index ab827aa..41dd5bb3 100644
--- a/core/java/android/content/pm/ShortcutInfo.java
+++ b/core/java/android/content/pm/ShortcutInfo.java
@@ -24,6 +24,7 @@
import android.app.Notification;
import android.app.Person;
import android.app.TaskStackBuilder;
+import android.app.appsearch.GenericDocument;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.ComponentName;
import android.content.Context;
@@ -656,6 +657,28 @@
}
/**
+ * Convert a {@link GenericDocument} into a ShortcutInfo.
+ *
+ * @param context Client context
+ * @param document An instance of {@link GenericDocument} that represents the shortcut.
+ */
+ @NonNull
+ public static ShortcutInfo createFromGenericDocument(@NonNull final Context context,
+ @NonNull final GenericDocument document) {
+ Objects.requireNonNull(context);
+ Objects.requireNonNull(document);
+ return createFromGenericDocument(context.getUserId(), document);
+ }
+
+ /**
+ * @hide
+ */
+ public static ShortcutInfo createFromGenericDocument(
+ final int userId, @NonNull final GenericDocument document) {
+ return new AppSearchShortcutInfo(document).toShortcutInfo(userId);
+ }
+
+ /**
* Load a string resource from the publisher app.
*
* @param resId resource ID
diff --git a/core/java/android/content/res/ColorStateList.java b/core/java/android/content/res/ColorStateList.java
index 5b727cc..5031faa 100644
--- a/core/java/android/content/res/ColorStateList.java
+++ b/core/java/android/content/res/ColorStateList.java
@@ -198,7 +198,7 @@
// Prune the cache before adding new items.
final int N = sCache.size();
for (int i = N - 1; i >= 0; i--) {
- if (sCache.valueAt(i).get() == null) {
+ if (sCache.valueAt(i).refersTo(null)) {
sCache.removeAt(i);
}
}
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index cb53a2a..1aba961 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -2080,7 +2080,7 @@
// Clean up references to garbage collected themes
if (mThemeRefs.size() > mThemeRefsNextFlushSize) {
- mThemeRefs.removeIf(ref -> ref.get() == null);
+ mThemeRefs.removeIf(ref -> ref.refersTo(null));
mThemeRefsNextFlushSize = Math.max(MIN_THEME_REFS_FLUSH_SIZE,
2 * mThemeRefs.size());
}
diff --git a/core/java/android/content/res/loader/ResourcesLoader.java b/core/java/android/content/res/loader/ResourcesLoader.java
index c308400..cf6e166 100644
--- a/core/java/android/content/res/loader/ResourcesLoader.java
+++ b/core/java/android/content/res/loader/ResourcesLoader.java
@@ -257,7 +257,7 @@
for (int i = mChangeCallbacks.size() - 1; i >= 0; i--) {
final WeakReference<Object> key = mChangeCallbacks.keyAt(i);
- if (key.get() == null) {
+ if (key.refersTo(null)) {
mChangeCallbacks.removeAt(i);
} else {
uniqueCallbacks.add(mChangeCallbacks.valueAt(i));
diff --git a/core/java/android/hardware/HardwareBuffer.java b/core/java/android/hardware/HardwareBuffer.java
index acceb654..515a009 100644
--- a/core/java/android/hardware/HardwareBuffer.java
+++ b/core/java/android/hardware/HardwareBuffer.java
@@ -156,7 +156,7 @@
* used as USAGE_GPU_COLOR_OUTPUT the buffer will behave similar to a single-buffered window.
* When used with USAGE_COMPOSER_OVERLAY, the system will try to prioritize the buffer
* receiving an overlay plane & avoid caching it in intermediate composition buffers. */
- public static final long USAGE_FRONT_BUFFER = 1 << 32;
+ public static final long USAGE_FRONT_BUFFER = 1L << 32;
/**
* Creates a new <code>HardwareBuffer</code> instance.
diff --git a/core/java/android/hardware/usb/IUsbManager.aidl b/core/java/android/hardware/usb/IUsbManager.aidl
index 459dab1..b617e05 100644
--- a/core/java/android/hardware/usb/IUsbManager.aidl
+++ b/core/java/android/hardware/usb/IUsbManager.aidl
@@ -136,6 +136,9 @@
/* Resets the USB gadget. */
void resetUsbGadget();
+ /* Resets the USB port. */
+ boolean resetUsbPort(in String portId, int operationId, in IUsbOperationInternal callback);
+
/* Set USB data on or off */
boolean enableUsbData(in String portId, boolean enable, int operationId, in IUsbOperationInternal callback);
diff --git a/core/java/android/hardware/usb/UsbManager.java b/core/java/android/hardware/usb/UsbManager.java
index f0e040e..60f5135 100644
--- a/core/java/android/hardware/usb/UsbManager.java
+++ b/core/java/android/hardware/usb/UsbManager.java
@@ -1324,6 +1324,43 @@
}
/**
+ * Should only be called by {@link UsbPort#resetUsbPort}.
+ * <p>
+ * Disable and then re-enable USB data signaling.
+ *
+ * Reset USB first port..
+ * It will force to stop and restart USB data signaling.
+ * Call UsbPort API if the device has more than one UsbPort.
+ * </p>
+ *
+ * @param port reset the USB Port
+ * @return true enable or disable USB data successfully
+ * false if something wrong
+ *
+ * Should only be called by {@link UsbPort#resetUsbPort}.
+ *
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(Manifest.permission.MANAGE_USB)
+ boolean resetUsbPort(@NonNull UsbPort port, int operationId,
+ IUsbOperationInternal callback) {
+ Objects.requireNonNull(port, "resetUsbPort: port must not be null. opId:" + operationId);
+ try {
+ return mService.resetUsbPort(port.getId(), operationId, callback);
+ } catch (RemoteException e) {
+ Log.e(TAG, "resetUsbPort: failed. ", e);
+ try {
+ callback.onOperationComplete(UsbOperationInternal.USB_OPERATION_ERROR_INTERNAL);
+ } catch (RemoteException r) {
+ Log.e(TAG, "resetUsbPort: failed to call onOperationComplete. opId:"
+ + operationId, r);
+ }
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Should only be called by {@link UsbPort#enableUsbData}.
* <p>
* Enables or disables USB data on the specific port.
diff --git a/core/java/android/hardware/usb/UsbPort.java b/core/java/android/hardware/usb/UsbPort.java
index bef4dea..a979725 100644
--- a/core/java/android/hardware/usb/UsbPort.java
+++ b/core/java/android/hardware/usb/UsbPort.java
@@ -128,6 +128,9 @@
@Retention(RetentionPolicy.SOURCE)
@interface EnableUsbDataStatus{}
+ @Retention(RetentionPolicy.SOURCE)
+ @interface ResetUsbPortStatus{}
+
/**
* The {@link #enableLimitPowerTransfer} request was successfully completed.
*/
@@ -319,6 +322,43 @@
}
/**
+ * Reset Usb data on the port.
+ *
+ * @return {@link #ENABLE_USB_DATA_SUCCESS} when request completes successfully or
+ * {@link #ENABLE_USB_DATA_ERROR_INTERNAL} when request fails due to internal
+ * error or
+ * {@link ENABLE_USB_DATA_ERROR_NOT_SUPPORTED} when not supported or
+ * {@link ENABLE_USB_DATA_ERROR_PORT_MISMATCH} when request fails due to port id
+ * mismatch or
+ * {@link ENABLE_USB_DATA_ERROR_OTHER} when fails due to other reasons.
+ */
+ @CheckResult
+ @RequiresPermission(Manifest.permission.MANAGE_USB)
+ public @ResetUsbPortStatus int resetUsbPort() {
+ // UID is added To minimize operationID overlap between two different packages.
+ int operationId = sUsbOperationCount.incrementAndGet() + Binder.getCallingUid();
+ Log.i(TAG, "resetUsbData opId:" + operationId);
+ UsbOperationInternal opCallback =
+ new UsbOperationInternal(operationId, mId);
+ if (mUsbManager.resetUsbPort(this, operationId, opCallback) == true) {
+ opCallback.waitForOperationComplete();
+ }
+ int result = opCallback.getStatus();
+ switch (result) {
+ case USB_OPERATION_SUCCESS:
+ return ENABLE_USB_DATA_SUCCESS;
+ case USB_OPERATION_ERROR_INTERNAL:
+ return ENABLE_USB_DATA_ERROR_INTERNAL;
+ case USB_OPERATION_ERROR_NOT_SUPPORTED:
+ return ENABLE_USB_DATA_ERROR_NOT_SUPPORTED;
+ case USB_OPERATION_ERROR_PORT_MISMATCH:
+ return ENABLE_USB_DATA_ERROR_PORT_MISMATCH;
+ default:
+ return ENABLE_USB_DATA_ERROR_OTHER;
+ }
+ }
+
+ /**
* Enables/Disables Usb data on the port.
*
* @param enable When true enables USB data if disabled.
diff --git a/core/java/android/inputmethodservice/AbstractInputMethodService.java b/core/java/android/inputmethodservice/AbstractInputMethodService.java
index 75beacf..f16e243 100644
--- a/core/java/android/inputmethodservice/AbstractInputMethodService.java
+++ b/core/java/android/inputmethodservice/AbstractInputMethodService.java
@@ -300,13 +300,6 @@
return false;
}
- // TODO(b/149463653): remove it in T. We missed the API deadline in S.
- /** @hide */
- @Override
- public final boolean isUiContext() {
- return true;
- }
-
/** @hide */
@Override
public final int getWindowType() {
diff --git a/core/java/android/inputmethodservice/NavigationBarController.java b/core/java/android/inputmethodservice/NavigationBarController.java
index 7bc9573..a6e475a 100644
--- a/core/java/android/inputmethodservice/NavigationBarController.java
+++ b/core/java/android/inputmethodservice/NavigationBarController.java
@@ -266,34 +266,50 @@
}
final boolean insetChanged = !Objects.equals(systemInsets, mLastInsets);
if (zOrderChanged || insetChanged) {
- final NavigationBarFrame that = mNavigationBarFrame;
- that.post(() -> {
- if (!that.isAttachedToWindow()) {
- return;
- }
- final Insets currentSystemInsets = getSystemInsets();
- if (!Objects.equals(currentSystemInsets, mLastInsets)) {
- that.setLayoutParams(
- new FrameLayout.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- currentSystemInsets.bottom, Gravity.BOTTOM));
- mLastInsets = currentSystemInsets;
- }
- if (decor instanceof ViewGroup) {
- ViewGroup decorGroup = (ViewGroup) decor;
- final View navbarBackgroundView =
- window.getNavigationBarBackgroundView();
- if (navbarBackgroundView != null
- && decorGroup.indexOfChild(navbarBackgroundView)
- > decorGroup.indexOfChild(that)) {
- decorGroup.bringChildToFront(that);
- }
- }
- });
+ scheduleRelayout();
}
}
}
+ private void scheduleRelayout() {
+ // Capture the current frame object in case the object is replaced or cleared later.
+ final NavigationBarFrame frame = mNavigationBarFrame;
+ frame.post(() -> {
+ if (mDestroyed) {
+ return;
+ }
+ if (!frame.isAttachedToWindow()) {
+ return;
+ }
+ final Window window = mService.mWindow.getWindow();
+ if (window == null) {
+ return;
+ }
+ final View decor = window.peekDecorView();
+ if (decor == null) {
+ return;
+ }
+ if (!(decor instanceof ViewGroup)) {
+ return;
+ }
+ final ViewGroup decorGroup = (ViewGroup) decor;
+ final Insets currentSystemInsets = getSystemInsets();
+ if (!Objects.equals(currentSystemInsets, mLastInsets)) {
+ frame.setLayoutParams(new FrameLayout.LayoutParams(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ currentSystemInsets.bottom, Gravity.BOTTOM));
+ mLastInsets = currentSystemInsets;
+ }
+ final View navbarBackgroundView =
+ window.getNavigationBarBackgroundView();
+ if (navbarBackgroundView != null
+ && decorGroup.indexOfChild(navbarBackgroundView)
+ > decorGroup.indexOfChild(frame)) {
+ decorGroup.bringChildToFront(frame);
+ }
+ });
+ }
+
private boolean isGesturalNavigationEnabled() {
final Resources resources = mService.getResources();
if (resources == null) {
diff --git a/core/java/android/nfc/INfcTag.aidl b/core/java/android/nfc/INfcTag.aidl
index 539fd4a..e1ccc4f 100644
--- a/core/java/android/nfc/INfcTag.aidl
+++ b/core/java/android/nfc/INfcTag.aidl
@@ -45,4 +45,7 @@
boolean canMakeReadOnly(int ndefType);
int getMaxTransceiveLength(int technology);
boolean getExtendedLengthApdusSupported();
+
+ void setTagUpToDate(long cookie);
+ boolean isTagUpToDate(long cookie);
}
diff --git a/core/java/android/nfc/Tag.java b/core/java/android/nfc/Tag.java
index 398ec63a..0ce9c70 100644
--- a/core/java/android/nfc/Tag.java
+++ b/core/java/android/nfc/Tag.java
@@ -34,6 +34,7 @@
import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
+import android.os.SystemClock;
import java.io.IOException;
import java.util.Arrays;
@@ -121,6 +122,7 @@
final INfcTag mTagService; // interface to NFC service, will be null if mock tag
int mConnectedTechnology;
+ long mCookie;
/**
* Hidden constructor to be used by NFC service and internal classes.
@@ -140,6 +142,13 @@
mTagService = tagService;
mConnectedTechnology = -1;
+
+ try {
+ mCookie = SystemClock.elapsedRealtime();
+ tagService.setTagUpToDate(mCookie);
+ } catch (RemoteException e) {
+ throw e.rethrowAsRuntimeException();
+ }
}
/**
@@ -361,6 +370,18 @@
/** @hide */
@UnsupportedAppUsage
public INfcTag getTagService() {
+ try {
+ if (!mTagService.isTagUpToDate(mCookie)) {
+ String id_str = "";
+ for (int i = 0; i < mId.length; i++) {
+ id_str = id_str + String.format("%02X ", mId[i]);
+ }
+ String msg = "Permission Denial: Tag ( ID: " + id_str + ") is out of date";
+ throw new SecurityException(msg);
+ }
+ } catch (RemoteException e) {
+ throw e.rethrowAsRuntimeException();
+ }
return mTagService;
}
diff --git a/core/java/android/os/BatteryManager.java b/core/java/android/os/BatteryManager.java
index 6d4593a..76f857b 100644
--- a/core/java/android/os/BatteryManager.java
+++ b/core/java/android/os/BatteryManager.java
@@ -187,10 +187,13 @@
public static final int BATTERY_PLUGGED_USB = OsProtoEnums.BATTERY_PLUGGED_USB; // = 2
/** Power source is wireless. */
public static final int BATTERY_PLUGGED_WIRELESS = OsProtoEnums.BATTERY_PLUGGED_WIRELESS; // = 4
+ /** Power source is dock. */
+ public static final int BATTERY_PLUGGED_DOCK = OsProtoEnums.BATTERY_PLUGGED_DOCK; // = 8
/** @hide */
public static final int BATTERY_PLUGGED_ANY =
- BATTERY_PLUGGED_AC | BATTERY_PLUGGED_USB | BATTERY_PLUGGED_WIRELESS;
+ BATTERY_PLUGGED_AC | BATTERY_PLUGGED_USB | BATTERY_PLUGGED_WIRELESS
+ | BATTERY_PLUGGED_DOCK;
/**
* Sent when the device's battery has started charging (or has reached full charge
diff --git a/core/java/android/os/BatteryUsageStats.java b/core/java/android/os/BatteryUsageStats.java
index abe5f81..d41a5fe 100644
--- a/core/java/android/os/BatteryUsageStats.java
+++ b/core/java/android/os/BatteryUsageStats.java
@@ -109,6 +109,7 @@
static final String XML_ATTR_DISCHARGE_PERCENT = "discharge_pct";
static final String XML_ATTR_DISCHARGE_LOWER = "discharge_lower";
static final String XML_ATTR_DISCHARGE_UPPER = "discharge_upper";
+ static final String XML_ATTR_DISCHARGE_DURATION = "discharge_duration";
static final String XML_ATTR_BATTERY_REMAINING = "battery_remaining";
static final String XML_ATTR_CHARGE_REMAINING = "charge_remaining";
static final String XML_ATTR_HIGHEST_DRAIN_PACKAGE = "highest_drain_package";
@@ -127,6 +128,7 @@
private final long mStatsDurationMs;
private final double mDischargedPowerLowerBound;
private final double mDischargedPowerUpperBound;
+ private final long mDischargeDurationMs;
private final long mBatteryTimeRemainingMs;
private final long mChargeTimeRemainingMs;
private final String[] mCustomPowerComponentNames;
@@ -146,6 +148,7 @@
mDischargePercentage = builder.mDischargePercentage;
mDischargedPowerLowerBound = builder.mDischargedPowerLowerBoundMah;
mDischargedPowerUpperBound = builder.mDischargedPowerUpperBoundMah;
+ mDischargeDurationMs = builder.mDischargeDurationMs;
mBatteryStatsHistory = builder.mBatteryStatsHistory;
mBatteryTimeRemainingMs = builder.mBatteryTimeRemainingMs;
mChargeTimeRemainingMs = builder.mChargeTimeRemainingMs;
@@ -246,6 +249,13 @@
}
/**
+ * Returns the total amount of time the battery was discharging.
+ */
+ public long getDischargeDurationMs() {
+ return mDischargeDurationMs;
+ }
+
+ /**
* Returns an approximation for how much run time (in milliseconds) is remaining on
* the battery. Returns -1 if no time can be computed: either there is not
* enough current data to make a decision, or the battery is currently
@@ -321,6 +331,7 @@
mDischargePercentage = source.readInt();
mDischargedPowerLowerBound = source.readDouble();
mDischargedPowerUpperBound = source.readDouble();
+ mDischargeDurationMs = source.readLong();
mBatteryTimeRemainingMs = source.readLong();
mChargeTimeRemainingMs = source.readLong();
mCustomPowerComponentNames = source.readStringArray();
@@ -378,6 +389,7 @@
dest.writeInt(mDischargePercentage);
dest.writeDouble(mDischargedPowerLowerBound);
dest.writeDouble(mDischargedPowerUpperBound);
+ dest.writeLong(mDischargeDurationMs);
dest.writeLong(mBatteryTimeRemainingMs);
dest.writeLong(mChargeTimeRemainingMs);
dest.writeStringArray(mCustomPowerComponentNames);
@@ -447,6 +459,8 @@
proto.write(BatteryUsageStatsAtomsProto.SESSION_DURATION_MILLIS, getStatsDuration());
proto.write(BatteryUsageStatsAtomsProto.SESSION_DISCHARGE_PERCENTAGE,
getDischargePercentage());
+ proto.write(BatteryUsageStatsAtomsProto.DISCHARGE_DURATION_MILLIS,
+ getDischargeDurationMs());
deviceBatteryConsumer.writeStatsProto(proto,
BatteryUsageStatsAtomsProto.DEVICE_BATTERY_CONSUMER);
writeUidBatteryConsumersProto(proto, maxRawSize);
@@ -638,6 +652,7 @@
serializer.attributeInt(null, XML_ATTR_DISCHARGE_PERCENT, mDischargePercentage);
serializer.attributeDouble(null, XML_ATTR_DISCHARGE_LOWER, mDischargedPowerLowerBound);
serializer.attributeDouble(null, XML_ATTR_DISCHARGE_UPPER, mDischargedPowerUpperBound);
+ serializer.attributeLong(null, XML_ATTR_DISCHARGE_DURATION, mDischargeDurationMs);
serializer.attributeLong(null, XML_ATTR_BATTERY_REMAINING, mBatteryTimeRemainingMs);
serializer.attributeLong(null, XML_ATTR_CHARGE_REMAINING, mChargeTimeRemainingMs);
@@ -693,6 +708,8 @@
builder.setDischargedPowerRange(
parser.getAttributeDouble(null, XML_ATTR_DISCHARGE_LOWER),
parser.getAttributeDouble(null, XML_ATTR_DISCHARGE_UPPER));
+ builder.setDischargeDurationMs(
+ parser.getAttributeLong(null, XML_ATTR_DISCHARGE_DURATION));
builder.setBatteryTimeRemainingMs(
parser.getAttributeLong(null, XML_ATTR_BATTERY_REMAINING));
builder.setChargeTimeRemainingMs(
@@ -759,6 +776,7 @@
private int mDischargePercentage;
private double mDischargedPowerLowerBoundMah;
private double mDischargedPowerUpperBoundMah;
+ private long mDischargeDurationMs;
private long mBatteryTimeRemainingMs = -1;
private long mChargeTimeRemainingMs = -1;
private final AggregateBatteryConsumer.Builder[] mAggregateBatteryConsumersBuilders =
@@ -869,6 +887,15 @@
}
/**
+ * Sets the total battery discharge time, in milliseconds.
+ */
+ @NonNull
+ public Builder setDischargeDurationMs(long durationMs) {
+ mDischargeDurationMs = durationMs;
+ return this;
+ }
+
+ /**
* Sets an approximation for how much time (in milliseconds) remains until the battery
* is fully discharged.
*/
@@ -994,6 +1021,7 @@
mDischargedPowerLowerBoundMah += stats.mDischargedPowerLowerBound;
mDischargedPowerUpperBoundMah += stats.mDischargedPowerUpperBound;
mDischargePercentage += stats.mDischargePercentage;
+ mDischargeDurationMs += stats.mDischargeDurationMs;
mStatsDurationMs = getStatsDuration() + stats.getStatsDuration();
diff --git a/core/java/android/os/BatteryUsageStatsQuery.java b/core/java/android/os/BatteryUsageStatsQuery.java
index 81e49e9..37bd51b 100644
--- a/core/java/android/os/BatteryUsageStatsQuery.java
+++ b/core/java/android/os/BatteryUsageStatsQuery.java
@@ -75,8 +75,9 @@
@NonNull
private final int[] mUserIds;
private final long mMaxStatsAgeMs;
- private long mFromTimestamp;
- private long mToTimestamp;
+ private final long mFromTimestamp;
+ private final long mToTimestamp;
+ private final @BatteryConsumer.PowerComponent int[] mPowerComponents;
private BatteryUsageStatsQuery(@NonNull Builder builder) {
mFlags = builder.mFlags;
@@ -85,6 +86,7 @@
mMaxStatsAgeMs = builder.mMaxStatsAgeMs;
mFromTimestamp = builder.mFromTimestamp;
mToTimestamp = builder.mToTimestamp;
+ mPowerComponents = builder.mPowerComponents;
}
@BatteryUsageStatsFlags
@@ -116,6 +118,14 @@
}
/**
+ * Returns the power components that should be estimated or null if all power components
+ * are being requested.
+ */
+ public int[] getPowerComponents() {
+ return mPowerComponents;
+ }
+
+ /**
* Returns the client's tolerance for stale battery stats. The data is allowed to be up to
* this many milliseconds out-of-date.
*/
@@ -147,6 +157,7 @@
mMaxStatsAgeMs = in.readLong();
mFromTimestamp = in.readLong();
mToTimestamp = in.readLong();
+ mPowerComponents = in.createIntArray();
}
@Override
@@ -157,6 +168,7 @@
dest.writeLong(mMaxStatsAgeMs);
dest.writeLong(mFromTimestamp);
dest.writeLong(mToTimestamp);
+ dest.writeIntArray(mPowerComponents);
}
@Override
@@ -187,6 +199,7 @@
private long mMaxStatsAgeMs = DEFAULT_MAX_STATS_AGE_MS;
private long mFromTimestamp;
private long mToTimestamp;
+ private @BatteryConsumer.PowerComponent int[] mPowerComponents;
/**
* Builds a read-only BatteryUsageStatsQuery object.
@@ -248,6 +261,16 @@
}
/**
+ * Requests to return only statistics for the specified power components. The default
+ * is all power components.
+ */
+ public Builder includePowerComponents(
+ @BatteryConsumer.PowerComponent int[] powerComponents) {
+ mPowerComponents = powerComponents;
+ return this;
+ }
+
+ /**
* Requests to aggregate stored snapshots between the two supplied timestamps
* @param fromTimestamp Exclusive starting timestamp, as per System.currentTimeMillis()
* @param toTimestamp Inclusive ending timestamp, as per System.currentTimeMillis()
diff --git a/core/java/android/os/BinderProxy.java b/core/java/android/os/BinderProxy.java
index e929920..1b7c00c 100644
--- a/core/java/android/os/BinderProxy.java
+++ b/core/java/android/os/BinderProxy.java
@@ -125,7 +125,7 @@
for (ArrayList<WeakReference<BinderProxy>> a : mMainIndexValues) {
if (a != null) {
for (WeakReference<BinderProxy> ref : a) {
- if (ref.get() != null) {
+ if (!ref.refersTo(null)) {
++size;
}
}
@@ -196,7 +196,7 @@
// This ensures that ArrayList size is bounded by the maximum occupancy of
// that bucket.
for (int i = 0; i < size; ++i) {
- if (valueArray.get(i).get() == null) {
+ if (valueArray.get(i).refersTo(null)) {
valueArray.set(i, newWr);
Long[] keyArray = mMainIndexKeys[myHash];
keyArray[i] = key;
@@ -204,7 +204,7 @@
// "Randomly" check one of the remaining entries in [i+1, size), so that
// needlessly long buckets are eventually pruned.
int rnd = Math.floorMod(++mRandom, size - (i + 1));
- if (valueArray.get(i + 1 + rnd).get() == null) {
+ if (valueArray.get(i + 1 + rnd).refersTo(null)) {
remove(myHash, i + 1 + rnd);
}
}
diff --git a/core/java/android/os/Handler.java b/core/java/android/os/Handler.java
index d310d6e..834867c 100644
--- a/core/java/android/os/Handler.java
+++ b/core/java/android/os/Handler.java
@@ -799,6 +799,10 @@
* Remove any pending posts of messages with code 'what' and whose obj is
* 'object' that are in the message queue. If <var>object</var> is null,
* all messages will be removed.
+ * <p>
+ * Similar to {@link #removeMessages(int, Object)} but uses object equality
+ * ({@link Object#equals(Object)}) instead of reference equality (==) in
+ * determining whether object is the message's obj'.
*
*@hide
*/
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index 1810904..881fced 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -49,19 +49,7 @@
import java.util.concurrent.atomic.AtomicLong;
/**
- * This class gives you control of the power state of the device.
- *
- * <p>
- * <b>Device battery life will be significantly affected by the use of this API.</b>
- * Do not acquire {@link WakeLock}s unless you really need them, use the minimum levels
- * possible, and be sure to release them as soon as possible. In most cases,
- * you'll want to use
- * {@link android.view.WindowManager.LayoutParams#FLAG_KEEP_SCREEN_ON} instead.
- *
- * <p>
- * Any application using a WakeLock must request the {@code android.permission.WAKE_LOCK}
- * permission in an {@code <uses-permission>} element of the application's manifest.
- * </p>
+ * This class lets you query and request control of aspects of the device's power state.
*/
@SystemService(Context.POWER_SERVICE)
public final class PowerManager {
@@ -704,6 +692,21 @@
public long wakeTime;
public @WakeReason int wakeReason;
public long sleepDuration;
+
+ @Override
+ public boolean equals(@Nullable Object o) {
+ if (o instanceof WakeData) {
+ final WakeData other = (WakeData) o;
+ return wakeTime == other.wakeTime && wakeReason == other.wakeReason
+ && sleepDuration == other.sleepDuration;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(wakeTime, wakeReason, sleepDuration);
+ }
}
/**
@@ -1181,6 +1184,11 @@
* Although a wake lock can be created without special permissions,
* the {@link android.Manifest.permission#WAKE_LOCK} permission is
* required to actually acquire or release the wake lock that is returned.
+ *
+ * </p><p>
+ * <b>Device battery life will be significantly affected by the use of this API.</b>
+ * Do not acquire {@link WakeLock}s unless you really need them, use the minimum levels
+ * possible, and be sure to release them as soon as possible.
* </p><p class="note">
* If using this to keep the screen on, you should strongly consider using
* {@link android.view.WindowManager.LayoutParams#FLAG_KEEP_SCREEN_ON} instead.
diff --git a/core/java/android/os/VibrationEffect.java b/core/java/android/os/VibrationEffect.java
index ae37a71..f490587 100644
--- a/core/java/android/os/VibrationEffect.java
+++ b/core/java/android/os/VibrationEffect.java
@@ -21,7 +21,6 @@
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.annotation.SuppressLint;
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.ContentResolver;
@@ -40,6 +39,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -196,20 +196,20 @@
/**
* Create a waveform vibration.
*
- * Waveform vibrations are a potentially repeating series of timing and amplitude pairs. For
+ * <p>Waveform vibrations are a potentially repeating series of timing and amplitude pairs. For
* each pair, the value in the amplitude array determines the strength of the vibration and the
* value in the timing array determines how long it vibrates for. An amplitude of 0 implies no
* vibration (i.e. off), and any pairs with a timing value of 0 will be ignored.
- * <p>
- * The amplitude array of the generated waveform will be the same size as the given
+ *
+ * <p>The amplitude array of the generated waveform will be the same size as the given
* timing array with alternating values of 0 (i.e. off) and {@link #DEFAULT_AMPLITUDE},
* starting with 0. Therefore the first timing value will be the period to wait before turning
* the vibrator on, the second value will be how long to vibrate at {@link #DEFAULT_AMPLITUDE}
* strength, etc.
- * </p><p>
- * To cause the pattern to repeat, pass the index into the timings array at which to start the
- * repetition, or -1 to disable repeating.
- * </p>
+ *
+ * <p>To cause the pattern to repeat, pass the index into the timings array at which to start
+ * the repetition, or -1 to disable repeating. Repeating effects will be played indefinitely
+ * and should be cancelled via {@link Vibrator#cancel()}.
*
* @param timings The pattern of alternating on-off timings, starting with off. Timing values
* of 0 will cause the timing / amplitude pair to be ignored.
@@ -229,15 +229,15 @@
/**
* Create a waveform vibration.
*
- * Waveform vibrations are a potentially repeating series of timing and amplitude pairs. For
+ * <p>Waveform vibrations are a potentially repeating series of timing and amplitude pairs. For
* each pair, the value in the amplitude array determines the strength of the vibration and the
* value in the timing array determines how long it vibrates for, in milliseconds. Amplitude
* values must be between 0 and 255, and an amplitude of 0 implies no vibration (i.e. off). Any
* pairs with a timing value of 0 will be ignored.
- * </p><p>
- * To cause the pattern to repeat, pass the index into the timings array at which to start the
- * repetition, or -1 to disable repeating.
- * </p>
+ *
+ * <p>To cause the pattern to repeat, pass the index into the timings array at which to start
+ * the repetition, or -1 to disable repeating. Repeating effects will be played indefinitely
+ * and should be cancelled via {@link Vibrator#cancel()}.
*
* @param timings The timing values, in milliseconds, of the timing / amplitude pairs. Timing
* values of 0 will cause the pair to be ignored.
@@ -407,20 +407,59 @@
* Start building a waveform vibration.
*
* <p>The waveform builder offers more flexibility for creating waveform vibrations, allowing
- * control over vibration frequency and ramping up or down the vibration amplitude, frequency or
- * both.
+ * control over vibration amplitude and frequency via smooth transitions between values.
*
- * <p>For simpler waveform patterns see {@link #createWaveform} methods.
+ * <p>The waveform will start the first transition from the vibrator off state, with the
+ * resonant frequency by default. To provide an initial state, use
+ * {@link #startWaveform(VibrationParameter)}.
*
- * @hide
- * @see VibrationEffect.WaveformBuilder
+ * @return The {@link VibrationEffect.WaveformBuilder} started with the initial parameters.
*/
- @TestApi
@NonNull
public static WaveformBuilder startWaveform() {
return new WaveformBuilder();
}
+ /**
+ * Start building a waveform vibration with an initial state specified by a
+ * {@link VibrationParameter}.
+ *
+ * <p>The waveform builder offers more flexibility for creating waveform vibrations, allowing
+ * control over vibration amplitude and frequency via smooth transitions between values.
+ *
+ * @param initialParameter The initial {@link VibrationParameter} value to be applied at the
+ * beginning of the vibration.
+ * @return The {@link VibrationEffect.WaveformBuilder} started with the initial parameters.
+ */
+ @NonNull
+ public static WaveformBuilder startWaveform(@NonNull VibrationParameter initialParameter) {
+ WaveformBuilder builder = startWaveform();
+ builder.addTransition(Duration.ZERO, initialParameter);
+ return builder;
+ }
+
+ /**
+ * Start building a waveform vibration with an initial state specified by two
+ * {@link VibrationParameter VibrationParameters}.
+ *
+ * <p>The waveform builder offers more flexibility for creating waveform vibrations, allowing
+ * control over vibration amplitude and frequency via smooth transitions between values.
+ *
+ * @param initialParameter1 The initial {@link VibrationParameter} value to be applied at the
+ * beginning of the vibration.
+ * @param initialParameter2 The initial {@link VibrationParameter} value to be applied at the
+ * beginning of the vibration, must be a different type of parameter
+ * than the one specified by the first argument.
+ * @return The {@link VibrationEffect.WaveformBuilder} started with the initial parameters.
+ */
+ @NonNull
+ public static WaveformBuilder startWaveform(@NonNull VibrationParameter initialParameter1,
+ @NonNull VibrationParameter initialParameter2) {
+ WaveformBuilder builder = startWaveform();
+ builder.addTransition(Duration.ZERO, initialParameter1, initialParameter2);
+ return builder;
+ }
+
@Override
public int describeContents() {
return 0;
@@ -784,10 +823,23 @@
PRIMITIVE_LOW_TICK,
})
@Retention(RetentionPolicy.SOURCE)
- public @interface PrimitiveType {}
+ public @interface PrimitiveType {
+ }
+
+ /**
+ * Exception thrown when adding an element to a {@link Composition} that already ends in an
+ * indefinitely repeating effect.
+ */
+ public static final class UnreachableAfterRepeatingIndefinitelyException
+ extends IllegalStateException {
+ UnreachableAfterRepeatingIndefinitelyException() {
+ super("Compositions ending in an indefinitely repeating effect can't be extended");
+ }
+ }
/**
* No haptic effect. Used to generate extended delays between primitives.
+ *
* @hide
*/
public static final int PRIMITIVE_NOOP = 0;
@@ -837,50 +889,87 @@
Composition() {}
/**
- * Add a haptic effect to the end of the current composition.
+ * Adds a time duration to the current composition, during which the vibrator will be
+ * turned off
*
- * <p>Similar to {@link #addEffect(VibrationEffect, int)} , but with no delay applied.
+ * @param duration The length of time the vibrator should be off. Value must be non-negative
+ * and will be truncated to milliseconds.
+ * @return This {@link Composition} object to enable adding multiple elements in one chain.
*
- * @param effect The effect to add to this composition as a primitive
- * @return The {@link Composition} object to enable adding multiple primitives in one chain.
- * @hide
+ * @throws UnreachableAfterRepeatingIndefinitelyException if the composition is currently
+ * ending with a repeating effect.
*/
- @TestApi
@NonNull
- public Composition addEffect(@NonNull VibrationEffect effect) {
- return addEffect(effect, /* delay= */ 0);
+ public Composition addOffDuration(@NonNull Duration duration) {
+ int durationMs = (int) duration.toMillis();
+ Preconditions.checkArgumentNonnegative(durationMs, "Off period must be non-negative");
+ if (durationMs > 0) {
+ // Created a segment sustaining the zero amplitude to represent the delay.
+ addSegment(new StepSegment(/* amplitude= */ 0, /* frequencyHz= */ 0,
+ (int) duration.toMillis()));
+ }
+ return this;
}
/**
* Add a haptic effect to the end of the current composition.
*
- * @param effect The effect to add to this composition as a primitive
- * @param delay The amount of time in milliseconds to wait before playing this primitive
- * @return The {@link Composition} object to enable adding multiple primitives in one chain.
- * @hide
+ * <p>If this effect is repeating (e.g. created by {@link VibrationEffect#createWaveform}
+ * with a non-negative repeat index, or created by another composition that has effects
+ * repeating indefinitely), then no more effects or primitives will be accepted by this
+ * composition after this method. Such effects should be cancelled via
+ * {@link Vibrator#cancel()}.
+ *
+ * @param effect The effect to add to the end of this composition.
+ * @return This {@link Composition} object to enable adding multiple elements in one chain.
+ *
+ * @throws UnreachableAfterRepeatingIndefinitelyException if the composition is currently
+ * ending with a repeating effect.
*/
- @TestApi
@NonNull
- public Composition addEffect(@NonNull VibrationEffect effect,
- @IntRange(from = 0) int delay) {
- Preconditions.checkArgumentNonnegative(delay);
- if (delay > 0) {
- // Created a segment sustaining the zero amplitude to represent the delay.
- addSegment(new StepSegment(/* amplitude= */ 0, /* frequencyHz= */ 0,
- /* duration= */ delay));
- }
+ public Composition addEffect(@NonNull VibrationEffect effect) {
return addSegments(effect);
}
/**
+ * Add a haptic effect to the end of the current composition and play it on repeat,
+ * indefinitely.
+ *
+ * <p>The entire effect will be played on repeat, indefinitely, after all other elements
+ * already added to this composition are played. No more effects or primitives will be
+ * accepted by this composition after this method. Such effects should be cancelled via
+ * {@link Vibrator#cancel()}.
+ *
+ * @param effect The effect to add to the end of this composition, must be finite.
+ * @return This {@link Composition} object to enable adding multiple elements in one chain,
+ * although only {@link #compose()} can follow this call.
+ *
+ * @throws IllegalArgumentException if the given effect is already repeating indefinitely.
+ * @throws UnreachableAfterRepeatingIndefinitelyException if the composition is currently
+ * ending with a repeating effect.
+ */
+ @NonNull
+ public Composition repeatEffectIndefinitely(@NonNull VibrationEffect effect) {
+ Preconditions.checkArgument(effect.getDuration() < Long.MAX_VALUE,
+ "Can't repeat an indefinitely repeating effect. Consider addEffect instead.");
+ int previousSegmentCount = mSegments.size();
+ addSegments(effect);
+ // Set repeat after segments were added, since addSegments checks this index.
+ mRepeatIndex = previousSegmentCount;
+ return this;
+ }
+
+ /**
* Add a haptic primitive to the end of the current composition.
*
* Similar to {@link #addPrimitive(int, float, int)}, but with no delay and a
* default scale applied.
*
* @param primitiveId The primitive to add
+ * @return This {@link Composition} object to enable adding multiple elements in one chain.
*
- * @return The {@link Composition} object to enable adding multiple primitives in one chain.
+ * @throws UnreachableAfterRepeatingIndefinitelyException if the composition is currently
+ * ending with a repeating effect.
*/
@NonNull
public Composition addPrimitive(@PrimitiveType int primitiveId) {
@@ -894,8 +983,10 @@
*
* @param primitiveId The primitive to add
* @param scale The scale to apply to the intensity of the primitive.
+ * @return This {@link Composition} object to enable adding multiple elements in one chain.
*
- * @return The {@link Composition} object to enable adding multiple primitives in one chain.
+ * @throws UnreachableAfterRepeatingIndefinitelyException if the composition is currently
+ * ending with a repeating effect.
*/
@NonNull
public Composition addPrimitive(@PrimitiveType int primitiveId,
@@ -910,7 +1001,10 @@
* @param scale The scale to apply to the intensity of the primitive.
* @param delay The amount of time in milliseconds to wait before playing this primitive,
* starting at the time the previous element in this composition is finished.
- * @return The {@link Composition} object to enable adding multiple primitives in one chain.
+ * @return This {@link Composition} object to enable adding multiple elements in one chain.
+ *
+ * @throws UnreachableAfterRepeatingIndefinitelyException if the composition is currently
+ * ending with a repeating effect.
*/
@NonNull
public Composition addPrimitive(@PrimitiveType int primitiveId,
@@ -923,9 +1017,7 @@
private Composition addSegment(VibrationEffectSegment segment) {
if (mRepeatIndex >= 0) {
- throw new IllegalStateException(
- "Composition already have a repeating effect so any new primitive would be"
- + " unreachable.");
+ throw new UnreachableAfterRepeatingIndefinitelyException();
}
mSegments.add(segment);
return this;
@@ -933,9 +1025,7 @@
private Composition addSegments(VibrationEffect effect) {
if (mRepeatIndex >= 0) {
- throw new IllegalStateException(
- "Composition already have a repeating effect so any new primitive would be"
- + " unreachable.");
+ throw new UnreachableAfterRepeatingIndefinitelyException();
}
Composed composed = (Composed) effect;
if (composed.getRepeatIndex() >= 0) {
@@ -1001,162 +1091,251 @@
/**
* A builder for waveform haptic effects.
*
- * <p>Waveform vibrations constitute of one or more timed segments where the vibration
- * amplitude, frequency or both can linearly ramp to new values.
+ * <p>Waveform vibrations constitute of one or more timed transitions to new sets of vibration
+ * parameters. These parameters can be the vibration amplitude or frequency, for example.
*
- * <p>Waveform segments may have zero duration, which represent a jump to new vibration
- * amplitude and/or frequency values.
+ * <p>Note that physical vibration actuators have different reaction times for changing
+ * amplitude and frequency. Durations specified here represent a timeline for the target
+ * parameters, and quality of effects may be improved if the durations allow time for a
+ * transition to be smoothly applied.
*
- * <p>Waveform segments may have the same start and end vibration amplitude and frequency,
- * which represent a step where the amplitude and frequency are maintained for that duration.
+ * <p>Repeating waveforms can be built by constructing the repeating block separately and adding
+ * it to the end of a composition using
+ * {@link Composition#repeatEffectIndefinitely(VibrationEffect)}.
*
- * @hide
- * @see VibrationEffect#startWaveform()
+ * @see VibrationEffect#startWaveform
*/
- @TestApi
public static final class WaveformBuilder {
+ // Epsilon used for float comparison of amplitude and frequency values on transitions.
+ private static final float EPSILON = 1e-5f;
+
private ArrayList<VibrationEffectSegment> mSegments = new ArrayList<>();
+ private float mLastAmplitude = 0f;
+ private float mLastFrequencyHz = 0f;
WaveformBuilder() {}
/**
- * Vibrate with given amplitude for the given duration, in millis, keeping the previous
- * frequency the same.
+ * Add a transition to new vibration parameter value to the end of this waveform.
*
- * <p>If the duration is zero the vibrator will jump to new amplitude.
+ * <p>The duration represents how long the vibrator should take to smoothly transition to
+ * the new vibration parameter. If the duration is zero then the vibrator will jump to the
+ * new value as fast as possible.
*
- * @param amplitude The amplitude for this step
- * @param duration The duration of this step in milliseconds
- * @return The {@link WaveformBuilder} object to enable adding multiple steps in chain.
+ * <p>Vibration parameter values will be truncated to conform to the device capabilities
+ * according to the {@link android.os.vibrator.VibratorFrequencyProfile}.
+ *
+ * @param duration The length of time this transition should take. Value must be
+ * non-negative and will be truncated to milliseconds.
+ * @param targetParameter The new target {@link VibrationParameter} value to be reached
+ * after the given duration.
+ * @return This {@link WaveformBuilder} object to enable adding multiple transitions in
+ * chain.
*/
- @SuppressLint("MissingGetterMatchingBuilder")
+ @SuppressWarnings("MissingGetterMatchingBuilder") // No getters to segments once created.
@NonNull
- public WaveformBuilder addStep(@FloatRange(from = 0f, to = 1f) float amplitude,
- @IntRange(from = 0) int duration) {
- mSegments.add(new StepSegment(amplitude, getPreviousFrequencyHz(), duration));
+ public WaveformBuilder addTransition(@NonNull Duration duration,
+ @NonNull VibrationParameter targetParameter) {
+ Preconditions.checkNotNull(duration, "Duration is null");
+ checkVibrationParameter(targetParameter, "targetParameter");
+ float amplitude = extractTargetAmplitude(targetParameter, /* target2= */ null);
+ float frequencyHz = extractTargetFrequency(targetParameter, /* target2= */ null);
+ addTransitionSegment(duration, amplitude, frequencyHz);
return this;
}
/**
- * Vibrate with given amplitude and frequency for the given duration, in millis.
+ * Add a transition to new vibration parameters to the end of this waveform.
*
- * <p>If the duration is zero the vibrator will jump to new amplitude.
+ * <p>The duration represents how long the vibrator should take to smoothly transition to
+ * the new vibration parameters. If the duration is zero then the vibrator will jump to the
+ * new values as fast as possible.
*
- * @param amplitude The amplitude for this step
- * @param frequencyHz The frequency for this step, in hertz
- * @param duration The duration of this step in milliseconds
- * @return The {@link WaveformBuilder} object to enable adding multiple steps in chain.
+ * <p>Vibration parameters values will be truncated to conform to the device capabilities
+ * according to the {@link android.os.vibrator.VibratorFrequencyProfile}.
+ *
+ * @param duration The length of time this transition should take. Value must be
+ * non-negative and will be truncated to milliseconds.
+ * @param targetParameter1 The first target {@link VibrationParameter} value to be reached
+ * after the given duration.
+ * @param targetParameter2 The second target {@link VibrationParameter} value to be reached
+ * after the given duration, must be a different type of parameter
+ * than the one specified by the first argument.
+ * @return This {@link WaveformBuilder} object to enable adding multiple transitions in
+ * chain.
*/
- @SuppressLint("MissingGetterMatchingBuilder")
+ @SuppressWarnings("MissingGetterMatchingBuilder") // No getters to segments once created.
@NonNull
- public WaveformBuilder addStep(@FloatRange(from = 0f, to = 1f) float amplitude,
- @FloatRange(from = 1f) float frequencyHz,
- @IntRange(from = 0) int duration) {
- Preconditions.checkArgument(frequencyHz >= 1, "Frequency must be >= 1");
- mSegments.add(new StepSegment(amplitude, frequencyHz, duration));
+ public WaveformBuilder addTransition(@NonNull Duration duration,
+ @NonNull VibrationParameter targetParameter1,
+ @NonNull VibrationParameter targetParameter2) {
+ Preconditions.checkNotNull(duration, "Duration is null");
+ checkVibrationParameter(targetParameter1, "targetParameter1");
+ checkVibrationParameter(targetParameter2, "targetParameter2");
+ Preconditions.checkArgument(
+ !Objects.equals(targetParameter1.getClass(), targetParameter2.getClass()),
+ "Parameter arguments must specify different parameter types");
+ float amplitude = extractTargetAmplitude(targetParameter1, targetParameter2);
+ float frequencyHz = extractTargetFrequency(targetParameter1, targetParameter2);
+ addTransitionSegment(duration, amplitude, frequencyHz);
return this;
}
/**
- * Ramp vibration linearly for the given duration, in millis, from previous amplitude value
- * to the given one, keeping previous frequency.
+ * Add a duration to sustain the last vibration parameters of this waveform.
*
- * <p>If the duration is zero the vibrator will jump to new amplitude.
+ * <p>The duration represents how long the vibrator should sustain the last set of
+ * parameters provided to this builder.
*
- * @param amplitude The final amplitude this ramp should reach
- * @param duration The duration of this ramp in milliseconds
- * @return The {@link WaveformBuilder} object to enable adding multiple steps in chain.
+ * @param duration The length of time the last values should be sustained by the vibrator.
+ * Value must be >= 1ms.
+ * @return This {@link WaveformBuilder} object to enable adding multiple transitions in
+ * chain.
*/
- @SuppressLint("MissingGetterMatchingBuilder")
+ @SuppressWarnings("MissingGetterMatchingBuilder") // No getters to segments once created.
@NonNull
- public WaveformBuilder addRamp(@FloatRange(from = 0f, to = 1f) float amplitude,
- @IntRange(from = 0) int duration) {
- mSegments.add(new RampSegment(getPreviousAmplitude(), amplitude,
- getPreviousFrequencyHz(), getPreviousFrequencyHz(), duration));
+ public WaveformBuilder addSustain(@NonNull Duration duration) {
+ int durationMs = (int) duration.toMillis();
+ Preconditions.checkArgument(durationMs >= 1, "Sustain duration must be >= 1ms");
+ mSegments.add(new StepSegment(mLastAmplitude, mLastFrequencyHz, durationMs));
return this;
}
/**
- * Ramp vibration linearly for the given duration, in millis, from previous amplitude and
- * frequency values to the given ones.
- *
- * <p>If the duration is zero the vibrator will jump to new amplitude and frequency.
- *
- * @param amplitude The final amplitude this ramp should reach
- * @param frequencyHz The final frequency this ramp should reach, in hertz
- * @param duration The duration of this ramp in milliseconds
- * @return The {@link WaveformBuilder} object to enable adding multiple steps in chain.
- */
- @SuppressLint("MissingGetterMatchingBuilder")
- @NonNull
- public WaveformBuilder addRamp(@FloatRange(from = 0f, to = 1f) float amplitude,
- @FloatRange(from = 1f) float frequencyHz,
- @IntRange(from = 0) int duration) {
- Preconditions.checkArgument(frequencyHz >= 1, "Frequency must be >= 1");
- mSegments.add(new RampSegment(getPreviousAmplitude(), amplitude,
- getPreviousFrequencyHz(), frequencyHz, duration));
- return this;
- }
-
- /**
- * Compose all the steps together into a single {@link VibrationEffect}.
+ * Build the waveform as a single {@link VibrationEffect}.
*
* The {@link WaveformBuilder} object is still valid after this call, so you can
* continue adding more primitives to it and generating more {@link VibrationEffect}s by
* calling this method again.
*
- * @return The {@link VibrationEffect} resulting from the composition of the steps.
+ * @return The {@link VibrationEffect} resulting from the list of transitions.
*/
@NonNull
public VibrationEffect build() {
- return build(/* repeat= */ -1);
- }
-
- /**
- * Compose all the steps together into a single {@link VibrationEffect}.
- *
- * <p>To cause the pattern to repeat, pass the index at which to start the repetition
- * (starting at 0), or -1 to disable repeating.
- *
- * <p>The {@link WaveformBuilder} object is still valid after this call, so you can
- * continue adding more primitives to it and generating more {@link VibrationEffect}s by
- * calling this method again.
- *
- * @return The {@link VibrationEffect} resulting from the composition of the steps.
- */
- @NonNull
- public VibrationEffect build(int repeat) {
if (mSegments.isEmpty()) {
throw new IllegalStateException(
- "WaveformBuilder must have at least one element to build.");
+ "WaveformBuilder must have at least one transition to build.");
}
- VibrationEffect effect = new Composed(mSegments, repeat);
+ VibrationEffect effect = new Composed(mSegments, /* repeatIndex= */ -1);
effect.validate();
return effect;
}
- private float getPreviousFrequencyHz() {
- if (!mSegments.isEmpty()) {
- VibrationEffectSegment segment = mSegments.get(mSegments.size() - 1);
- if (segment instanceof StepSegment) {
- return ((StepSegment) segment).getFrequencyHz();
- } else if (segment instanceof RampSegment) {
- return ((RampSegment) segment).getEndFrequencyHz();
- }
- }
- return 0;
+ private void checkVibrationParameter(@NonNull VibrationParameter vibrationParameter,
+ String paramName) {
+ Preconditions.checkNotNull(vibrationParameter, "%s is null", paramName);
+ Preconditions.checkArgument(
+ (vibrationParameter instanceof AmplitudeVibrationParameter)
+ || (vibrationParameter instanceof FrequencyVibrationParameter),
+ "%s is a unknown parameter", paramName);
}
- private float getPreviousAmplitude() {
- if (!mSegments.isEmpty()) {
- VibrationEffectSegment segment = mSegments.get(mSegments.size() - 1);
- if (segment instanceof StepSegment) {
- return ((StepSegment) segment).getAmplitude();
- } else if (segment instanceof RampSegment) {
- return ((RampSegment) segment).getEndAmplitude();
+ private float extractTargetAmplitude(@Nullable VibrationParameter target1,
+ @Nullable VibrationParameter target2) {
+ if (target2 instanceof AmplitudeVibrationParameter) {
+ return ((AmplitudeVibrationParameter) target2).amplitude;
+ }
+ if (target1 instanceof AmplitudeVibrationParameter) {
+ return ((AmplitudeVibrationParameter) target1).amplitude;
+ }
+ return mLastAmplitude;
+ }
+
+ private float extractTargetFrequency(@Nullable VibrationParameter target1,
+ @Nullable VibrationParameter target2) {
+ if (target2 instanceof FrequencyVibrationParameter) {
+ return ((FrequencyVibrationParameter) target2).frequencyHz;
+ }
+ if (target1 instanceof FrequencyVibrationParameter) {
+ return ((FrequencyVibrationParameter) target1).frequencyHz;
+ }
+ return mLastFrequencyHz;
+ }
+
+ private void addTransitionSegment(Duration duration, float targetAmplitude,
+ float targetFrequency) {
+ Preconditions.checkNotNull(duration, "Duration is null");
+ Preconditions.checkArgument(!duration.isNegative(),
+ "Transition duration must be non-negative");
+ int durationMs = (int) duration.toMillis();
+
+ // Ignore transitions with zero duration, but keep values for next additions.
+ if (durationMs > 0) {
+ if ((Math.abs(mLastAmplitude - targetAmplitude) < EPSILON)
+ && (Math.abs(mLastFrequencyHz - targetFrequency) < EPSILON)) {
+ // No value is changing, this can be best represented by a step segment.
+ mSegments.add(new StepSegment(targetAmplitude, targetFrequency, durationMs));
+ } else {
+ mSegments.add(new RampSegment(mLastAmplitude, targetAmplitude,
+ mLastFrequencyHz, targetFrequency, durationMs));
}
}
- return 0;
+
+ mLastAmplitude = targetAmplitude;
+ mLastFrequencyHz = targetFrequency;
+ }
+ }
+
+ /**
+ * A representation of a single vibration parameter.
+ *
+ * <p>This is to describe a waveform haptic effect, which consists of one or more timed
+ * transitions to a new set of {@link VibrationParameter}s.
+ *
+ * <p>Examples of concrete parameters are the vibration amplitude or frequency.
+ *
+ * @see VibrationEffect.WaveformBuilder
+ */
+ @SuppressWarnings("UserHandleName") // This is not a regular set of parameters, no *Params.
+ public static class VibrationParameter {
+ VibrationParameter() {
+ }
+
+ /**
+ * The target vibration amplitude.
+ *
+ * @param amplitude The amplitude value, between 0 and 1, inclusive, where 0 represents the
+ * vibrator turned off and 1 represents the maximum amplitude the vibrator
+ * can reach across all supported frequencies.
+ * @return The {@link VibrationParameter} instance that represents given amplitude.
+ */
+ @NonNull
+ public static VibrationParameter targetAmplitude(
+ @FloatRange(from = 0, to = 1) float amplitude) {
+ return new AmplitudeVibrationParameter(amplitude);
+ }
+
+ /**
+ * The target vibration frequency.
+ *
+ * @param frequencyHz The frequency value, in hertz.
+ * @return The {@link VibrationParameter} instance that represents given frequency.
+ */
+ @NonNull
+ public static VibrationParameter targetFrequency(@FloatRange(from = 1) float frequencyHz) {
+ return new FrequencyVibrationParameter(frequencyHz);
+ }
+ }
+
+ /** The vibration amplitude, represented by a value in [0,1]. */
+ private static final class AmplitudeVibrationParameter extends VibrationParameter {
+ public final float amplitude;
+
+ AmplitudeVibrationParameter(float amplitude) {
+ Preconditions.checkArgument((amplitude >= 0) && (amplitude <= 1),
+ "Amplitude must be within [0,1]");
+ this.amplitude = amplitude;
+ }
+ }
+
+ /** The vibration frequency, in hertz, or zero to represent undefined frequency. */
+ private static final class FrequencyVibrationParameter extends VibrationParameter {
+ public final float frequencyHz;
+
+ FrequencyVibrationParameter(float frequencyHz) {
+ Preconditions.checkArgument(frequencyHz >= 1, "Frequency must be >= 1");
+ Preconditions.checkArgument(Float.isFinite(frequencyHz), "Frequency must be finite");
+ this.frequencyHz = frequencyHz;
}
}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 3f54408..2a563ac 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -17210,6 +17210,12 @@
*/
public static final String CLOCKWORK_LONG_PRESS_TO_ASSISTANT_ENABLED =
"clockwork_long_press_to_assistant_enabled";
+
+ /*
+ * Whether the device has Wet Mode/ Touch Lock Mode enabled.
+ * @hide
+ */
+ public static final String WET_MODE_ON = "wet_mode_on";
}
}
diff --git a/core/java/android/service/games/GameSession.java b/core/java/android/service/games/GameSession.java
index cb5c19b..f4baedc 100644
--- a/core/java/android/service/games/GameSession.java
+++ b/core/java/android/service/games/GameSession.java
@@ -20,6 +20,7 @@
import android.annotation.IntDef;
import android.annotation.MainThread;
import android.annotation.NonNull;
+import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.content.Context;
import android.content.res.Configuration;
@@ -271,6 +272,25 @@
}
/**
+ * Attempts to force stop and relaunch the game associated with the current session. This may
+ * be useful, for example, after applying settings that will not take effect until the game is
+ * restarted.
+ *
+ * @return {@code true} if the game was successfully restarted; otherwise, {@code false}.
+ */
+ @RequiresPermission(android.Manifest.permission.FORCE_STOP_PACKAGES)
+ public final boolean restartGame() {
+ try {
+ mGameSessionController.restartGame(mTaskId);
+ } catch (RemoteException e) {
+ Slog.w(TAG, "Failed to restart game", e);
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
* Root view of the {@link SurfaceControlViewHost} associated with the {@link GameSession}
* instance. It is responsible for observing changes in the size of the window and resizing
* itself to match.
diff --git a/core/java/android/service/games/IGameSessionController.aidl b/core/java/android/service/games/IGameSessionController.aidl
index fe1d362..84311dc 100644
--- a/core/java/android/service/games/IGameSessionController.aidl
+++ b/core/java/android/service/games/IGameSessionController.aidl
@@ -16,6 +16,7 @@
package android.service.games;
+import android.content.Intent;
import com.android.internal.infra.AndroidFuture;
/**
@@ -23,4 +24,6 @@
*/
oneway interface IGameSessionController {
void takeScreenshot(int taskId, in AndroidFuture gameScreenshotResultFuture);
-}
\ No newline at end of file
+ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.FORCE_STOP_PACKAGES)")
+ void restartGame(in int taskId);
+}
diff --git a/core/java/android/service/notification/ZenModeConfig.java b/core/java/android/service/notification/ZenModeConfig.java
index 8834cee..4cc379e 100644
--- a/core/java/android/service/notification/ZenModeConfig.java
+++ b/core/java/android/service/notification/ZenModeConfig.java
@@ -46,6 +46,7 @@
import android.text.format.DateFormat;
import android.util.ArrayMap;
import android.util.ArraySet;
+import android.util.PluralsMessageFormatter;
import android.util.Slog;
import android.util.TypedXmlPullParser;
import android.util.TypedXmlSerializer;
@@ -63,8 +64,10 @@
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
+import java.util.HashMap;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import java.util.Objects;
import java.util.TimeZone;
import java.util.UUID;
@@ -1333,25 +1336,30 @@
final CharSequence formattedTime =
getFormattedTime(context, time, isToday(time), userHandle);
final Resources res = context.getResources();
+ final Map<String, Object> arguments = new HashMap<>();
if (minutes < 60) {
// display as minutes
num = minutes;
- int summaryResId = shortVersion ? R.plurals.zen_mode_duration_minutes_summary_short
- : R.plurals.zen_mode_duration_minutes_summary;
- summary = res.getQuantityString(summaryResId, num, num, formattedTime);
- int line1ResId = shortVersion ? R.plurals.zen_mode_duration_minutes_short
- : R.plurals.zen_mode_duration_minutes;
- line1 = res.getQuantityString(line1ResId, num, num, formattedTime);
+ int summaryResId = shortVersion ? R.string.zen_mode_duration_minutes_summary_short
+ : R.string.zen_mode_duration_minutes_summary;
+ arguments.put("count", num);
+ arguments.put("formattedTime", formattedTime);
+ summary = PluralsMessageFormatter.format(res, arguments, summaryResId);
+ int line1ResId = shortVersion ? R.string.zen_mode_duration_minutes_short
+ : R.string.zen_mode_duration_minutes;
+ line1 = PluralsMessageFormatter.format(res, arguments, line1ResId);
line2 = res.getString(R.string.zen_mode_until, formattedTime);
} else if (minutes < DAY_MINUTES) {
// display as hours
num = Math.round(minutes / 60f);
- int summaryResId = shortVersion ? R.plurals.zen_mode_duration_hours_summary_short
- : R.plurals.zen_mode_duration_hours_summary;
- summary = res.getQuantityString(summaryResId, num, num, formattedTime);
- int line1ResId = shortVersion ? R.plurals.zen_mode_duration_hours_short
- : R.plurals.zen_mode_duration_hours;
- line1 = res.getQuantityString(line1ResId, num, num, formattedTime);
+ int summaryResId = shortVersion ? R.string.zen_mode_duration_hours_summary_short
+ : R.string.zen_mode_duration_hours_summary;
+ arguments.put("count", num);
+ arguments.put("formattedTime", formattedTime);
+ summary = PluralsMessageFormatter.format(res, arguments, summaryResId);
+ int line1ResId = shortVersion ? R.string.zen_mode_duration_hours_short
+ : R.string.zen_mode_duration_hours;
+ line1 = PluralsMessageFormatter.format(res, arguments, line1ResId);
line2 = res.getString(R.string.zen_mode_until, formattedTime);
} else {
// display as day/time
diff --git a/core/java/android/text/TextUtils.java b/core/java/android/text/TextUtils.java
index d0fd2b3..28f5c21 100644
--- a/core/java/android/text/TextUtils.java
+++ b/core/java/android/text/TextUtils.java
@@ -2071,15 +2071,6 @@
}
/**
- * Return localized string representing the given number of selected items.
- *
- * @hide
- */
- public static CharSequence formatSelectedCount(int count) {
- return Resources.getSystem().getQuantityString(R.plurals.selected_count, count, count);
- }
-
- /**
* Simple alternative to {@link String#format} which purposefully supports
* only a small handful of substitutions to improve execution speed.
* Benchmarking reveals this optimized alternative performs 6.5x faster for
diff --git a/core/java/android/text/method/TextKeyListener.java b/core/java/android/text/method/TextKeyListener.java
index 9cbda9c..2eb917b 100644
--- a/core/java/android/text/method/TextKeyListener.java
+++ b/core/java/android/text/method/TextKeyListener.java
@@ -306,7 +306,7 @@
/* package */ int getPrefs(Context context) {
synchronized (this) {
- if (!mPrefsInited || mResolver.get() == null) {
+ if (!mPrefsInited || mResolver.refersTo(null)) {
initPrefs(context);
}
}
diff --git a/core/java/android/util/PluralsMessageFormatter.java b/core/java/android/util/PluralsMessageFormatter.java
new file mode 100644
index 0000000..7cb9fb3
--- /dev/null
+++ b/core/java/android/util/PluralsMessageFormatter.java
@@ -0,0 +1,44 @@
+/*
+ * 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 android.util;
+
+import android.annotation.NonNull;
+import android.annotation.StringRes;
+import android.content.res.Resources;
+import android.icu.text.MessageFormat;
+
+import java.util.Map;
+
+/**
+ * Helper class for easier formatting of ICU {@link android.icu.text.MessageFormat} syntax.
+ * @hide
+ */
+public class PluralsMessageFormatter {
+ /**
+ * Formatting the ICU {@link android.icu.text.MessageFormat} syntax
+ *
+ * @param resources the {@link android.content.res.Resources}
+ * @param arguments the mapping of argument names and values
+ * @param messageId the string resource id with {@link android.icu.text.MessageFormat} syntax
+ * @return the formatted result
+ */
+ public static String format(@NonNull Resources resources,
+ Map<String, Object> arguments,
+ @StringRes int messageId) {
+ return new MessageFormat(resources.getString(messageId)).format(arguments);
+ }
+}
diff --git a/core/java/android/util/SparseArrayMap.java b/core/java/android/util/SparseArrayMap.java
index cd592a7..e5bb9f45 100644
--- a/core/java/android/util/SparseArrayMap.java
+++ b/core/java/android/util/SparseArrayMap.java
@@ -62,6 +62,14 @@
}
/**
+ * Removes all the data for the keyIndex, if there was any.
+ * @hide
+ */
+ public void deleteAt(int keyIndex) {
+ mData.removeAt(keyIndex);
+ }
+
+ /**
* Removes the data for the key and mapKey, if there was any.
*
* @return Returns the value that was stored under the keys, or null if there was none.
@@ -142,6 +150,15 @@
return data == null ? 0 : data.size();
}
+ /**
+ * Returns the number of elements in the map of the given keyIndex.
+ * @hide
+ */
+ public int numElementsForKeyAt(int keyIndex) {
+ ArrayMap<K, V> data = mData.valueAt(keyIndex);
+ return data == null ? 0 : data.size();
+ }
+
/** Returns the value V at the given key and map index. */
@Nullable
public V valueAt(int keyIndex, int mapIndex) {
diff --git a/core/java/android/util/SparseDoubleArray.java b/core/java/android/util/SparseDoubleArray.java
index e8d96d8..ee2e3ce 100644
--- a/core/java/android/util/SparseDoubleArray.java
+++ b/core/java/android/util/SparseDoubleArray.java
@@ -124,6 +124,15 @@
}
/**
+ * Returns the index for which {@link #keyAt} would return the
+ * specified key, or a negative number if the specified
+ * key is not mapped.
+ */
+ public int indexOfKey(int key) {
+ return mValues.indexOfKey(key);
+ }
+
+ /**
* Given an index in the range <code>0...size()-1</code>, returns
* the key from the <code>index</code>th key-value mapping that this
* SparseDoubleArray stores.
@@ -146,6 +155,34 @@
}
/**
+ * Given an index in the range <code>0...size()-1</code>, sets a new
+ * value for the <code>index</code>th key-value mapping that this
+ * SparseDoubleArray stores.
+ *
+ * <p>For indices outside of the range <code>0...size()-1</code>, the behavior is undefined for
+ * apps targeting {@link android.os.Build.VERSION_CODES#P} and earlier, and an
+ * {@link ArrayIndexOutOfBoundsException} is thrown for apps targeting
+ * {@link android.os.Build.VERSION_CODES#Q} and later.</p>
+ */
+ public void setValueAt(int index, double value) {
+ mValues.setValueAt(index, Double.doubleToRawLongBits(value));
+ }
+
+ /**
+ * Removes the mapping at the given index.
+ */
+ public void removeAt(int index) {
+ mValues.removeAt(index);
+ }
+
+ /**
+ * Removes the mapping from the specified key, if there was any.
+ */
+ public void delete(int key) {
+ mValues.delete(key);
+ }
+
+ /**
* Removes all key-value mappings from this SparseDoubleArray.
*/
public void clear() {
diff --git a/core/java/android/util/SparseLongArray.java b/core/java/android/util/SparseLongArray.java
index 7185972..b739e37 100644
--- a/core/java/android/util/SparseLongArray.java
+++ b/core/java/android/util/SparseLongArray.java
@@ -245,6 +245,28 @@
}
/**
+ * Given an index in the range <code>0...size()-1</code>, sets a new
+ * value for the <code>index</code>th key-value mapping that this
+ * SparseLongArray stores.
+ *
+ * <p>For indices outside of the range <code>0...size()-1</code>, the behavior is undefined for
+ * apps targeting {@link android.os.Build.VERSION_CODES#P} and earlier, and an
+ * {@link ArrayIndexOutOfBoundsException} is thrown for apps targeting
+ * {@link android.os.Build.VERSION_CODES#Q} and later.</p>
+ *
+ * @hide
+ */
+ public void setValueAt(int index, long value) {
+ if (index >= mSize && UtilConfig.sThrowExceptionForUpperArrayOutOfBounds) {
+ // The array might be slightly bigger than mSize, in which case, indexing won't fail.
+ // Check if exception should be thrown outside of the critical path.
+ throw new ArrayIndexOutOfBoundsException(index);
+ }
+
+ mValues[index] = value;
+ }
+
+ /**
* Returns the index for which {@link #keyAt} would return the
* specified key, or a negative number if the specified
* key is not mapped.
diff --git a/core/java/android/util/apk/ApkSignatureSchemeV2Verifier.java b/core/java/android/util/apk/ApkSignatureSchemeV2Verifier.java
index c7d9b9c..c8c1fd4 100644
--- a/core/java/android/util/apk/ApkSignatureSchemeV2Verifier.java
+++ b/core/java/android/util/apk/ApkSignatureSchemeV2Verifier.java
@@ -407,20 +407,6 @@
}
}
- static byte[] generateApkVerityRootHash(String apkPath)
- throws IOException, SignatureNotFoundException, DigestException,
- NoSuchAlgorithmException {
- try (RandomAccessFile apk = new RandomAccessFile(apkPath, "r")) {
- SignatureInfo signatureInfo = findSignature(apk);
- VerifiedSigner vSigner = verify(apk, false);
- if (vSigner.verityRootHash == null) {
- return null;
- }
- return VerityBuilder.generateApkVerityRootHash(
- apk, ByteBuffer.wrap(vSigner.verityRootHash), signatureInfo);
- }
- }
-
/**
* Verified APK Signature Scheme v2 signer.
*
diff --git a/core/java/android/util/apk/ApkSignatureSchemeV3Verifier.java b/core/java/android/util/apk/ApkSignatureSchemeV3Verifier.java
index 7e65d61..3287ce8 100644
--- a/core/java/android/util/apk/ApkSignatureSchemeV3Verifier.java
+++ b/core/java/android/util/apk/ApkSignatureSchemeV3Verifier.java
@@ -545,20 +545,6 @@
}
}
- static byte[] generateApkVerityRootHash(String apkPath)
- throws NoSuchAlgorithmException, DigestException, IOException,
- SignatureNotFoundException {
- try (RandomAccessFile apk = new RandomAccessFile(apkPath, "r")) {
- SignatureInfo signatureInfo = findSignature(apk);
- VerifiedSigner vSigner = verify(apk, false);
- if (vSigner.verityRootHash == null) {
- return null;
- }
- return VerityBuilder.generateApkVerityRootHash(
- apk, ByteBuffer.wrap(vSigner.verityRootHash), signatureInfo);
- }
- }
-
/**
* Verified APK Signature Scheme v3 signer, including the proof of rotation structure.
*
diff --git a/core/java/android/util/apk/ApkSignatureVerifier.java b/core/java/android/util/apk/ApkSignatureVerifier.java
index bff5426..d2a18dd 100644
--- a/core/java/android/util/apk/ApkSignatureVerifier.java
+++ b/core/java/android/util/apk/ApkSignatureVerifier.java
@@ -569,27 +569,6 @@
}
/**
- * Generates the FSVerity root hash from FSVerity header, extensions and Merkle tree root hash
- * in Signing Block.
- *
- * @return FSverity root hash
- */
- public static byte[] generateApkVerityRootHash(String apkPath)
- throws NoSuchAlgorithmException, DigestException, IOException {
- // first try v3
- try {
- return ApkSignatureSchemeV3Verifier.generateApkVerityRootHash(apkPath);
- } catch (SignatureNotFoundException e) {
- // try older version
- }
- try {
- return ApkSignatureSchemeV2Verifier.generateApkVerityRootHash(apkPath);
- } catch (SignatureNotFoundException e) {
- return null;
- }
- }
-
- /**
* Extended signing details.
* @hide for internal use only.
*/
diff --git a/core/java/android/util/apk/VerityBuilder.java b/core/java/android/util/apk/VerityBuilder.java
index c7c465d..adf53c2 100644
--- a/core/java/android/util/apk/VerityBuilder.java
+++ b/core/java/android/util/apk/VerityBuilder.java
@@ -143,25 +143,6 @@
return generateFsVerityTreeInternal(apk, salt, levelOffset, tree);
}
}
- /**
- * Calculates the apk-verity root hash for integrity measurement. This needs to be consistent
- * to what kernel returns.
- */
- @NonNull
- static byte[] generateApkVerityRootHash(@NonNull RandomAccessFile apk,
- @NonNull ByteBuffer apkDigest, @NonNull SignatureInfo signatureInfo)
- throws NoSuchAlgorithmException, DigestException, IOException {
- assertSigningBlockAlignedAndHasFullPages(signatureInfo);
-
- ByteBuffer footer = ByteBuffer.allocate(CHUNK_SIZE_BYTES).order(ByteOrder.LITTLE_ENDIAN);
- generateApkVerityFooter(apk, signatureInfo, footer);
- footer.flip();
-
- MessageDigest md = MessageDigest.getInstance(JCA_DIGEST_ALGORITHM);
- md.update(footer);
- md.update(apkDigest);
- return md.digest();
- }
/**
* Generates the apk-verity header and hash tree to be used by kernel for the given apk. This
diff --git a/core/java/android/view/HandwritingInitiator.java b/core/java/android/view/HandwritingInitiator.java
index 097d1d0..c87c13d 100644
--- a/core/java/android/view/HandwritingInitiator.java
+++ b/core/java/android/view/HandwritingInitiator.java
@@ -161,6 +161,11 @@
return mConnectedView.get();
}
+ private void clearConnectedView() {
+ mConnectedView = null;
+ mConnectionCount = 0;
+ }
+
/**
* Notify HandwritingInitiator that a new InputConnection is created.
* The caller of this method should guarantee that each onInputConnectionCreated call
@@ -169,6 +174,10 @@
* @see #onInputConnectionClosed(View)
*/
public void onInputConnectionCreated(@NonNull View view) {
+ if (!view.isAutoHandwritingEnabled()) {
+ clearConnectedView();
+ return;
+ }
final View connectedView = getConnectedView();
if (connectedView == view) {
++mConnectionCount;
@@ -187,15 +196,15 @@
*/
public void onInputConnectionClosed(@NonNull View view) {
final View connectedView = getConnectedView();
+ if (connectedView == null) return;
if (connectedView == view) {
--mConnectionCount;
if (mConnectionCount == 0) {
- mConnectedView = null;
+ clearConnectedView();
}
} else {
// Unexpected branch, set mConnectedView to null to avoid further problem.
- mConnectedView = null;
- mConnectionCount = 0;
+ clearConnectedView();
}
}
@@ -218,6 +227,12 @@
if (connectedView == null) {
return;
}
+
+ if (!connectedView.isAutoHandwritingEnabled()) {
+ clearConnectedView();
+ return;
+ }
+
final ViewParent viewParent = connectedView.getParent();
// Do a final check before startHandwriting.
if (viewParent != null && connectedView.isAttachedToWindow()) {
diff --git a/core/java/android/view/IWindowSession.aidl b/core/java/android/view/IWindowSession.aidl
index 32054b1..ccf1e44 100644
--- a/core/java/android/view/IWindowSession.aidl
+++ b/core/java/android/view/IWindowSession.aidl
@@ -298,7 +298,7 @@
*/
void grantInputChannel(int displayId, in SurfaceControl surface, in IWindow window,
in IBinder hostInputToken, int flags, int privateFlags, int type,
- in IBinder focusGrantToken, out InputChannel outInputChannel);
+ out InputChannel outInputChannel);
/**
* Update the flags on an input channel associated with a particular surface.
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index e751720b..904d7c8 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -254,6 +254,7 @@
private static native int nativeGetLayerId(long nativeObject);
private static native void nativeAddTransactionCommittedListener(long nativeObject,
TransactionCommittedListener listener);
+ private static native void nativeSanitize(long transactionObject);
/**
* Transforms that can be applied to buffers as they are displayed to a window.
@@ -3700,6 +3701,13 @@
}
/**
+ * @hide
+ */
+ public void sanitize() {
+ nativeSanitize(mNativeObject);
+ }
+
+ /**
* Merge the other transaction into this transaction, clearing the
* other transaction as if it had been applied.
*
diff --git a/core/java/android/view/SurfaceControlViewHost.java b/core/java/android/view/SurfaceControlViewHost.java
index 22baa69..85a9dbd 100644
--- a/core/java/android/view/SurfaceControlViewHost.java
+++ b/core/java/android/view/SurfaceControlViewHost.java
@@ -274,7 +274,7 @@
public @Nullable SurfacePackage getSurfacePackage() {
if (mSurfaceControl != null && mAccessibilityEmbeddedConnection != null) {
return new SurfacePackage(mSurfaceControl, mAccessibilityEmbeddedConnection,
- mWm.getFocusGrantToken(), mRemoteInterface);
+ mViewRoot.getInputToken(), mRemoteInterface);
} else {
return null;
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 93fdee0..7559273 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -3517,6 +3517,7 @@
* 1 PFLAG4_DETACHED
* 1 PFLAG4_HAS_TRANSLATION_TRANSIENT_STATE
* 1 PFLAG4_DRAG_A11Y_STARTED
+ * 1 PFLAG4_AUTO_HANDWRITING_INITIATION_ENABLED
* |-------|-------|-------|-------|
*/
@@ -3593,6 +3594,10 @@
*/
private static final int PFLAG4_DRAG_A11Y_STARTED = 0x000008000;
+ /**
+ * Indicates that the view enables auto handwriting initiation.
+ */
+ private static final int PFLAG4_AUTO_HANDWRITING_ENABLED = 0x000010000;
/* End of masks for mPrivateFlags4 */
/** @hide */
@@ -5321,6 +5326,7 @@
(TEXT_ALIGNMENT_DEFAULT << PFLAG2_TEXT_ALIGNMENT_MASK_SHIFT) |
(PFLAG2_TEXT_ALIGNMENT_RESOLVED_DEFAULT) |
(IMPORTANT_FOR_ACCESSIBILITY_DEFAULT << PFLAG2_IMPORTANT_FOR_ACCESSIBILITY_SHIFT);
+ mPrivateFlags4 = PFLAG4_AUTO_HANDWRITING_ENABLED;
final ViewConfiguration configuration = ViewConfiguration.get(context);
mTouchSlop = configuration.getScaledTouchSlop();
@@ -6034,6 +6040,9 @@
case R.styleable.View_preferKeepClear:
setPreferKeepClear(a.getBoolean(attr, false));
break;
+ case R.styleable.View_autoHandwritingEnabled:
+ setAutoHandwritingEnabled(a.getBoolean(attr, true));
+ break;
}
}
@@ -31118,6 +31127,42 @@
}
/**
+ * Set whether this view enables automatic handwriting initiation.
+ *
+ * For a view with an active {@link InputConnection}, if auto handwriting is enabled then
+ * stylus movement within its view boundary will automatically trigger the handwriting mode.
+ * Check {@link android.view.inputmethod.InputMethodManager#startStylusHandwriting(View)} for
+ * more details about handwriting mode.
+ *
+ * If the View wants to initiate handwriting mode by itself, it can set this field to
+ * {@code false} and call
+ * {@link android.view.inputmethod.InputMethodManager#startStylusHandwriting(View)} when there
+ * is stylus movement detected.
+ *
+ * @see #onCreateInputConnection(EditorInfo)
+ * @see android.view.inputmethod.InputMethodManager#startStylusHandwriting(View)
+ * @param enabled whether auto handwriting initiation is enabled for this view.
+ * @attr ref android.R.styleable#View_autoHandwritingEnabled
+ */
+ public void setAutoHandwritingEnabled(boolean enabled) {
+ if (enabled) {
+ mPrivateFlags4 |= PFLAG4_AUTO_HANDWRITING_ENABLED;
+ } else {
+ mPrivateFlags4 &= ~PFLAG4_AUTO_HANDWRITING_ENABLED;
+ }
+ }
+
+ /**
+ * Return whether the View allows automatic handwriting initiation. Returns true if automatic
+ * handwriting initiation is enabled, and verse visa.
+ * @see #setAutoHandwritingEnabled(boolean)
+ */
+ public boolean isAutoHandwritingEnabled() {
+ return (mPrivateFlags4 & PFLAG4_AUTO_HANDWRITING_ENABLED)
+ == PFLAG4_AUTO_HANDWRITING_ENABLED;
+ }
+
+ /**
* Collects a {@link ViewTranslationRequest} which represents the content to be translated in
* the view.
*
diff --git a/core/java/android/view/WindowlessWindowManager.java b/core/java/android/view/WindowlessWindowManager.java
index 5ec9654..3392edc 100644
--- a/core/java/android/view/WindowlessWindowManager.java
+++ b/core/java/android/view/WindowlessWindowManager.java
@@ -21,7 +21,6 @@
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.Region;
-import android.os.Binder;
import android.os.IBinder;
import android.os.RemoteCallback;
import android.os.RemoteException;
@@ -76,7 +75,6 @@
private final Configuration mConfiguration;
private final IWindowSession mRealWm;
private final IBinder mHostInputToken;
- private final IBinder mFocusGrantToken = new Binder();
private int mForceHeight = -1;
private int mForceWidth = -1;
@@ -93,10 +91,6 @@
mConfiguration.setTo(configuration);
}
- IBinder getFocusGrantToken() {
- return mFocusGrantToken;
- }
-
/**
* Utility API.
*/
@@ -159,10 +153,10 @@
mRealWm.grantInputChannel(displayId,
new SurfaceControl(sc, "WindowlessWindowManager.addToDisplay"),
window, mHostInputToken, attrs.flags, attrs.privateFlags, attrs.type,
- mFocusGrantToken, outInputChannel);
+ outInputChannel);
} else {
mRealWm.grantInputChannel(displayId, sc, window, mHostInputToken, attrs.flags,
- attrs.privateFlags, attrs.type, mFocusGrantToken, outInputChannel);
+ attrs.privateFlags, attrs.type, outInputChannel);
}
} catch (RemoteException e) {
Log.e(TAG, "Failed to grant input to surface: ", e);
@@ -475,7 +469,7 @@
@Override
public void grantInputChannel(int displayId, SurfaceControl surface, IWindow window,
- IBinder hostInputToken, int flags, int privateFlags, int type, IBinder focusGrantToken,
+ IBinder hostInputToken, int flags, int privateFlags, int type,
InputChannel outInputChannel) {
}
diff --git a/core/java/android/webkit/DateSorter.java b/core/java/android/webkit/DateSorter.java
index 90d44db..c29e774 100644
--- a/core/java/android/webkit/DateSorter.java
+++ b/core/java/android/webkit/DateSorter.java
@@ -18,11 +18,14 @@
import android.content.Context;
import android.content.res.Resources;
+import android.util.PluralsMessageFormatter;
import com.android.icu.text.DateSorterBridge;
import java.util.Calendar;
+import java.util.HashMap;
import java.util.Locale;
+import java.util.Map;
/**
* Sorts dates into the following groups:
@@ -73,9 +76,12 @@
mLabels[0] = dateSorterBridge.getToday();
mLabels[1] = dateSorterBridge.getYesterday();
- int resId = com.android.internal.R.plurals.last_num_days;
- String format = resources.getQuantityString(resId, NUM_DAYS_AGO);
- mLabels[2] = String.format(format, NUM_DAYS_AGO);
+ Map<String, Object> arguments = new HashMap<>();
+ arguments.put("count", NUM_DAYS_AGO);
+ mLabels[2] = PluralsMessageFormatter.format(
+ resources,
+ arguments,
+ com.android.internal.R.string.last_num_days);
mLabels[3] = context.getString(com.android.internal.R.string.last_month);
mLabels[4] = context.getString(com.android.internal.R.string.older);
diff --git a/core/java/android/webkit/FindActionModeCallback.java b/core/java/android/webkit/FindActionModeCallback.java
index e011d51..b1d07f5 100644
--- a/core/java/android/webkit/FindActionModeCallback.java
+++ b/core/java/android/webkit/FindActionModeCallback.java
@@ -26,6 +26,7 @@
import android.text.Selection;
import android.text.Spannable;
import android.text.TextWatcher;
+import android.util.PluralsMessageFormatter;
import android.view.ActionMode;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -35,6 +36,11 @@
import android.widget.EditText;
import android.widget.TextView;
+import com.android.internal.R;
+
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @hide
*/
@@ -180,9 +186,14 @@
if (mNumberOfMatches == 0) {
mMatches.setText(com.android.internal.R.string.no_matches);
} else {
- mMatches.setText(mResources.getQuantityString(
- com.android.internal.R.plurals.matches_found, mNumberOfMatches,
- mActiveMatchIndex + 1, mNumberOfMatches));
+ Map<String, Object> arguments = new HashMap<>();
+ arguments.put("count", mActiveMatchIndex + 1);
+ arguments.put("total", mNumberOfMatches);
+
+ mMatches.setText(PluralsMessageFormatter.format(
+ mResources,
+ arguments,
+ R.string.matches_found));
}
mMatches.setVisibility(View.VISIBLE);
}
diff --git a/core/java/android/widget/DateTimeView.java b/core/java/android/widget/DateTimeView.java
index 9555522..2c62647 100644
--- a/core/java/android/widget/DateTimeView.java
+++ b/core/java/android/widget/DateTimeView.java
@@ -33,6 +33,7 @@
import android.os.Build;
import android.os.Handler;
import android.util.AttributeSet;
+import android.util.PluralsMessageFormatter;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.inspector.InspectableProperty;
import android.widget.RemoteViews.RemoteView;
@@ -48,6 +49,8 @@
import java.time.temporal.JulianFields;
import java.util.ArrayList;
import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
//
// TODO
@@ -260,19 +263,17 @@
return;
} else if (duration < HOUR_IN_MILLIS) {
count = (int)(duration / MINUTE_IN_MILLIS);
- result = String.format(getContext().getResources().getQuantityString(past
- ? com.android.internal.R.plurals.duration_minutes_shortest
- : com.android.internal.R.plurals.duration_minutes_shortest_future,
- count),
+ result = getContext().getResources().getString(past
+ ? com.android.internal.R.string.duration_minutes_shortest
+ : com.android.internal.R.string.duration_minutes_shortest_future,
count);
millisIncrease = MINUTE_IN_MILLIS;
} else if (duration < DAY_IN_MILLIS) {
count = (int)(duration / HOUR_IN_MILLIS);
- result = String.format(getContext().getResources().getQuantityString(past
- ? com.android.internal.R.plurals.duration_hours_shortest
- : com.android.internal.R.plurals.duration_hours_shortest_future,
- count),
- count);
+ result = getContext().getResources().getString(past
+ ? com.android.internal.R.string.duration_hours_shortest
+ : com.android.internal.R.string.duration_hours_shortest_future,
+ count);
millisIncrease = HOUR_IN_MILLIS;
} else if (duration < YEAR_IN_MILLIS) {
// In weird cases it can become 0 because of daylight savings
@@ -281,10 +282,9 @@
LocalDateTime localNow = toLocalDateTime(now, zoneId);
count = Math.max(Math.abs(dayDistance(localDateTime, localNow)), 1);
- result = String.format(getContext().getResources().getQuantityString(past
- ? com.android.internal.R.plurals.duration_days_shortest
- : com.android.internal.R.plurals.duration_days_shortest_future,
- count),
+ result = getContext().getResources().getString(past
+ ? com.android.internal.R.string.duration_days_shortest
+ : com.android.internal.R.string.duration_days_shortest_future,
count);
if (past || count != 1) {
mUpdateTimeMillis = computeNextMidnight(localNow, zoneId);
@@ -295,10 +295,9 @@
} else {
count = (int)(duration / YEAR_IN_MILLIS);
- result = String.format(getContext().getResources().getQuantityString(past
- ? com.android.internal.R.plurals.duration_years_shortest
- : com.android.internal.R.plurals.duration_years_shortest_future,
- count),
+ result = getContext().getResources().getString(past
+ ? com.android.internal.R.string.duration_years_shortest
+ : com.android.internal.R.string.duration_years_shortest_future,
count);
millisIncrease = YEAR_IN_MILLIS;
}
@@ -363,26 +362,25 @@
int count;
boolean past = (now >= mTimeMillis);
String result;
+ Map<String, Object> arguments = new HashMap<>();
if (duration < MINUTE_IN_MILLIS) {
result = mNowText;
} else if (duration < HOUR_IN_MILLIS) {
count = (int)(duration / MINUTE_IN_MILLIS);
- result = String.format(getContext().getResources().getQuantityString(past
- ? com.android.internal.
- R.plurals.duration_minutes_relative
- : com.android.internal.
- R.plurals.duration_minutes_relative_future,
- count),
- count);
+ arguments.put("count", count);
+ result = PluralsMessageFormatter.format(
+ getContext().getResources(),
+ arguments,
+ past ? R.string.duration_minutes_relative
+ : R.string.duration_minutes_relative_future);
} else if (duration < DAY_IN_MILLIS) {
count = (int)(duration / HOUR_IN_MILLIS);
- result = String.format(getContext().getResources().getQuantityString(past
- ? com.android.internal.
- R.plurals.duration_hours_relative
- : com.android.internal.
- R.plurals.duration_hours_relative_future,
- count),
- count);
+ arguments.put("count", count);
+ result = PluralsMessageFormatter.format(
+ getContext().getResources(),
+ arguments,
+ past ? R.string.duration_hours_relative
+ : R.string.duration_hours_relative_future);
} else if (duration < YEAR_IN_MILLIS) {
// In weird cases it can become 0 because of daylight savings
LocalDateTime localDateTime = mLocalTime;
@@ -390,23 +388,20 @@
LocalDateTime localNow = toLocalDateTime(now, zoneId);
count = Math.max(Math.abs(dayDistance(localDateTime, localNow)), 1);
- result = String.format(getContext().getResources().getQuantityString(past
- ? com.android.internal.
- R.plurals.duration_days_relative
- : com.android.internal.
- R.plurals.duration_days_relative_future,
- count),
- count);
-
+ arguments.put("count", count);
+ result = PluralsMessageFormatter.format(
+ getContext().getResources(),
+ arguments,
+ past ? R.string.duration_days_relative
+ : R.string.duration_days_relative_future);
} else {
count = (int)(duration / YEAR_IN_MILLIS);
- result = String.format(getContext().getResources().getQuantityString(past
- ? com.android.internal.
- R.plurals.duration_years_relative
- : com.android.internal.
- R.plurals.duration_years_relative_future,
- count),
- count);
+ arguments.put("count", count);
+ result = PluralsMessageFormatter.format(
+ getContext().getResources(),
+ arguments,
+ past ? R.string.duration_years_relative
+ : R.string.duration_years_relative_future);
}
info.setText(result);
}
diff --git a/core/java/android/window/SplashScreenView.java b/core/java/android/window/SplashScreenView.java
index f04155d..b90e628 100644
--- a/core/java/android/window/SplashScreenView.java
+++ b/core/java/android/window/SplashScreenView.java
@@ -151,6 +151,7 @@
private Instant mIconAnimationStart;
private Duration mIconAnimationDuration;
private Consumer<Runnable> mUiThreadInitTask;
+ private boolean mAllowHandleEmpty = true;
public Builder(@NonNull Context context) {
mContext = context;
@@ -258,6 +259,15 @@
}
/**
+ * Sets whether this view can be copied and transferred to the client if the view is
+ * empty style splash screen.
+ */
+ public Builder setAllowHandleEmpty(boolean allowHandleEmpty) {
+ mAllowHandleEmpty = allowHandleEmpty;
+ return this;
+ }
+
+ /**
* Create SplashScreenWindowView object from materials.
*/
public SplashScreenView build() {
@@ -303,7 +313,7 @@
}
view.mIconView = imageView;
}
- if (mOverlayDrawable != null || mIconDrawable == null) {
+ if (mOverlayDrawable != null || (view.mIconView == null && !mAllowHandleEmpty)) {
view.setNotCopyable();
}
@@ -720,13 +730,15 @@
private RemoteCallback mClientCallback;
public SplashScreenViewParcelable(SplashScreenView view) {
- mIconSize = view.mIconView.getWidth();
+ final View iconView = view.getIconView();
+ mIconSize = iconView != null ? iconView.getWidth() : 0;
mBackgroundColor = view.getInitBackgroundColor();
- mIconBackground = copyDrawable(view.getIconView().getBackground());
+ mIconBackground = iconView != null ? copyDrawable(iconView.getBackground()) : null;
mSurfacePackage = view.mSurfacePackageCopy;
if (mSurfacePackage == null) {
// We only need to copy the drawable if we are not using a SurfaceView
- mIconBitmap = copyDrawable(((ImageView) view.getIconView()).getDrawable());
+ mIconBitmap = iconView != null
+ ? copyDrawable(((ImageView) view.getIconView()).getDrawable()) : null;
}
mBrandingBitmap = copyDrawable(view.getBrandingView().getBackground());
diff --git a/core/java/android/window/StartingWindowInfo.java b/core/java/android/window/StartingWindowInfo.java
index aec910b..24899a4 100644
--- a/core/java/android/window/StartingWindowInfo.java
+++ b/core/java/android/window/StartingWindowInfo.java
@@ -116,6 +116,7 @@
TYPE_PARAMETER_ALLOW_TASK_SNAPSHOT,
TYPE_PARAMETER_ACTIVITY_CREATED,
TYPE_PARAMETER_USE_EMPTY_SPLASH_SCREEN,
+ TYPE_PARAMETER_ALLOW_HANDLE_EMPTY_SCREEN,
TYPE_PARAMETER_LEGACY_SPLASH_SCREEN
})
public @interface StartingTypeParams {}
@@ -141,6 +142,11 @@
*/
public static final int TYPE_PARAMETER_ACTIVITY_DRAWN = 0x00000040;
/**
+ * Application is allowed to handle empty splash screen.
+ * @hide
+ */
+ public static final int TYPE_PARAMETER_ALLOW_HANDLE_EMPTY_SCREEN = 0x00000080;
+ /**
* Application is allowed to use the legacy splash screen
* @hide
*/
@@ -185,6 +191,13 @@
readFromParcel(source);
}
+ /**
+ * Return whether the application allow to handle the empty style splash screen.
+ */
+ public boolean allowHandleEmptySplashScreen() {
+ return (startingWindowTypeParameter & TYPE_PARAMETER_ALLOW_HANDLE_EMPTY_SCREEN) != 0;
+ }
+
@Override
public int describeContents() {
return 0;
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java
index be7388b..4ae6bf7 100644
--- a/core/java/com/android/internal/app/ChooserActivity.java
+++ b/core/java/com/android/internal/app/ChooserActivity.java
@@ -90,6 +90,7 @@
import android.util.AttributeSet;
import android.util.HashedStringCache;
import android.util.Log;
+import android.util.PluralsMessageFormatter;
import android.util.Size;
import android.util.Slog;
import android.view.LayoutInflater;
@@ -216,6 +217,9 @@
private static final int APP_PREDICTION_SHARE_TARGET_QUERY_PACKAGE_LIMIT = 20;
public static final String APP_PREDICTION_INTENT_FILTER_KEY = "intent_filter";
+ private static final String PLURALS_COUNT = "count";
+ private static final String PLURALS_FILE_NAME = "file_name";
+
@VisibleForTesting
public static final int LIST_VIEW_UPDATE_INTERVAL_IN_MILLIS = 250;
@@ -1551,8 +1555,13 @@
} else {
FileInfo fileInfo = extractFileInfo(uris.get(0), getContentResolver());
int remUriCount = uriCount - 1;
- String fileName = getResources().getQuantityString(R.plurals.file_count,
- remUriCount, fileInfo.name, remUriCount);
+ Map<String, Object> arguments = new HashMap<>();
+ arguments.put(PLURALS_COUNT, remUriCount);
+ arguments.put(PLURALS_FILE_NAME, fileInfo.name);
+ String fileName = PluralsMessageFormatter.format(
+ getResources(),
+ arguments,
+ R.string.file_count);
TextView fileNameView = contentPreviewLayout.findViewById(
R.id.content_preview_filename);
diff --git a/core/java/com/android/internal/logging/InstanceId.aidl b/core/java/com/android/internal/logging/InstanceId.aidl
new file mode 100644
index 0000000..19a6177
--- /dev/null
+++ b/core/java/com/android/internal/logging/InstanceId.aidl
@@ -0,0 +1,19 @@
+/*
+ * 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.internal.logging;
+
+parcelable InstanceId;
diff --git a/core/java/com/android/internal/notification/SystemNotificationChannels.java b/core/java/com/android/internal/notification/SystemNotificationChannels.java
index 3b6f8f6..b79c0be 100644
--- a/core/java/com/android/internal/notification/SystemNotificationChannels.java
+++ b/core/java/com/android/internal/notification/SystemNotificationChannels.java
@@ -62,6 +62,7 @@
public static String DO_NOT_DISTURB = "DO_NOT_DISTURB";
public static String ACCESSIBILITY_MAGNIFICATION = "ACCESSIBILITY_MAGNIFICATION";
public static String ACCESSIBILITY_SECURITY_POLICY = "ACCESSIBILITY_SECURITY_POLICY";
+ public static String ABUSIVE_BACKGROUND_APPS = "ABUSIVE_BACKGROUND_APPS";
public static void createAll(Context context) {
final NotificationManager nm = context.getSystemService(NotificationManager.class);
@@ -209,6 +210,12 @@
NotificationManager.IMPORTANCE_LOW);
channelsList.add(accessibilitySecurityPolicyChannel);
+ final NotificationChannel abusiveBackgroundAppsChannel = new NotificationChannel(
+ ABUSIVE_BACKGROUND_APPS,
+ context.getString(R.string.notification_channel_abusive_bg_apps),
+ NotificationManager.IMPORTANCE_LOW);
+ channelsList.add(abusiveBackgroundAppsChannel);
+
nm.createNotificationChannels(channelsList);
}
diff --git a/core/java/com/android/internal/os/AmbientDisplayPowerCalculator.java b/core/java/com/android/internal/os/AmbientDisplayPowerCalculator.java
index 9443070..d8e89b4 100644
--- a/core/java/com/android/internal/os/AmbientDisplayPowerCalculator.java
+++ b/core/java/com/android/internal/os/AmbientDisplayPowerCalculator.java
@@ -33,6 +33,11 @@
public class AmbientDisplayPowerCalculator extends PowerCalculator {
private final UsageBasedPowerEstimator[] mPowerEstimators;
+ @Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY;
+ }
+
public AmbientDisplayPowerCalculator(PowerProfile powerProfile) {
final int numDisplays = powerProfile.getNumDisplays();
mPowerEstimators = new UsageBasedPowerEstimator[numDisplays];
diff --git a/core/java/com/android/internal/os/AudioPowerCalculator.java b/core/java/com/android/internal/os/AudioPowerCalculator.java
index 2eab506..f9310b0 100644
--- a/core/java/com/android/internal/os/AudioPowerCalculator.java
+++ b/core/java/com/android/internal/os/AudioPowerCalculator.java
@@ -44,6 +44,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_AUDIO;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
final PowerAndDuration total = new PowerAndDuration();
diff --git a/core/java/com/android/internal/os/BatteryChargeCalculator.java b/core/java/com/android/internal/os/BatteryChargeCalculator.java
index 8178529..71a1463 100644
--- a/core/java/com/android/internal/os/BatteryChargeCalculator.java
+++ b/core/java/com/android/internal/os/BatteryChargeCalculator.java
@@ -16,6 +16,7 @@
package com.android.internal.os;
+import android.os.BatteryConsumer;
import android.os.BatteryStats;
import android.os.BatteryUsageStats;
import android.os.BatteryUsageStatsQuery;
@@ -30,6 +31,12 @@
public class BatteryChargeCalculator extends PowerCalculator {
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ // Always apply this power calculator, no matter what power components were requested
+ return true;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
builder.setDischargePercentage(
@@ -51,7 +58,8 @@
builder.setDischargePercentage(
batteryStats.getDischargeAmount(BatteryStats.STATS_SINCE_CHARGED))
.setDischargedPowerRange(dischargedPowerLowerBoundMah,
- dischargedPowerUpperBoundMah);
+ dischargedPowerUpperBoundMah)
+ .setDischargeDurationMs(batteryStats.getBatteryRealtime(rawRealtimeUs) / 1000);
final long batteryTimeRemainingMs = batteryStats.computeBatteryTimeRemaining(rawRealtimeUs);
if (batteryTimeRemainingMs != -1) {
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index 8213c86..25ee2d0 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -13223,59 +13223,57 @@
long totalRxPackets = 0;
long totalTxPackets = 0;
if (delta != null) {
- NetworkStats.Entry entry = new NetworkStats.Entry();
- final int size = delta.size();
- for (int i = 0; i < size; i++) {
- entry = delta.getValues(i, entry);
- if (entry.rxPackets == 0 && entry.txPackets == 0) {
+ for (NetworkStats.Entry entry : delta) {
+ if (entry.getRxPackets() == 0 && entry.getTxPackets() == 0) {
continue;
}
if (DEBUG_ENERGY) {
- Slog.d(TAG, "Mobile uid " + entry.uid + ": delta rx=" + entry.rxBytes
- + " tx=" + entry.txBytes + " rxPackets=" + entry.rxPackets
- + " txPackets=" + entry.txPackets);
+ Slog.d(TAG, "Mobile uid " + entry.getUid() + ": delta rx="
+ + entry.getRxBytes() + " tx=" + entry.getTxBytes()
+ + " rxPackets=" + entry.getRxPackets()
+ + " txPackets=" + entry.getTxPackets());
}
- totalRxPackets += entry.rxPackets;
- totalTxPackets += entry.txPackets;
+ totalRxPackets += entry.getRxPackets();
+ totalTxPackets += entry.getTxPackets();
- final Uid u = getUidStatsLocked(mapUid(entry.uid), elapsedRealtimeMs, uptimeMs);
- u.noteNetworkActivityLocked(NETWORK_MOBILE_RX_DATA, entry.rxBytes,
- entry.rxPackets);
- u.noteNetworkActivityLocked(NETWORK_MOBILE_TX_DATA, entry.txBytes,
- entry.txPackets);
- if (entry.set == NetworkStats.SET_DEFAULT) { // Background transfers
+ final Uid u = getUidStatsLocked(
+ mapUid(entry.getUid()), elapsedRealtimeMs, uptimeMs);
+ u.noteNetworkActivityLocked(NETWORK_MOBILE_RX_DATA, entry.getRxBytes(),
+ entry.getRxPackets());
+ u.noteNetworkActivityLocked(NETWORK_MOBILE_TX_DATA, entry.getTxBytes(),
+ entry.getTxPackets());
+ if (entry.getSet() == NetworkStats.SET_DEFAULT) { // Background transfers
u.noteNetworkActivityLocked(NETWORK_MOBILE_BG_RX_DATA,
- entry.rxBytes, entry.rxPackets);
+ entry.getRxBytes(), entry.getRxPackets());
u.noteNetworkActivityLocked(NETWORK_MOBILE_BG_TX_DATA,
- entry.txBytes, entry.txPackets);
+ entry.getTxBytes(), entry.getTxPackets());
}
mNetworkByteActivityCounters[NETWORK_MOBILE_RX_DATA].addCountLocked(
- entry.rxBytes);
+ entry.getRxBytes());
mNetworkByteActivityCounters[NETWORK_MOBILE_TX_DATA].addCountLocked(
- entry.txBytes);
+ entry.getTxBytes());
mNetworkPacketActivityCounters[NETWORK_MOBILE_RX_DATA].addCountLocked(
- entry.rxPackets);
+ entry.getRxPackets());
mNetworkPacketActivityCounters[NETWORK_MOBILE_TX_DATA].addCountLocked(
- entry.txPackets);
+ entry.getTxPackets());
}
// Now distribute proportional blame to the apps that did networking.
long totalPackets = totalRxPackets + totalTxPackets;
if (totalPackets > 0) {
- for (int i = 0; i < size; i++) {
- entry = delta.getValues(i, entry);
- if (entry.rxPackets == 0 && entry.txPackets == 0) {
+ for (NetworkStats.Entry entry : delta) {
+ if (entry.getRxPackets() == 0 && entry.getTxPackets() == 0) {
continue;
}
- final Uid u = getUidStatsLocked(mapUid(entry.uid),
+ final Uid u = getUidStatsLocked(mapUid(entry.getUid()),
elapsedRealtimeMs, uptimeMs);
// Distribute total radio active time in to this app.
- final long appPackets = entry.rxPackets + entry.txPackets;
+ final long appPackets = entry.getRxPackets() + entry.getTxPackets();
final long appRadioTimeUs =
(totalAppRadioTimeUs * appPackets) / totalPackets;
u.noteMobileRadioActiveTimeLocked(appRadioTimeUs, elapsedRealtimeMs);
@@ -13296,17 +13294,17 @@
if (deltaInfo != null) {
ControllerActivityCounterImpl activityCounter =
u.getOrCreateModemControllerActivityLocked();
- if (totalRxPackets > 0 && entry.rxPackets > 0) {
- final long rxMs = (entry.rxPackets
+ if (totalRxPackets > 0 && entry.getRxPackets() > 0) {
+ final long rxMs = (entry.getRxPackets()
* deltaInfo.getReceiveTimeMillis()) / totalRxPackets;
activityCounter.getOrCreateRxTimeCounter()
.increment(rxMs, elapsedRealtimeMs);
}
- if (totalTxPackets > 0 && entry.txPackets > 0) {
+ if (totalTxPackets > 0 && entry.getTxPackets() > 0) {
for (int lvl = 0; lvl < ModemActivityInfo.getNumTxPowerLevels();
lvl++) {
- long txMs = entry.txPackets
+ long txMs = entry.getTxPackets()
* deltaInfo.getTransmitDurationMillisAtPowerLevel(lvl);
txMs /= totalTxPackets;
activityCounter.getOrCreateTxTimeCounters()[lvl]
diff --git a/core/java/com/android/internal/os/BatteryUsageStatsProvider.java b/core/java/com/android/internal/os/BatteryUsageStatsProvider.java
index 69b7b4e..e4d5fb7 100644
--- a/core/java/com/android/internal/os/BatteryUsageStatsProvider.java
+++ b/core/java/com/android/internal/os/BatteryUsageStatsProvider.java
@@ -181,9 +181,22 @@
getProcessForegroundTimeMs(uid, realtimeUs));
}
+ final int[] powerComponents = query.getPowerComponents();
final List<PowerCalculator> powerCalculators = getPowerCalculators();
for (int i = 0, count = powerCalculators.size(); i < count; i++) {
PowerCalculator powerCalculator = powerCalculators.get(i);
+ if (powerComponents != null) {
+ boolean include = false;
+ for (int j = 0; j < powerComponents.length; j++) {
+ if (powerCalculator.isPowerComponentSupported(powerComponents[j])) {
+ include = true;
+ break;
+ }
+ }
+ if (!include) {
+ continue;
+ }
+ }
powerCalculator.calculate(batteryUsageStatsBuilder, mStats, realtimeUs, uptimeUs,
query);
}
diff --git a/core/java/com/android/internal/os/BluetoothPowerCalculator.java b/core/java/com/android/internal/os/BluetoothPowerCalculator.java
index 20535d2..066ee84 100644
--- a/core/java/com/android/internal/os/BluetoothPowerCalculator.java
+++ b/core/java/com/android/internal/os/BluetoothPowerCalculator.java
@@ -64,6 +64,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_BLUETOOTH;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
if (!batteryStats.hasBluetoothActivityReporting()) {
diff --git a/core/java/com/android/internal/os/CameraPowerCalculator.java b/core/java/com/android/internal/os/CameraPowerCalculator.java
index ddcabe8..7bccab5 100644
--- a/core/java/com/android/internal/os/CameraPowerCalculator.java
+++ b/core/java/com/android/internal/os/CameraPowerCalculator.java
@@ -37,6 +37,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_CAMERA;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
super.calculate(builder, batteryStats, rawRealtimeUs, rawUptimeUs, query);
diff --git a/core/java/com/android/internal/os/CpuPowerCalculator.java b/core/java/com/android/internal/os/CpuPowerCalculator.java
index ee614cd..6a96cfe 100644
--- a/core/java/com/android/internal/os/CpuPowerCalculator.java
+++ b/core/java/com/android/internal/os/CpuPowerCalculator.java
@@ -93,6 +93,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_CPU;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
double totalPowerMah = 0;
diff --git a/core/java/com/android/internal/os/CustomMeasuredPowerCalculator.java b/core/java/com/android/internal/os/CustomMeasuredPowerCalculator.java
index bb307a0..4cb7ef1 100644
--- a/core/java/com/android/internal/os/CustomMeasuredPowerCalculator.java
+++ b/core/java/com/android/internal/os/CustomMeasuredPowerCalculator.java
@@ -37,6 +37,11 @@
}
@Override
+ public boolean isPowerComponentSupported(int powerComponent) {
+ return false;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
double[] totalAppPowerMah = null;
diff --git a/core/java/com/android/internal/os/FlashlightPowerCalculator.java b/core/java/com/android/internal/os/FlashlightPowerCalculator.java
index 32df17c..7d3f962 100644
--- a/core/java/com/android/internal/os/FlashlightPowerCalculator.java
+++ b/core/java/com/android/internal/os/FlashlightPowerCalculator.java
@@ -35,6 +35,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_FLASHLIGHT;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
super.calculate(builder, batteryStats, rawRealtimeUs, rawUptimeUs, query);
diff --git a/core/java/com/android/internal/os/GnssPowerCalculator.java b/core/java/com/android/internal/os/GnssPowerCalculator.java
index a508e03..a836ddb 100644
--- a/core/java/com/android/internal/os/GnssPowerCalculator.java
+++ b/core/java/com/android/internal/os/GnssPowerCalculator.java
@@ -44,6 +44,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_GNSS;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
double appsPowerMah = 0;
diff --git a/core/java/com/android/internal/os/IdlePowerCalculator.java b/core/java/com/android/internal/os/IdlePowerCalculator.java
index d33a88d..46808f9 100644
--- a/core/java/com/android/internal/os/IdlePowerCalculator.java
+++ b/core/java/com/android/internal/os/IdlePowerCalculator.java
@@ -47,6 +47,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_IDLE;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
calculatePowerAndDuration(batteryStats, rawRealtimeUs, rawUptimeUs,
diff --git a/core/java/com/android/internal/os/MediaPowerCalculator.java b/core/java/com/android/internal/os/MediaPowerCalculator.java
index e93d93c..fff96da 100644
--- a/core/java/com/android/internal/os/MediaPowerCalculator.java
+++ b/core/java/com/android/internal/os/MediaPowerCalculator.java
@@ -15,6 +15,7 @@
*/
package com.android.internal.os;
+import android.os.BatteryConsumer;
import android.os.BatteryStats;
/**
@@ -33,6 +34,12 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_VIDEO
+ || powerComponent == BatteryConsumer.POWER_COMPONENT_AUDIO;
+ }
+
+ @Override
protected void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs,
long rawUptimeUs, int statsType) {
// Calculate audio power usage, an estimate based on the average power routed to different
diff --git a/core/java/com/android/internal/os/MemoryPowerCalculator.java b/core/java/com/android/internal/os/MemoryPowerCalculator.java
index 09fd85e..0440a58 100644
--- a/core/java/com/android/internal/os/MemoryPowerCalculator.java
+++ b/core/java/com/android/internal/os/MemoryPowerCalculator.java
@@ -24,6 +24,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_MEMORY;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
final long durationMs = calculateDuration(batteryStats, rawRealtimeUs,
diff --git a/core/java/com/android/internal/os/MobileRadioPowerCalculator.java b/core/java/com/android/internal/os/MobileRadioPowerCalculator.java
index 28cc836..a1d5fc9 100644
--- a/core/java/com/android/internal/os/MobileRadioPowerCalculator.java
+++ b/core/java/com/android/internal/os/MobileRadioPowerCalculator.java
@@ -86,6 +86,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
diff --git a/core/java/com/android/internal/os/PhonePowerCalculator.java b/core/java/com/android/internal/os/PhonePowerCalculator.java
index 8dd463c..7310314 100644
--- a/core/java/com/android/internal/os/PhonePowerCalculator.java
+++ b/core/java/com/android/internal/os/PhonePowerCalculator.java
@@ -37,6 +37,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_PHONE;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
final long phoneOnTimeMs = batteryStats.getPhoneOnTime(rawRealtimeUs,
diff --git a/core/java/com/android/internal/os/PowerCalculator.java b/core/java/com/android/internal/os/PowerCalculator.java
index 93d562c..d0a83e7 100644
--- a/core/java/com/android/internal/os/PowerCalculator.java
+++ b/core/java/com/android/internal/os/PowerCalculator.java
@@ -36,6 +36,14 @@
protected static final double MILLIAMPHOUR_PER_MICROCOULOMB = 1.0 / 1000.0 / 60.0 / 60.0;
/**
+ * Returns true if this power calculator computes power/duration for the specified
+ * power component.
+ */
+ public abstract boolean isPowerComponentSupported(
+ @BatteryConsumer.PowerComponent int powerComponent);
+
+
+ /**
* Attributes the total amount of power used by this subsystem to various consumers such
* as apps.
*
diff --git a/core/java/com/android/internal/os/ScreenPowerCalculator.java b/core/java/com/android/internal/os/ScreenPowerCalculator.java
index 2b63459..d989e2a 100644
--- a/core/java/com/android/internal/os/ScreenPowerCalculator.java
+++ b/core/java/com/android/internal/os/ScreenPowerCalculator.java
@@ -66,6 +66,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_SCREEN;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
final PowerAndDuration totalPowerAndDuration = new PowerAndDuration();
diff --git a/core/java/com/android/internal/os/SensorPowerCalculator.java b/core/java/com/android/internal/os/SensorPowerCalculator.java
index 83e5b57..495a6d9 100644
--- a/core/java/com/android/internal/os/SensorPowerCalculator.java
+++ b/core/java/com/android/internal/os/SensorPowerCalculator.java
@@ -39,6 +39,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_SENSORS;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
double appsPowerMah = 0;
diff --git a/core/java/com/android/internal/os/SystemServicePowerCalculator.java b/core/java/com/android/internal/os/SystemServicePowerCalculator.java
index c527c06..d7872ba 100644
--- a/core/java/com/android/internal/os/SystemServicePowerCalculator.java
+++ b/core/java/com/android/internal/os/SystemServicePowerCalculator.java
@@ -62,6 +62,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_SYSTEM_SERVICES;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
final BatteryStats.Uid systemUid = batteryStats.getUidStats().get(Process.SYSTEM_UID);
diff --git a/core/java/com/android/internal/os/UserPowerCalculator.java b/core/java/com/android/internal/os/UserPowerCalculator.java
index 8e80286..b590bf7 100644
--- a/core/java/com/android/internal/os/UserPowerCalculator.java
+++ b/core/java/com/android/internal/os/UserPowerCalculator.java
@@ -16,6 +16,7 @@
package com.android.internal.os;
+import android.os.BatteryConsumer;
import android.os.BatteryStats;
import android.os.BatteryUsageStats;
import android.os.BatteryUsageStatsQuery;
@@ -34,6 +35,11 @@
public class UserPowerCalculator extends PowerCalculator {
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return true;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
final int[] userIds = query.getUserIds();
diff --git a/core/java/com/android/internal/os/VideoPowerCalculator.java b/core/java/com/android/internal/os/VideoPowerCalculator.java
index 47916a6..a222bcb 100644
--- a/core/java/com/android/internal/os/VideoPowerCalculator.java
+++ b/core/java/com/android/internal/os/VideoPowerCalculator.java
@@ -41,6 +41,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_VIDEO;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
final PowerAndDuration total = new PowerAndDuration();
diff --git a/core/java/com/android/internal/os/WakelockPowerCalculator.java b/core/java/com/android/internal/os/WakelockPowerCalculator.java
index e0ef129..aa6a4f8 100644
--- a/core/java/com/android/internal/os/WakelockPowerCalculator.java
+++ b/core/java/com/android/internal/os/WakelockPowerCalculator.java
@@ -44,6 +44,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_WAKELOCK;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
final PowerAndDuration result = new PowerAndDuration();
diff --git a/core/java/com/android/internal/os/WifiPowerCalculator.java b/core/java/com/android/internal/os/WifiPowerCalculator.java
index 2a71ac6..77f15f1 100644
--- a/core/java/com/android/internal/os/WifiPowerCalculator.java
+++ b/core/java/com/android/internal/os/WifiPowerCalculator.java
@@ -82,6 +82,11 @@
}
@Override
+ public boolean isPowerComponentSupported(@BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_WIFI;
+ }
+
+ @Override
public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
BatteryConsumer.Key[] keys = UNINITIALIZED_KEYS;
diff --git a/core/java/com/android/internal/security/VerityUtils.java b/core/java/com/android/internal/security/VerityUtils.java
index 8770267..76f7b21 100644
--- a/core/java/com/android/internal/security/VerityUtils.java
+++ b/core/java/com/android/internal/security/VerityUtils.java
@@ -18,28 +18,15 @@
import android.annotation.NonNull;
import android.os.Build;
-import android.os.SharedMemory;
import android.os.SystemProperties;
-import android.system.ErrnoException;
import android.system.Os;
import android.system.OsConstants;
-import android.util.Pair;
import android.util.Slog;
-import android.util.apk.ApkSignatureVerifier;
-import android.util.apk.ByteBufferFactory;
-import android.util.apk.SignatureNotFoundException;
-
-import libcore.util.HexEncoding;
import java.io.File;
-import java.io.FileDescriptor;
import java.io.IOException;
-import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.nio.file.Paths;
-import java.security.DigestException;
-import java.security.NoSuchAlgorithmException;
-import java.util.Arrays;
/** Provides fsverity related operations. */
public abstract class VerityUtils {
@@ -57,8 +44,6 @@
/** SHA256 hash size. */
private static final int HASH_SIZE_BYTES = 32;
- private static final boolean DEBUG = false;
-
public static boolean isFsVeritySupported() {
return Build.VERSION.DEVICE_INITIAL_SDK_INT >= Build.VERSION_CODES.R
|| SystemProperties.getInt("ro.apk_verity.mode", 0) == 2;
@@ -123,204 +108,4 @@
private static native int measureFsverityNative(@NonNull String filePath,
@NonNull byte[] digest);
private static native int statxForFsverityNative(@NonNull String filePath);
-
- /**
- * Generates legacy Merkle tree and fs-verity metadata with Signing Block skipped.
- *
- * @deprecated This is only used for previous fs-verity implementation, and should never be used
- * on new devices.
- * @return {@code SetupResult} that contains the result code, and when success, the
- * {@code FileDescriptor} to read all the data from.
- */
- @Deprecated
- public static SetupResult generateApkVeritySetupData(@NonNull String apkPath) {
- if (DEBUG) {
- Slog.d(TAG, "Trying to install legacy apk verity to " + apkPath);
- }
- SharedMemory shm = null;
- try {
- final byte[] signedVerityHash = ApkSignatureVerifier.getVerityRootHash(apkPath);
- if (signedVerityHash == null) {
- if (DEBUG) {
- Slog.d(TAG, "Skip verity tree generation since there is no signed root hash");
- }
- return SetupResult.skipped();
- }
-
- Pair<SharedMemory, Integer> result =
- generateFsVerityIntoSharedMemory(apkPath, signedVerityHash);
- shm = result.first;
- int contentSize = result.second;
- FileDescriptor rfd = shm.getFileDescriptor();
- if (rfd == null || !rfd.valid()) {
- return SetupResult.failed();
- }
- return SetupResult.ok(Os.dup(rfd), contentSize);
- } catch (IOException | SecurityException | DigestException | NoSuchAlgorithmException
- | SignatureNotFoundException | ErrnoException e) {
- Slog.e(TAG, "Failed to set up apk verity: ", e);
- return SetupResult.failed();
- } finally {
- if (shm != null) {
- shm.close();
- }
- }
- }
-
- /**
- * {@see ApkSignatureVerifier#generateApkVerityRootHash(String)}.
- * @deprecated This is only used for previous fs-verity implementation, and should never be used
- * on new devices.
- */
- @Deprecated
- public static byte[] generateApkVerityRootHash(@NonNull String apkPath)
- throws NoSuchAlgorithmException, DigestException, IOException {
- return ApkSignatureVerifier.generateApkVerityRootHash(apkPath);
- }
-
- /**
- * {@see ApkSignatureVerifier#getVerityRootHash(String)}.
- * @deprecated This is only used for previous fs-verity implementation, and should never be used
- * on new devices.
- */
- @Deprecated
- public static byte[] getVerityRootHash(@NonNull String apkPath)
- throws IOException, SignatureNotFoundException {
- return ApkSignatureVerifier.getVerityRootHash(apkPath);
- }
-
- /**
- * Returns a pair of {@code SharedMemory} and {@code Integer}. The {@code SharedMemory} contains
- * Merkle tree and fsverity headers for the given apk, in the form that can immediately be used
- * for fsverity setup. The data is aligned to the beginning of {@code SharedMemory}, and has
- * length equals to the returned {@code Integer}.
- */
- private static Pair<SharedMemory, Integer> generateFsVerityIntoSharedMemory(String apkPath,
- @NonNull byte[] expectedRootHash)
- throws IOException, DigestException, NoSuchAlgorithmException,
- SignatureNotFoundException {
- TrackedShmBufferFactory shmBufferFactory = new TrackedShmBufferFactory();
- byte[] generatedRootHash =
- ApkSignatureVerifier.generateApkVerity(apkPath, shmBufferFactory);
- // We only generate Merkle tree once here, so it's important to make sure the root hash
- // matches the signed one in the apk.
- if (!Arrays.equals(expectedRootHash, generatedRootHash)) {
- throw new SecurityException("verity hash mismatch: "
- + bytesToString(generatedRootHash) + " != " + bytesToString(expectedRootHash));
- }
-
- int contentSize = shmBufferFactory.getBufferLimit();
- SharedMemory shm = shmBufferFactory.releaseSharedMemory();
- if (shm == null) {
- throw new IllegalStateException("Failed to generate verity tree into shared memory");
- }
- if (!shm.setProtect(OsConstants.PROT_READ)) {
- throw new SecurityException("Failed to set up shared memory correctly");
- }
- return Pair.create(shm, contentSize);
- }
-
- private static String bytesToString(byte[] bytes) {
- return HexEncoding.encodeToString(bytes);
- }
-
- /**
- * @deprecated This is only used for previous fs-verity implementation, and should never be used
- * on new devices.
- */
- @Deprecated
- public static class SetupResult {
- /** Result code if verity is set up correctly. */
- private static final int RESULT_OK = 1;
-
- /** Result code if signature is not provided. */
- private static final int RESULT_SKIPPED = 2;
-
- /** Result code if the setup failed. */
- private static final int RESULT_FAILED = 3;
-
- private final int mCode;
- private final FileDescriptor mFileDescriptor;
- private final int mContentSize;
-
- /** @deprecated */
- @Deprecated
- public static SetupResult ok(@NonNull FileDescriptor fileDescriptor, int contentSize) {
- return new SetupResult(RESULT_OK, fileDescriptor, contentSize);
- }
-
- /** @deprecated */
- @Deprecated
- public static SetupResult skipped() {
- return new SetupResult(RESULT_SKIPPED, null, -1);
- }
-
- /** @deprecated */
- @Deprecated
- public static SetupResult failed() {
- return new SetupResult(RESULT_FAILED, null, -1);
- }
-
- private SetupResult(int code, FileDescriptor fileDescriptor, int contentSize) {
- this.mCode = code;
- this.mFileDescriptor = fileDescriptor;
- this.mContentSize = contentSize;
- }
-
- public boolean isFailed() {
- return mCode == RESULT_FAILED;
- }
-
- public boolean isOk() {
- return mCode == RESULT_OK;
- }
-
- public @NonNull FileDescriptor getUnownedFileDescriptor() {
- return mFileDescriptor;
- }
-
- public int getContentSize() {
- return mContentSize;
- }
- }
-
- /** A {@code ByteBufferFactory} that creates a shared memory backed {@code ByteBuffer}. */
- private static class TrackedShmBufferFactory implements ByteBufferFactory {
- private SharedMemory mShm;
- private ByteBuffer mBuffer;
-
- @Override
- public ByteBuffer create(int capacity) {
- try {
- if (DEBUG) Slog.d(TAG, "Creating shared memory for apk verity");
- // NB: This method is supposed to be called once according to the contract with
- // ApkSignatureSchemeV2Verifier.
- if (mBuffer != null) {
- throw new IllegalStateException("Multiple instantiation from this factory");
- }
- mShm = SharedMemory.create("apkverity", capacity);
- if (!mShm.setProtect(OsConstants.PROT_READ | OsConstants.PROT_WRITE)) {
- throw new SecurityException("Failed to set protection");
- }
- mBuffer = mShm.mapReadWrite();
- return mBuffer;
- } catch (ErrnoException e) {
- throw new SecurityException("Failed to set protection", e);
- }
- }
-
- public SharedMemory releaseSharedMemory() {
- if (mBuffer != null) {
- SharedMemory.unmap(mBuffer);
- mBuffer = null;
- }
- SharedMemory tmp = mShm;
- mShm = null;
- return tmp;
- }
-
- public int getBufferLimit() {
- return mBuffer == null ? -1 : mBuffer.limit();
- }
- }
}
diff --git a/core/java/com/android/internal/statusbar/ISessionListener.aidl b/core/java/com/android/internal/statusbar/ISessionListener.aidl
new file mode 100644
index 0000000..101a2d2
--- /dev/null
+++ b/core/java/com/android/internal/statusbar/ISessionListener.aidl
@@ -0,0 +1,25 @@
+/**
+ * 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 permissons and
+ * limitations under the License.
+ */
+
+package com.android.internal.statusbar;
+
+import com.android.internal.logging.InstanceId;
+
+/** {@hide} */
+oneway interface ISessionListener {
+ void onSessionStarted(int sessionType, in InstanceId instance);
+ void onSessionEnded(int sessionType, in InstanceId instance);
+}
\ No newline at end of file
diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
index 3c6b7ff..accb986 100644
--- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
@@ -28,7 +28,9 @@
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
+import com.android.internal.logging.InstanceId;
import com.android.internal.statusbar.IAddTileResultCallback;
+import com.android.internal.statusbar.ISessionListener;
import com.android.internal.statusbar.IStatusBar;
import com.android.internal.statusbar.RegisterStatusBarResult;
import com.android.internal.statusbar.StatusBarIcon;
@@ -178,4 +180,17 @@
* @hide
*/
int getNavBarModeOverride();
+
+ /**
+ * Register a listener for certain sessions. Each session may be guarded by its own permission.
+ */
+ void registerSessionListener(int sessionFlags, in ISessionListener listener);
+ void unregisterSessionListener(int sessionFlags, in ISessionListener listener);
+
+ /**
+ * Informs all registered listeners that a session has begun and has the following instanceId.
+ * Can only be set by callers with certain permission based on the session type being updated.
+ */
+ void onSessionStarted(int sessionType, in InstanceId instanceId);
+ void onSessionEnded(int sessionType, in InstanceId instanceId);
}
diff --git a/core/jni/android_hardware_UsbDeviceConnection.cpp b/core/jni/android_hardware_UsbDeviceConnection.cpp
index 845d65c..a022842 100644
--- a/core/jni/android_hardware_UsbDeviceConnection.cpp
+++ b/core/jni/android_hardware_UsbDeviceConnection.cpp
@@ -16,20 +16,19 @@
#define LOG_TAG "UsbDeviceConnectionJNI"
-#include "utils/Log.h"
-
-#include "jni.h"
+#include <fcntl.h>
#include <nativehelper/JNIPlatformHelp.h>
-#include "core_jni_helpers.h"
-
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <usbhost/usbhost.h>
+#include <usbhost/usbhost_jni.h>
#include <chrono>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
+#include "core_jni_helpers.h"
+#include "jni.h"
+#include "utils/Log.h"
using namespace android;
using namespace std::chrono;
@@ -91,22 +90,8 @@
static jbyteArray
android_hardware_UsbDeviceConnection_get_desc(JNIEnv *env, jobject thiz)
{
- char buffer[16384];
int fd = android_hardware_UsbDeviceConnection_get_fd(env, thiz);
- if (fd < 0) return NULL;
- lseek(fd, 0, SEEK_SET);
- int length = read(fd, buffer, sizeof(buffer));
- if (length < 0) return NULL;
-
- jbyteArray ret = env->NewByteArray(length);
- if (ret) {
- jbyte* bytes = (jbyte*)env->GetPrimitiveArrayCritical(ret, 0);
- if (bytes) {
- memcpy(bytes, buffer, length);
- env->ReleasePrimitiveArrayCritical(ret, bytes, 0);
- }
- }
- return ret;
+ return usb_jni_read_descriptors(env, fd);
}
static jboolean
diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp
index 3e2b258..e13b788 100644
--- a/core/jni/android_media_AudioSystem.cpp
+++ b/core/jni/android_media_AudioSystem.cpp
@@ -1236,6 +1236,65 @@
return false;
}
+static jint convertAudioProfileFromNative(JNIEnv *env, jobject *jAudioProfile,
+ const audio_profile *nAudioProfile, bool useInMask) {
+ size_t numPositionMasks = 0;
+ size_t numIndexMasks = 0;
+
+ // count up how many masks are positional and indexed
+ for (size_t index = 0; index < nAudioProfile->num_channel_masks; index++) {
+ const audio_channel_mask_t mask = nAudioProfile->channel_masks[index];
+ if (audio_channel_mask_get_representation(mask) == AUDIO_CHANNEL_REPRESENTATION_INDEX) {
+ numIndexMasks++;
+ } else {
+ numPositionMasks++;
+ }
+ }
+
+ ScopedLocalRef<jintArray> jSamplingRates(env,
+ env->NewIntArray(nAudioProfile->num_sample_rates));
+ ScopedLocalRef<jintArray> jChannelMasks(env, env->NewIntArray(numPositionMasks));
+ ScopedLocalRef<jintArray> jChannelIndexMasks(env, env->NewIntArray(numIndexMasks));
+ if (!jSamplingRates.get() || !jChannelMasks.get() || !jChannelIndexMasks.get()) {
+ return AUDIO_JAVA_ERROR;
+ }
+
+ if (nAudioProfile->num_sample_rates) {
+ env->SetIntArrayRegion(jSamplingRates.get(), 0 /*start*/, nAudioProfile->num_sample_rates,
+ (jint *)nAudioProfile->sample_rates);
+ }
+
+ // put the masks in the output arrays
+ for (size_t maskIndex = 0, posMaskIndex = 0, indexedMaskIndex = 0;
+ maskIndex < nAudioProfile->num_channel_masks; maskIndex++) {
+ const audio_channel_mask_t mask = nAudioProfile->channel_masks[maskIndex];
+ if (audio_channel_mask_get_representation(mask) == AUDIO_CHANNEL_REPRESENTATION_INDEX) {
+ jint jMask = audio_channel_mask_get_bits(mask);
+ env->SetIntArrayRegion(jChannelIndexMasks.get(), indexedMaskIndex++, 1, &jMask);
+ } else {
+ jint jMask = useInMask ? inChannelMaskFromNative(mask) : outChannelMaskFromNative(mask);
+ env->SetIntArrayRegion(jChannelMasks.get(), posMaskIndex++, 1, &jMask);
+ }
+ }
+
+ int encapsulationType;
+ if (audioEncapsulationTypeFromNative(nAudioProfile->encapsulation_type, &encapsulationType) !=
+ NO_ERROR) {
+ ALOGW("Unknown encapsulation type for JAVA API: %u", nAudioProfile->encapsulation_type);
+ }
+
+ *jAudioProfile =
+ env->NewObject(gAudioProfileClass, gAudioProfileCstor,
+ audioFormatFromNative(nAudioProfile->format), jSamplingRates.get(),
+ jChannelMasks.get(), jChannelIndexMasks.get(), encapsulationType);
+
+ if (jAudioProfile == nullptr) {
+ return AUDIO_JAVA_ERROR;
+ }
+
+ return AUDIO_JAVA_SUCCESS;
+}
+
static jint convertAudioPortFromNative(JNIEnv *env, jobject *jAudioPort,
const struct audio_port_v7 *nAudioPort) {
jint jStatus = (jint)AUDIO_JAVA_SUCCESS;
@@ -2479,6 +2538,10 @@
return AudioSystem::isHapticPlaybackSupported();
}
+static jboolean android_media_AudioSystem_isUltrasoundSupported(JNIEnv *env, jobject thiz) {
+ return AudioSystem::isUltrasoundSupported();
+}
+
static jint android_media_AudioSystem_setSupportedSystemUsages(JNIEnv *env, jobject thiz,
jintArray systemUsages) {
std::vector<audio_usage_t> nativeSystemUsagesVector;
@@ -2814,6 +2877,50 @@
return convertAudioDirectModeFromNative(directMode);
}
+static jint android_media_AudioSystem_getDirectProfilesForAttributes(JNIEnv *env, jobject thiz,
+ jobject jAudioAttributes,
+ jobject jAudioProfilesList) {
+ ALOGV("getDirectProfilesForAttributes");
+
+ if (jAudioAttributes == nullptr) {
+ ALOGE("jAudioAttributes is NULL");
+ return (jint)AUDIO_JAVA_BAD_VALUE;
+ }
+ if (jAudioProfilesList == nullptr) {
+ ALOGE("jAudioProfilesList is NULL");
+ return (jint)AUDIO_JAVA_BAD_VALUE;
+ }
+ if (!env->IsInstanceOf(jAudioProfilesList, gArrayListClass)) {
+ ALOGE("jAudioProfilesList not an ArrayList");
+ return (jint)AUDIO_JAVA_BAD_VALUE;
+ }
+
+ JNIAudioAttributeHelper::UniqueAaPtr paa = JNIAudioAttributeHelper::makeUnique();
+ jint jStatus = JNIAudioAttributeHelper::nativeFromJava(env, jAudioAttributes, paa.get());
+ if (jStatus != (jint)AUDIO_JAVA_SUCCESS) {
+ return jStatus;
+ }
+
+ std::vector<audio_profile> audioProfiles;
+ status_t status = AudioSystem::getDirectProfilesForAttributes(paa.get(), &audioProfiles);
+ if (status != NO_ERROR) {
+ ALOGE("AudioSystem::getDirectProfilesForAttributes error %d", status);
+ jStatus = nativeToJavaStatus(status);
+ return jStatus;
+ }
+
+ for (const auto &audioProfile : audioProfiles) {
+ jobject jAudioProfile;
+ jStatus = convertAudioProfileFromNative(env, &jAudioProfile, &audioProfile, false);
+ if (jStatus != AUDIO_JAVA_SUCCESS) {
+ return jStatus;
+ }
+ env->CallBooleanMethod(jAudioProfilesList, gArrayListMethods.add, jAudioProfile);
+ env->DeleteLocalRef(jAudioProfile);
+ }
+ return jStatus;
+}
+
// ----------------------------------------------------------------------------
static const JNINativeMethod gMethods[] =
@@ -2915,6 +3022,7 @@
{"setA11yServicesUids", "([I)I", (void *)android_media_AudioSystem_setA11yServicesUids},
{"isHapticPlaybackSupported", "()Z",
(void *)android_media_AudioSystem_isHapticPlaybackSupported},
+ {"isUltrasoundSupported", "()Z", (void *)android_media_AudioSystem_isUltrasoundSupported},
{"getHwOffloadFormatsSupportedForBluetoothMedia", "(ILjava/util/ArrayList;)I",
(void *)android_media_AudioSystem_getHwOffloadFormatsSupportedForBluetoothMedia},
{"setSupportedSystemUsages", "([I)I",
@@ -2960,7 +3068,10 @@
(void *)android_media_AudioSystem_canBeSpatialized},
{"getDirectPlaybackSupport",
"(Landroid/media/AudioFormat;Landroid/media/AudioAttributes;)I",
- (void *)android_media_AudioSystem_getDirectPlaybackSupport}};
+ (void *)android_media_AudioSystem_getDirectPlaybackSupport},
+ {"getDirectProfilesForAttributes",
+ "(Landroid/media/AudioAttributes;Ljava/util/ArrayList;)I",
+ (void *)android_media_AudioSystem_getDirectProfilesForAttributes}};
static const JNINativeMethod gEventHandlerMethods[] = {
{"native_setup",
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index d5470cc..a8cf253 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -953,6 +953,11 @@
transaction->setDropInputMode(ctrl, static_cast<gui::DropInputMode>(mode));
}
+static void nativeSanitize(JNIEnv* env, jclass clazz, jlong transactionObj) {
+ auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
+ transaction->sanitize();
+}
+
static jlongArray nativeGetPhysicalDisplayIds(JNIEnv* env, jclass clazz) {
const auto displayIds = SurfaceComposerClient::getPhysicalDisplayIds();
jlongArray array = env->NewLongArray(displayIds.size());
@@ -2134,6 +2139,8 @@
(void*)nativeSetDropInputMode },
{"nativeAddTransactionCommittedListener", "(JLandroid/view/TransactionCommittedListener;)V",
(void*) nativeAddTransactionCommittedListener },
+ {"nativeSanitize", "(J)V",
+ (void*) nativeSanitize }
// clang-format on
};
diff --git a/core/proto/android/os/batteryusagestats.proto b/core/proto/android/os/batteryusagestats.proto
index c0a9f03..cc90e05 100644
--- a/core/proto/android/os/batteryusagestats.proto
+++ b/core/proto/android/os/batteryusagestats.proto
@@ -98,4 +98,7 @@
// Sum of all discharge percentage point drops during the reported session.
optional int32 session_discharge_percentage = 6;
-}
\ No newline at end of file
+
+ // Total amount of time battery was discharging during the reported session
+ optional int64 discharge_duration_millis = 7;
+}
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index f106872..862d93c 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -717,6 +717,7 @@
<!-- Added in T -->
<protected-broadcast android:name="android.intent.action.REFRESH_SAFETY_SOURCES" />
<protected-broadcast android:name="android.app.action.DEVICE_POLICY_RESOURCE_UPDATED" />
+ <protected-broadcast android:name="android.intent.action.SHOW_FOREGROUND_SERVICE_MANAGER" />
<!-- ====================================================================== -->
<!-- RUNTIME PERMISSIONS -->
@@ -3119,8 +3120,6 @@
({@link android.companion.AssociationRequest#DEVICE_PROFILE_APP_STREAMING})
by {@link android.companion.CompanionDeviceManager}.
<p>Not for use by third-party applications.
- @hide
- @SystemApi
-->
<permission android:name="android.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING"
android:protectionLevel="signature|privileged" />
@@ -3130,15 +3129,20 @@
({@link android.companion.AssociationRequest#DEVICE_PROFILE_AUTOMOTIVE_PROJECTION})
by {@link android.companion.CompanionDeviceManager}.
<p>Not for use by third-party applications.
- @hide
- @SystemApi
-->
<permission android:name="android.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION"
android:protectionLevel="internal|role" />
+ <!-- Allows application to request to be associated with a computer to share functionality
+ and/or data with other devices, such as notifications, photos and media
+ ({@link android.companion.AssociationRequest#DEVICE_PROFILE_COMPUTER})
+ by {@link android.companion.CompanionDeviceManager}.
+ <p>Not for use by third-party applications.
+ -->
+ <permission android:name="android.permission.REQUEST_COMPANION_PROFILE_COMPUTER"
+ android:protectionLevel="signature|privileged" />
+
<!-- Allows an application to create a "self-managed" association.
- @hide
- @SystemApi
-->
<permission android:name="android.permission.REQUEST_COMPANION_SELF_MANAGED"
android:protectionLevel="signature|privileged" />
@@ -4205,6 +4209,13 @@
<permission android:name="android.permission.BIND_TV_INPUT"
android:protectionLevel="signature|privileged" />
+ <!-- Must be required by a {@link android.media.tv.interactive.TvInteractiveAppService}
+ to ensure that only the system can bind to it.
+ <p>Protection level: signature|privileged
+ -->
+ <permission android:name="android.permission.BIND_TV_INTERACTIVE_APP"
+ android:protectionLevel="signature|privileged" />
+
<!-- @SystemApi
Must be required by a {@link com.android.media.tv.remoteprovider.TvRemoteProvider}
to ensure that only the system can bind to it.
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 8696f5a..7916ef4 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -3355,6 +3355,14 @@
<p>The system will try to respect this, but when not possible will ignore it.
See {@link android.view.View#setPreferKeepClear}. -->
<attr name="preferKeepClear" format="boolean" />
+
+ <!-- <p>Whether or not the auto handwriting initiation is enabled in this View.
+ <p>For a view with active {@link android.view.inputmethod.InputConnection},
+ if auto handwriting initiation is enabled stylus movement within its view boundary
+ will automatically trigger the handwriting mode.
+ <p>This is true by default.
+ See {@link android.view.View#setAutoHandwritingEnabled}. -->
+ <attr name="autoHandwritingEnabled" format="boolean" />
</declare-styleable>
<!-- Attributes that can be assigned to a tag for a particular View. -->
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 02d6293d..5fee1fa 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -4600,6 +4600,18 @@
<array name="config_displayWhiteBalanceDisplayColorTemperatures">
</array>
+ <!-- See DisplayWhiteBalanceController.
+ The same as config_displayWhiteBalanceAmbientColorTemperatures, but with a stronger
+ visual adjustment. -->
+ <array name="config_displayWhiteBalanceStrongAmbientColorTemperatures">
+ </array>
+
+ <!-- See DisplayWhiteBalanceController.
+ The same as config_displayWhiteBalanceDisplayColorTemperatures, but with a stronger
+ visual adjustment. -->
+ <array name="config_displayWhiteBalanceStrongDisplayColorTemperatures">
+ </array>
+
<!-- All of the paths defined for the batterymeter are defined on a 12x20 canvas, and must
be parsable by android.utill.PathParser -->
<string name="config_batterymeterPerimeterPath" translatable="false">
@@ -4944,6 +4956,9 @@
Used by ChooserActivity. -->
<string translatable="false" name="config_defaultNearbySharingComponent"></string>
+ <!-- URI used for Nearby Share SliceProvider scanning. -->
+ <string translatable="false" name="config_defaultNearbySharingSliceUri"></string>
+
<!-- Boolean indicating whether frameworks needs to reset cell broadcast geo-fencing
check after reboot or airplane mode toggling -->
<bool translatable="false" name="reset_geo_fencing_check_after_boot_or_apm">false</bool>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 3f08e4b..d374b74 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -755,6 +755,8 @@
<dimen name="item_touch_helper_swipe_escape_velocity">120dp</dimen>
<dimen name="item_touch_helper_swipe_escape_max_velocity">800dp</dimen>
+ <!-- The maximum size of the small notification icon. -->
+ <dimen name="notification_small_icon_size">48dp</dimen>
<!-- The maximum height of any image in a remote view. This is applied to all images in custom remoteviews. This value is determined by the maximum notification height -->
<dimen name="notification_custom_view_max_image_height">284dp</dimen>
<!-- The maximum height of any image in a remote view. This is applied to all images in custom remoteviews. This value is determined a maximum notification width -->
@@ -779,6 +781,8 @@
<!-- The alpha of a disabled notification button -->
<item type="dimen" format="float" name="notification_action_disabled_alpha">0.5</item>
+ <!-- The maximum size of the small notification icon on low memory devices. -->
+ <dimen name="notification_small_icon_size_low_ram">@dimen/notification_small_icon_size</dimen>
<!-- The maximum height of any image in a remote view. This is applied to all images in custom remoteviews. -->
<dimen name="notification_custom_view_max_image_height_low_ram">208dp</dimen>
<!-- The maximum height of any image in a remote view. This is applied to all images in custom remoteviews. -->
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 505fe59..655deac 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -3259,6 +3259,7 @@
<public name="showBackground" />
<public name="inheritKeyStoreKeys" />
<public name="preferKeepClear" />
+ <public name="autoHandwritingEnabled" />
</staging-public-group>
<staging-public-group type="id" first-id="0x01de0000">
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 59ad302..44ede49 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -463,10 +463,11 @@
<!-- SSL CA cert notification --> <skip />
<!-- Shows up when there is a user SSL CA Cert installed on the
device. Indicates to the user that SSL traffic can be intercepted. [CHAR LIMIT=NONE] -->
- <plurals name="ssl_ca_cert_warning">
- <item quantity="one">Certificate authority installed</item>
- <item quantity="other">Certificate authorities installed</item>
- </plurals>
+ <string name="ssl_ca_cert_warning">{count, plural,
+ =1 {Certificate authority installed}
+ other {Certificate authorities installed}
+ }
+ </string>
<!-- Content text for a notification. The Title of the notification is "ssl_ca_cert_warning".
This says that an unknown party is doing the monitoring. [CHAR LIMIT=100]-->
<string name="ssl_ca_cert_noti_by_unknown">By an unknown third party</string>
@@ -691,10 +692,11 @@
your device is unresponsive or too slow, or when you need all report sections.
Does not allow you to enter more details or take additional screenshots.</string>
<!-- Toast message informing user in how many seconds a bugreport screenshot will be taken -->
- <plurals name="bugreport_countdown">
- <item quantity="one">Taking screenshot for bug report in <xliff:g id="number">%d</xliff:g> second.</item>
- <item quantity="other">Taking screenshot for bug report in <xliff:g id="number">%d</xliff:g> seconds.</item>
- </plurals>
+ <string name="bugreport_countdown">{count, plural,
+ =1 {Taking screenshot for bug report in # second.}
+ other {Taking screenshot for bug report in # seconds.}
+ }
+ </string>
<!-- Format for build summary info [CHAR LIMIT=NONE] -->
<string name="bugreport_status" translatable="false">%s (%s)</string>
@@ -3066,10 +3068,10 @@
<string name="beforeOneMonthDurationPast">Before 1 month ago</string>
<!-- This is used to express that something occurred within the last X days (e.g., Last 7 days). -->
- <plurals name="last_num_days">
- <item quantity="one">Last <xliff:g id="count">%d</xliff:g> day</item>
- <item quantity="other">Last <xliff:g id="count">%d</xliff:g> days</item>
- </plurals>
+ <string name="last_num_days">{ count, plural,
+ =1 {Last # day}
+ other {Last # days}
+ }</string>
<!-- This is used to express that something has occurred within the last month -->
<string name="last_month">Last month</string>
@@ -3113,100 +3115,100 @@
<string name="now_string_shortest">now</string>
<!-- Phrase describing a time duration using minutes that is as short as possible, preferrably one character. If the language needs a space in between the integer and the unit, please also integrate it in the string, but preferably it should not have a space in between.[CHAR LIMIT=6] -->
- <plurals name="duration_minutes_shortest">
- <item quantity="one"><xliff:g example="1" id="count">%d</xliff:g>m</item>
- <item quantity="other"><xliff:g example="2" id="count">%d</xliff:g>m</item>
- </plurals>
+ <string name="duration_minutes_shortest">
+ <xliff:g id="count">%d</xliff:g>m
+ </string>
<!-- Phrase describing a time duration using hours that is as short as possible, preferrably one character. If the language needs a space in between the integer and the unit, please also integrate it in the string, but preferably it should not have a space in between.[CHAR LIMIT=6] -->
- <plurals name="duration_hours_shortest">
- <item quantity="one"><xliff:g example="1" id="count">%d</xliff:g>h</item>
- <item quantity="other"><xliff:g example="2" id="count">%d</xliff:g>h</item>
- </plurals>
+ <string name="duration_hours_shortest">
+ <xliff:g id="count">%d</xliff:g>h
+ </string>
<!-- Phrase describing a time duration using days that is as short as possible, preferrably one character. If the language needs a space in between the integer and the unit, please also integrate it in the string, but preferably it should not have a space in between.[CHAR LIMIT=6] -->
- <plurals name="duration_days_shortest">
- <item quantity="one"><xliff:g example="1" id="count">%d</xliff:g>d</item>
- <item quantity="other"><xliff:g example="2" id="count">%d</xliff:g>d</item>
- </plurals>
+ <string name="duration_days_shortest">
+ <xliff:g id="count">%d</xliff:g>d
+ </string>
<!-- Phrase describing a time duration using years that is as short as possible, preferrably one character. If the language needs a space in between the integer and the unit, please also integrate it in the string, but preferably it should not have a space in between.[CHAR LIMIT=6] -->
- <plurals name="duration_years_shortest">
- <item quantity="one"><xliff:g example="1" id="count">%d</xliff:g>y</item>
- <item quantity="other"><xliff:g example="2" id="count">%d</xliff:g>y</item>
- </plurals>
+ <string name="duration_years_shortest">
+ <xliff:g id="count">%d</xliff:g>y
+ </string>
<!-- Phrase describing a time duration using minutes that is as short as possible, preferrably one character. This version should be a future point in time. If the language needs a space in between the integer and the unit, please also integrate it in the string, but preferably it should not have a space in between.[CHAR LIMIT=14] -->
- <plurals name="duration_minutes_shortest_future">
- <item quantity="one">in <xliff:g example="1" id="count">%d</xliff:g>m</item>
- <item quantity="other">in <xliff:g example="2" id="count">%d</xliff:g>m</item>
- </plurals>
+ <string name="duration_minutes_shortest_future">
+ in <xliff:g id="count">%d</xliff:g>m
+ </string>
<!-- Phrase describing a time duration using hours that is as short as possible, preferrably one character. This version should be a future point in time. If the language needs a space in between the integer and the unit, please also integrate it in the string, but preferably it should not have a space in between.[CHAR LIMIT=14] -->
- <plurals name="duration_hours_shortest_future">
- <item quantity="one">in <xliff:g example="1" id="count">%d</xliff:g>h</item>
- <item quantity="other">in <xliff:g example="2" id="count">%d</xliff:g>h</item>
- </plurals>
+ <string name="duration_hours_shortest_future">
+ in <xliff:g id="count">%d</xliff:g>h
+ </string>
<!-- Phrase describing a time duration using days that is as short as possible, preferrably one character. This version should be a future point in time. If the language needs a space in between the integer and the unit, please also integrate it in the string, but preferably it should not have a space in between.[CHAR LIMIT=14] -->
- <plurals name="duration_days_shortest_future">
- <item quantity="one">in <xliff:g example="1" id="count">%d</xliff:g>d</item>
- <item quantity="other">in <xliff:g example="2" id="count">%d</xliff:g>d</item>
- </plurals>
+ <string name="duration_days_shortest_future">
+ in <xliff:g example="1" id="count">%d</xliff:g>d
+ </string>
<!-- Phrase describing a time duration using years that is as short as possible, preferrably one character. This version should be a future point in time. If the language needs a space in between the integer and the unit, please also integrate it in the string, but preferably it should not have a space in between.[CHAR LIMIT=14] -->
- <plurals name="duration_years_shortest_future">
- <item quantity="one">in <xliff:g example="1" id="count">%d</xliff:g>y</item>
- <item quantity="other">in <xliff:g example="2" id="count">%d</xliff:g>y</item>
- </plurals>
+ <string name="duration_years_shortest_future">
+ in <xliff:g id="count">%d</xliff:g>y
+ </string>
<!-- Phrase describing a relative time using minutes in the past that is not shown on the screen but used for accessibility. [CHAR LIMIT=NONE] -->
- <plurals name="duration_minutes_relative">
- <item quantity="one"><xliff:g example="1" id="count">%d</xliff:g> minute ago</item>
- <item quantity="other"><xliff:g example="2" id="count">%d</xliff:g> minutes ago</item>
- </plurals>
+ <string name="duration_minutes_relative">{count, plural,
+ =1 {# minute ago}
+ other {# minutes ago}
+ }
+ </string>
<!-- Phrase describing a relative time using hours in the past that is not shown on the screen but used for accessibility. [CHAR LIMIT=NONE] -->
- <plurals name="duration_hours_relative">
- <item quantity="one"><xliff:g example="1" id="count">%d</xliff:g> hour ago</item>
- <item quantity="other"><xliff:g example="2" id="count">%d</xliff:g> hours ago</item>
- </plurals>
+ <string name="duration_hours_relative">{count, plural,
+ =1 {# hour ago}
+ other {# hours ago}
+ }
+ </string>
<!-- Phrase describing a relative time using days in the past that is not shown on the screen but used for accessibility. [CHAR LIMIT=NONE] -->
- <plurals name="duration_days_relative">
- <item quantity="one"><xliff:g example="1" id="count">%d</xliff:g> day ago</item>
- <item quantity="other"><xliff:g example="2" id="count">%d</xliff:g> days ago</item>
- </plurals>
+ <string name="duration_days_relative">{count, plural,
+ =1 {# day ago}
+ other {# days ago}
+ }
+ </string>
<!-- Phrase describing a relative time using years in the past that is not shown on the screen but used for accessibility. [CHAR LIMIT=NONE] -->
- <plurals name="duration_years_relative">
- <item quantity="one"><xliff:g example="1" id="count">%d</xliff:g> year ago</item>
- <item quantity="other"><xliff:g example="2" id="count">%d</xliff:g> years ago</item>
- </plurals>
+ <string name="duration_years_relative">{count, plural,
+ =1 {# year ago}
+ other {# years ago}
+ }
+ </string>
<!-- Phrase describing a relative time using minutes that is not shown on the screen but used for accessibility. This version should be a future point in time. [CHAR LIMIT=NONE] -->
- <plurals name="duration_minutes_relative_future">
- <item quantity="one">in <xliff:g example="1" id="count">%d</xliff:g> minute</item>
- <item quantity="other">in <xliff:g example="2" id="count">%d</xliff:g> minutes</item>
- </plurals>
+ <string name="duration_minutes_relative_future">{count, plural,
+ =1 {# minute}
+ other {# minutes}
+ }
+ </string>
<!-- Phrase describing a relative time using hours that is not shown on the screen but used for accessibility. This version should be a future point in time. [CHAR LIMIT=NONE] -->
- <plurals name="duration_hours_relative_future">
- <item quantity="one">in <xliff:g example="1" id="count">%d</xliff:g> hour</item>
- <item quantity="other">in <xliff:g example="2" id="count">%d</xliff:g> hours</item>
- </plurals>
+ <string name="duration_hours_relative_future">{count, plural,
+ =1 {# hour}
+ other {# hours}
+ }
+ </string>
<!-- Phrase describing a relative time using days that is not shown on the screen but used for accessibility. This version should be a future point in time. [CHAR LIMIT=NONE] -->
- <plurals name="duration_days_relative_future">
- <item quantity="one">in <xliff:g example="1" id="count">%d</xliff:g> day</item>
- <item quantity="other">in <xliff:g example="2" id="count">%d</xliff:g> days</item>
- </plurals>
+ <string name="duration_days_relative_future">{count, plural,
+ =1 {# day}
+ other {# days}
+ }
+ </string>
<!-- Phrase describing a relative time using years that is not shown on the screen but used for accessibility. This version should be a future point in time. [CHAR LIMIT=NONE] -->
- <plurals name="duration_years_relative_future">
- <item quantity="one">in <xliff:g example="1" id="count">%d</xliff:g> year</item>
- <item quantity="other">in <xliff:g example="2" id="count">%d</xliff:g> years</item>
- </plurals>
+ <string name="duration_years_relative_future">{count, plural,
+ =1 {# year}
+ other {# years}
+ }
+ </string>
<!-- Title for error alert when a video cannot be played. it can be used by any app. -->
<string name="VideoView_error_title">Video problem</string>
@@ -4228,12 +4230,11 @@
<!-- Displayed on the Find dialog to display the index of the highlighted
match and total number of matches found in the current page. [CHAR LIMIT=NONE] -->
- <plurals name="matches_found">
- <!-- Case of one match -->
- <item quantity="one">1 match</item>
- <!-- Case of multiple total matches -->
- <item quantity="other"><xliff:g id="index" example="2">%d</xliff:g> of <xliff:g id="total" example="137">%d</xliff:g></item>
- </plurals>
+ <string name="matches_found">{ count, plural,
+ =1 {# match}
+ other {# of {total}}}
+ }
+ </string>
<!-- Label for the "Done" button on the far left of action mode toolbars. -->
<string name="action_mode_done">Done</string>
@@ -4595,11 +4596,6 @@
<string name="kg_wrong_password">Wrong Password</string>
<!-- Message shown when user enters wrong PIN -->
<string name="kg_wrong_pin">Wrong PIN</string>
- <!-- Countdown message shown after too many failed unlock attempts -->
- <plurals name="kg_too_many_failed_attempts_countdown">
- <item quantity="one">Try again in 1 second.</item>
- <item quantity="other">Try again in <xliff:g id="number">%d</xliff:g> seconds.</item>
- </plurals>
<!-- Instructions for using the pattern unlock screen -->
<string name="kg_pattern_instructions">Draw your pattern</string>
<!-- Instructions for using the SIM PIN unlock screen -->
@@ -5135,12 +5131,6 @@
<string name="restr_pin_error_doesnt_match">PINs don\'t match. Try again.</string>
<!-- PIN entry dialog error when PIN is too short [CHAR LIMIT=none] -->
<string name="restr_pin_error_too_short">PIN is too short. Must be at least 4 digits.</string>
- <!-- PIN entry dialog countdown message for next chance to enter the PIN [CHAR LIMIT=none] -->
- <!-- Phrase describing a time duration using seconds [CHAR LIMIT=none] -->
- <plurals name="restr_pin_countdown">
- <item quantity="one">Try again in 1 second</item>
- <item quantity="other">Try again in <xliff:g id="count">%d</xliff:g> seconds</item>
- </plurals>
<!-- PIN entry dialog tells the user to not enter a PIN for a while. [CHAR LIMIT=none] -->
<string name="restr_pin_try_later">Try again later</string>
@@ -5234,52 +5224,60 @@
<string name="data_saver_enable_button">Turn on</string>
<!-- Zen mode condition - summary: time duration in minutes. [CHAR LIMIT=NONE] -->
- <plurals name="zen_mode_duration_minutes_summary">
- <item quantity="one">For one minute (until <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
- <item quantity="other">For %1$d minutes (until <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
- </plurals>
+ <string name="zen_mode_duration_minutes_summary">{count, plural,
+ =1 {For one minute (until {formattedTime})}
+ other {For # minutes (until {formattedTime})}
+ }
+ </string>
<!-- Zen mode condition - summary: time duration in minutes (short version). [CHAR LIMIT=NONE] -->
- <plurals name="zen_mode_duration_minutes_summary_short">
- <item quantity="one">For 1 min (until <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
- <item quantity="other">For %1$d min (until <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
- </plurals>
+ <string name="zen_mode_duration_minutes_summary_short">{count, plural,
+ =1 {For 1 min (until {formattedTime})}
+ other {For # min (until {formattedTime})}
+ }
+ </string>
<!-- Zen mode condition - summary: time duration in hours. [CHAR LIMIT=NONE] -->
- <plurals name="zen_mode_duration_hours_summary">
- <item quantity="one">For 1 hour (until <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
- <item quantity="other">For %1$d hours (until <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
- </plurals>
+ <string name="zen_mode_duration_hours_summary">{count, plural,
+ =1 {For 1 hour (until {formattedTime})}
+ other {For # hours (until {formattedTime})}
+ }
+ </string>
<!-- Zen mode condition - summary: time duration in hours (short version). [CHAR LIMIT=NONE] -->
- <plurals name="zen_mode_duration_hours_summary_short">
- <item quantity="one">For 1 hr (until <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
- <item quantity="other">For %1$d hr (until <xliff:g id="formattedTime" example="10:00 PM">%2$s</xliff:g>)</item>
- </plurals>
+ <string name="zen_mode_duration_hours_summary_short">{count, plural,
+ =1 {For 1 hr (until {formattedTime})}
+ other {For # hr (until {formattedTime})}
+ }
+ </string>
<!-- Zen mode condition - line one: time duration in minutes. [CHAR LIMIT=NONE] -->
- <plurals name="zen_mode_duration_minutes">
- <item quantity="one">For one minute</item>
- <item quantity="other">For %d minutes</item>
- </plurals>
+ <string name="zen_mode_duration_minutes">{count, plural,
+ =1 {For one minute}
+ other {For # minutes}
+ }
+ </string>
<!-- Zen mode condition - line one: time duration in minutes (short version). [CHAR LIMIT=NONE] -->
- <plurals name="zen_mode_duration_minutes_short">
- <item quantity="one">For 1 min</item>
- <item quantity="other">For %d min</item>
- </plurals>
+ <string name="zen_mode_duration_minutes_short">{count, plural,
+ =1 {For 1 min}
+ other {For # min}
+ }
+ </string>
<!-- Zen mode condition - line one: time duration in hours. [CHAR LIMIT=NONE] -->
- <plurals name="zen_mode_duration_hours">
- <item quantity="one">For 1 hour</item>
- <item quantity="other">For %d hours</item>
- </plurals>
+ <string name="zen_mode_duration_hours">{count, plural,
+ =1 {For 1 hour}
+ other {For # hours}
+ }
+ </string>
<!-- Zen mode condition - line one: time duration in hours (short version). [CHAR LIMIT=NONE] -->
- <plurals name="zen_mode_duration_hours_short">
- <item quantity="one">For 1 hr</item>
- <item quantity="other">For %d hr</item>
- </plurals>
+ <string name="zen_mode_duration_hours_short">{count, plural,
+ =1 {For 1 hr}
+ other {For # hr}
+ }
+ </string>
<!-- Zen mode condition - line two: ending time indicating the next day. [CHAR LIMIT=NONE] -->
<string name="zen_mode_until_next_day">Until <xliff:g id="formattedTime" example="Tue, 10 PM">%1$s</xliff:g></string>
@@ -5402,12 +5400,6 @@
<!-- Default notification text to be displayed in screening call notifications [CHAR LIMIT=40] -->
<string name="call_notification_screening_text">Screening an incoming call</string>
- <!-- Label describing the number of selected items [CHAR LIMIT=48] -->
- <plurals name="selected_count">
- <item quantity="one"><xliff:g id="count" example="1">%1$d</xliff:g> selected</item>
- <item quantity="other"><xliff:g id="count" example="3">%1$d</xliff:g> selected</item>
- </plurals>
-
<string name="default_notification_channel_label">Uncategorized</string>
<string name="importance_from_user">You set the importance of these notifications.</string>
@@ -5570,10 +5562,11 @@
<string name="autofill_picker_no_suggestions">No autofill suggestions</string>
<!-- Accessibility string to announce there are some autofill suggestions in the autofill picker. [CHAR LIMIT=NONE] -->
- <plurals name="autofill_picker_some_suggestions">
- <item quantity="one">One autofill suggestion</item>
- <item quantity="other"><xliff:g id="count" example="Two">%1$s</xliff:g> autofill suggestions</item>
- </plurals>
+ <string name="autofill_picker_some_suggestions">{count, plural,
+ =1 {One autofill suggestion}
+ other {# autofill suggestions}
+ }
+ </string>
<!-- Title for the autofill save dialog shown when the the contents of the activity can be saved
by an autofill service, but the service does not know what the activity represents [CHAR LIMIT=NONE] -->
@@ -5843,10 +5836,11 @@
<!-- String displayed when loading a user in the car [CHAR LIMIT=30] -->
<string name="car_loading_profile">Loading</string>
- <plurals name="file_count">
- <item quantity="one"><xliff:g id="file_name">%s</xliff:g> + <xliff:g id="count">%d</xliff:g> file</item>
- <item quantity="other"><xliff:g id="file_name">%s</xliff:g> + <xliff:g id="count">%d</xliff:g> files</item>
- </plurals>
+ <string name="file_count">{count, plural,
+ =1 {{file_name} + # file}
+ other {{file_name} + # files}
+ }
+ </string>
<!-- ChooserActivity - No direct share targets are available. [CHAR LIMIT=NONE] -->
<string name="chooser_no_direct_share_targets">No recommended people to share with</string>
@@ -6226,4 +6220,19 @@
<string name="ui_translation_accessibility_translated_text"><xliff:g id="message" example="Hello">%1$s</xliff:g> Translated.</string>
<!-- Accessibility message announced to notify the user when the system has finished translating the content displayed on the screen to a different language after the user requested translation. [CHAR LIMIT=NONE] -->
<string name="ui_translation_accessibility_translation_finished">Message translated from <xliff:g id="from_language" example="English">%1$s</xliff:g> to <xliff:g id="to_language" example="French">%2$s</xliff:g>.</string>
+
+ <!-- Title for the notification channel notifying user of abusive background apps. [CHAR LIMIT=NONE] -->
+ <string name="notification_channel_abusive_bg_apps">Background Activity</string>
+ <!-- Title of notification indicating abusive background apps. [CHAR LIMIT=NONE] -->
+ <string name="notification_title_abusive_bg_apps">Background Activity</string>
+ <!-- Content of notification indicating abusive background apps. [CHAR LIMIT=NONE] -->
+ <string name="notification_content_abusive_bg_apps">
+ <xliff:g id="app" example="Gmail">%1$s</xliff:g> is running in the background and draining battery. Tap to review.
+ </string>
+ <!-- Content of notification indicating long running foreground service. [CHAR LIMIT=NONE] -->
+ <string name="notification_content_long_running_fgs">
+ <xliff:g id="app" example="Gmail">%1$s</xliff:g> is running in the background for a long time. Tap to review.
+ </string>
+ <!-- Action label of notification for user to check background apps. [CHAR LIMIT=NONE] -->
+ <string name="notification_action_check_bg_apps">Check active apps</string>
</resources>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 4d8f9a2..1ee85ea 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1251,13 +1251,12 @@
<java-symbol type="string" name="conference_call" />
<java-symbol type="string" name="tooltip_popup_title" />
- <java-symbol type="plurals" name="bugreport_countdown" />
- <java-symbol type="plurals" name="file_count" />
- <java-symbol type="plurals" name="last_num_days" />
- <java-symbol type="plurals" name="matches_found" />
- <java-symbol type="plurals" name="restr_pin_countdown" />
+ <java-symbol type="string" name="bugreport_countdown" />
+ <java-symbol type="string" name="file_count" />
+ <java-symbol type="string" name="last_num_days" />
+ <java-symbol type="string" name="matches_found" />
<java-symbol type="plurals" name="pinpuk_attempts" />
- <java-symbol type="plurals" name="ssl_ca_cert_warning" />
+ <java-symbol type="string" name="ssl_ca_cert_warning" />
<java-symbol type="array" name="carrier_properties" />
<java-symbol type="array" name="config_sms_enabled_locking_shift_tables" />
@@ -2502,14 +2501,14 @@
<java-symbol type="string" name="zen_mode_forever" />
<java-symbol type="string" name="zen_mode_forever_dnd" />
<java-symbol type="string" name="zen_mode_rule_name_combination" />
- <java-symbol type="plurals" name="zen_mode_duration_minutes" />
- <java-symbol type="plurals" name="zen_mode_duration_hours" />
- <java-symbol type="plurals" name="zen_mode_duration_minutes_summary" />
- <java-symbol type="plurals" name="zen_mode_duration_hours_summary" />
- <java-symbol type="plurals" name="zen_mode_duration_minutes_short" />
- <java-symbol type="plurals" name="zen_mode_duration_hours_short" />
- <java-symbol type="plurals" name="zen_mode_duration_minutes_summary_short" />
- <java-symbol type="plurals" name="zen_mode_duration_hours_summary_short" />
+ <java-symbol type="string" name="zen_mode_duration_minutes" />
+ <java-symbol type="string" name="zen_mode_duration_hours" />
+ <java-symbol type="string" name="zen_mode_duration_minutes_summary" />
+ <java-symbol type="string" name="zen_mode_duration_hours_summary" />
+ <java-symbol type="string" name="zen_mode_duration_minutes_short" />
+ <java-symbol type="string" name="zen_mode_duration_hours_short" />
+ <java-symbol type="string" name="zen_mode_duration_minutes_summary_short" />
+ <java-symbol type="string" name="zen_mode_duration_hours_summary_short" />
<java-symbol type="string" name="zen_mode_until_next_day" />
<java-symbol type="string" name="zen_mode_until" />
<java-symbol type="string" name="zen_mode_feature_name" />
@@ -2941,7 +2940,6 @@
<java-symbol type="string" name="ext_media_status_missing" />
<java-symbol type="string" name="ext_media_unsupported_notification_message" />
<java-symbol type="string" name="ext_media_unsupported_notification_title" />
- <java-symbol type="plurals" name="selected_count" />
<java-symbol type="drawable" name="ic_dialog_alert_material" />
@@ -3112,23 +3110,23 @@
<java-symbol type="id" name="aerr_wait" />
- <java-symbol type="plurals" name="duration_minutes_shortest" />
- <java-symbol type="plurals" name="duration_hours_shortest" />
- <java-symbol type="plurals" name="duration_days_shortest" />
- <java-symbol type="plurals" name="duration_years_shortest" />
- <java-symbol type="plurals" name="duration_minutes_shortest_future" />
- <java-symbol type="plurals" name="duration_hours_shortest_future" />
- <java-symbol type="plurals" name="duration_days_shortest_future" />
- <java-symbol type="plurals" name="duration_years_shortest_future" />
+ <java-symbol type="string" name="duration_minutes_shortest" />
+ <java-symbol type="string" name="duration_hours_shortest" />
+ <java-symbol type="string" name="duration_days_shortest" />
+ <java-symbol type="string" name="duration_years_shortest" />
+ <java-symbol type="string" name="duration_minutes_shortest_future" />
+ <java-symbol type="string" name="duration_hours_shortest_future" />
+ <java-symbol type="string" name="duration_days_shortest_future" />
+ <java-symbol type="string" name="duration_years_shortest_future" />
- <java-symbol type="plurals" name="duration_minutes_relative" />
- <java-symbol type="plurals" name="duration_hours_relative" />
- <java-symbol type="plurals" name="duration_days_relative" />
- <java-symbol type="plurals" name="duration_years_relative" />
- <java-symbol type="plurals" name="duration_minutes_relative_future" />
- <java-symbol type="plurals" name="duration_hours_relative_future" />
- <java-symbol type="plurals" name="duration_days_relative_future" />
- <java-symbol type="plurals" name="duration_years_relative_future" />
+ <java-symbol type="string" name="duration_minutes_relative" />
+ <java-symbol type="string" name="duration_hours_relative" />
+ <java-symbol type="string" name="duration_days_relative" />
+ <java-symbol type="string" name="duration_years_relative" />
+ <java-symbol type="string" name="duration_minutes_relative_future" />
+ <java-symbol type="string" name="duration_hours_relative_future" />
+ <java-symbol type="string" name="duration_days_relative_future" />
+ <java-symbol type="string" name="duration_years_relative_future" />
<java-symbol type="string" name="now_string_shortest" />
@@ -3520,7 +3518,7 @@
<java-symbol type="id" name="autofill_save_yes" />
<java-symbol type="string" name="autofill_error_cannot_autofill" />
<java-symbol type="string" name="autofill_picker_no_suggestions" />
- <java-symbol type="plurals" name="autofill_picker_some_suggestions" />
+ <java-symbol type="string" name="autofill_picker_some_suggestions" />
<java-symbol type="string" name="autofill" />
<java-symbol type="string" name="autofill_picker_accessibility_title " />
<java-symbol type="string" name="autofill_update_title" />
@@ -3561,6 +3559,7 @@
<java-symbol type="style" name="Theme.DeviceDefault.Autofill.Save" />
<java-symbol type="style" name="Theme.DeviceDefault.Light.Autofill.Save" />
+ <java-symbol type="dimen" name="notification_small_icon_size"/>
<java-symbol type="dimen" name="notification_big_picture_max_height"/>
<java-symbol type="dimen" name="notification_big_picture_max_width"/>
<java-symbol type="dimen" name="notification_right_icon_size"/>
@@ -3569,6 +3568,7 @@
<java-symbol type="dimen" name="notification_custom_view_max_image_height"/>
<java-symbol type="dimen" name="notification_custom_view_max_image_width"/>
+ <java-symbol type="dimen" name="notification_small_icon_size_low_ram"/>
<java-symbol type="dimen" name="notification_big_picture_max_height_low_ram"/>
<java-symbol type="dimen" name="notification_big_picture_max_width_low_ram"/>
<java-symbol type="dimen" name="notification_right_icon_size_low_ram"/>
@@ -3980,6 +3980,8 @@
<java-symbol type="dimen" name="config_displayWhiteBalanceHighLightAmbientColorTemperature" />
<java-symbol type="array" name="config_displayWhiteBalanceAmbientColorTemperatures" />
<java-symbol type="array" name="config_displayWhiteBalanceDisplayColorTemperatures" />
+ <java-symbol type="array" name="config_displayWhiteBalanceStrongAmbientColorTemperatures" />
+ <java-symbol type="array" name="config_displayWhiteBalanceStrongDisplayColorTemperatures" />
<java-symbol type="drawable" name="ic_action_open" />
<java-symbol type="drawable" name="ic_menu_copy_material" />
@@ -4657,4 +4659,10 @@
<java-symbol type="string" name="config_deviceManagerUpdater" />
<java-symbol type="string" name="config_deviceSpecificDeviceStatePolicyProvider" />
+
+ <java-symbol type="string" name="notification_channel_abusive_bg_apps"/>
+ <java-symbol type="string" name="notification_title_abusive_bg_apps"/>
+ <java-symbol type="string" name="notification_content_abusive_bg_apps"/>
+ <java-symbol type="string" name="notification_content_long_running_fgs"/>
+ <java-symbol type="string" name="notification_action_check_bg_apps"/>
</resources>
diff --git a/core/tests/batterystatstests/BatteryUsageStatsProtoTests/src/com/android/internal/os/BatteryUsageStatsPulledTest.java b/core/tests/batterystatstests/BatteryUsageStatsProtoTests/src/com/android/internal/os/BatteryUsageStatsPulledTest.java
index e230a54..23b12cf 100644
--- a/core/tests/batterystatstests/BatteryUsageStatsProtoTests/src/com/android/internal/os/BatteryUsageStatsPulledTest.java
+++ b/core/tests/batterystatstests/BatteryUsageStatsProtoTests/src/com/android/internal/os/BatteryUsageStatsPulledTest.java
@@ -68,6 +68,7 @@
bus.getStatsEndTimestamp() - bus.getStatsStartTimestamp(),
proto.sessionDurationMillis);
assertEquals(bus.getDischargePercentage(), proto.sessionDischargePercentage);
+ assertEquals(bus.getDischargeDurationMs(), proto.dischargeDurationMillis);
assertEquals(3, proto.deviceBatteryConsumer.powerComponents.length); // Only 3 are non-empty
assertSameBatteryConsumer("For deviceBatteryConsumer",
@@ -215,6 +216,7 @@
/* includeProcessStats */true)
.setDischargePercentage(20)
.setDischargedPowerRange(1000, 2000)
+ .setDischargeDurationMs(1234)
.setStatsStartTimestamp(1000);
final UidBatteryConsumer.Builder uidBuilder = builder.getOrCreateUidBatteryConsumerBuilder(
batteryStatsUid0)
diff --git a/core/tests/coretests/src/android/app/NotificationTest.java b/core/tests/coretests/src/android/app/NotificationTest.java
index 37cf514..e6d2364 100644
--- a/core/tests/coretests/src/android/app/NotificationTest.java
+++ b/core/tests/coretests/src/android/app/NotificationTest.java
@@ -39,6 +39,7 @@
import android.content.LocusId;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
+import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.Icon;
@@ -504,6 +505,22 @@
}
@Test
+ public void testBuild_ensureSmallIconIsNotTooBig_resizesIcon() {
+ Icon hugeIcon = Icon.createWithBitmap(
+ Bitmap.createBitmap(3000, 3000, Bitmap.Config.ARGB_8888));
+ Notification notification = new Notification.Builder(mContext, "Channel").setSmallIcon(
+ hugeIcon).build();
+
+ Bitmap smallNotificationIcon = notification.getSmallIcon().getBitmap();
+ assertThat(smallNotificationIcon.getWidth()).isEqualTo(
+ mContext.getResources().getDimensionPixelSize(
+ R.dimen.notification_small_icon_size));
+ assertThat(smallNotificationIcon.getHeight()).isEqualTo(
+ mContext.getResources().getDimensionPixelSize(
+ R.dimen.notification_small_icon_size));
+ }
+
+ @Test
public void testColors_ensureColors_dayMode_producesValidPalette() {
Notification.Colors c = new Notification.Colors();
boolean colorized = false;
diff --git a/core/tests/coretests/src/android/content/pm/AppSearchPersonTest.java b/core/tests/coretests/src/android/content/pm/AppSearchShortcutPersonTest.java
similarity index 92%
rename from core/tests/coretests/src/android/content/pm/AppSearchPersonTest.java
rename to core/tests/coretests/src/android/content/pm/AppSearchShortcutPersonTest.java
index 5ba9059..3c49481 100644
--- a/core/tests/coretests/src/android/content/pm/AppSearchPersonTest.java
+++ b/core/tests/coretests/src/android/content/pm/AppSearchShortcutPersonTest.java
@@ -24,7 +24,7 @@
import org.junit.Test;
@Presubmit
-public class AppSearchPersonTest {
+public class AppSearchShortcutPersonTest {
@Test
public void testBuildPersonAndGetValue() {
@@ -32,7 +32,7 @@
final String key = "key";
final String uri = "name:name";
- final Person person = new AppSearchPerson.Builder(uri)
+ final Person person = new AppSearchShortcutPerson.Builder(uri)
.setName(name)
.setKey(key)
.setIsBot(true)
diff --git a/core/tests/coretests/src/android/os/VibrationEffectTest.java b/core/tests/coretests/src/android/os/VibrationEffectTest.java
index 10cec82..104f077 100644
--- a/core/tests/coretests/src/android/os/VibrationEffectTest.java
+++ b/core/tests/coretests/src/android/os/VibrationEffectTest.java
@@ -16,6 +16,9 @@
package android.os;
+import static android.os.VibrationEffect.VibrationParameter.targetAmplitude;
+import static android.os.VibrationEffect.VibrationParameter.targetFrequency;
+
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
@@ -32,6 +35,7 @@
import android.content.Context;
import android.content.res.Resources;
import android.net.Uri;
+import android.os.VibrationEffect.Composition.UnreachableAfterRepeatingIndefinitelyException;
import android.os.vibrator.PrebakedSegment;
import android.os.vibrator.PrimitiveSegment;
import android.os.vibrator.StepSegment;
@@ -43,6 +47,8 @@
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
+import java.time.Duration;
+
@Presubmit
@RunWith(MockitoJUnitRunner.class)
public class VibrationEffectTest {
@@ -122,16 +128,7 @@
VibrationEffect.createWaveform(TEST_TIMINGS, TEST_AMPLITUDES, -1).validate();
VibrationEffect.createWaveform(new long[]{10, 10}, new int[] {0, 0}, -1).validate();
VibrationEffect.createWaveform(TEST_TIMINGS, TEST_AMPLITUDES, 0).validate();
- VibrationEffect.startWaveform()
- .addStep(/* amplitude= */ 1, /* duration= */ 10)
- .addRamp(/* amplitude= */ 0, /* duration= */ 20)
- .addStep(/* amplitude= */ 1, /* frequencyHz= */ 1, /* duration= */ 100)
- .addRamp(/* amplitude= */ 0.5f, /* frequencyHz= */ 100, /* duration= */ 50)
- .build()
- .validate();
- assertThrows(IllegalStateException.class,
- () -> VibrationEffect.startWaveform().build().validate());
assertThrows(IllegalArgumentException.class,
() -> VibrationEffect.createWaveform(new long[0], new int[0], -1).validate());
assertThrows(IllegalArgumentException.class,
@@ -145,27 +142,31 @@
assertThrows(IllegalArgumentException.class,
() -> VibrationEffect.createWaveform(
TEST_TIMINGS, TEST_AMPLITUDES, TEST_TIMINGS.length).validate());
+ }
+
+ @Test
+ public void testValidateWaveformBuilder() {
+ VibrationEffect.startWaveform(targetAmplitude(1))
+ .addTransition(Duration.ofSeconds(1), targetAmplitude(0.5f), targetFrequency(100))
+ .addTransition(Duration.ZERO, targetAmplitude(0f), targetFrequency(200))
+ .addSustain(Duration.ofMinutes(2))
+ .addTransition(Duration.ofMillis(10), targetAmplitude(1f), targetFrequency(50))
+ .addSustain(Duration.ofMillis(1))
+ .addTransition(Duration.ZERO, targetFrequency(150))
+ .addSustain(Duration.ofMillis(2))
+ .addTransition(Duration.ofSeconds(15), targetAmplitude(1))
+ .build()
+ .validate();
+
+ assertThrows(IllegalStateException.class,
+ () -> VibrationEffect.startWaveform().build().validate());
+ assertThrows(IllegalArgumentException.class, () -> targetAmplitude(-2));
+ assertThrows(IllegalArgumentException.class, () -> targetFrequency(0));
assertThrows(IllegalArgumentException.class,
- () -> VibrationEffect.startWaveform()
- .addStep(/* amplitude= */ -2, 10).build().validate());
+ () -> VibrationEffect.startWaveform().addTransition(
+ Duration.ofMillis(-10), targetAmplitude(1)).build().validate());
assertThrows(IllegalArgumentException.class,
- () -> VibrationEffect.startWaveform()
- .addStep(1, /* frequencyHz= */ -1f, 10).build().validate());
- assertThrows(IllegalArgumentException.class,
- () -> VibrationEffect.startWaveform()
- .addStep(1, /* duration= */ -1).build().validate());
- assertThrows(IllegalArgumentException.class,
- () -> VibrationEffect.startWaveform()
- .addStep(1, 100f, /* duration= */ -1).build().validate());
- assertThrows(IllegalArgumentException.class,
- () -> VibrationEffect.startWaveform()
- .addRamp(/* amplitude= */ -3, 10).build().validate());
- assertThrows(IllegalArgumentException.class,
- () -> VibrationEffect.startWaveform()
- .addRamp(1, /* frequencyHz= */ 0, 10).build().validate());
- assertThrows(IllegalArgumentException.class,
- () -> VibrationEffect.startWaveform()
- .addRamp(1, 10f, /* duration= */ -3).build().validate());
+ () -> VibrationEffect.startWaveform().addSustain(Duration.ZERO).build().validate());
}
@Test
@@ -174,14 +175,24 @@
.addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK)
.addEffect(TEST_ONE_SHOT)
.addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 1f)
- .addEffect(TEST_WAVEFORM, 100)
+ .addOffDuration(Duration.ofMillis(100))
.addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 0.5f, 10)
.addEffect(VibrationEffect.get(VibrationEffect.EFFECT_CLICK))
.compose()
.validate();
+ VibrationEffect.startComposition()
+ .repeatEffectIndefinitely(TEST_ONE_SHOT)
+ .compose()
+ .validate();
+
assertThrows(IllegalStateException.class,
() -> VibrationEffect.startComposition().compose().validate());
+ assertThrows(IllegalStateException.class,
+ () -> VibrationEffect.startComposition()
+ .addOffDuration(Duration.ofSeconds(0))
+ .compose()
+ .validate());
assertThrows(IllegalArgumentException.class,
() -> VibrationEffect.startComposition().addPrimitive(-1).compose().validate());
assertThrows(IllegalArgumentException.class,
@@ -196,12 +207,27 @@
.validate());
assertThrows(IllegalArgumentException.class,
() -> VibrationEffect.startComposition()
- .addEffect(TEST_ONE_SHOT, /* delay= */ -10)
+ .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 1f, -1)
.compose()
.validate());
assertThrows(IllegalArgumentException.class,
() -> VibrationEffect.startComposition()
- .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 1f, -1)
+ .repeatEffectIndefinitely(
+ // Repeating waveform.
+ VibrationEffect.createWaveform(
+ new long[] { 10 }, new int[] { 100}, 0))
+ .compose()
+ .validate());
+ assertThrows(UnreachableAfterRepeatingIndefinitelyException.class,
+ () -> VibrationEffect.startComposition()
+ .repeatEffectIndefinitely(TEST_WAVEFORM)
+ .addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK)
+ .compose()
+ .validate());
+ assertThrows(UnreachableAfterRepeatingIndefinitelyException.class,
+ () -> VibrationEffect.startComposition()
+ .repeatEffectIndefinitely(TEST_WAVEFORM)
+ .addEffect(TEST_ONE_SHOT)
.compose()
.validate());
}
@@ -354,9 +380,9 @@
assertFalse(VibrationEffect.createWaveform(
new long[]{200, 200, 700}, new int[]{1, 2, 3}, -1).isHapticFeedbackCandidate());
assertFalse(VibrationEffect.startWaveform()
- .addRamp(1, 500)
- .addStep(1, 200)
- .addRamp(0, 500)
+ .addTransition(Duration.ofMillis(500), targetAmplitude(1))
+ .addTransition(Duration.ofMillis(200), targetAmplitude(0.5f))
+ .addTransition(Duration.ofMillis(500), targetAmplitude(0))
.build()
.isHapticFeedbackCandidate());
}
@@ -367,9 +393,9 @@
assertTrue(VibrationEffect.createWaveform(
new long[]{100, 200, 300}, new int[]{1, 2, 3}, -1).isHapticFeedbackCandidate());
assertTrue(VibrationEffect.startWaveform()
- .addRamp(1, 300)
- .addStep(1, 200)
- .addRamp(0, 300)
+ .addTransition(Duration.ofMillis(300), targetAmplitude(1))
+ .addTransition(Duration.ofMillis(200), targetAmplitude(0.5f))
+ .addTransition(Duration.ofMillis(300), targetAmplitude(0))
.build()
.isHapticFeedbackCandidate());
}
diff --git a/core/tests/coretests/src/android/view/HandwritingInitiatorTest.java b/core/tests/coretests/src/android/view/HandwritingInitiatorTest.java
index 5ea9199..632a1a9 100644
--- a/core/tests/coretests/src/android/view/HandwritingInitiatorTest.java
+++ b/core/tests/coretests/src/android/view/HandwritingInitiatorTest.java
@@ -59,34 +59,20 @@
private HandwritingInitiator mHandwritingInitiator;
private View mTestView;
+ private Context mContext;
@Before
public void setup() {
final Instrumentation mInstrumentation = InstrumentationRegistry.getInstrumentation();
- Context context = mInstrumentation.getTargetContext();
+ mContext = mInstrumentation.getTargetContext();
ViewConfiguration viewConfiguration = mock(ViewConfiguration.class);
when(viewConfiguration.getScaledTouchSlop()).thenReturn(TOUCH_SLOP);
- InputMethodManager inputMethodManager = context.getSystemService(InputMethodManager.class);
+ InputMethodManager inputMethodManager = mContext.getSystemService(InputMethodManager.class);
mHandwritingInitiator =
spy(new HandwritingInitiator(viewConfiguration, inputMethodManager));
- // mock a parent so that HandwritingInitiator can get
- ViewGroup parent = new ViewGroup(context) {
- @Override
- protected void onLayout(boolean changed, int l, int t, int r, int b) {
- // We don't layout this view.
- }
- @Override
- public boolean getChildVisibleRect(View child, Rect r, android.graphics.Point offset) {
- r.set(sHwArea);
- return true;
- }
- };
-
- mTestView = mock(View.class);
- when(mTestView.isAttachedToWindow()).thenReturn(true);
- parent.addView(mTestView);
+ mTestView = createMockView(sHwArea, true);
}
@Test
@@ -203,14 +189,42 @@
}
@Test
- public void onInputConnectionCreated_inputConnectionCreated() {
+ public void autoHandwriting_whenDisabled_wontStartHW() {
+ View mockView = createMockView(sHwArea, false);
+ mHandwritingInitiator.onInputConnectionCreated(mockView);
+ final int x1 = (sHwArea.left + sHwArea.right) / 2;
+ final int y1 = (sHwArea.top + sHwArea.bottom) / 2;
+ MotionEvent stylusEvent1 = createStylusEvent(ACTION_DOWN, x1, y1, 0);
+ mHandwritingInitiator.onTouchEvent(stylusEvent1);
+
+ final int x2 = x1 + TOUCH_SLOP * 2;
+ final int y2 = y1;
+
+ MotionEvent stylusEvent2 = createStylusEvent(ACTION_MOVE, x2, y2, 0);
+ mHandwritingInitiator.onTouchEvent(stylusEvent2);
+
+ verify(mHandwritingInitiator, never()).startHandwriting(mTestView);
+ }
+
+ @Test
+ public void onInputConnectionCreated() {
mHandwritingInitiator.onInputConnectionCreated(mTestView);
assertThat(mHandwritingInitiator.mConnectedView).isNotNull();
assertThat(mHandwritingInitiator.mConnectedView.get()).isEqualTo(mTestView);
}
@Test
- public void onInputConnectionCreated_inputConnectionClosed() {
+ public void onInputConnectionCreated_whenAutoHandwritingIsDisabled() {
+ View view = new View(mContext);
+ view.setAutoHandwritingEnabled(false);
+ assertThat(view.isAutoHandwritingEnabled()).isFalse();
+ mHandwritingInitiator.onInputConnectionCreated(view);
+
+ assertThat(mHandwritingInitiator.mConnectedView).isNull();
+ }
+
+ @Test
+ public void onInputConnectionClosed() {
mHandwritingInitiator.onInputConnectionCreated(mTestView);
mHandwritingInitiator.onInputConnectionClosed(mTestView);
@@ -218,6 +232,16 @@
}
@Test
+ public void onInputConnectionClosed_whenAutoHandwritingIsDisabled() {
+ View view = new View(mContext);
+ view.setAutoHandwritingEnabled(false);
+ mHandwritingInitiator.onInputConnectionCreated(view);
+ mHandwritingInitiator.onInputConnectionClosed(view);
+
+ assertThat(mHandwritingInitiator.mConnectedView).isNull();
+ }
+
+ @Test
public void onInputConnectionCreated_inputConnectionRestarted() {
// When IMM restarts input connection, View#onInputConnectionCreatedInternal might be
// called before View#onInputConnectionClosedInternal. As a result, we need to handle the
@@ -243,4 +267,25 @@
1 /* yPrecision */, 0 /* deviceId */, 0 /* edgeFlags */,
InputDevice.SOURCE_TOUCHSCREEN, 0 /* flags */);
}
+
+ private View createMockView(Rect viewBound, boolean autoHandwritingEnabled) {
+ // mock a parent so that HandwritingInitiator can get
+ ViewGroup parent = new ViewGroup(mContext) {
+ @Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ // We don't layout this view.
+ }
+ @Override
+ public boolean getChildVisibleRect(View child, Rect r, android.graphics.Point offset) {
+ r.set(viewBound);
+ return true;
+ }
+ };
+
+ View mockView = mock(View.class);
+ when(mockView.isAttachedToWindow()).thenReturn(true);
+ when(mockView.isAutoHandwritingEnabled()).thenReturn(autoHandwritingEnabled);
+ parent.addView(mockView);
+ return mockView;
+ }
}
diff --git a/core/tests/coretests/src/com/android/internal/app/ChooserActivityTest.java b/core/tests/coretests/src/com/android/internal/app/ChooserActivityTest.java
index 69ff7c6..cd42a34 100644
--- a/core/tests/coretests/src/com/android/internal/app/ChooserActivityTest.java
+++ b/core/tests/coretests/src/com/android/internal/app/ChooserActivityTest.java
@@ -81,6 +81,7 @@
import android.os.UserHandle;
import android.provider.DeviceConfig;
import android.service.chooser.ChooserTarget;
+import android.util.Log;
import android.view.View;
import androidx.annotation.CallSuper;
@@ -187,7 +188,7 @@
* TODO: remove when we no longer want to test the system's on-the-fly evaluation.
*/
protected boolean shouldTestTogglingAppPredictionServiceAvailabilityAtRuntime() {
- return true;
+ return false;
}
/* --------
@@ -762,6 +763,7 @@
@Test
+ @Ignore
public void testNearbyShareLogging() throws Exception {
Intent sendIntent = createSendTextIntent();
List<ResolvedComponentInfo> resolvedComponentInfos = createResolvedComponentsForTest(2);
@@ -1327,16 +1329,17 @@
final ChooserActivity activity =
mActivityRule.launchActivity(Intent.createChooser(sendIntent, null));
waitForIdle();
-
if (activity.getPackageManager().getAppPredictionServicePackageName() == null) {
assertThat(activity.isAppPredictionServiceAvailable(), is(false));
} else {
- assertThat(activity.isAppPredictionServiceAvailable(), is(true));
-
if (!shouldTestTogglingAppPredictionServiceAvailabilityAtRuntime()) {
return;
}
+ // This isn't a toggle per-se, but isAppPredictionServiceAvailable only works in
+ // system (see comment in the method).
+ assertThat(activity.isAppPredictionServiceAvailable(), is(true));
+
ChooserActivityOverrideData.getInstance().resources =
Mockito.spy(activity.getResources());
when(
diff --git a/core/tests/coretests/src/com/android/internal/app/ChooserWrapperActivity.java b/core/tests/coretests/src/com/android/internal/app/ChooserWrapperActivity.java
index d4f08ba..7f85982 100644
--- a/core/tests/coretests/src/com/android/internal/app/ChooserWrapperActivity.java
+++ b/core/tests/coretests/src/com/android/internal/app/ChooserWrapperActivity.java
@@ -51,6 +51,13 @@
static final ChooserActivityOverrideData sOverrides = ChooserActivityOverrideData.getInstance();
private UsageStatsManager mUsm;
+ // ResolverActivity (the base class of ChooserActivity) inspects the launched-from UID at
+ // onCreate and needs to see some non-negative value in the test.
+ @Override
+ public int getLaunchedFromUid() {
+ return 1234;
+ }
+
@Override
protected AbstractMultiProfilePagerAdapter createMultiProfilePagerAdapter(
Intent[] initialIntents, List<ResolveInfo> rList, boolean filterLastUsed) {
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryChargeCalculatorTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryChargeCalculatorTest.java
index 6457e3f..96d6a7e 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryChargeCalculatorTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryChargeCalculatorTest.java
@@ -54,6 +54,7 @@
/* plugType */ 0, 80, 72, 3700, 2_400_000, 4_000_000, 0,
2_000_000, 2_000_000, 2_000_000);
+ mStatsRule.setTime(5_000_000, 5_000_000);
BatteryChargeCalculator calculator = new BatteryChargeCalculator();
BatteryUsageStats batteryUsageStats = mStatsRule.apply(calculator);
@@ -64,6 +65,8 @@
.isWithin(PRECISION).of(360.0);
assertThat(batteryUsageStats.getDischargedPowerRange().getUpper())
.isWithin(PRECISION).of(400.0);
+ // 5_000_000 (current time) - 1_000_000 (started discharging)
+ assertThat(batteryUsageStats.getDischargeDurationMs()).isEqualTo(4_000_000);
assertThat(batteryUsageStats.getBatteryTimeRemainingMs()).isEqualTo(8_000_000);
assertThat(batteryUsageStats.getChargeTimeRemainingMs()).isEqualTo(-1);
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsProviderTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsProviderTest.java
index 9b3876f..354b937 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsProviderTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsProviderTest.java
@@ -50,19 +50,75 @@
@SmallTest
@RunWith(AndroidJUnit4.class)
+@SuppressWarnings("GuardedBy")
public class BatteryUsageStatsProviderTest {
private static final int APP_UID = Process.FIRST_APPLICATION_UID + 42;
private static final long MINUTE_IN_MS = 60 * 1000;
+ private static final double PRECISION = 0.00001;
private final File mHistoryDir =
TestIoUtils.createTemporaryDirectory(getClass().getSimpleName());
@Rule
public final BatteryUsageStatsRule mStatsRule =
new BatteryUsageStatsRule(12345, mHistoryDir)
- .setAveragePower(PowerProfile.POWER_FLASHLIGHT, 360.0);
+ .setAveragePower(PowerProfile.POWER_FLASHLIGHT, 360.0)
+ .setAveragePower(PowerProfile.POWER_AUDIO, 720.0);
@Test
public void test_getBatteryUsageStats() {
+ BatteryStatsImpl batteryStats = prepareBatteryStats();
+
+ Context context = InstrumentationRegistry.getContext();
+ BatteryUsageStatsProvider provider = new BatteryUsageStatsProvider(context, batteryStats);
+
+ final BatteryUsageStats batteryUsageStats =
+ provider.getBatteryUsageStats(BatteryUsageStatsQuery.DEFAULT);
+
+ final List<UidBatteryConsumer> uidBatteryConsumers =
+ batteryUsageStats.getUidBatteryConsumers();
+ final UidBatteryConsumer uidBatteryConsumer = uidBatteryConsumers.get(0);
+ assertThat(uidBatteryConsumer.getTimeInStateMs(UidBatteryConsumer.STATE_FOREGROUND))
+ .isEqualTo(60 * MINUTE_IN_MS);
+ assertThat(uidBatteryConsumer.getTimeInStateMs(UidBatteryConsumer.STATE_BACKGROUND))
+ .isEqualTo(10 * MINUTE_IN_MS);
+ assertThat(uidBatteryConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_AUDIO))
+ .isWithin(PRECISION).of(2.0);
+ assertThat(
+ uidBatteryConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_FLASHLIGHT))
+ .isWithin(PRECISION).of(0.4);
+
+ assertThat(batteryUsageStats.getStatsStartTimestamp()).isEqualTo(12345);
+ assertThat(batteryUsageStats.getStatsEndTimestamp()).isEqualTo(54321);
+ }
+
+ @Test
+ public void test_selectPowerComponents() {
+ BatteryStatsImpl batteryStats = prepareBatteryStats();
+
+ Context context = InstrumentationRegistry.getContext();
+ BatteryUsageStatsProvider provider = new BatteryUsageStatsProvider(context, batteryStats);
+
+ final BatteryUsageStats batteryUsageStats =
+ provider.getBatteryUsageStats(
+ new BatteryUsageStatsQuery.Builder()
+ .includePowerComponents(
+ new int[]{BatteryConsumer.POWER_COMPONENT_AUDIO})
+ .build()
+ );
+
+ final List<UidBatteryConsumer> uidBatteryConsumers =
+ batteryUsageStats.getUidBatteryConsumers();
+ final UidBatteryConsumer uidBatteryConsumer = uidBatteryConsumers.get(0);
+ assertThat(uidBatteryConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_AUDIO))
+ .isWithin(PRECISION).of(2.0);
+
+ // FLASHLIGHT power estimation not requested, so the returned value is 0
+ assertThat(
+ uidBatteryConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_FLASHLIGHT))
+ .isEqualTo(0);
+ }
+
+ private BatteryStatsImpl prepareBatteryStats() {
BatteryStatsImpl batteryStats = mStatsRule.getBatteryStats();
batteryStats.noteActivityResumedLocked(APP_UID,
@@ -82,24 +138,14 @@
batteryStats.noteUidProcessStateLocked(APP_UID, ActivityManager.PROCESS_STATE_CACHED_EMPTY,
80 * MINUTE_IN_MS, 80 * MINUTE_IN_MS);
+ batteryStats.noteFlashlightOnLocked(APP_UID, 1000, 1000);
+ batteryStats.noteFlashlightOffLocked(APP_UID, 5000, 5000);
+
+ batteryStats.noteAudioOnLocked(APP_UID, 10000, 10000);
+ batteryStats.noteAudioOffLocked(APP_UID, 20000, 20000);
+
mStatsRule.setCurrentTime(54321);
-
- Context context = InstrumentationRegistry.getContext();
- BatteryUsageStatsProvider provider = new BatteryUsageStatsProvider(context, batteryStats);
-
- final BatteryUsageStats batteryUsageStats =
- provider.getBatteryUsageStats(BatteryUsageStatsQuery.DEFAULT);
-
- final List<UidBatteryConsumer> uidBatteryConsumers =
- batteryUsageStats.getUidBatteryConsumers();
- final UidBatteryConsumer uidBatteryConsumer = uidBatteryConsumers.get(0);
- assertThat(uidBatteryConsumer.getTimeInStateMs(UidBatteryConsumer.STATE_FOREGROUND))
- .isEqualTo(60 * MINUTE_IN_MS);
- assertThat(uidBatteryConsumer.getTimeInStateMs(UidBatteryConsumer.STATE_BACKGROUND))
- .isEqualTo(10 * MINUTE_IN_MS);
-
- assertThat(batteryUsageStats.getStatsStartTimestamp()).isEqualTo(12345);
- assertThat(batteryUsageStats.getStatsEndTimestamp()).isEqualTo(54321);
+ return batteryStats;
}
@Test
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsRule.java b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsRule.java
index b3056e2..4f29863 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsRule.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsRule.java
@@ -212,8 +212,8 @@
}
for (PowerCalculator calculator : calculators) {
- calculator.calculate(builder, mBatteryStats, mMockClock.realtime, mMockClock.uptime,
- query);
+ calculator.calculate(builder, mBatteryStats, mMockClock.realtime * 1000,
+ mMockClock.uptime * 1000, query);
}
mBatteryUsageStats = builder.build();
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsStoreTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsStoreTest.java
index 51f20f3..21f6e7c 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsStoreTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsStoreTest.java
@@ -44,6 +44,7 @@
import java.util.Arrays;
@RunWith(AndroidJUnit4.class)
+@SuppressWarnings("GuardedBy")
public class BatteryUsageStatsStoreTest {
private static final long MAX_BATTERY_STATS_SNAPSHOT_STORAGE_BYTES = 2 * 1024;
@@ -76,8 +77,13 @@
@Test
public void testStoreSnapshot() {
mMockClock.currentTime = 1_600_000;
+ mMockClock.realtime = 1000;
+ mMockClock.uptime = 1000;
prepareBatteryStats();
+
+ mMockClock.realtime = 1_000_000;
+ mMockClock.uptime = 1_000_000;
mBatteryStats.resetAllStatsCmdLocked();
final long[] timestamps = mBatteryUsageStatsStore.listBatteryUsageStatsTimestamps();
@@ -90,6 +96,7 @@
assertThat(batteryUsageStats.getStatsEndTimestamp()).isEqualTo(1_600_000);
assertThat(batteryUsageStats.getBatteryCapacity()).isEqualTo(4000);
assertThat(batteryUsageStats.getDischargePercentage()).isEqualTo(5);
+ assertThat(batteryUsageStats.getDischargeDurationMs()).isEqualTo(1_000_000 - 1_000);
assertThat(batteryUsageStats.getAggregateBatteryConsumer(
BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE).getConsumedPower())
.isEqualTo(600); // (3_600_000 - 3_000_000) / 1000
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsTest.java
index 8cc4c34..5adc9bd 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsTest.java
@@ -183,7 +183,7 @@
.add(stats2)
.build();
- assertBatteryUsageStats(sum, 42345, 50, 2234, 4345, 1000, 5000, 5000);
+ assertBatteryUsageStats(sum, 42345, 50, 2234, 4345, 1234, 1000, 5000, 5000);
final List<UidBatteryConsumer> uidBatteryConsumers =
sum.getUidBatteryConsumers();
@@ -259,6 +259,7 @@
.setBatteryCapacity(4000)
.setDischargePercentage(20)
.setDischargedPowerRange(1000, 2000)
+ .setDischargeDurationMs(1234)
.setStatsStartTimestamp(1000)
.setStatsEndTimestamp(3000);
@@ -420,7 +421,7 @@
public void assertBatteryUsageStats1(BatteryUsageStats batteryUsageStats,
boolean includesUserBatteryConsumers) {
- assertBatteryUsageStats(batteryUsageStats, 30000, 20, 1000, 2000, 1000, 3000, 2000);
+ assertBatteryUsageStats(batteryUsageStats, 30000, 20, 1000, 2000, 1234, 1000, 3000, 2000);
final List<UidBatteryConsumer> uidBatteryConsumers =
batteryUsageStats.getUidBatteryConsumers();
@@ -463,13 +464,15 @@
private void assertBatteryUsageStats(BatteryUsageStats batteryUsageStats, int consumedPower,
int dischargePercentage, int dischagePowerLower, int dischargePowerUpper,
- int statsStartTimestamp, int statsEndTimestamp, int statsDuration) {
+ int dischargeDuration, int statsStartTimestamp, int statsEndTimestamp,
+ int statsDuration) {
assertThat(batteryUsageStats.getConsumedPower()).isEqualTo(consumedPower);
assertThat(batteryUsageStats.getDischargePercentage()).isEqualTo(dischargePercentage);
assertThat(batteryUsageStats.getDischargedPowerRange().getLower()).isEqualTo(
dischagePowerLower);
assertThat(batteryUsageStats.getDischargedPowerRange().getUpper()).isEqualTo(
dischargePowerUpper);
+ assertThat(batteryUsageStats.getDischargeDurationMs()).isEqualTo(dischargeDuration);
assertThat(batteryUsageStats.getStatsStartTimestamp()).isEqualTo(statsStartTimestamp);
assertThat(batteryUsageStats.getStatsEndTimestamp()).isEqualTo(statsEndTimestamp);
assertThat(batteryUsageStats.getStatsDuration()).isEqualTo(statsDuration);
diff --git a/core/tests/coretests/src/com/android/internal/os/IdlePowerCalculatorTest.java b/core/tests/coretests/src/com/android/internal/os/IdlePowerCalculatorTest.java
index 67b1e51..2b28031 100644
--- a/core/tests/coretests/src/com/android/internal/os/IdlePowerCalculatorTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/IdlePowerCalculatorTest.java
@@ -39,7 +39,7 @@
@Test
public void testTimerBasedModel() {
- mStatsRule.setTime(3_000_000, 2_000_000);
+ mStatsRule.setTime(3_000, 2_000);
IdlePowerCalculator calculator = new IdlePowerCalculator(mStatsRule.getPowerProfile());
diff --git a/core/tests/coretests/src/com/android/internal/os/MobileRadioPowerCalculatorTest.java b/core/tests/coretests/src/com/android/internal/os/MobileRadioPowerCalculatorTest.java
index ce2f764..c20293b 100644
--- a/core/tests/coretests/src/com/android/internal/os/MobileRadioPowerCalculatorTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/MobileRadioPowerCalculatorTest.java
@@ -102,7 +102,7 @@
stats.noteModemControllerActivity(mai, POWER_DATA_UNAVAILABLE, 10000, 10000,
mNetworkStatsManager);
- mStatsRule.setTime(12_000_000, 12_000_000);
+ mStatsRule.setTime(12_000, 12_000);
MobileRadioPowerCalculator calculator =
new MobileRadioPowerCalculator(mStatsRule.getPowerProfile());
@@ -248,7 +248,7 @@
new int[]{100, 200, 300, 400, 500}, 600);
stats.noteModemControllerActivity(mai, 10_000_000, 10000, 10000, mNetworkStatsManager);
- mStatsRule.setTime(12_000_000, 12_000_000);
+ mStatsRule.setTime(12_000, 12_000);
MobileRadioPowerCalculator calculator =
new MobileRadioPowerCalculator(mStatsRule.getPowerProfile());
diff --git a/core/tests/coretests/src/com/android/internal/os/UserPowerCalculatorTest.java b/core/tests/coretests/src/com/android/internal/os/UserPowerCalculatorTest.java
index aae69d7..aec4f52 100644
--- a/core/tests/coretests/src/com/android/internal/os/UserPowerCalculatorTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/UserPowerCalculatorTest.java
@@ -126,6 +126,13 @@
}
private static class FakeAudioPowerCalculator extends PowerCalculator {
+
+ @Override
+ public boolean isPowerComponentSupported(
+ @BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_AUDIO;
+ }
+
@Override
protected void calculateApp(UidBatteryConsumer.Builder app, BatteryStats.Uid u,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
@@ -135,6 +142,13 @@
}
private static class FakeVideoPowerCalculator extends PowerCalculator {
+
+ @Override
+ public boolean isPowerComponentSupported(
+ @BatteryConsumer.PowerComponent int powerComponent) {
+ return powerComponent == BatteryConsumer.POWER_COMPONENT_VIDEO;
+ }
+
@Override
protected void calculateApp(UidBatteryConsumer.Builder app, BatteryStats.Uid u,
long rawRealtimeUs, long rawUptimeUs, BatteryUsageStatsQuery query) {
diff --git a/core/tests/coretests/src/com/android/internal/os/WakelockPowerCalculatorTest.java b/core/tests/coretests/src/com/android/internal/os/WakelockPowerCalculatorTest.java
index a7f4fb3..f3456af 100644
--- a/core/tests/coretests/src/com/android/internal/os/WakelockPowerCalculatorTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/WakelockPowerCalculatorTest.java
@@ -54,7 +54,7 @@
batteryStats.noteStopWakeFromSourceLocked(new WorkSource(APP_UID), APP_PID, "awake", "",
BatteryStats.WAKE_TYPE_PARTIAL, 2000, 2000);
- mStatsRule.setTime(10_000_000, 6_000_000);
+ mStatsRule.setTime(10_000, 6_000);
WakelockPowerCalculator calculator =
new WakelockPowerCalculator(mStatsRule.getPowerProfile());
diff --git a/data/etc/privapp-permissions-platform.xml b/data/etc/privapp-permissions-platform.xml
index 0e06fac..e68b1ac 100644
--- a/data/etc/privapp-permissions-platform.xml
+++ b/data/etc/privapp-permissions-platform.xml
@@ -391,6 +391,7 @@
<permission name="android.permission.STATUS_BAR_SERVICE"/>
<permission name="android.permission.REQUEST_INCIDENT_REPORT_APPROVAL"/>
<permission name="android.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS"/>
+ <permission name="android.permission.MANAGE_WEAK_ESCROW_TOKEN"/>
<permission name="android.permission.SET_WALLPAPER" />
<permission name="android.permission.SET_WALLPAPER_COMPONENT" />
<permission name="android.permission.SET_WALLPAPER_DIM_AMOUNT" />
@@ -435,6 +436,7 @@
<permission name="android.permission.MANAGE_COMPANION_DEVICES" />
<permission name="android.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING" />
<permission name="android.permission.REQUEST_COMPANION_PROFILE_WATCH" />
+ <permission name="android.permission.REQUEST_COMPANION_PROFILE_COMPUTER" />
<permission name="android.permission.REQUEST_COMPANION_SELF_MANAGED" />
<!-- Permission required for testing registering pull atom callbacks. -->
<permission name="android.permission.REGISTER_STATS_PULL_ATOM"/>
@@ -471,6 +473,7 @@
<!-- Permission needed for CTS test - WifiManagerTest -->
<permission name="android.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS" />
<permission name="android.permission.WIFI_UPDATE_COEX_UNSAFE_CHANNELS" />
+ <permission name="android.permission.OVERRIDE_WIFI_CONFIG" />
<!-- Permission required for CTS test CarrierMessagingServiceWrapperTest -->
<permission name="android.permission.BIND_CARRIER_SERVICES"/>
<!-- Permission required for CTS test - MusicRecognitionManagerTest -->
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index eefad8d..afd320d 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -2184,9 +2184,13 @@
contextCount, isRtl, outMetrics);
} else {
char[] buf = TemporaryBuffer.obtain(contextCount);
- TextUtils.getChars(text, contextStart, contextStart + contextCount, buf, 0);
- nGetFontMetricsIntForText(mNativePaint, buf, start - contextStart, count, 0,
- contextCount, isRtl, outMetrics);
+ try {
+ TextUtils.getChars(text, contextStart, contextStart + contextCount, buf, 0);
+ nGetFontMetricsIntForText(mNativePaint, buf, start - contextStart, count, 0,
+ contextCount, isRtl, outMetrics);
+ } finally {
+ TemporaryBuffer.recycle(buf);
+ }
}
}
diff --git a/libs/WindowManager/Shell/res/values-af/strings_tv.xml b/libs/WindowManager/Shell/res/values-af/strings_tv.xml
index 3edb8e9..1bfe128 100644
--- a/libs/WindowManager/Shell/res/values-af/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-af/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Titellose program)"</string>
<string name="pip_close" msgid="9135220303720555525">"Maak PIP toe"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Volskerm"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Skuif PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-am/strings_tv.xml b/libs/WindowManager/Shell/res/values-am/strings_tv.xml
index b1c6542..456b4b8 100644
--- a/libs/WindowManager/Shell/res/values-am/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-am/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(ርዕስ የሌለው ፕሮግራም)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIPን ዝጋ"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"ሙሉ ማያ ገጽ"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"ፒአይፒ ውሰድ"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ar/strings_tv.xml b/libs/WindowManager/Shell/res/values-ar/strings_tv.xml
index dfc5053..2546fe9 100644
--- a/libs/WindowManager/Shell/res/values-ar/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-ar/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(ليس هناك عنوان للبرنامج)"</string>
<string name="pip_close" msgid="9135220303720555525">"إغلاق PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"ملء الشاشة"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"نقل نافذة داخل النافذة (PIP)"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-as/strings_tv.xml b/libs/WindowManager/Shell/res/values-as/strings_tv.xml
index 352bde5..d17c1f3 100644
--- a/libs/WindowManager/Shell/res/values-as/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-as/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(শিৰোনামবিহীন কাৰ্যক্ৰম)"</string>
<string name="pip_close" msgid="9135220303720555525">"পিপ বন্ধ কৰক"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"সম্পূৰ্ণ স্ক্ৰীন"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"পিপ স্থানান্তৰ কৰক"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-az/strings_tv.xml b/libs/WindowManager/Shell/res/values-az/strings_tv.xml
index 9b46d5f..a5c4792 100644
--- a/libs/WindowManager/Shell/res/values-az/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-az/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Başlıqsız proqram)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP bağlayın"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Tam ekran"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP tətbiq edin"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-b+sr+Latn/strings_tv.xml b/libs/WindowManager/Shell/res/values-b+sr+Latn/strings_tv.xml
index 790a6d47..b4d9bd1 100644
--- a/libs/WindowManager/Shell/res/values-b+sr+Latn/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-b+sr+Latn/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Program bez naslova)"</string>
<string name="pip_close" msgid="9135220303720555525">"Zatvori PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Ceo ekran"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Premesti sliku u slici"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-be/strings_tv.xml b/libs/WindowManager/Shell/res/values-be/strings_tv.xml
index c4df7fc..514d06b 100644
--- a/libs/WindowManager/Shell/res/values-be/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-be/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Праграма без назвы)"</string>
<string name="pip_close" msgid="9135220303720555525">"Закрыць PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Поўнаэкранны рэжым"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Перамясціць PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-bg/strings_tv.xml b/libs/WindowManager/Shell/res/values-bg/strings_tv.xml
index cbb00ae..19f83e7 100644
--- a/libs/WindowManager/Shell/res/values-bg/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-bg/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Програма без заглавие)"</string>
<string name="pip_close" msgid="9135220303720555525">"Затваряне на PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Цял екран"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"„Картина в картина“: Преместв."</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-bn/strings_tv.xml b/libs/WindowManager/Shell/res/values-bn/strings_tv.xml
index f24c92a..5f90eeb 100644
--- a/libs/WindowManager/Shell/res/values-bn/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-bn/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(শিরোনামহীন প্রোগ্রাম)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP বন্ধ করুন"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"পূর্ণ স্ক্রিন"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP সরান"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-bs/strings_tv.xml b/libs/WindowManager/Shell/res/values-bs/strings_tv.xml
index 80bac2a..3f2adf3 100644
--- a/libs/WindowManager/Shell/res/values-bs/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-bs/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Program bez naslova)"</string>
<string name="pip_close" msgid="9135220303720555525">"Zatvori sliku u slici"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Cijeli ekran"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Pokreni sliku u slici"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ca/strings_tv.xml b/libs/WindowManager/Shell/res/values-ca/strings_tv.xml
index 66cd93a..db750c4 100644
--- a/libs/WindowManager/Shell/res/values-ca/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-ca/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Programa sense títol)"</string>
<string name="pip_close" msgid="9135220303720555525">"Tanca PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Pantalla completa"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Mou pantalla en pantalla"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-cs/strings_tv.xml b/libs/WindowManager/Shell/res/values-cs/strings_tv.xml
index 500050b..cef0b99 100644
--- a/libs/WindowManager/Shell/res/values-cs/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-cs/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Bez názvu)"</string>
<string name="pip_close" msgid="9135220303720555525">"Ukončit obraz v obraze (PIP)"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Celá obrazovka"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Přesunout PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-da/strings_tv.xml b/libs/WindowManager/Shell/res/values-da/strings_tv.xml
index 896895b..2330530 100644
--- a/libs/WindowManager/Shell/res/values-da/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-da/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Program uden titel)"</string>
<string name="pip_close" msgid="9135220303720555525">"Luk integreret billede"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Fuld skærm"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Flyt PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-de/strings_tv.xml b/libs/WindowManager/Shell/res/values-de/strings_tv.xml
index 7809efe..8da9110 100644
--- a/libs/WindowManager/Shell/res/values-de/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-de/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Kein Sendungsname gefunden)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP schließen"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Vollbild"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"BiB verschieben"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-el/strings_tv.xml b/libs/WindowManager/Shell/res/values-el/strings_tv.xml
index 088bcc3..df35113 100644
--- a/libs/WindowManager/Shell/res/values-el/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-el/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Δεν υπάρχει τίτλος προγράμματος)"</string>
<string name="pip_close" msgid="9135220303720555525">"Κλείσιμο PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Πλήρης οθόνη"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Μετακίνηση PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-en-rAU/strings_tv.xml b/libs/WindowManager/Shell/res/values-en-rAU/strings_tv.xml
index 7900fdc..1fb3191 100644
--- a/libs/WindowManager/Shell/res/values-en-rAU/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-en-rAU/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(No title program)"</string>
<string name="pip_close" msgid="9135220303720555525">"Close PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Full screen"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Move PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-en-rCA/strings_tv.xml b/libs/WindowManager/Shell/res/values-en-rCA/strings_tv.xml
index 7900fdc..1fb3191 100644
--- a/libs/WindowManager/Shell/res/values-en-rCA/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-en-rCA/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(No title program)"</string>
<string name="pip_close" msgid="9135220303720555525">"Close PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Full screen"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Move PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-en-rGB/strings_tv.xml b/libs/WindowManager/Shell/res/values-en-rGB/strings_tv.xml
index 7900fdc..1fb3191 100644
--- a/libs/WindowManager/Shell/res/values-en-rGB/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-en-rGB/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(No title program)"</string>
<string name="pip_close" msgid="9135220303720555525">"Close PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Full screen"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Move PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-en-rIN/strings_tv.xml b/libs/WindowManager/Shell/res/values-en-rIN/strings_tv.xml
index 7900fdc..1fb3191 100644
--- a/libs/WindowManager/Shell/res/values-en-rIN/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-en-rIN/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(No title program)"</string>
<string name="pip_close" msgid="9135220303720555525">"Close PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Full screen"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Move PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-es-rUS/strings_tv.xml b/libs/WindowManager/Shell/res/values-es-rUS/strings_tv.xml
index 3be850a..1beb0b5 100644
--- a/libs/WindowManager/Shell/res/values-es-rUS/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-es-rUS/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Sin título de programa)"</string>
<string name="pip_close" msgid="9135220303720555525">"Cerrar PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Pantalla completa"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Mover PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-es/strings_tv.xml b/libs/WindowManager/Shell/res/values-es/strings_tv.xml
index 7eba361..d042b43 100644
--- a/libs/WindowManager/Shell/res/values-es/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-es/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Programa sin título)"</string>
<string name="pip_close" msgid="9135220303720555525">"Cerrar PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Pantalla completa"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Mover imagen en imagen"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-et/strings_tv.xml b/libs/WindowManager/Shell/res/values-et/strings_tv.xml
index ca6e669..3da16db 100644
--- a/libs/WindowManager/Shell/res/values-et/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-et/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Programmi pealkiri puudub)"</string>
<string name="pip_close" msgid="9135220303720555525">"Sule PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Täisekraan"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Teisalda PIP-režiimi"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-eu/strings_tv.xml b/libs/WindowManager/Shell/res/values-eu/strings_tv.xml
index 3f47e95..e4b57ba 100644
--- a/libs/WindowManager/Shell/res/values-eu/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-eu/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Programa izengabea)"</string>
<string name="pip_close" msgid="9135220303720555525">"Itxi PIPa"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Pantaila osoa"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Mugitu pantaila txiki gainjarria"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-fa/strings_tv.xml b/libs/WindowManager/Shell/res/values-fa/strings_tv.xml
index cc5cf64..aaab34f 100644
--- a/libs/WindowManager/Shell/res/values-fa/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-fa/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(برنامه بدون عنوان)"</string>
<string name="pip_close" msgid="9135220303720555525">"بستن PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"تمام صفحه"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"انتقال PIP (تصویر در تصویر)"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-fi/strings_tv.xml b/libs/WindowManager/Shell/res/values-fi/strings_tv.xml
index b779886..21c6463 100644
--- a/libs/WindowManager/Shell/res/values-fi/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-fi/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Nimetön)"</string>
<string name="pip_close" msgid="9135220303720555525">"Sulje PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Koko näyttö"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Siirrä PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-fr-rCA/strings_tv.xml b/libs/WindowManager/Shell/res/values-fr-rCA/strings_tv.xml
index 1798c7d..f4baaad 100644
--- a/libs/WindowManager/Shell/res/values-fr-rCA/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-fr-rCA/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Aucun programme de titre)"</string>
<string name="pip_close" msgid="9135220303720555525">"Fermer mode IDI"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Plein écran"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Déplacer l\'image incrustée"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-fr/strings_tv.xml b/libs/WindowManager/Shell/res/values-fr/strings_tv.xml
index b039934..6ad8174 100644
--- a/libs/WindowManager/Shell/res/values-fr/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-fr/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Programme sans titre)"</string>
<string name="pip_close" msgid="9135220303720555525">"Fermer mode PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Plein écran"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Déplacer le PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-gl/strings_tv.xml b/libs/WindowManager/Shell/res/values-gl/strings_tv.xml
index 0d91eba..dcb8709 100644
--- a/libs/WindowManager/Shell/res/values-gl/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-gl/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Programa sen título)"</string>
<string name="pip_close" msgid="9135220303720555525">"Pechar PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Pantalla completa"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Mover pantalla superposta"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-gu/strings_tv.xml b/libs/WindowManager/Shell/res/values-gu/strings_tv.xml
index a748df3..ed815ca 100644
--- a/libs/WindowManager/Shell/res/values-gu/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-gu/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(કોઈ ટાઇટલ પ્રોગ્રામ નથી)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP બંધ કરો"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"પૂર્ણ સ્ક્રીન"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP ખસેડો"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-hi/strings_tv.xml b/libs/WindowManager/Shell/res/values-hi/strings_tv.xml
index 040072b..8bcc631 100644
--- a/libs/WindowManager/Shell/res/values-hi/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-hi/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(कोई शीर्षक कार्यक्रम नहीं)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP बंद करें"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"फ़ुल स्क्रीन"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"पीआईपी को दूसरी जगह लेकर जाएं"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-hr/strings_tv.xml b/libs/WindowManager/Shell/res/values-hr/strings_tv.xml
index 20081e4..49b7ae0 100644
--- a/libs/WindowManager/Shell/res/values-hr/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-hr/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Program bez naslova)"</string>
<string name="pip_close" msgid="9135220303720555525">"Zatvori PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Cijeli zaslon"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Premjesti PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-hu/strings_tv.xml b/libs/WindowManager/Shell/res/values-hu/strings_tv.xml
index c78146d..484db0c 100644
--- a/libs/WindowManager/Shell/res/values-hu/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-hu/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Cím nélküli program)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP bezárása"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Teljes képernyő"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP áthelyezése"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-hy/strings_tv.xml b/libs/WindowManager/Shell/res/values-hy/strings_tv.xml
index 55d5bd7..e447ffc 100644
--- a/libs/WindowManager/Shell/res/values-hy/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-hy/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Առանց վերնագրի ծրագիր)"</string>
<string name="pip_close" msgid="9135220303720555525">"Փակել PIP-ն"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Լիէկրան"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Տեղափոխել PIP-ը"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-in/strings_tv.xml b/libs/WindowManager/Shell/res/values-in/strings_tv.xml
index 6401852..b631705 100644
--- a/libs/WindowManager/Shell/res/values-in/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-in/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Program tanpa judul)"</string>
<string name="pip_close" msgid="9135220303720555525">"Tutup PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Layar penuh"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Pindahkan PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-is/strings_tv.xml b/libs/WindowManager/Shell/res/values-is/strings_tv.xml
index fa36829..119ecf0 100644
--- a/libs/WindowManager/Shell/res/values-is/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-is/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Efni án titils)"</string>
<string name="pip_close" msgid="9135220303720555525">"Loka mynd í mynd"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Allur skjárinn"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Færa innfellda mynd"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-it/strings_tv.xml b/libs/WindowManager/Shell/res/values-it/strings_tv.xml
index f6e91be..92f015c 100644
--- a/libs/WindowManager/Shell/res/values-it/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-it/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Programma senza titolo)"</string>
<string name="pip_close" msgid="9135220303720555525">"Chiudi PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Schermo intero"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Sposta PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-iw/strings_tv.xml b/libs/WindowManager/Shell/res/values-iw/strings_tv.xml
index 356e8d5..d09b850 100644
--- a/libs/WindowManager/Shell/res/values-iw/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-iw/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(תוכנית ללא כותרת)"</string>
<string name="pip_close" msgid="9135220303720555525">"סגירת PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"מסך מלא"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"העברת תמונה בתוך תמונה (PIP)"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ja/strings_tv.xml b/libs/WindowManager/Shell/res/values-ja/strings_tv.xml
index 07684d3..d6399e5 100644
--- a/libs/WindowManager/Shell/res/values-ja/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-ja/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(無題の番組)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP を閉じる"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"全画面表示"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP を移動"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ka/strings_tv.xml b/libs/WindowManager/Shell/res/values-ka/strings_tv.xml
index 043e5eb..8d7bee8 100644
--- a/libs/WindowManager/Shell/res/values-ka/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-ka/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(პროგრამის სათაურის გარეშე)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP-ის დახურვა"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"სრულ ეკრანზე"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP გადატანა"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-kk/strings_tv.xml b/libs/WindowManager/Shell/res/values-kk/strings_tv.xml
index 7943797..05bdcc7 100644
--- a/libs/WindowManager/Shell/res/values-kk/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-kk/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Атаусыз бағдарлама)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP жабу"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Толық экран"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP клипін жылжыту"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-km/strings_tv.xml b/libs/WindowManager/Shell/res/values-km/strings_tv.xml
index 2e56254..e831516 100644
--- a/libs/WindowManager/Shell/res/values-km/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-km/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(កម្មវិធីគ្មានចំណងជើង)"</string>
<string name="pip_close" msgid="9135220303720555525">"បិទ PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"ពេញអេក្រង់"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"ផ្លាស់ទី PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-kn/strings_tv.xml b/libs/WindowManager/Shell/res/values-kn/strings_tv.xml
index 6c8880d..305ef66 100644
--- a/libs/WindowManager/Shell/res/values-kn/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-kn/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(ಶೀರ್ಷಿಕೆ ರಹಿತ ಕಾರ್ಯಕ್ರಮ)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP ಮುಚ್ಚಿ"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"ಪೂರ್ಣ ಪರದೆ"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP ಅನ್ನು ಸರಿಸಿ"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ko/strings_tv.xml b/libs/WindowManager/Shell/res/values-ko/strings_tv.xml
index 35b1b19..76b0adf 100644
--- a/libs/WindowManager/Shell/res/values-ko/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-ko/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(제목 없는 프로그램)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP 닫기"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"전체화면"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP 이동"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ky/strings_tv.xml b/libs/WindowManager/Shell/res/values-ky/strings_tv.xml
index 72d70f0..57b955a 100644
--- a/libs/WindowManager/Shell/res/values-ky/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-ky/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Аталышы жок программа)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP\'ти жабуу"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Толук экран"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP\'ти жылдыруу"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-lo/strings_tv.xml b/libs/WindowManager/Shell/res/values-lo/strings_tv.xml
index 3604726..cbea84e 100644
--- a/libs/WindowManager/Shell/res/values-lo/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-lo/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(ໂປຣແກຣມບໍ່ມີຊື່)"</string>
<string name="pip_close" msgid="9135220303720555525">"ປິດ PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"ເຕັມໜ້າຈໍ"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"ຍ້າຍ PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-lt/strings_tv.xml b/libs/WindowManager/Shell/res/values-lt/strings_tv.xml
index fa5a4c4..81716a6 100644
--- a/libs/WindowManager/Shell/res/values-lt/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-lt/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Programa be pavadinimo)"</string>
<string name="pip_close" msgid="9135220303720555525">"Uždaryti PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Visas ekranas"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Perkelti PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-lv/strings_tv.xml b/libs/WindowManager/Shell/res/values-lv/strings_tv.xml
index cafd43a..5295cd2 100644
--- a/libs/WindowManager/Shell/res/values-lv/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-lv/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Programma bez nosaukuma)"</string>
<string name="pip_close" msgid="9135220303720555525">"Aizvērt PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Pilnekrāna režīms"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Pārvietot attēlu attēlā"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-mk/strings_tv.xml b/libs/WindowManager/Shell/res/values-mk/strings_tv.xml
index b927b56..fa48a6c 100644
--- a/libs/WindowManager/Shell/res/values-mk/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-mk/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Програма без наслов)"</string>
<string name="pip_close" msgid="9135220303720555525">"Затвори PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Цел екран"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Премести PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ml/strings_tv.xml b/libs/WindowManager/Shell/res/values-ml/strings_tv.xml
index aef059f..5333757 100644
--- a/libs/WindowManager/Shell/res/values-ml/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-ml/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(പേരില്ലാത്ത പ്രോഗ്രാം)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP അടയ്ക്കുക"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"പൂര്ണ്ണ സ്ക്രീന്"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP നീക്കുക"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-mn/strings_tv.xml b/libs/WindowManager/Shell/res/values-mn/strings_tv.xml
index 7dfec68..ca1d27f 100644
--- a/libs/WindowManager/Shell/res/values-mn/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-mn/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Гарчиггүй хөтөлбөр)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP-г хаах"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Бүтэн дэлгэц"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP-г зөөх"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-mr/strings_tv.xml b/libs/WindowManager/Shell/res/values-mr/strings_tv.xml
index 447cb7d..212bd21 100644
--- a/libs/WindowManager/Shell/res/values-mr/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-mr/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(शीर्षक नसलेला कार्यक्रम)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP बंद करा"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"फुल स्क्रीन"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP हलवा"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ms/strings_tv.xml b/libs/WindowManager/Shell/res/values-ms/strings_tv.xml
index 3a5584d..ce29126 100644
--- a/libs/WindowManager/Shell/res/values-ms/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-ms/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Program tiada tajuk)"</string>
<string name="pip_close" msgid="9135220303720555525">"Tutup PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Skrin penuh"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Alihkan PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-my/strings_tv.xml b/libs/WindowManager/Shell/res/values-my/strings_tv.xml
index 84ec0e5..4847742 100644
--- a/libs/WindowManager/Shell/res/values-my/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-my/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(ခေါင်းစဉ်မဲ့ အစီအစဉ်)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP ကိုပိတ်ပါ"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"မျက်နှာပြင် အပြည့်"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP ရွှေ့ရန်"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-nb/strings_tv.xml b/libs/WindowManager/Shell/res/values-nb/strings_tv.xml
index 78ec6db..7cef11c 100644
--- a/libs/WindowManager/Shell/res/values-nb/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-nb/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Program uten tittel)"</string>
<string name="pip_close" msgid="9135220303720555525">"Lukk PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Fullskjerm"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Flytt BIB"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ne/strings_tv.xml b/libs/WindowManager/Shell/res/values-ne/strings_tv.xml
index 4458a14..684d114 100644
--- a/libs/WindowManager/Shell/res/values-ne/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-ne/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(शीर्षकविहीन कार्यक्रम)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP लाई बन्द गर्नुहोस्"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"फुल स्क्रिन"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP सार्नुहोस्"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-nl/strings_tv.xml b/libs/WindowManager/Shell/res/values-nl/strings_tv.xml
index d21515d..8562517 100644
--- a/libs/WindowManager/Shell/res/values-nl/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-nl/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Naamloos programma)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP sluiten"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Volledig scherm"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"SIS verplaatsen"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-or/strings_tv.xml b/libs/WindowManager/Shell/res/values-or/strings_tv.xml
index a679350..f8bc016 100644
--- a/libs/WindowManager/Shell/res/values-or/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-or/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(କୌଣସି ଟାଇଟଲ୍ ପ୍ରୋଗ୍ରାମ୍ ନାହିଁ)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP ବନ୍ଦ କରନ୍ତୁ"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"ପୂର୍ଣ୍ଣ ସ୍କ୍ରୀନ୍"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIPକୁ ମୁଭ କରନ୍ତୁ"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-pa/strings_tv.xml b/libs/WindowManager/Shell/res/values-pa/strings_tv.xml
index a0ff4f3..1667e5f 100644
--- a/libs/WindowManager/Shell/res/values-pa/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-pa/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(ਸਿਰਲੇਖ-ਰਹਿਤ ਪ੍ਰੋਗਰਾਮ)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP ਬੰਦ ਕਰੋ"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"ਪੂਰੀ ਸਕ੍ਰੀਨ"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP ਨੂੰ ਲਿਜਾਓ"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-pl/strings_tv.xml b/libs/WindowManager/Shell/res/values-pl/strings_tv.xml
index 6320893..28bf66a 100644
--- a/libs/WindowManager/Shell/res/values-pl/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-pl/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Program bez tytułu)"</string>
<string name="pip_close" msgid="9135220303720555525">"Zamknij PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Pełny ekran"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Przenieś PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-pt-rBR/strings_tv.xml b/libs/WindowManager/Shell/res/values-pt-rBR/strings_tv.xml
index fef9d47..27626b8 100644
--- a/libs/WindowManager/Shell/res/values-pt-rBR/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-pt-rBR/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(programa sem título)"</string>
<string name="pip_close" msgid="9135220303720555525">"Fechar PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Tela cheia"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Mover picture-in-picture"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-pt-rPT/strings_tv.xml b/libs/WindowManager/Shell/res/values-pt-rPT/strings_tv.xml
index 461571f..a2010ce 100644
--- a/libs/WindowManager/Shell/res/values-pt-rPT/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-pt-rPT/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Sem título do programa)"</string>
<string name="pip_close" msgid="9135220303720555525">"Fechar PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Ecrã inteiro"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Mover Ecrã no ecrã"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-pt/strings_tv.xml b/libs/WindowManager/Shell/res/values-pt/strings_tv.xml
index fef9d47..27626b8 100644
--- a/libs/WindowManager/Shell/res/values-pt/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-pt/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(programa sem título)"</string>
<string name="pip_close" msgid="9135220303720555525">"Fechar PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Tela cheia"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Mover picture-in-picture"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ro/strings_tv.xml b/libs/WindowManager/Shell/res/values-ro/strings_tv.xml
index 80bf151..18e29a6 100644
--- a/libs/WindowManager/Shell/res/values-ro/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-ro/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Program fără titlu)"</string>
<string name="pip_close" msgid="9135220303720555525">"Închideți PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Ecran complet"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Mutați fereastra PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ru/strings_tv.xml b/libs/WindowManager/Shell/res/values-ru/strings_tv.xml
index de5348a..d119240 100644
--- a/libs/WindowManager/Shell/res/values-ru/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-ru/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Без названия)"</string>
<string name="pip_close" msgid="9135220303720555525">"\"Кадр в кадре\" – выйти"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Во весь экран"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Переместить PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-si/strings_tv.xml b/libs/WindowManager/Shell/res/values-si/strings_tv.xml
index 0470040..86769b6 100644
--- a/libs/WindowManager/Shell/res/values-si/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-si/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(මාතෘකාවක් නැති වැඩසටහන)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP වසන්න"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"සම්පූර්ණ තිරය"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP ගෙන යන්න"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-sk/strings_tv.xml b/libs/WindowManager/Shell/res/values-sk/strings_tv.xml
index 41a432c..6f6ccb7 100644
--- a/libs/WindowManager/Shell/res/values-sk/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-sk/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Program bez názvu)"</string>
<string name="pip_close" msgid="9135220303720555525">"Zavrieť režim PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Celá obrazovka"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Presunúť obraz v obraze"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-sl/strings_tv.xml b/libs/WindowManager/Shell/res/values-sl/strings_tv.xml
index de5605f..837794a 100644
--- a/libs/WindowManager/Shell/res/values-sl/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-sl/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Program brez naslova)"</string>
<string name="pip_close" msgid="9135220303720555525">"Zapri način PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Celozaslonsko"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Premakni sliko v sliki"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-sq/strings_tv.xml b/libs/WindowManager/Shell/res/values-sq/strings_tv.xml
index 08a6409..107870d0 100644
--- a/libs/WindowManager/Shell/res/values-sq/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-sq/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Program pa titull)"</string>
<string name="pip_close" msgid="9135220303720555525">"Mbyll PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Ekrani i plotë"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Zhvendos PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-sr/strings_tv.xml b/libs/WindowManager/Shell/res/values-sr/strings_tv.xml
index f932928..ee5690b 100644
--- a/libs/WindowManager/Shell/res/values-sr/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-sr/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Програм без наслова)"</string>
<string name="pip_close" msgid="9135220303720555525">"Затвори PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Цео екран"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Премести слику у слици"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-sv/strings_tv.xml b/libs/WindowManager/Shell/res/values-sv/strings_tv.xml
index 1428fdb..7355adf 100644
--- a/libs/WindowManager/Shell/res/values-sv/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-sv/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Namnlöst program)"</string>
<string name="pip_close" msgid="9135220303720555525">"Stäng PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Helskärm"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Flytta BIB"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-sw/strings_tv.xml b/libs/WindowManager/Shell/res/values-sw/strings_tv.xml
index 615209f..0ee2841 100644
--- a/libs/WindowManager/Shell/res/values-sw/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-sw/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Programu isiyo na jina)"</string>
<string name="pip_close" msgid="9135220303720555525">"Funga PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Skrini nzima"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Kuhamisha PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ta/strings_tv.xml b/libs/WindowManager/Shell/res/values-ta/strings_tv.xml
index 71c242c..8bcc43b 100644
--- a/libs/WindowManager/Shell/res/values-ta/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-ta/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(தலைப்பு இல்லை)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIPஐ மூடு"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"முழுத்திரை"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIPபை நகர்த்து"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-te/strings_tv.xml b/libs/WindowManager/Shell/res/values-te/strings_tv.xml
index f2dfb39..6e80bd7 100644
--- a/libs/WindowManager/Shell/res/values-te/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-te/strings_tv.xml
@@ -20,7 +20,6 @@
<string name="notification_channel_tv_pip" msgid="2576686079160402435">"పిక్చర్-ఇన్-పిక్చర్"</string>
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(శీర్షిక లేని ప్రోగ్రామ్)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIPని మూసివేయి"</string>
- <string name="pip_fullscreen" msgid="7278047353591302554">"పూర్తి స్క్రీన్"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_fullscreen" msgid="7278047353591302554">"ఫుల్-స్క్రీన్"</string>
+ <string name="pip_move" msgid="1544227837964635439">"PIPను తరలించండి"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-th/strings_tv.xml b/libs/WindowManager/Shell/res/values-th/strings_tv.xml
index e810c88..b6f6369 100644
--- a/libs/WindowManager/Shell/res/values-th/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-th/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(ไม่มีชื่อรายการ)"</string>
<string name="pip_close" msgid="9135220303720555525">"ปิด PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"เต็มหน้าจอ"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"ย้าย PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-tl/strings_tv.xml b/libs/WindowManager/Shell/res/values-tl/strings_tv.xml
index 11d2953..71ca230 100644
--- a/libs/WindowManager/Shell/res/values-tl/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-tl/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Walang pamagat na programa)"</string>
<string name="pip_close" msgid="9135220303720555525">"Isara ang PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Full screen"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Ilipat ang PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-tr/strings_tv.xml b/libs/WindowManager/Shell/res/values-tr/strings_tv.xml
index 6ed6e9f..e6ae7f1 100644
--- a/libs/WindowManager/Shell/res/values-tr/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-tr/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Başlıksız program)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP\'yi kapat"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Tam ekran"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP\'yi taşı"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-uk/strings_tv.xml b/libs/WindowManager/Shell/res/values-uk/strings_tv.xml
index 482f59a..97e1f09 100644
--- a/libs/WindowManager/Shell/res/values-uk/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-uk/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Програма без назви)"</string>
<string name="pip_close" msgid="9135220303720555525">"Закрити PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"На весь екран"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Перемістити картинку в картинці"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ur/strings_tv.xml b/libs/WindowManager/Shell/res/values-ur/strings_tv.xml
index c1954c7..1418570 100644
--- a/libs/WindowManager/Shell/res/values-ur/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-ur/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(بلا عنوان پروگرام)"</string>
<string name="pip_close" msgid="9135220303720555525">"PIP بند کریں"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"فُل اسکرین"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIP کو منتقل کریں"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-uz/strings_tv.xml b/libs/WindowManager/Shell/res/values-uz/strings_tv.xml
index 5140552..31c762e 100644
--- a/libs/WindowManager/Shell/res/values-uz/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-uz/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Nomsiz)"</string>
<string name="pip_close" msgid="9135220303720555525">"Kadr ichida kadr – chiqish"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Butun ekran"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"PIPni siljitish"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-vi/strings_tv.xml b/libs/WindowManager/Shell/res/values-vi/strings_tv.xml
index e54d866..b46cd49 100644
--- a/libs/WindowManager/Shell/res/values-vi/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-vi/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Không có chương trình tiêu đề)"</string>
<string name="pip_close" msgid="9135220303720555525">"Đóng PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Toàn màn hình"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Di chuyển PIP (Ảnh trong ảnh)"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-zh-rCN/strings_tv.xml b/libs/WindowManager/Shell/res/values-zh-rCN/strings_tv.xml
index 9ce1e6c..b6fec63 100644
--- a/libs/WindowManager/Shell/res/values-zh-rCN/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-zh-rCN/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(节目没有标题)"</string>
<string name="pip_close" msgid="9135220303720555525">"关闭画中画"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"全屏"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"移动画中画窗口"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-zh-rHK/strings_tv.xml b/libs/WindowManager/Shell/res/values-zh-rHK/strings_tv.xml
index 9846772..b5d54cb 100644
--- a/libs/WindowManager/Shell/res/values-zh-rHK/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-zh-rHK/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(沒有標題的節目)"</string>
<string name="pip_close" msgid="9135220303720555525">"關閉 PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"全螢幕"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"移動畫中畫"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-zh-rTW/strings_tv.xml b/libs/WindowManager/Shell/res/values-zh-rTW/strings_tv.xml
index 7314d48..57db7a8 100644
--- a/libs/WindowManager/Shell/res/values-zh-rTW/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-zh-rTW/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(無標題的節目)"</string>
<string name="pip_close" msgid="9135220303720555525">"關閉子母畫面"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"全螢幕"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"移動子母畫面"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-zu/strings_tv.xml b/libs/WindowManager/Shell/res/values-zu/strings_tv.xml
index 63d9dd5..646a488 100644
--- a/libs/WindowManager/Shell/res/values-zu/strings_tv.xml
+++ b/libs/WindowManager/Shell/res/values-zu/strings_tv.xml
@@ -21,6 +21,5 @@
<string name="pip_notification_unknown_title" msgid="2729870284350772311">"(Alukho uhlelo lwesihloko)"</string>
<string name="pip_close" msgid="9135220303720555525">"Vala i-PIP"</string>
<string name="pip_fullscreen" msgid="7278047353591302554">"Iskrini esigcwele"</string>
- <!-- no translation found for pip_move (1544227837964635439) -->
- <skip />
+ <string name="pip_move" msgid="1544227837964635439">"Hambisa i-PIP"</string>
</resources>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java
index 413627d..e255e44 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java
@@ -54,6 +54,7 @@
import android.view.SurfaceControl;
import android.view.View;
import android.window.SplashScreenView;
+import android.window.StartingWindowInfo;
import android.window.StartingWindowInfo.StartingWindowType;
import com.android.internal.R;
@@ -138,8 +139,8 @@
* executed on splash screen thread. Note that the view can be
* null if failed.
*/
- void createContentView(Context context, @StartingWindowType int suggestType, ActivityInfo info,
- int taskId, Consumer<SplashScreenView> splashScreenViewConsumer,
+ void createContentView(Context context, @StartingWindowType int suggestType,
+ StartingWindowInfo info, Consumer<SplashScreenView> splashScreenViewConsumer,
Consumer<Runnable> uiThreadInitConsumer) {
mSplashscreenWorkerHandler.post(() -> {
SplashScreenView contentView;
@@ -150,7 +151,7 @@
Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
} catch (RuntimeException e) {
Slog.w(TAG, "failed creating starting window content at taskId: "
- + taskId, e);
+ + info.taskInfo.taskId, e);
contentView = null;
}
splashScreenViewConsumer.accept(contentView);
@@ -241,7 +242,7 @@
return null;
}
- private SplashScreenView makeSplashScreenContentView(Context context, ActivityInfo ai,
+ private SplashScreenView makeSplashScreenContentView(Context context, StartingWindowInfo info,
@StartingWindowType int suggestType, Consumer<Runnable> uiThreadInitConsumer) {
updateDensity();
@@ -250,6 +251,9 @@
final Drawable legacyDrawable = suggestType == STARTING_WINDOW_TYPE_LEGACY_SPLASH_SCREEN
? peekLegacySplashscreenContent(context, mTmpAttrs) : null;
+ final ActivityInfo ai = info.targetActivityInfo != null
+ ? info.targetActivityInfo
+ : info.taskInfo.topActivityInfo;
final int themeBGColor = legacyDrawable != null
? getBGColorFromCache(ai, () -> estimateWindowBGColor(legacyDrawable))
: getBGColorFromCache(ai, () -> peekWindowBGColor(context, mTmpAttrs));
@@ -258,6 +262,7 @@
.overlayDrawable(legacyDrawable)
.chooseStyle(suggestType)
.setUiThreadInitConsumer(uiThreadInitConsumer)
+ .setAllowHandleEmpty(info.allowHandleEmptySplashScreen())
.build();
}
@@ -327,6 +332,7 @@
private Drawable[] mFinalIconDrawables;
private int mFinalIconSize = mIconSize;
private Consumer<Runnable> mUiThreadInitTask;
+ private boolean mAllowHandleEmpty;
StartingWindowViewBuilder(@NonNull Context context, @NonNull ActivityInfo aInfo) {
mContext = context;
@@ -353,6 +359,11 @@
return this;
}
+ StartingWindowViewBuilder setAllowHandleEmpty(boolean allowHandleEmpty) {
+ mAllowHandleEmpty = allowHandleEmpty;
+ return this;
+ }
+
SplashScreenView build() {
Drawable iconDrawable;
final int animationDuration;
@@ -491,7 +502,8 @@
.setIconBackground(background)
.setCenterViewDrawable(foreground)
.setAnimationDurationMillis(animationDuration)
- .setUiThreadInitConsumer(uiThreadInitTask);
+ .setUiThreadInitConsumer(uiThreadInitTask)
+ .setAllowHandleEmpty(mAllowHandleEmpty);
if (mSuggestType == STARTING_WINDOW_TYPE_SPLASH_SCREEN
&& mTmpAttrs.mBrandingImage != null) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java
index f8902c6..9a966b8 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java
@@ -328,7 +328,7 @@
if (mSysuiProxy != null) {
mSysuiProxy.requestTopUi(true, TAG);
}
- mSplashscreenContentDrawer.createContentView(context, suggestType, activityInfo, taskId,
+ mSplashscreenContentDrawer.createContentView(context, suggestType, windowInfo,
viewSupplier::setView, viewSupplier::setUiThreadInitTask);
try {
if (addWindow(taskId, appToken, rootLayout, display, params, suggestType)) {
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/ExpandBubbleScreen.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/ExpandBubbleScreen.kt
index f8d14c6..af629cc 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/ExpandBubbleScreen.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/ExpandBubbleScreen.kt
@@ -24,9 +24,6 @@
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group4
import com.android.server.wm.flicker.dsl.FlickerBuilder
-import com.android.wm.shell.flicker.helpers.BaseAppHelper
-import org.junit.Assume
-import org.junit.Before
import org.junit.runner.RunWith
import org.junit.Test
import org.junit.runners.Parameterized
@@ -62,12 +59,6 @@
}
}
- @Before
- fun setup() {
- // This test doesn't work in shell transitions because of b/205288792
- Assume.assumeFalse(BaseAppHelper.isShellTransitionsEnabled())
- }
-
@Presubmit
@Test
fun testAppIsAlwaysVisible() {
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/MultiBubblesScreen.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/MultiBubblesScreen.kt
index c93c5ad..add11c1 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/MultiBubblesScreen.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/bubble/MultiBubblesScreen.kt
@@ -25,9 +25,6 @@
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.annotation.Group4
import com.android.server.wm.flicker.dsl.FlickerBuilder
-import com.android.wm.shell.flicker.helpers.BaseAppHelper
-import org.junit.Assume
-import org.junit.Before
import org.junit.runner.RunWith
import org.junit.Test
import org.junit.runners.Parameterized
@@ -70,12 +67,6 @@
}
}
- @Before
- fun setup() {
- // This test doesn't work in shell transitions because of b/205288792
- Assume.assumeFalse(BaseAppHelper.isShellTransitionsEnabled())
- }
-
@Presubmit
@Test
fun testAppIsAlwaysVisible() {
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTest.kt
index dee13c1..afe64e3 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTest.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/EnterPipToOtherOrientationTest.kt
@@ -204,7 +204,6 @@
@Presubmit
@Test
fun testAppPlusPipLayerCoversFullScreenOnEnd() {
- // This test doesn't work in shell transitions because of b/206669574
testSpec.assertLayersEnd {
val pipRegion = visibleRegion(pipApp.component).region
visibleRegion(testApp.component)
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt
index c36dfda..1d61ab4 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt
@@ -31,6 +31,7 @@
import com.android.server.wm.traces.common.FlickerComponentName
import com.android.wm.shell.flicker.helpers.ImeAppHelper
import org.junit.Assume.assumeFalse
+import org.junit.Assume.assumeTrue
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -82,6 +83,13 @@
super.statusBarLayerRotatesScales()
}
+ @FlakyTest(bugId = 214452854)
+ @Test
+ fun statusBarLayerRotatesScales_shellTransit() {
+ assumeTrue(isShellTransitionsEnabled)
+ super.statusBarLayerRotatesScales()
+ }
+
/**
* Ensure the pip window remains visible throughout any keyboard interactions
*/
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipLegacySplitScreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipLegacySplitScreenTest.kt
index df58194..21175a0 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipLegacySplitScreenTest.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipLegacySplitScreenTest.kt
@@ -92,11 +92,7 @@
/** {@inheritDoc} */
@FlakyTest(bugId = 206753786)
@Test
- override fun statusBarLayerRotatesScales() {
- // This test doesn't work in shell transitions because of b/206753786
- assumeFalse(com.android.server.wm.flicker.helpers.isShellTransitionsEnabled)
- super.statusBarLayerRotatesScales()
- }
+ override fun statusBarLayerRotatesScales() = super.statusBarLayerRotatesScales()
@FlakyTest(bugId = 161435597)
@Test
diff --git a/libs/hwui/jni/Bitmap.cpp b/libs/hwui/jni/Bitmap.cpp
index 6989ac0..5db0783 100755
--- a/libs/hwui/jni/Bitmap.cpp
+++ b/libs/hwui/jni/Bitmap.cpp
@@ -686,16 +686,14 @@
}
return data->ptr != nullptr;
}));
- inPlaceCallback(std::move(data.ptr), data.size);
- return STATUS_OK;
+ return inPlaceCallback(std::move(data.ptr), data.size);
} else if (type == BlobType::ASHMEM) {
int rawFd = -1;
int32_t size = 0;
ON_ERROR_RETURN(AParcel_readInt32(parcel, &size));
ON_ERROR_RETURN(AParcel_readParcelFileDescriptor(parcel, &rawFd));
android::base::unique_fd fd(rawFd);
- ashmemCallback(std::move(fd), size);
- return STATUS_OK;
+ return ashmemCallback(std::move(fd), size);
} else {
// Although the above if/else was "exhaustive" guard against unknown types
return STATUS_UNKNOWN_ERROR;
@@ -768,7 +766,7 @@
// framework, we may need to update this maximum size.
static constexpr size_t kMaxColorSpaceSerializedBytes = 80;
-static constexpr auto RuntimeException = "java/lang/RuntimeException";
+static constexpr auto BadParcelableException = "android/os/BadParcelableException";
static bool validateImageInfo(const SkImageInfo& info, int32_t rowBytes) {
// TODO: Can we avoid making a SkBitmap for this?
@@ -809,7 +807,7 @@
kRGB_565_SkColorType != colorType &&
kARGB_4444_SkColorType != colorType &&
kAlpha_8_SkColorType != colorType) {
- jniThrowExceptionFmt(env, RuntimeException,
+ jniThrowExceptionFmt(env, BadParcelableException,
"Bitmap_createFromParcel unknown colortype: %d\n", colorType);
return NULL;
}
@@ -821,7 +819,7 @@
return NULL;
}
if (!Bitmap::computeAllocationSize(rowBytes, height, &allocationSize)) {
- jniThrowExceptionFmt(env, RuntimeException,
+ jniThrowExceptionFmt(env, BadParcelableException,
"Received bad bitmap size: width=%d, height=%d, rowBytes=%d", width,
height, rowBytes);
return NULL;
@@ -831,13 +829,23 @@
p.get(),
// In place callback
[&](std::unique_ptr<int8_t[]> buffer, int32_t size) {
+ if (allocationSize > size) {
+ android_errorWriteLog(0x534e4554, "213169612");
+ return STATUS_BAD_VALUE;
+ }
nativeBitmap = Bitmap::allocateHeapBitmap(allocationSize, imageInfo, rowBytes);
if (nativeBitmap) {
- memcpy(nativeBitmap->pixels(), buffer.get(), size);
+ memcpy(nativeBitmap->pixels(), buffer.get(), allocationSize);
+ return STATUS_OK;
}
+ return STATUS_NO_MEMORY;
},
// Ashmem callback
[&](android::base::unique_fd fd, int32_t size) {
+ if (allocationSize > size) {
+ android_errorWriteLog(0x534e4554, "213169612");
+ return STATUS_BAD_VALUE;
+ }
int flags = PROT_READ;
if (isMutable) {
flags |= PROT_WRITE;
@@ -846,18 +854,21 @@
if (addr == MAP_FAILED) {
const int err = errno;
ALOGW("mmap failed, error %d (%s)", err, strerror(err));
- return;
+ return STATUS_NO_MEMORY;
}
nativeBitmap =
Bitmap::createFrom(imageInfo, rowBytes, fd.release(), addr, size, !isMutable);
+ return STATUS_OK;
});
- if (error != STATUS_OK) {
+
+ if (error != STATUS_OK && error != STATUS_NO_MEMORY) {
// TODO: Stringify the error, see signalExceptionForError in android_util_Binder.cpp
- jniThrowExceptionFmt(env, RuntimeException, "Failed to read from Parcel, error=%d", error);
+ jniThrowExceptionFmt(env, BadParcelableException, "Failed to read from Parcel, error=%d",
+ error);
return nullptr;
}
- if (!nativeBitmap) {
- jniThrowRuntimeException(env, "Could not allocate java pixel ref.");
+ if (error == STATUS_NO_MEMORY || !nativeBitmap) {
+ jniThrowRuntimeException(env, "Could not allocate bitmap data.");
return nullptr;
}
diff --git a/location/java/android/location/SatellitePvt.java b/location/java/android/location/SatellitePvt.java
index aa43cfd..29888e1 100644
--- a/location/java/android/location/SatellitePvt.java
+++ b/location/java/android/location/SatellitePvt.java
@@ -17,12 +17,19 @@
package android.location;
import android.annotation.FloatRange;
+import android.annotation.IntDef;
+import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;
+import com.android.internal.util.Preconditions;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
* A class that contains GNSS satellite position, velocity and time information at the
* same signal transmission time {@link GnssMeasurement#getReceivedSvTimeNanos()}.
@@ -64,6 +71,60 @@
private static final int HAS_TROPO = 1 << 2;
/**
+ * Bit mask for {@link #mFlags} indicating a valid Issue of Data, Clock field is stored in the
+ * SatellitePvt.
+ */
+ private static final int HAS_ISSUE_OF_DATA_CLOCK = 1 << 3;
+
+ /**
+ * Bit mask for {@link #mFlags} indicating a valid Issue of Data, Ephemeris field is stored in
+ * the SatellitePvt.
+ */
+ private static final int HAS_ISSUE_OF_DATA_EPHEMERIS = 1 << 4;
+
+ /**
+ * Bit mask for {@link #mFlags} indicating a valid Time of Clock field is stored in the
+ * SatellitePvt.
+ */
+ private static final int HAS_TIME_OF_CLOCK = 1 << 5;
+
+ /**
+ * Bit mask for {@link #mFlags} indicating a valid Time of Ephemeris field is stored in
+ * the SatellitePvt.
+ */
+ private static final int HAS_TIME_OF_EPHEMERIS = 1 << 6;
+
+
+ /** Ephemeris demodulated from broadcast signals */
+ public static final int EPHEMERIS_SOURCE_DEMODULATED = 0;
+
+ /**
+ * Server provided Normal type ephemeris data, which is similar to broadcast ephemeris in
+ * longevity (e.g. SUPL) - lasting for few hours and providing satellite orbit and clock
+ * with accuracy of 1 - 2 meters.
+ */
+ public static final int EPHEMERIS_SOURCE_SERVER_NORMAL = 1;
+
+ /**
+ * Server provided Long-Term type ephemeris data, which lasts for many hours to several days
+ * and often provides satellite orbit and clock accuracy of 2 - 20 meters.
+ */
+ public static final int EPHEMERIS_SOURCE_SERVER_LONG_TERM = 2;
+
+ /** Other ephemeris source */
+ public static final int EPHEMERIS_SOURCE_OTHER = 3;
+
+ /**
+ * Satellite ephemeris source
+ * @hide
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef({EPHEMERIS_SOURCE_DEMODULATED, EPHEMERIS_SOURCE_SERVER_NORMAL,
+ EPHEMERIS_SOURCE_SERVER_LONG_TERM, EPHEMERIS_SOURCE_OTHER})
+ public @interface EphemerisSource {
+ }
+
+ /**
* A bitfield of flags indicating the validity of the fields in this SatellitePvt.
* The bit masks are defined in the constants with prefix HAS_*
*
@@ -83,6 +144,12 @@
private final ClockInfo mClockInfo;
private final double mIonoDelayMeters;
private final double mTropoDelayMeters;
+ private final int mTimeOfClock;
+ private final int mTimeOfEphemeris;
+ private final int mIssueOfDataClock;
+ private final int mIssueOfDataEphemeris;
+ @EphemerisSource
+ private final int mEphemerisSource;
/**
* Class containing estimates of the satellite position fields in ECEF coordinate frame.
@@ -389,13 +456,23 @@
@Nullable VelocityEcef velocityEcef,
@Nullable ClockInfo clockInfo,
double ionoDelayMeters,
- double tropoDelayMeters) {
+ double tropoDelayMeters,
+ int timeOfClock,
+ int timeOfEphemeris,
+ int issueOfDataClock,
+ int issueOfDataEphemeris,
+ @EphemerisSource int ephemerisSource) {
mFlags = flags;
mPositionEcef = positionEcef;
mVelocityEcef = velocityEcef;
mClockInfo = clockInfo;
mIonoDelayMeters = ionoDelayMeters;
mTropoDelayMeters = tropoDelayMeters;
+ mTimeOfClock = timeOfClock;
+ mTimeOfEphemeris = timeOfEphemeris;
+ mIssueOfDataClock = issueOfDataClock;
+ mIssueOfDataEphemeris = issueOfDataEphemeris;
+ mEphemerisSource = ephemerisSource;
}
/**
@@ -441,6 +518,66 @@
return mTropoDelayMeters;
}
+ /**
+ * Issue of Data, Clock.
+ *
+ * <p>This is defined in GPS ICD200 documentation (e.g.,
+ * <a href="https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf"></a>).
+ *
+ * <p>This field is valid if {@link #hasIssueOfDataClock()} is true.
+ */
+ @IntRange(from = 0, to = 1023)
+ public int getIssueOfDataClock() {
+ return mIssueOfDataClock;
+ }
+
+ /**
+ * Issue of Data, Ephemeris.
+ *
+ * <p>This is defined in GPS ICD200 documentation (e.g.,
+ * <a href="https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf"></a>).
+ *
+ * <p>This field is valid if {@link #hasIssueOfDataEphemeris()} is true.
+ */
+ @IntRange(from = 0, to = 255)
+ public int getIssueOfDataEphemeris() {
+ return mIssueOfDataEphemeris;
+ }
+
+ /**
+ * Time of Clock.
+ *
+ * <p>This is defined in GPS ICD200 documentation (e.g.,
+ * <a href="https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf"></a>).
+ *
+ * <p>This field is valid if {@link #hasTimeOfClock()} is true.
+ */
+ @IntRange(from = 0, to = 604784)
+ public int getTimeOfClock() {
+ return mTimeOfClock;
+ }
+
+ /**
+ * Time of ephemeris.
+ *
+ * <p>This is defined in GPS ICD200 documentation (e.g.,
+ * <a href="https://www.gps.gov/technical/icwg/IS-GPS-200H.pdf"></a>).
+ *
+ * <p>This field is valid if {@link #hasTimeOfEphemeris()} is true.
+ */
+ @IntRange(from = 0, to = 604784)
+ public int getTimeOfEphemeris() {
+ return mTimeOfEphemeris;
+ }
+
+ /**
+ * Satellite ephemeris source.
+ */
+ @EphemerisSource
+ public int getEphemerisSource() {
+ return mEphemerisSource;
+ }
+
/** Returns {@code true} if {@link #getPositionEcef()}, {@link #getVelocityEcef()},
* and {@link #getClockInfo()} are valid.
*/
@@ -458,6 +595,26 @@
return (mFlags & HAS_TROPO) != 0;
}
+ /** Returns {@code true} if {@link #getIssueOfDataClock()} is valid. */
+ public boolean hasIssueOfDataClock() {
+ return (mFlags & HAS_ISSUE_OF_DATA_CLOCK) != 0;
+ }
+
+ /** Returns {@code true} if {@link #getIssueOfDataEphemeris()} is valid. */
+ public boolean hasIssueOfDataEphemeris() {
+ return (mFlags & HAS_ISSUE_OF_DATA_EPHEMERIS) != 0;
+ }
+
+ /** Returns {@code true} if {@link #getTimeOfClock()} ()} is valid. */
+ public boolean hasTimeOfClock() {
+ return (mFlags & HAS_TIME_OF_CLOCK) != 0;
+ }
+
+ /** Returns {@code true} if {@link #getTimeOfEphemeris()} is valid. */
+ public boolean hasTimeOfEphemeris() {
+ return (mFlags & HAS_TIME_OF_EPHEMERIS) != 0;
+ }
+
public static final @android.annotation.NonNull Creator<SatellitePvt> CREATOR =
new Creator<SatellitePvt>() {
@Override
@@ -465,11 +622,19 @@
public SatellitePvt createFromParcel(Parcel in) {
int flags = in.readInt();
ClassLoader classLoader = getClass().getClassLoader();
- PositionEcef positionEcef = in.readParcelable(classLoader, android.location.SatellitePvt.PositionEcef.class);
- VelocityEcef velocityEcef = in.readParcelable(classLoader, android.location.SatellitePvt.VelocityEcef.class);
- ClockInfo clockInfo = in.readParcelable(classLoader, android.location.SatellitePvt.ClockInfo.class);
+ PositionEcef positionEcef = in.readParcelable(classLoader,
+ android.location.SatellitePvt.PositionEcef.class);
+ VelocityEcef velocityEcef = in.readParcelable(classLoader,
+ android.location.SatellitePvt.VelocityEcef.class);
+ ClockInfo clockInfo = in.readParcelable(classLoader,
+ android.location.SatellitePvt.ClockInfo.class);
double ionoDelayMeters = in.readDouble();
double tropoDelayMeters = in.readDouble();
+ int toc = in.readInt();
+ int toe = in.readInt();
+ int iodc = in.readInt();
+ int iode = in.readInt();
+ int ephemerisSource = in.readInt();
return new SatellitePvt(
flags,
@@ -477,7 +642,12 @@
velocityEcef,
clockInfo,
ionoDelayMeters,
- tropoDelayMeters);
+ tropoDelayMeters,
+ toc,
+ toe,
+ iodc,
+ iode,
+ ephemerisSource);
}
@Override
@@ -499,18 +669,28 @@
parcel.writeParcelable(mClockInfo, flags);
parcel.writeDouble(mIonoDelayMeters);
parcel.writeDouble(mTropoDelayMeters);
+ parcel.writeInt(mTimeOfClock);
+ parcel.writeInt(mTimeOfEphemeris);
+ parcel.writeInt(mIssueOfDataClock);
+ parcel.writeInt(mIssueOfDataEphemeris);
+ parcel.writeInt(mEphemerisSource);
}
@Override
public String toString() {
- return "SatellitePvt{"
+ return "SatellitePvt["
+ "Flags=" + mFlags
+ ", PositionEcef=" + mPositionEcef
+ ", VelocityEcef=" + mVelocityEcef
+ ", ClockInfo=" + mClockInfo
+ ", IonoDelayMeters=" + mIonoDelayMeters
+ ", TropoDelayMeters=" + mTropoDelayMeters
- + "}";
+ + ", TimeOfClock=" + mTimeOfClock
+ + ", TimeOfEphemeris=" + mTimeOfEphemeris
+ + ", IssueOfDataClock=" + mIssueOfDataClock
+ + ", IssueOfDataEphemeris=" + mIssueOfDataEphemeris
+ + ", EphemerisSource=" + mEphemerisSource
+ + "]";
}
/**
@@ -527,12 +707,18 @@
@Nullable private ClockInfo mClockInfo;
private double mIonoDelayMeters;
private double mTropoDelayMeters;
+ private int mTimeOfClock;
+ private int mTimeOfEphemeris;
+ private int mIssueOfDataClock;
+ private int mIssueOfDataEphemeris;
+ @EphemerisSource
+ private int mEphemerisSource = EPHEMERIS_SOURCE_OTHER;
/**
* Set position ECEF.
*
* @param positionEcef position ECEF object
- * @return Builder builder object
+ * @return builder object
*/
@NonNull
public Builder setPositionEcef(
@@ -546,7 +732,7 @@
* Set velocity ECEF.
*
* @param velocityEcef velocity ECEF object
- * @return Builder builder object
+ * @return builder object
*/
@NonNull
public Builder setVelocityEcef(
@@ -560,7 +746,7 @@
* Set clock info.
*
* @param clockInfo clock info object
- * @return Builder builder object
+ * @return builder object
*/
@NonNull
public Builder setClockInfo(
@@ -580,7 +766,7 @@
* Set ionospheric delay in meters.
*
* @param ionoDelayMeters ionospheric delay (meters)
- * @return Builder builder object
+ * @return builder object
*/
@NonNull
public Builder setIonoDelayMeters(
@@ -594,7 +780,7 @@
* Set tropospheric delay in meters.
*
* @param tropoDelayMeters tropospheric delay (meters)
- * @return Builder builder object
+ * @return builder object
*/
@NonNull
public Builder setTropoDelayMeters(
@@ -605,6 +791,80 @@
}
/**
+ * Set time of clock in seconds.
+ *
+ * @param timeOfClock time of clock (seconds)
+ * @return builder object
+ */
+ @NonNull
+ public Builder setTimeOfClock(@IntRange(from = 0, to = 604784) int timeOfClock) {
+ Preconditions.checkArgumentInRange(timeOfClock, 0, 604784, "timeOfClock");
+ mTimeOfClock = timeOfClock;
+ mFlags = (byte) (mFlags | HAS_TIME_OF_CLOCK);
+ return this;
+ }
+
+ /**
+ * Set time of ephemeris in seconds.
+ *
+ * @param timeOfEphemeris time of ephemeris (seconds)
+ * @return builder object
+ */
+ @NonNull
+ public Builder setTimeOfEphemeris(@IntRange(from = 0, to = 604784) int timeOfEphemeris) {
+ Preconditions.checkArgumentInRange(timeOfEphemeris, 0, 604784, "timeOfEphemeris");
+ mTimeOfEphemeris = timeOfEphemeris;
+ mFlags = (byte) (mFlags | HAS_TIME_OF_EPHEMERIS);
+ return this;
+ }
+
+ /**
+ * Set issue of data, clock.
+ *
+ * @param issueOfDataClock issue of data, clock.
+ * @return builder object
+ */
+ @NonNull
+ public Builder setIssueOfDataClock(@IntRange(from = 0, to = 1023) int issueOfDataClock) {
+ Preconditions.checkArgumentInRange(issueOfDataClock, 0, 1023, "issueOfDataClock");
+ mIssueOfDataClock = issueOfDataClock;
+ mFlags = (byte) (mFlags | HAS_ISSUE_OF_DATA_CLOCK);
+ return this;
+ }
+
+ /**
+ * Set issue of data, ephemeris.
+ *
+ * @param issueOfDataEphemeris issue of data, ephemeris.
+ * @return builder object
+ */
+ @NonNull
+ public Builder setIssueOfDataEphemeris(
+ @IntRange(from = 0, to = 255) int issueOfDataEphemeris) {
+ Preconditions.checkArgumentInRange(issueOfDataEphemeris, 0, 255,
+ "issueOfDataEphemeris");
+ mIssueOfDataEphemeris = issueOfDataEphemeris;
+ mFlags = (byte) (mFlags | HAS_ISSUE_OF_DATA_EPHEMERIS);
+ return this;
+ }
+
+ /**
+ * Set satellite ephemeris source.
+ *
+ * @param ephemerisSource satellite ephemeris source
+ * @return builder object
+ */
+ @NonNull
+ public Builder setEphemerisSource(@EphemerisSource int ephemerisSource) {
+ Preconditions.checkArgument(ephemerisSource == EPHEMERIS_SOURCE_DEMODULATED
+ || ephemerisSource == EPHEMERIS_SOURCE_SERVER_NORMAL
+ || ephemerisSource == EPHEMERIS_SOURCE_SERVER_LONG_TERM
+ || ephemerisSource == EPHEMERIS_SOURCE_OTHER);
+ mEphemerisSource = ephemerisSource;
+ return this;
+ }
+
+ /**
* Build SatellitePvt object.
*
* @return instance of SatellitePvt
@@ -612,7 +872,9 @@
@NonNull
public SatellitePvt build() {
return new SatellitePvt(mFlags, mPositionEcef, mVelocityEcef, mClockInfo,
- mIonoDelayMeters, mTropoDelayMeters);
+ mIonoDelayMeters, mTropoDelayMeters, mTimeOfClock, mTimeOfEphemeris,
+ mIssueOfDataClock, mIssueOfDataEphemeris,
+ mEphemerisSource);
}
}
}
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index c4cef4c..a2704f9 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -7242,6 +7242,24 @@
/**
* @hide
+ * Indicates whether a platform supports the Ultrasound feature which covers the playback
+ * and recording of 20kHz~ sounds. If platform supports Ultrasound, then the
+ * usage will be
+ * To start the Ultrasound playback:
+ * - Create an AudioTrack with {@link AudioAttributes.CONTENT_TYPE_ULTRASOUND}.
+ * To start the Ultrasound capture:
+ * - Create an AudioRecord with {@link MediaRecorder.AudioSource.ULTRASOUND}.
+ *
+ * @return whether the ultrasound feature is supported, true when platform supports both
+ * Ultrasound playback and capture, false otherwise.
+ */
+ @SystemApi
+ public static boolean isUltrasoundSupported() {
+ return AudioSystem.isUltrasoundSupported();
+ }
+
+ /**
+ * @hide
* Introspection API to retrieve audio product strategies.
* When implementing {Car|Oem}AudioManager, use this method to retrieve the collection of
* audio product strategies, which is indexed by a weakly typed index in order to be extended
@@ -7675,6 +7693,33 @@
}
/**
+ * Returns a list of direct {@link AudioProfile} that are supported for the specified
+ * {@link AudioAttributes}. This can be empty in case of an error or if no direct playback
+ * is possible.
+ *
+ * <p>Direct playback means that the audio stream is not resampled or downmixed
+ * by the framework. Checking for direct support can help the app select the representation
+ * of audio content that most closely matches the capabilities of the device and peripherals
+ * (e.g. A/V receiver) connected to it. Note that the provided stream can still be re-encoded
+ * or mixed with other streams, if needed.
+ * <p>When using this information to inform your application which audio format to play,
+ * query again whenever audio output devices change (see {@link AudioDeviceCallback}).
+ * @param attributes a non-null {@link AudioAttributes} instance.
+ * @return a list of {@link AudioProfile}
+ */
+ @NonNull
+ public List<AudioProfile> getDirectProfilesForAttributes(@NonNull AudioAttributes attributes) {
+ Objects.requireNonNull(attributes);
+ ArrayList<AudioProfile> audioProfilesList = new ArrayList<>();
+ int status = AudioSystem.getDirectProfilesForAttributes(attributes, audioProfilesList);
+ if (status != SUCCESS) {
+ Log.w(TAG, "getDirectProfilesForAttributes failed.");
+ return new ArrayList<>();
+ }
+ return audioProfilesList;
+ }
+
+ /**
* @hide
* Returns an {@link AudioDeviceInfo} corresponding to a connected device of the type provided.
* The type must be a valid output type defined in <code>AudioDeviceInfo</code> class,
@@ -8352,4 +8397,4 @@
return mHandler;
}
}
-}
\ No newline at end of file
+}
diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java
index 306479a..1b46a50 100644
--- a/media/java/android/media/AudioSystem.java
+++ b/media/java/android/media/AudioSystem.java
@@ -1871,6 +1871,12 @@
/**
* @hide
+ * @see AudioManager#isUltrasoundSupported()
+ */
+ public static native boolean isUltrasoundSupported();
+
+ /**
+ * @hide
* Send audio HAL server process pids to native audioserver process for use
* when generating audio HAL servers tombstones
*/
@@ -2115,6 +2121,15 @@
AudioFormat format,
AudioDeviceAttributes[] devices);
+ /**
+ * @hide
+ * @param attributes audio attributes describing the playback use case
+ * @param audioProfilesList the list of AudioProfiles that can be played as direct output
+ * @return {@link #SUCCESS} if the list of AudioProfiles was successfully created (can be empty)
+ */
+ public static native int getDirectProfilesForAttributes(@NonNull AudioAttributes attributes,
+ @NonNull ArrayList<AudioProfile> audioProfilesList);
+
// Items shared with audio service
/**
diff --git a/media/java/android/media/ImageReader.java b/media/java/android/media/ImageReader.java
index 09d7fbd..e2e48d3 100644
--- a/media/java/android/media/ImageReader.java
+++ b/media/java/android/media/ImageReader.java
@@ -963,7 +963,7 @@
*
* @see HardwareBuffer
*/
- public @NonNull Builder setUsage(long usage) {
+ public @NonNull Builder setUsage(@Usage long usage) {
mUsage = usage;
return this;
}
diff --git a/media/java/android/media/ImageWriter.java b/media/java/android/media/ImageWriter.java
index 6168c22..a1aedf1 100644
--- a/media/java/android/media/ImageWriter.java
+++ b/media/java/android/media/ImageWriter.java
@@ -102,11 +102,10 @@
private int mWidth;
private int mHeight;
private final int mMaxImages;
- private @Usage long mUsage = HardwareBuffer.USAGE_CPU_WRITE_OFTEN;
+ private long mUsage = HardwareBuffer.USAGE_CPU_WRITE_OFTEN;
private @HardwareBuffer.Format int mHardwareBufferFormat;
private @NamedDataSpace long mDataSpace;
private boolean mUseLegacyImageFormat;
- private boolean mUseSurfaceImageFormatInfo;
// Field below is used by native code, do not access or modify.
private int mWriterFormat;
@@ -255,35 +254,38 @@
+ ", maxImages: " + maxImages);
}
- mUseSurfaceImageFormatInfo = useSurfaceImageFormatInfo;
mUseLegacyImageFormat = useLegacyImageFormat;
// Note that the underlying BufferQueue is working in synchronous mode
// to avoid dropping any buffers.
mNativeContext = nativeInit(new WeakReference<>(this), surface, maxImages, width, height,
useSurfaceImageFormatInfo, hardwareBufferFormat, dataSpace, usage);
+ // if useSurfaceImageFormatInfo is true, imageformat should be read from the surface.
if (useSurfaceImageFormatInfo) {
// nativeInit internally overrides UNKNOWN format. So does surface format query after
// nativeInit and before getEstimatedNativeAllocBytes().
imageFormat = SurfaceUtils.getSurfaceFormat(surface);
- // Several public formats use the same native HAL_PIXEL_FORMAT_BLOB. The native
- // allocation estimation sequence depends on the public formats values. To avoid
- // possible errors, convert where necessary.
- if (imageFormat == StreamConfigurationMap.HAL_PIXEL_FORMAT_BLOB) {
- int surfaceDataspace = SurfaceUtils.getSurfaceDataspace(surface);
- switch (surfaceDataspace) {
- case StreamConfigurationMap.HAL_DATASPACE_DEPTH:
- imageFormat = ImageFormat.DEPTH_POINT_CLOUD;
- break;
- case StreamConfigurationMap.HAL_DATASPACE_DYNAMIC_DEPTH:
- imageFormat = ImageFormat.DEPTH_JPEG;
- break;
- case StreamConfigurationMap.HAL_DATASPACE_HEIF:
- imageFormat = ImageFormat.HEIC;
- break;
- default:
- imageFormat = ImageFormat.JPEG;
- }
+ mHardwareBufferFormat = PublicFormatUtils.getHalFormat(imageFormat);
+ mDataSpace = PublicFormatUtils.getHalDataspace(imageFormat);
+ }
+
+ // Several public formats use the same native HAL_PIXEL_FORMAT_BLOB. The native
+ // allocation estimation sequence depends on the public formats values. To avoid
+ // possible errors, convert where necessary.
+ if (imageFormat == StreamConfigurationMap.HAL_PIXEL_FORMAT_BLOB) {
+ int surfaceDataspace = SurfaceUtils.getSurfaceDataspace(surface);
+ switch (surfaceDataspace) {
+ case StreamConfigurationMap.HAL_DATASPACE_DEPTH:
+ imageFormat = ImageFormat.DEPTH_POINT_CLOUD;
+ break;
+ case StreamConfigurationMap.HAL_DATASPACE_DYNAMIC_DEPTH:
+ imageFormat = ImageFormat.DEPTH_JPEG;
+ break;
+ case StreamConfigurationMap.HAL_DATASPACE_HEIF:
+ imageFormat = ImageFormat.HEIC;
+ break;
+ default:
+ imageFormat = ImageFormat.JPEG;
}
mHardwareBufferFormat = PublicFormatUtils.getHalFormat(imageFormat);
mDataSpace = PublicFormatUtils.getHalDataspace(imageFormat);
@@ -307,7 +309,6 @@
private ImageWriter(Surface surface, int maxImages, boolean useSurfaceImageFormatInfo,
int imageFormat, int width, int height) {
mMaxImages = maxImages;
- // update hal format and dataspace only if image format is overridden by producer.
mHardwareBufferFormat = PublicFormatUtils.getHalFormat(imageFormat);
mDataSpace = PublicFormatUtils.getHalDataspace(imageFormat);
@@ -566,6 +567,9 @@
/**
* Get the ImageWriter usage flag.
*
+ * <p>It is not recommended to use this function if {@link Builder#setUsage} is not called.
+ * Invalid usage value will be returned if so.</p>
+ *
* @return The ImageWriter usage flag.
*/
public @Usage long getUsage() {
@@ -873,7 +877,7 @@
private int mHeight = -1;
private int mMaxImages = 1;
private int mImageFormat = ImageFormat.UNKNOWN;
- private @Usage long mUsage = HardwareBuffer.USAGE_CPU_WRITE_OFTEN;
+ private long mUsage = -1;
private @HardwareBuffer.Format int mHardwareBufferFormat = HardwareBuffer.RGBA_8888;
private @NamedDataSpace long mDataSpace = DataSpace.DATASPACE_UNKNOWN;
private boolean mUseSurfaceImageFormatInfo = true;
@@ -885,10 +889,19 @@
/**
* Constructs a new builder for {@link ImageWriter}.
*
+ * <p>Uses {@code surface} input parameter to retrieve image format, hal format
+ * and hal dataspace value for default. </p>
+ *
* @param surface The destination Surface this writer produces Image data into.
+ *
+ * @throws IllegalArgumentException if the surface is already abandoned.
*/
public Builder(@NonNull Surface surface) {
mSurface = surface;
+ // retrieve format from surface
+ mImageFormat = SurfaceUtils.getSurfaceFormat(surface);
+ mDataSpace = SurfaceUtils.getSurfaceDataspace(surface);
+ mHardwareBufferFormat = PublicFormatUtils.getHalFormat(mImageFormat);
}
/**
@@ -926,6 +939,8 @@
* @param imageFormat The format of the {@link ImageWriter}. It can be any valid specified
* by {@link ImageFormat} or {@link PixelFormat}.
* @return the Builder instance with customized image format.
+ *
+ * @throws IllegalArgumentException if {@code imageFormat} is invalid.
*/
@SuppressLint("MissingGetterMatchingBuilder")
public @NonNull Builder setImageFormat(@Format int imageFormat) {
@@ -985,12 +1000,16 @@
/**
* Set the usage flag of this ImageWriter.
- * Default value is {@link HardwareBuffer#USAGE_CPU_WRITE_OFTEN}.
+ *
+ * <p>If this function is not called, usage bit will be set
+ * to {@link HardwareBuffer#USAGE_CPU_WRITE_OFTEN} if the image format is not
+ * {@link ImageFormat#PRIVATE PRIVATE}.</p>
*
* @param usage The intended usage of the images produced by this ImageWriter.
* @return the Builder instance with customized usage flag.
*
* @see HardwareBuffer
+ * @see #getUsage
*/
public @NonNull Builder setUsage(@Usage long usage) {
mUsage = usage;
@@ -1022,6 +1041,7 @@
private int mHeight = -1;
private int mWidth = -1;
private int mFormat = -1;
+ private @NamedDataSpace long mDataSpace = DataSpace.DATASPACE_UNKNOWN;
// When this default timestamp is used, timestamp for the input Image
// will be generated automatically when queueInputBuffer is called.
private final long DEFAULT_TIMESTAMP = Long.MIN_VALUE;
@@ -1034,19 +1054,34 @@
mOwner = writer;
mWidth = writer.mWidth;
mHeight = writer.mHeight;
+ mDataSpace = writer.mDataSpace;
- if (!writer.mUseLegacyImageFormat) {
+ if (!mOwner.mUseLegacyImageFormat) {
mFormat = PublicFormatUtils.getPublicFormat(
- writer.mHardwareBufferFormat, writer.mDataSpace);
+ mOwner.mHardwareBufferFormat, mDataSpace);
}
}
@Override
+ public @NamedDataSpace long getDataSpace() {
+ throwISEIfImageIsInvalid();
+
+ return mDataSpace;
+ }
+
+ @Override
+ public void setDataSpace(@NamedDataSpace long dataSpace) {
+ throwISEIfImageIsInvalid();
+
+ mDataSpace = dataSpace;
+ }
+
+ @Override
public int getFormat() {
throwISEIfImageIsInvalid();
- if (mFormat == -1) {
- mFormat = nativeGetFormat();
+ if (mOwner.mUseLegacyImageFormat && mFormat == -1) {
+ mFormat = nativeGetFormat(mDataSpace);
}
return mFormat;
}
@@ -1114,7 +1149,8 @@
if (mPlanes == null) {
int numPlanes = ImageUtils.getNumPlanesForFormat(getFormat());
- mPlanes = nativeCreatePlanes(numPlanes, getOwner().getFormat());
+ mPlanes = nativeCreatePlanes(numPlanes, getOwner().getFormat(),
+ getOwner().getDataSpace());
}
return mPlanes.clone();
@@ -1222,13 +1258,14 @@
}
// Create the SurfacePlane object and fill the information
- private synchronized native SurfacePlane[] nativeCreatePlanes(int numPlanes, int writerFmt);
+ private synchronized native SurfacePlane[] nativeCreatePlanes(int numPlanes, int writerFmt,
+ long dataSpace);
private synchronized native int nativeGetWidth();
private synchronized native int nativeGetHeight();
- private synchronized native int nativeGetFormat();
+ private synchronized native int nativeGetFormat(long dataSpace);
private synchronized native HardwareBuffer nativeGetHardwareBuffer();
}
diff --git a/media/java/android/media/MediaCodecInfo.java b/media/java/android/media/MediaCodecInfo.java
index e75df1d..5dee945 100644
--- a/media/java/android/media/MediaCodecInfo.java
+++ b/media/java/android/media/MediaCodecInfo.java
@@ -426,10 +426,30 @@
/** @deprecated Use {@link #COLOR_Format32bitABGR8888}. */
public static final int COLOR_Format24BitABGR6666 = 43;
- /** @hide
- * P010 is a 4:2:0 YCbCr semiplanar format comprised of a WxH Y plane
- * followed by a Wx(H/2) CbCr plane. Each sample is represented by a 16-bit
- * little-endian value, with the lower 6 bits set to zero. */
+ /**
+ * P010 is 10-bit-per component 4:2:0 YCbCr semiplanar format.
+ * <p>
+ * This format uses 24 allocated bits per pixel with 15 bits of
+ * data per pixel. Chroma planes are subsampled by 2 both
+ * horizontally and vertically. Each chroma and luma component
+ * has 16 allocated bits in little-endian configuration with 10
+ * MSB of actual data.
+ *
+ * <pre>
+ * byte byte
+ * <--------- i --------> | <------ i + 1 ------>
+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ * | UNUSED | Y/Cb/Cr |
+ * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
+ * 0 5 6 7 0 7
+ * bit
+ * </pre>
+ *
+ * Use this format with {@link Image}. This format corresponds
+ * to {@link android.graphics.ImageFormat#YCBCR_P010}.
+ * <p>
+ */
+ @SuppressLint("AllUpper")
public static final int COLOR_FormatYUVP010 = 54;
/** @deprecated Use {@link #COLOR_FormatYUV420Flexible}. */
@@ -439,6 +459,25 @@
public static final int COLOR_FormatSurface = 0x7F000789;
/**
+ * 64 bits per pixel RGBA color format, with 16-bit signed
+ * floating point red, green, blue, and alpha components.
+ * <p>
+ *
+ * <pre>
+ * byte byte byte byte
+ * <-- i -->|<- i+1 ->|<- i+2 ->|<- i+3 ->|<- i+4 ->|<- i+5 ->|<- i+6 ->|<- i+7 ->
+ * +---------+---------+-------------------+---------+---------+---------+---------+
+ * | RED | GREEN | BLUE | ALPHA |
+ * +---------+---------+-------------------+---------+---------+---------+---------+
+ * 0 7 0 7 0 7 0 7 0 7 0 7 0 7 0 7
+ * </pre>
+ *
+ * This corresponds to {@link android.graphics.PixelFormat#RGBA_F16}.
+ */
+ @SuppressLint("AllUpper")
+ public static final int COLOR_Format64bitABGRFloat = 0x7F000F16;
+
+ /**
* 32 bits per pixel RGBA color format, with 8-bit red, green, blue, and alpha components.
* <p>
* Using 32-bit little-endian representation, colors stored as Red 7:0, Green 15:8,
@@ -456,6 +495,26 @@
public static final int COLOR_Format32bitABGR8888 = 0x7F00A000;
/**
+ * 32 bits per pixel RGBA color format, with 10-bit red, green,
+ * blue, and 2-bit alpha components.
+ * <p>
+ * Using 32-bit little-endian representation, colors stored as
+ * Red 9:0, Green 19:10, Blue 29:20, and Alpha 31:30.
+ * <pre>
+ * byte byte byte byte
+ * <------ i -----> | <---- i+1 ----> | <---- i+2 ----> | <---- i+3 ----->
+ * +-----------------+---+-------------+-------+---------+-----------+-----+
+ * | RED | GREEN | BLUE |ALPHA|
+ * +-----------------+---+-------------+-------+---------+-----------+-----+
+ * 0 7 0 1 2 7 0 3 4 7 0 5 6 7
+ * </pre>
+ *
+ * This corresponds to {@link android.graphics.PixelFormat#RGBA_1010102}.
+ */
+ @SuppressLint("AllUpper")
+ public static final int COLOR_Format32bitABGR2101010 = 0x7F00AAA2;
+
+ /**
* Flexible 12 bits per pixel, subsampled YUV color format with 8-bit chroma and luma
* components.
* <p>
@@ -615,6 +674,24 @@
public static final String FEATURE_EncodingStatistics = "encoding-statistics";
/**
+ * <b>video encoder only</b>: codec supports HDR editing.
+ * <p>
+ * HDR editing support means that the codec accepts 10-bit HDR
+ * input surface, and it is capable of generating any HDR
+ * metadata required from both YUV and RGB input when the
+ * metadata is not present. This feature is only meaningful when
+ * using an HDR capable profile (and 10-bit HDR input).
+ * <p>
+ * This feature implies that the codec is capable of encoding at
+ * least one HDR format, and that it supports RGBA_1010102 as
+ * well as P010, and optionally RGBA_FP16 input formats, and
+ * that the encoder can generate HDR metadata for all supported
+ * HDR input formats.
+ */
+ @SuppressLint("AllUpper")
+ public static final String FEATURE_HdrEditing = "hdr-editing";
+
+ /**
* Query codec feature capabilities.
* <p>
* These features are supported to be used by the codec. These
@@ -654,6 +731,7 @@
new Feature(FEATURE_DynamicTimestamp, (1 << 2), false),
new Feature(FEATURE_QpBounds, (1 << 3), false),
new Feature(FEATURE_EncodingStatistics, (1 << 4), false),
+ new Feature(FEATURE_HdrEditing, (1 << 5), false),
// feature to exclude codec from REGULAR codec list
new Feature(FEATURE_SpecialCodec, (1 << 30), false, true),
};
diff --git a/media/java/android/media/MediaDrm.java b/media/java/android/media/MediaDrm.java
index 3a19b13..2a04ebb 100644
--- a/media/java/android/media/MediaDrm.java
+++ b/media/java/android/media/MediaDrm.java
@@ -41,9 +41,9 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.ref.WeakReference;
import java.nio.ByteBuffer;
-import java.time.Instant;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
+import java.time.Instant;
import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
@@ -1864,7 +1864,16 @@
* <p>
* Each secure stop has a unique ID that can be used to identify it during
* enumeration, access and removal.
+ *
* @return a list of all secure stops from secure persistent memory
+ * @deprecated This method is deprecated and may be removed in a future
+ * release. Secure stops are a way to enforce limits on the number of
+ * concurrent streams per subscriber across devices. They provide secure
+ * monitoring of the lifetime of content decryption keys in MediaDrm
+ * sessions. Limits on concurrent streams may also be enforced by
+ * periodically renewing licenses. This can be achieved by calling
+ * {@link #getKeyRequest} to initiate a renewal. MediaDrm users should
+ * transition away from secure stops to periodic renewals.
*/
@NonNull
public native List<byte[]> getSecureStops();
@@ -1875,6 +1884,10 @@
* secure stop.
*
* @return a list of secure stop IDs
+ * @deprecated This method is deprecated and may be removed in a future
+ * release. Use renewals by calling {@link #getKeyRequest} to track
+ * concurrent playback. See additional information in
+ * {@link #getSecureStops}
*/
@NonNull
public native List<byte[]> getSecureStopIds();
@@ -1885,6 +1898,10 @@
*
* @param ssid the ID of the secure stop to return
* @return the secure stop identified by ssid
+ * @deprecated This method is deprecated and may be removed in a future
+ * release. Use renewals by calling {@link #getKeyRequest} to track
+ * concurrent playback. See additional information in
+ * {@link #getSecureStops}
*/
@NonNull
public native byte[] getSecureStop(@NonNull byte[] ssid);
@@ -1895,6 +1912,10 @@
* response.
*
* @param ssRelease the server response indicating which secure stops to release
+ * @deprecated This method is deprecated and may be removed in a future
+ * release. Use renewals by calling {@link #getKeyRequest} to track
+ * concurrent playback. See additional information in
+ * {@link #getSecureStops}
*/
public native void releaseSecureStops(@NonNull byte[] ssRelease);
@@ -1902,6 +1923,10 @@
* Remove a specific secure stop without requiring a secure stop release message
* from the license server.
* @param ssid the ID of the secure stop to remove
+ * @deprecated This method is deprecated and may be removed in a future
+ * release. Use renewals by calling {@link #getKeyRequest} to track
+ * concurrent playback. See additional information in
+ * {@link #getSecureStops}
*/
public native void removeSecureStop(@NonNull byte[] ssid);
@@ -1912,6 +1937,10 @@
* This method was added in API 28. In API versions 18 through 27,
* {@link #releaseAllSecureStops} should be called instead. There is no need to
* do anything for API versions prior to 18.
+ * @deprecated This method is deprecated and may be removed in a future
+ * release. Use renewals by calling {@link #getKeyRequest} to track
+ * concurrent playback. See additional information in
+ * {@link #getSecureStops}
*/
public native void removeAllSecureStops();
diff --git a/media/java/android/media/MediaMetadataRetriever.java b/media/java/android/media/MediaMetadataRetriever.java
index ad8fc07..ea26185 100644
--- a/media/java/android/media/MediaMetadataRetriever.java
+++ b/media/java/android/media/MediaMetadataRetriever.java
@@ -1078,8 +1078,8 @@
*
* @throws IOException When an {@link IOException} is thrown while closing a {@link
* MediaDataSource} passed to {@link #setDataSource(MediaDataSource)}. This throws clause exists
- * since API 33, but this method can throw in earlier API versions where the exception is not
- * declared.
+ * since API {@link android.os.Build.VERSION_CODES#TIRAMISU}, but this method can throw in
+ * earlier API versions where the exception is not declared.
*/
@Override
public void close() throws IOException {
@@ -1091,8 +1091,8 @@
*
* @throws IOException When an {@link IOException} is thrown while closing a {@link
* MediaDataSource} passed to {@link #setDataSource(MediaDataSource)}. This throws clause exists
- * since API 33, but this method can throw in earlier API versions where the exception is not
- * declared.
+ * since API {@link android.os.Build.VERSION_CODES#TIRAMISU}, but this method can throw in
+ * earlier API versions where the exception is not declared.
*/
public native void release() throws IOException;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
diff --git a/media/java/android/media/RingtoneManager.java b/media/java/android/media/RingtoneManager.java
index a6f244f..2772769 100644
--- a/media/java/android/media/RingtoneManager.java
+++ b/media/java/android/media/RingtoneManager.java
@@ -1059,7 +1059,8 @@
* haptic channels or not. As this function doesn't has a context
* to resolve the uri, the result may be wrong if the uri cannot be
* resolved correctly.
- * Use {@link #hasHapticChannels(int)} instead when possible.
+ * Use {@link #hasHapticChannels(int)} or {@link #hasHapticChannels(Context, Uri)}
+ * instead when possible.
*
* @param ringtoneUri The {@link Uri} of a sound or ringtone.
* @return true if the ringtone contains haptic channels.
@@ -1069,6 +1070,17 @@
}
/**
+ * Returns if the {@link Ringtone} from a given sound URI contains haptics channels or not.
+ *
+ * @param context the {@link android.content.Context} to use when resolving the Uri.
+ * @param ringtoneUri the {@link Uri} of a sound or ringtone.
+ * @return true if the ringtone contains haptic channels.
+ */
+ public static boolean hasHapticChannels(@NonNull Context context, @NonNull Uri ringtoneUri) {
+ return AudioManager.hasHapticChannels(context, ringtoneUri);
+ }
+
+ /**
* Attempts to create a context for the given user.
*
* @return created context, or null if package does not exist
diff --git a/media/java/android/media/tv/AdRequest.java b/media/java/android/media/tv/AdRequest.java
index 536baf2..0542c55 100644
--- a/media/java/android/media/tv/AdRequest.java
+++ b/media/java/android/media/tv/AdRequest.java
@@ -16,8 +16,9 @@
package android.media.tv;
+import android.annotation.IntDef;
import android.annotation.NonNull;
-import android.annotation.StringDef;
+import android.annotation.Nullable;
import android.os.Bundle;
import android.os.Parcel;
import android.os.ParcelFileDescriptor;
@@ -26,17 +27,26 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-/** @hide */
+/**
+ * An advertisement request which can be sent to TV input to request AD operations.
+ */
public final class AdRequest implements Parcelable {
+ /** @hide */
@Retention(RetentionPolicy.SOURCE)
- @StringDef(prefix = "REQUEST_TYPE_", value = {
+ @IntDef(prefix = "REQUEST_TYPE_", value = {
REQUEST_TYPE_START,
REQUEST_TYPE_STOP
})
public @interface RequestType {}
- public static final String REQUEST_TYPE_START = "START";
- public static final String REQUEST_TYPE_STOP = "STOP";
+ /**
+ * Request to start an advertisement.
+ */
+ public static final int REQUEST_TYPE_START = 1;
+ /**
+ * Request to stop an advertisement.
+ */
+ public static final int REQUEST_TYPE_STOP = 2;
public static final @NonNull Parcelable.Creator<AdRequest> CREATOR =
new Parcelable.Creator<AdRequest>() {
@@ -52,7 +62,7 @@
};
private final int mId;
- private final @RequestType String mRequestType;
+ private final @RequestType int mRequestType;
private final ParcelFileDescriptor mFileDescriptor;
private final long mStartTime;
private final long mStopTime;
@@ -60,9 +70,9 @@
private final String mMediaFileType;
private final Bundle mMetadata;
- public AdRequest(int id, @RequestType String requestType, ParcelFileDescriptor fileDescriptor,
- long startTime, long stopTime, long echoInterval, String mediaFileType,
- Bundle metadata) {
+ public AdRequest(int id, @RequestType int requestType,
+ @Nullable ParcelFileDescriptor fileDescriptor, long startTime, long stopTime,
+ long echoInterval, @Nullable String mediaFileType, @NonNull Bundle metadata) {
mId = id;
mRequestType = requestType;
mFileDescriptor = fileDescriptor;
@@ -75,8 +85,12 @@
private AdRequest(Parcel source) {
mId = source.readInt();
- mRequestType = source.readString();
- mFileDescriptor = source.readFileDescriptor();
+ mRequestType = source.readInt();
+ if (source.readInt() != 0) {
+ mFileDescriptor = ParcelFileDescriptor.CREATOR.createFromParcel(source);
+ } else {
+ mFileDescriptor = null;
+ }
mStartTime = source.readLong();
mStopTime = source.readLong();
mEchoInterval = source.readLong();
@@ -84,34 +98,77 @@
mMetadata = source.readBundle();
}
+ /**
+ * Gets the ID of AD request.
+ */
public int getId() {
return mId;
}
- public @RequestType String getRequestType() {
+ /**
+ * Gets the request type.
+ */
+ @RequestType
+ public int getRequestType() {
return mRequestType;
}
+ /**
+ * Gets the file descriptor of the AD media.
+ *
+ * @return The file descriptor of the AD media. Can be {@code null} for
+ * {@link #REQUEST_TYPE_STOP}
+ */
+ @Nullable
public ParcelFileDescriptor getFileDescriptor() {
return mFileDescriptor;
}
- public long getStartTime() {
+ /**
+ * Gets the start time of the AD media in milliseconds.
+ * <p>0 means start immediately
+ */
+ public long getStartTimeMillis() {
return mStartTime;
}
- public long getStopTime() {
+ /**
+ * Gets the stop time of the AD media in milliseconds.
+ * <p>-1 means until the end
+ */
+ public long getStopTimeMillis() {
return mStopTime;
}
- public long getEchoInterval() {
+ /**
+ * Gets the echo interval in milliseconds.
+ * <p>The interval TV input needs to echo and inform TV interactive app service the video
+ * playback elapsed time.
+ *
+ * @see android.media.tv.AdResponse
+ */
+ public long getEchoIntervalMillis() {
return mEchoInterval;
}
+ /**
+ * Gets the media file type such as mp4, mob, avi.
+ *
+ * @return The media file type. Can be {@code null} for {@link #REQUEST_TYPE_STOP}.
+ */
+ @Nullable
public String getMediaFileType() {
return mMediaFileType;
}
+ /**
+ * Gets the metadata of the media file.
+ * <p>This includes additional information the TV input needs to play the AD media.
+ *
+ * @return The metadata of the media file. Can be an empty bundle for
+ * {@link #REQUEST_TYPE_STOP}.
+ */
+ @NonNull
public Bundle getMetadata() {
return mMetadata;
}
@@ -124,8 +181,13 @@
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeInt(mId);
- dest.writeString(mRequestType);
- mFileDescriptor.writeToParcel(dest, flags);
+ dest.writeInt(mRequestType);
+ if (mFileDescriptor != null) {
+ dest.writeInt(1);
+ mFileDescriptor.writeToParcel(dest, flags);
+ } else {
+ dest.writeInt(0);
+ }
dest.writeLong(mStartTime);
dest.writeLong(mStopTime);
dest.writeLong(mEchoInterval);
diff --git a/media/java/android/media/tv/AdResponse.java b/media/java/android/media/tv/AdResponse.java
index 28cf5ac..0c20954 100644
--- a/media/java/android/media/tv/AdResponse.java
+++ b/media/java/android/media/tv/AdResponse.java
@@ -16,19 +16,21 @@
package android.media.tv;
+import android.annotation.IntDef;
import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.StringDef;
import android.os.Parcel;
import android.os.Parcelable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-/** @hide */
+/**
+ * An advertisement request which can be sent to TV interactive App service to inform AD status.
+ */
public final class AdResponse implements Parcelable {
+ /** @hide */
@Retention(RetentionPolicy.SOURCE)
- @StringDef(prefix = "RESPONSE_TYPE_", value = {
+ @IntDef(prefix = "RESPONSE_TYPE_", value = {
RESPONSE_TYPE_PLAYING,
RESPONSE_TYPE_FINISHED,
RESPONSE_TYPE_STOPPED,
@@ -36,10 +38,10 @@
})
public @interface ResponseType {}
- public static final String RESPONSE_TYPE_PLAYING = "PLAYING";
- public static final String RESPONSE_TYPE_FINISHED = "FINISHED";
- public static final String RESPONSE_TYPE_STOPPED = "STOPPED";
- public static final String RESPONSE_TYPE_ERROR = "ERROR";
+ public static final int RESPONSE_TYPE_PLAYING = 1;
+ public static final int RESPONSE_TYPE_FINISHED = 2;
+ public static final int RESPONSE_TYPE_STOPPED = 3;
+ public static final int RESPONSE_TYPE_ERROR = 4;
public static final @NonNull Parcelable.Creator<AdResponse> CREATOR =
new Parcelable.Creator<AdResponse>() {
@@ -55,10 +57,10 @@
};
private final int mId;
- private final @ResponseType String mResponseType;
- private final Long mElapsedTime;
+ private final @ResponseType int mResponseType;
+ private final long mElapsedTime;
- public AdResponse(int id, @ResponseType String responseType, @Nullable Long elapsedTime) {
+ public AdResponse(int id, @ResponseType int responseType, long elapsedTime) {
mId = id;
mResponseType = responseType;
mElapsedTime = elapsedTime;
@@ -66,19 +68,31 @@
private AdResponse(Parcel source) {
mId = source.readInt();
- mResponseType = source.readString();
- mElapsedTime = (Long) source.readValue(Long.class.getClassLoader());
+ mResponseType = source.readInt();
+ mElapsedTime = source.readLong();
}
+ /**
+ * Gets the ID of AD response.
+ */
public int getId() {
return mId;
}
- public @ResponseType String getResponseType() {
+ /**
+ * Gets the response type.
+ */
+ @ResponseType
+ public int getResponseType() {
return mResponseType;
}
- public Long getElapsedTime() {
+ /**
+ * Gets the playback elapsed time in milliseconds.
+ *
+ * @return The playback elapsed time. -1 if no valid elapsed time.
+ */
+ public long getElapsedTimeMillis() {
return mElapsedTime;
}
@@ -90,7 +104,7 @@
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeInt(mId);
- dest.writeString(mResponseType);
- dest.writeValue(mElapsedTime);
+ dest.writeInt(mResponseType);
+ dest.writeLong(mElapsedTime);
}
}
diff --git a/media/java/android/media/tv/BroadcastInfoRequest.java b/media/java/android/media/tv/BroadcastInfoRequest.java
index 6ba9133..f7a52f2 100644
--- a/media/java/android/media/tv/BroadcastInfoRequest.java
+++ b/media/java/android/media/tv/BroadcastInfoRequest.java
@@ -18,19 +18,34 @@
import android.annotation.IntDef;
import android.annotation.NonNull;
+import android.annotation.SuppressLint;
import android.os.Parcel;
import android.os.Parcelable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-/** @hide */
+/**
+ * A request for the information retrieved from broadcast signal.
+ */
+@SuppressLint("ParcelNotFinal")
public abstract class BroadcastInfoRequest implements Parcelable {
+ /** @hide */
@Retention(RetentionPolicy.SOURCE)
@IntDef({REQUEST_OPTION_REPEAT, REQUEST_OPTION_AUTO_UPDATE})
public @interface RequestOption {}
+ /**
+ * Request option: repeat.
+ * <p>With this option, a response is sent when related broadcast information is detected,
+ * even if the same information has been sent previously.
+ */
public static final int REQUEST_OPTION_REPEAT = 0;
+ /**
+ * Request option: auto update.
+ * <p>With this option, a response is sent only when broadcast information is detected for the
+ * first time, new values are detected.
+ */
public static final int REQUEST_OPTION_AUTO_UPDATE = 1;
public static final @NonNull Parcelable.Creator<BroadcastInfoRequest> CREATOR =
@@ -66,32 +81,54 @@
}
};
- protected final @TvInputManager.BroadcastInfoType int mType;
- protected final int mRequestId;
- protected final @RequestOption int mOption;
+ private final @TvInputManager.BroadcastInfoType int mType;
+ private final int mRequestId;
+ private final @RequestOption int mOption;
- protected BroadcastInfoRequest(@TvInputManager.BroadcastInfoType int type,
+ BroadcastInfoRequest(@TvInputManager.BroadcastInfoType int type,
int requestId, @RequestOption int option) {
mType = type;
mRequestId = requestId;
mOption = option;
}
- protected BroadcastInfoRequest(@TvInputManager.BroadcastInfoType int type, Parcel source) {
+ BroadcastInfoRequest(@TvInputManager.BroadcastInfoType int type, Parcel source) {
mType = type;
mRequestId = source.readInt();
mOption = source.readInt();
}
- public @TvInputManager.BroadcastInfoType int getType() {
+ /**
+ * Gets the broadcast info type.
+ *
+ * <p>The type indicates what broadcast information is requested, such as broadcast table,
+ * PES (packetized Elementary Stream), TS (transport stream), etc. The type of the
+ * request and the related responses should be the same.
+ */
+ @TvInputManager.BroadcastInfoType
+ public int getType() {
return mType;
}
+ /**
+ * Gets the ID of the request.
+ *
+ * <p>The ID is used to associate the response with the request.
+ *
+ * @see android.media.tv.BroadcastInfoResponse#getRequestId()
+ */
public int getRequestId() {
return mRequestId;
}
- public @RequestOption int getOption() {
+ /**
+ * Gets the request option of the request.
+ *
+ * @see #REQUEST_OPTION_REPEAT
+ * @see #REQUEST_OPTION_AUTO_UPDATE
+ */
+ @RequestOption
+ public int getOption() {
return mOption;
}
diff --git a/media/java/android/media/tv/BroadcastInfoResponse.java b/media/java/android/media/tv/BroadcastInfoResponse.java
index 67bdedc..ff4ec15 100644
--- a/media/java/android/media/tv/BroadcastInfoResponse.java
+++ b/media/java/android/media/tv/BroadcastInfoResponse.java
@@ -18,20 +18,35 @@
import android.annotation.IntDef;
import android.annotation.NonNull;
+import android.annotation.SuppressLint;
import android.os.Parcel;
import android.os.Parcelable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-/** @hide */
+/**
+ * A response of {@link BroadcastInfoRequest} for information retrieved from broadcast signal.
+ */
+@SuppressLint("ParcelNotFinal")
public abstract class BroadcastInfoResponse implements Parcelable {
+ /** @hide */
@Retention(RetentionPolicy.SOURCE)
@IntDef({RESPONSE_RESULT_ERROR, RESPONSE_RESULT_OK, RESPONSE_RESULT_CANCEL})
public @interface ResponseResult {}
+ /**
+ * Response result: error. This means the request can not be set up successfully.
+ */
public static final int RESPONSE_RESULT_ERROR = 1;
+ /**
+ * Response result: OK. This means the request is set up successfully and the related responses
+ * are normal responses.
+ */
public static final int RESPONSE_RESULT_OK = 2;
+ /**
+ * Response result: cancel. This means the request has been cancelled.
+ */
public static final int RESPONSE_RESULT_CANCEL = 3;
public static final @NonNull Parcelable.Creator<BroadcastInfoResponse> CREATOR =
@@ -67,12 +82,12 @@
}
};
- protected final @TvInputManager.BroadcastInfoType int mType;
- protected final int mRequestId;
- protected final int mSequence;
- protected final @ResponseResult int mResponseResult;
+ private final @TvInputManager.BroadcastInfoType int mType;
+ private final int mRequestId;
+ private final int mSequence;
+ private final @ResponseResult int mResponseResult;
- protected BroadcastInfoResponse(@TvInputManager.BroadcastInfoType int type, int requestId,
+ BroadcastInfoResponse(@TvInputManager.BroadcastInfoType int type, int requestId,
int sequence, @ResponseResult int responseResult) {
mType = type;
mRequestId = requestId;
@@ -80,26 +95,52 @@
mResponseResult = responseResult;
}
- protected BroadcastInfoResponse(@TvInputManager.BroadcastInfoType int type, Parcel source) {
+ BroadcastInfoResponse(@TvInputManager.BroadcastInfoType int type, Parcel source) {
mType = type;
mRequestId = source.readInt();
mSequence = source.readInt();
mResponseResult = source.readInt();
}
- public @TvInputManager.BroadcastInfoType int getType() {
+ /**
+ * Gets the broadcast info type.
+ *
+ * <p>The type indicates what broadcast information is requested, such as broadcast table,
+ * PES (packetized Elementary Stream), TS (transport stream), etc. The type of the
+ * request and the related responses should be the same.
+ */
+ @TvInputManager.BroadcastInfoType
+ public int getType() {
return mType;
}
+ /**
+ * Gets the ID of the request.
+ *
+ * <p>The ID is used to associate the response with the request.
+ *
+ * @see android.media.tv.BroadcastInfoRequest#getRequestId()
+ */
public int getRequestId() {
return mRequestId;
}
+ /**
+ * Gets the sequence number which indicates the order of related responses.
+ */
public int getSequence() {
return mSequence;
}
- public @ResponseResult int getResponseResult() {
+ /**
+ * Gets the result for the response.
+ *
+ * @see #RESPONSE_RESULT_OK
+ * @see #RESPONSE_RESULT_ERROR
+ * @see #RESPONSE_RESULT_CANCEL
+ */
+ @ResponseResult
+ public int getResponseResult() {
return mResponseResult;
}
diff --git a/media/java/android/media/tv/CommandRequest.java b/media/java/android/media/tv/CommandRequest.java
index d61c858..ffb6e07 100644
--- a/media/java/android/media/tv/CommandRequest.java
+++ b/media/java/android/media/tv/CommandRequest.java
@@ -20,9 +20,11 @@
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A request for command from broadcast signal.
+ */
public final class CommandRequest extends BroadcastInfoRequest implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int requestType =
+ private static final @TvInputManager.BroadcastInfoType int REQUEST_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_COMMAND;
public static final @NonNull Parcelable.Creator<CommandRequest> CREATOR =
@@ -43,38 +45,56 @@
private final String mName;
private final String mArguments;
- public static CommandRequest createFromParcelBody(Parcel in) {
+ static CommandRequest createFromParcelBody(Parcel in) {
return new CommandRequest(in);
}
- public CommandRequest(int requestId, @RequestOption int option, String nameSpace,
- String name, String arguments) {
- super(requestType, requestId, option);
+ public CommandRequest(int requestId, @RequestOption int option, @NonNull String nameSpace,
+ @NonNull String name, @NonNull String arguments) {
+ super(REQUEST_TYPE, requestId, option);
mNameSpace = nameSpace;
mName = name;
mArguments = arguments;
}
- protected CommandRequest(Parcel source) {
- super(requestType, source);
+ CommandRequest(Parcel source) {
+ super(REQUEST_TYPE, source);
mNameSpace = source.readString();
mName = source.readString();
mArguments = source.readString();
}
+ /**
+ * Gets the namespace of the command.
+ */
+ @NonNull
public String getNameSpace() {
return mNameSpace;
}
+ /**
+ * Gets the name of the command.
+ */
+ @NonNull
public String getName() {
return mName;
}
+ /**
+ * Gets the arguments of the command.
+ * It could be serialized from some formats, such as JSON, XML, etc.
+ */
+ @NonNull
public String getArguments() {
return mArguments;
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeString(mNameSpace);
diff --git a/media/java/android/media/tv/CommandResponse.java b/media/java/android/media/tv/CommandResponse.java
index af3d00c..c8853f1 100644
--- a/media/java/android/media/tv/CommandResponse.java
+++ b/media/java/android/media/tv/CommandResponse.java
@@ -17,12 +17,15 @@
package android.media.tv;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A response for command from broadcast signal.
+ */
public final class CommandResponse extends BroadcastInfoResponse implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int responseType =
+ private static final @TvInputManager.BroadcastInfoType int RESPONSE_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_COMMAND;
public static final @NonNull Parcelable.Creator<CommandResponse> CREATOR =
@@ -41,26 +44,36 @@
private final String mResponse;
- public static CommandResponse createFromParcelBody(Parcel in) {
+ static CommandResponse createFromParcelBody(Parcel in) {
return new CommandResponse(in);
}
public CommandResponse(int requestId, int sequence,
- @ResponseResult int responseResult, String response) {
- super(responseType, requestId, sequence, responseResult);
+ @ResponseResult int responseResult, @Nullable String response) {
+ super(RESPONSE_TYPE, requestId, sequence, responseResult);
mResponse = response;
}
- protected CommandResponse(Parcel source) {
- super(responseType, source);
+ CommandResponse(Parcel source) {
+ super(RESPONSE_TYPE, source);
mResponse = source.readString();
}
+ /**
+ * Gets the response of the command.
+ * It could be serialized from some formats, such as JSON, XML, etc.
+ */
+ @Nullable
public String getResponse() {
return mResponse;
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeString(mResponse);
diff --git a/media/java/android/media/tv/DsmccRequest.java b/media/java/android/media/tv/DsmccRequest.java
index 6bb1472..0425939 100644
--- a/media/java/android/media/tv/DsmccRequest.java
+++ b/media/java/android/media/tv/DsmccRequest.java
@@ -21,9 +21,11 @@
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A request for DSM-CC from broadcast signal.
+ */
public final class DsmccRequest extends BroadcastInfoRequest implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int requestType =
+ private static final @TvInputManager.BroadcastInfoType int REQUEST_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_DSMCC;
public static final @NonNull Parcelable.Creator<DsmccRequest> CREATOR =
@@ -42,26 +44,35 @@
private final Uri mUri;
- public static DsmccRequest createFromParcelBody(Parcel in) {
+ static DsmccRequest createFromParcelBody(Parcel in) {
return new DsmccRequest(in);
}
- public DsmccRequest(int requestId, @RequestOption int option, Uri uri) {
- super(requestType, requestId, option);
+ public DsmccRequest(int requestId, @RequestOption int option, @NonNull Uri uri) {
+ super(REQUEST_TYPE, requestId, option);
mUri = uri;
}
- protected DsmccRequest(Parcel source) {
- super(requestType, source);
+ DsmccRequest(Parcel source) {
+ super(REQUEST_TYPE, source);
String uriString = source.readString();
mUri = uriString == null ? null : Uri.parse(uriString);
}
+ /**
+ * Gets the URI for DSM-CC object.
+ */
+ @NonNull
public Uri getUri() {
return mUri;
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
String uriString = mUri == null ? null : mUri.toString();
diff --git a/media/java/android/media/tv/DsmccResponse.java b/media/java/android/media/tv/DsmccResponse.java
index 3ca63e3..e14e8791 100644
--- a/media/java/android/media/tv/DsmccResponse.java
+++ b/media/java/android/media/tv/DsmccResponse.java
@@ -17,6 +17,7 @@
package android.media.tv;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.StringDef;
import android.os.Parcel;
import android.os.ParcelFileDescriptor;
@@ -27,9 +28,11 @@
import java.util.ArrayList;
import java.util.List;
-/** @hide */
+/**
+ * A response for DSM-CC from broadcast signal.
+ */
public final class DsmccResponse extends BroadcastInfoResponse implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int responseType =
+ private static final @TvInputManager.BroadcastInfoType int RESPONSE_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_DSMCC;
/** @hide */
@@ -73,7 +76,7 @@
private final int[] mEventIds;
private final String[] mEventNames;
- public static DsmccResponse createFromParcelBody(Parcel in) {
+ static DsmccResponse createFromParcelBody(Parcel in) {
return new DsmccResponse(in);
}
@@ -81,8 +84,8 @@
* Constructs a BIOP file message response.
*/
public DsmccResponse(int requestId, int sequence, @ResponseResult int responseResult,
- @NonNull ParcelFileDescriptor file) {
- super(responseType, requestId, sequence, responseResult);
+ @Nullable ParcelFileDescriptor file) {
+ super(RESPONSE_TYPE, requestId, sequence, responseResult);
mBiopMessageType = BIOP_MESSAGE_TYPE_FILE;
mFileDescriptor = file;
mChildList = null;
@@ -94,8 +97,8 @@
* Constructs a BIOP service gateway or directory message response.
*/
public DsmccResponse(int requestId, int sequence, @ResponseResult int responseResult,
- boolean isServiceGateway, @NonNull List<String> childList) {
- super(responseType, requestId, sequence, responseResult);
+ boolean isServiceGateway, @Nullable List<String> childList) {
+ super(RESPONSE_TYPE, requestId, sequence, responseResult);
if (isServiceGateway) {
mBiopMessageType = BIOP_MESSAGE_TYPE_SERVICE_GATEWAY;
} else {
@@ -114,8 +117,8 @@
* stream event message type.
*/
public DsmccResponse(int requestId, int sequence, @ResponseResult int responseResult,
- @NonNull int[] eventIds, @NonNull String[] eventNames) {
- super(responseType, requestId, sequence, responseResult);
+ @Nullable int[] eventIds, @Nullable String[] eventNames) {
+ super(RESPONSE_TYPE, requestId, sequence, responseResult);
mBiopMessageType = BIOP_MESSAGE_TYPE_STREAM;
mFileDescriptor = null;
mChildList = null;
@@ -127,7 +130,7 @@
}
private DsmccResponse(@NonNull Parcel source) {
- super(responseType, source);
+ super(RESPONSE_TYPE, source);
mBiopMessageType = source.readString();
switch (mBiopMessageType) {
@@ -164,13 +167,17 @@
}
}
- /** Returns the BIOP message type */
+ /**
+ * Returns the BIOP message type.
+ */
@NonNull
public @BiopMessageType String getBiopMessageType() {
return mBiopMessageType;
}
- /** Returns the file descriptor for a given file message response */
+ /**
+ * Returns the file descriptor for a given file message response.
+ */
@NonNull
public ParcelFileDescriptor getFile() {
if (!mBiopMessageType.equals(BIOP_MESSAGE_TYPE_FILE)) {
@@ -192,7 +199,9 @@
return new ArrayList<String>(mChildList);
}
- /** Returns all event IDs carried in a given stream message response. */
+ /**
+ * Returns all event IDs carried in a given stream message response.
+ */
@NonNull
public int[] getStreamEventIds() {
if (!mBiopMessageType.equals(BIOP_MESSAGE_TYPE_STREAM)) {
@@ -201,7 +210,9 @@
return mEventIds;
}
- /** Returns all event names carried in a given stream message response */
+ /**
+ * Returns all event names carried in a given stream message response.
+ */
@NonNull
public String[] getStreamEventNames() {
if (!mBiopMessageType.equals(BIOP_MESSAGE_TYPE_STREAM)) {
@@ -211,6 +222,11 @@
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeString(mBiopMessageType);
diff --git a/media/java/android/media/tv/PesRequest.java b/media/java/android/media/tv/PesRequest.java
index 7dedb65..bacfaa3 100644
--- a/media/java/android/media/tv/PesRequest.java
+++ b/media/java/android/media/tv/PesRequest.java
@@ -20,9 +20,11 @@
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A request for PES from broadcast signal.
+ */
public final class PesRequest extends BroadcastInfoRequest implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int requestType =
+ private static final @TvInputManager.BroadcastInfoType int REQUEST_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_PES;
public static final @NonNull Parcelable.Creator<PesRequest> CREATOR =
@@ -42,31 +44,42 @@
private final int mTsPid;
private final int mStreamId;
- public static PesRequest createFromParcelBody(Parcel in) {
+ static PesRequest createFromParcelBody(Parcel in) {
return new PesRequest(in);
}
public PesRequest(int requestId, @RequestOption int option, int tsPid, int streamId) {
- super(requestType, requestId, option);
+ super(REQUEST_TYPE, requestId, option);
mTsPid = tsPid;
mStreamId = streamId;
}
- protected PesRequest(Parcel source) {
- super(requestType, source);
+ PesRequest(Parcel source) {
+ super(REQUEST_TYPE, source);
mTsPid = source.readInt();
mStreamId = source.readInt();
}
+ /**
+ * Gets the packet identifier (PID) of the TS (transport stream).
+ */
public int getTsPid() {
return mTsPid;
}
+ /**
+ * Gets the StreamID of requested PES.
+ */
public int getStreamId() {
return mStreamId;
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeInt(mTsPid);
diff --git a/media/java/android/media/tv/PesResponse.java b/media/java/android/media/tv/PesResponse.java
index a657f91..9f420b1 100644
--- a/media/java/android/media/tv/PesResponse.java
+++ b/media/java/android/media/tv/PesResponse.java
@@ -17,12 +17,15 @@
package android.media.tv;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A response for PES from broadcast signal.
+ */
public final class PesResponse extends BroadcastInfoResponse implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int responseType =
+ private static final @TvInputManager.BroadcastInfoType int RESPONSE_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_PES;
public static final @NonNull Parcelable.Creator<PesResponse> CREATOR =
@@ -41,26 +44,35 @@
private final String mSharedFilterToken;
- public static PesResponse createFromParcelBody(Parcel in) {
+ static PesResponse createFromParcelBody(Parcel in) {
return new PesResponse(in);
}
public PesResponse(int requestId, int sequence, @ResponseResult int responseResult,
- String sharedFilterToken) {
- super(responseType, requestId, sequence, responseResult);
+ @Nullable String sharedFilterToken) {
+ super(RESPONSE_TYPE, requestId, sequence, responseResult);
mSharedFilterToken = sharedFilterToken;
}
- protected PesResponse(Parcel source) {
- super(responseType, source);
+ PesResponse(Parcel source) {
+ super(RESPONSE_TYPE, source);
mSharedFilterToken = source.readString();
}
+ /**
+ * Gets the token for a shared filter from Tv Input Service.
+ */
+ @Nullable
public String getSharedFilterToken() {
return mSharedFilterToken;
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeString(mSharedFilterToken);
diff --git a/media/java/android/media/tv/SectionRequest.java b/media/java/android/media/tv/SectionRequest.java
index 533c509..5957528 100644
--- a/media/java/android/media/tv/SectionRequest.java
+++ b/media/java/android/media/tv/SectionRequest.java
@@ -20,9 +20,11 @@
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A request for Section from broadcast signal.
+ */
public final class SectionRequest extends BroadcastInfoRequest implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int requestType =
+ private static final @TvInputManager.BroadcastInfoType int REQUEST_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_SECTION;
public static final @NonNull Parcelable.Creator<SectionRequest> CREATOR =
@@ -41,44 +43,58 @@
private final int mTsPid;
private final int mTableId;
- private final Integer mVersion;
+ private final int mVersion;
- public static SectionRequest createFromParcelBody(Parcel in) {
+ static SectionRequest createFromParcelBody(Parcel in) {
return new SectionRequest(in);
}
public SectionRequest(int requestId, @RequestOption int option, int tsPid, int tableId,
- Integer version) {
- super(requestType, requestId, option);
+ int version) {
+ super(REQUEST_TYPE, requestId, option);
mTsPid = tsPid;
mTableId = tableId;
mVersion = version;
}
- protected SectionRequest(Parcel source) {
- super(requestType, source);
+ SectionRequest(Parcel source) {
+ super(REQUEST_TYPE, source);
mTsPid = source.readInt();
mTableId = source.readInt();
- mVersion = (Integer) source.readValue(Integer.class.getClassLoader());
+ mVersion = source.readInt();
}
+ /**
+ * Gets the packet identifier (PID) of the TS (transport stream).
+ */
public int getTsPid() {
return mTsPid;
}
+ /**
+ * Gets the ID of the requested table.
+ */
public int getTableId() {
return mTableId;
}
- public Integer getVersion() {
+ /**
+ * Gets the version number of requested session. If it is null, value will be -1.
+ */
+ public int getVersion() {
return mVersion;
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeInt(mTsPid);
dest.writeInt(mTableId);
- dest.writeValue(mVersion);
+ dest.writeInt(mVersion);
}
}
diff --git a/media/java/android/media/tv/SectionResponse.java b/media/java/android/media/tv/SectionResponse.java
index d3fa3c0..35836be 100644
--- a/media/java/android/media/tv/SectionResponse.java
+++ b/media/java/android/media/tv/SectionResponse.java
@@ -17,13 +17,16 @@
package android.media.tv;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A response for Section from broadcast signal.
+ */
public final class SectionResponse extends BroadcastInfoResponse implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int responseType =
+ private static final @TvInputManager.BroadcastInfoType int RESPONSE_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_SECTION;
public static final @NonNull Parcelable.Creator<SectionResponse> CREATOR =
@@ -44,38 +47,53 @@
private final int mVersion;
private final Bundle mSessionData;
- public static SectionResponse createFromParcelBody(Parcel in) {
+ static SectionResponse createFromParcelBody(Parcel in) {
return new SectionResponse(in);
}
public SectionResponse(int requestId, int sequence, @ResponseResult int responseResult,
- int sessionId, int version, Bundle sessionData) {
- super(responseType, requestId, sequence, responseResult);
+ int sessionId, int version, @Nullable Bundle sessionData) {
+ super(RESPONSE_TYPE, requestId, sequence, responseResult);
mSessionId = sessionId;
mVersion = version;
mSessionData = sessionData;
}
- protected SectionResponse(Parcel source) {
- super(responseType, source);
+ SectionResponse(Parcel source) {
+ super(RESPONSE_TYPE, source);
mSessionId = source.readInt();
mVersion = source.readInt();
mSessionData = source.readBundle();
}
+ /**
+ * Gets the Session Id of requested session.
+ */
public int getSessionId() {
return mSessionId;
}
+ /**
+ * Gets the Version number of requested session.
+ */
public int getVersion() {
return mVersion;
}
+ /**
+ * Gets the raw data of session.
+ */
+ @NonNull
public Bundle getSessionData() {
return mSessionData;
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeInt(mSessionId);
diff --git a/media/java/android/media/tv/StreamEventRequest.java b/media/java/android/media/tv/StreamEventRequest.java
index 84a5bee..8a46128 100644
--- a/media/java/android/media/tv/StreamEventRequest.java
+++ b/media/java/android/media/tv/StreamEventRequest.java
@@ -21,9 +21,11 @@
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A request for Stream Event from broadcast signal.
+ */
public final class StreamEventRequest extends BroadcastInfoRequest implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int requestType =
+ private static final @TvInputManager.BroadcastInfoType int REQUEST_TYPE =
TvInputManager.BROADCAST_INFO_STREAM_EVENT;
public static final @NonNull Parcelable.Creator<StreamEventRequest> CREATOR =
@@ -43,33 +45,46 @@
private final Uri mTargetUri;
private final String mEventName;
- public static StreamEventRequest createFromParcelBody(Parcel in) {
+ static StreamEventRequest createFromParcelBody(Parcel in) {
return new StreamEventRequest(in);
}
- public StreamEventRequest(int requestId, @RequestOption int option, Uri targetUri,
- String eventName) {
- super(requestType, requestId, option);
+ public StreamEventRequest(int requestId, @RequestOption int option, @NonNull Uri targetUri,
+ @NonNull String eventName) {
+ super(REQUEST_TYPE, requestId, option);
this.mTargetUri = targetUri;
this.mEventName = eventName;
}
- protected StreamEventRequest(Parcel source) {
- super(requestType, source);
+ StreamEventRequest(Parcel source) {
+ super(REQUEST_TYPE, source);
String uriString = source.readString();
mTargetUri = uriString == null ? null : Uri.parse(uriString);
mEventName = source.readString();
}
+ /**
+ * Gets the URI for the DSM-CC Object or the event description file describing the event.
+ */
+ @NonNull
public Uri getTargetUri() {
return mTargetUri;
}
+ /**
+ * Gets the name of the event.
+ */
+ @NonNull
public String getEventName() {
return mEventName;
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
String uriString = mTargetUri == null ? null : mTargetUri.toString();
diff --git a/media/java/android/media/tv/StreamEventResponse.java b/media/java/android/media/tv/StreamEventResponse.java
index 903fab5c2..f952ce9 100644
--- a/media/java/android/media/tv/StreamEventResponse.java
+++ b/media/java/android/media/tv/StreamEventResponse.java
@@ -17,12 +17,15 @@
package android.media.tv;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A response for Stream Event from broadcast signal.
+ */
public final class StreamEventResponse extends BroadcastInfoResponse implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int responseType =
+ private static final @TvInputManager.BroadcastInfoType int RESPONSE_TYPE =
TvInputManager.BROADCAST_INFO_STREAM_EVENT;
public static final @NonNull Parcelable.Creator<StreamEventResponse> CREATOR =
@@ -43,20 +46,20 @@
private final long mNpt;
private final byte[] mData;
- public static StreamEventResponse createFromParcelBody(Parcel in) {
+ static StreamEventResponse createFromParcelBody(Parcel in) {
return new StreamEventResponse(in);
}
public StreamEventResponse(int requestId, int sequence, @ResponseResult int responseResult,
- int eventId, long npt, @NonNull byte[] data) {
- super(responseType, requestId, sequence, responseResult);
+ int eventId, long npt, @Nullable byte[] data) {
+ super(RESPONSE_TYPE, requestId, sequence, responseResult);
mEventId = eventId;
mNpt = npt;
mData = data;
}
private StreamEventResponse(@NonNull Parcel source) {
- super(responseType, source);
+ super(RESPONSE_TYPE, source);
mEventId = source.readInt();
mNpt = source.readLong();
int dataLength = source.readInt();
@@ -64,23 +67,34 @@
source.readByteArray(mData);
}
- /** Returns the event ID */
+ /**
+ * Returns the event ID.
+ */
public int getEventId() {
return mEventId;
}
- /** Returns the NPT(Normal Play Time) value when the event occurred or will occur */
+ /**
+ * Returns the NPT(Normal Play Time) value when the event occurred or will occur.
+ */
public long getNpt() {
return mNpt;
}
- /** Returns the application specific data */
- @NonNull
+ /**
+ * Returns the application specific data.
+ */
+ @Nullable
public byte[] getData() {
return mData;
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeInt(mEventId);
diff --git a/media/java/android/media/tv/TableRequest.java b/media/java/android/media/tv/TableRequest.java
index 389536d..37df4ea 100644
--- a/media/java/android/media/tv/TableRequest.java
+++ b/media/java/android/media/tv/TableRequest.java
@@ -24,11 +24,14 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-/** @hide */
+/**
+ * A request for Table from broadcast signal.
+ */
public final class TableRequest extends BroadcastInfoRequest implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int requestType =
+ private static final @TvInputManager.BroadcastInfoType int REQUEST_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_TABLE;
+ /** @hide */
@Retention(RetentionPolicy.SOURCE)
@IntDef({TABLE_NAME_PAT, TABLE_NAME_PMT})
public @interface TableName {}
@@ -54,38 +57,52 @@
private final @TableName int mTableName;
private final int mVersion;
- public static TableRequest createFromParcelBody(Parcel in) {
+ static TableRequest createFromParcelBody(Parcel in) {
return new TableRequest(in);
}
public TableRequest(int requestId, @RequestOption int option, int tableId,
@TableName int tableName, int version) {
- super(requestType, requestId, option);
+ super(REQUEST_TYPE, requestId, option);
mTableId = tableId;
mTableName = tableName;
mVersion = version;
}
- protected TableRequest(Parcel source) {
- super(requestType, source);
+ TableRequest(Parcel source) {
+ super(REQUEST_TYPE, source);
mTableId = source.readInt();
mTableName = source.readInt();
mVersion = source.readInt();
}
+ /**
+ * Gets the ID of requested table.
+ */
public int getTableId() {
return mTableId;
}
+ /**
+ * Gets the name of requested table.
+ */
public @TableName int getTableName() {
return mTableName;
}
+ /**
+ * Gets the version number of requested table.
+ */
public int getVersion() {
return mVersion;
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeInt(mTableId);
diff --git a/media/java/android/media/tv/TableResponse.java b/media/java/android/media/tv/TableResponse.java
index 68d5f8a..e9f1136 100644
--- a/media/java/android/media/tv/TableResponse.java
+++ b/media/java/android/media/tv/TableResponse.java
@@ -17,13 +17,16 @@
package android.media.tv;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A response for Table from broadcast signal.
+ */
public final class TableResponse extends BroadcastInfoResponse implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int responseType =
+ private static final @TvInputManager.BroadcastInfoType int RESPONSE_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_TABLE;
public static final @NonNull Parcelable.Creator<TableResponse> CREATOR =
@@ -44,39 +47,54 @@
private final int mVersion;
private final int mSize;
- public static TableResponse createFromParcelBody(Parcel in) {
+ static TableResponse createFromParcelBody(Parcel in) {
return new TableResponse(in);
}
public TableResponse(int requestId, int sequence, @ResponseResult int responseResult,
- Uri tableUri, int version, int size) {
- super(responseType, requestId, sequence, responseResult);
+ @Nullable Uri tableUri, int version, int size) {
+ super(RESPONSE_TYPE, requestId, sequence, responseResult);
mTableUri = tableUri;
mVersion = version;
mSize = size;
}
- protected TableResponse(Parcel source) {
- super(responseType, source);
+ TableResponse(Parcel source) {
+ super(RESPONSE_TYPE, source);
String uriString = source.readString();
mTableUri = uriString == null ? null : Uri.parse(uriString);
mVersion = source.readInt();
mSize = source.readInt();
}
+ /**
+ * Gets the URI in TvProvider database.
+ */
+ @Nullable
public Uri getTableUri() {
return mTableUri;
}
+ /**
+ * Gets the Version number of table.
+ */
public int getVersion() {
return mVersion;
}
+ /**
+ * Gets the Size number of table.
+ */
public int getSize() {
return mSize;
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
String uriString = mTableUri == null ? null : mTableUri.toString();
diff --git a/media/java/android/media/tv/TimelineRequest.java b/media/java/android/media/tv/TimelineRequest.java
index 0714972..03c62f0 100644
--- a/media/java/android/media/tv/TimelineRequest.java
+++ b/media/java/android/media/tv/TimelineRequest.java
@@ -20,7 +20,9 @@
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A request for Timeline from broadcast signal.
+ */
public final class TimelineRequest extends BroadcastInfoRequest implements Parcelable {
private static final @TvInputManager.BroadcastInfoType int REQUEST_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_TIMELINE;
@@ -39,24 +41,27 @@
}
};
- private final int mIntervalMs;
+ private final int mIntervalMillis;
static TimelineRequest createFromParcelBody(Parcel in) {
return new TimelineRequest(in);
}
- public TimelineRequest(int requestId, @RequestOption int option, int intervalMs) {
+ public TimelineRequest(int requestId, @RequestOption int option, int intervalMillis) {
super(REQUEST_TYPE, requestId, option);
- mIntervalMs = intervalMs;
+ mIntervalMillis = intervalMillis;
}
- protected TimelineRequest(Parcel source) {
+ TimelineRequest(Parcel source) {
super(REQUEST_TYPE, source);
- mIntervalMs = source.readInt();
+ mIntervalMillis = source.readInt();
}
- public int getIntervalMs() {
- return mIntervalMs;
+ /**
+ * Gets the interval of TIS sending response to TIAS in millisecond.
+ */
+ public int getIntervalMillis() {
+ return mIntervalMillis;
}
@Override
@@ -67,6 +72,6 @@
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
- dest.writeInt(mIntervalMs);
+ dest.writeInt(mIntervalMillis);
}
}
diff --git a/media/java/android/media/tv/TimelineResponse.java b/media/java/android/media/tv/TimelineResponse.java
index fee10b4..fbeb0c4 100644
--- a/media/java/android/media/tv/TimelineResponse.java
+++ b/media/java/android/media/tv/TimelineResponse.java
@@ -17,10 +17,13 @@
package android.media.tv;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A response for Timeline from broadcast signal.
+ */
public final class TimelineResponse extends BroadcastInfoResponse implements Parcelable {
private static final @TvInputManager.BroadcastInfoType int RESPONSE_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_TIMELINE;
@@ -50,7 +53,7 @@
}
public TimelineResponse(int requestId, int sequence,
- @ResponseResult int responseResult, String selector, int unitsPerTick,
+ @ResponseResult int responseResult, @Nullable String selector, int unitsPerTick,
int unitsPerSecond, long wallClock, long ticks) {
super(RESPONSE_TYPE, requestId, sequence, responseResult);
mSelector = selector;
@@ -60,7 +63,7 @@
mTicks = ticks;
}
- protected TimelineResponse(Parcel source) {
+ TimelineResponse(Parcel source) {
super(RESPONSE_TYPE, source);
mSelector = source.readString();
mUnitsPerTick = source.readInt();
@@ -69,22 +72,43 @@
mTicks = source.readLong();
}
+ /**
+ * Gets the Timeline Selector of the response.
+ * The Timeline Selector is a URI that specifies the source of a Timeline
+ * by indicating its type and information needed to locate the signalling
+ * that conveys Time Values on it.
+ */
+ @Nullable
public String getSelector() {
return mSelector;
}
+ /**
+ * Gets the UnitsPerTick of the response.
+ */
public int getUnitsPerTick() {
return mUnitsPerTick;
}
+ /**
+ * Gets the UnitsPerSecond of the response.
+ */
public int getUnitsPerSecond() {
return mUnitsPerSecond;
}
+ /**
+ * Gets the System time (UTC) of the response.
+ */
public long getWallClock() {
return mWallClock;
}
+ /**
+ * Gets the Ticks of the response.
+ * A Time Value is a measure of a moment in time for a particular Timeline.
+ * Time Values are represented by an integer number of ticks (positive or negative).
+ */
public long getTicks() {
return mTicks;
}
diff --git a/media/java/android/media/tv/TsRequest.java b/media/java/android/media/tv/TsRequest.java
index 99350c9..4a1dccb 100644
--- a/media/java/android/media/tv/TsRequest.java
+++ b/media/java/android/media/tv/TsRequest.java
@@ -20,9 +20,11 @@
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A request for TS (transport stream) from broadcast signal.
+ */
public final class TsRequest extends BroadcastInfoRequest implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int requestType =
+ private static final @TvInputManager.BroadcastInfoType int REQUEST_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_TS;
public static final @NonNull Parcelable.Creator<TsRequest> CREATOR =
@@ -41,25 +43,33 @@
private final int mTsPid;
- public static TsRequest createFromParcelBody(Parcel in) {
+ static @NonNull TsRequest createFromParcelBody(@NonNull Parcel in) {
return new TsRequest(in);
}
public TsRequest(int requestId, @RequestOption int option, int tsPid) {
- super(requestType, requestId, option);
+ super(REQUEST_TYPE, requestId, option);
mTsPid = tsPid;
}
- protected TsRequest(Parcel source) {
- super(requestType, source);
+ TsRequest(@NonNull Parcel source) {
+ super(REQUEST_TYPE, source);
mTsPid = source.readInt();
}
+ /**
+ * Gets the packet identifier (PID) of the TS (transport stream).
+ */
public int getTsPid() {
return mTsPid;
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeInt(mTsPid);
diff --git a/media/java/android/media/tv/TsResponse.java b/media/java/android/media/tv/TsResponse.java
index c5ec53a..abcd736 100644
--- a/media/java/android/media/tv/TsResponse.java
+++ b/media/java/android/media/tv/TsResponse.java
@@ -17,12 +17,15 @@
package android.media.tv;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.os.Parcel;
import android.os.Parcelable;
-/** @hide */
+/**
+ * A response for TS (transport stream) from broadcast signal.
+ */
public final class TsResponse extends BroadcastInfoResponse implements Parcelable {
- public static final @TvInputManager.BroadcastInfoType int responseType =
+ private static final @TvInputManager.BroadcastInfoType int RESPONSE_TYPE =
TvInputManager.BROADCAST_INFO_TYPE_TS;
public static final @NonNull Parcelable.Creator<TsResponse> CREATOR =
@@ -41,26 +44,37 @@
private final String mSharedFilterToken;
- public static TsResponse createFromParcelBody(Parcel in) {
+ static TsResponse createFromParcelBody(@NonNull Parcel in) {
return new TsResponse(in);
}
public TsResponse(int requestId, int sequence, @ResponseResult int responseResult,
- String sharedFilterToken) {
- super(responseType, requestId, sequence, responseResult);
+ @Nullable String sharedFilterToken) {
+ super(RESPONSE_TYPE, requestId, sequence, responseResult);
this.mSharedFilterToken = sharedFilterToken;
}
- protected TsResponse(Parcel source) {
- super(responseType, source);
+ TsResponse(Parcel source) {
+ super(RESPONSE_TYPE, source);
mSharedFilterToken = source.readString();
}
+ /**
+ * Gets a token of SharedFilter.
+ *
+ * <p>The token can be used to retrieve the transport stream from the filter.
+ */
+ @Nullable
public String getSharedFilterToken() {
return mSharedFilterToken;
}
@Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
super.writeToParcel(dest, flags);
dest.writeString(mSharedFilterToken);
diff --git a/media/java/android/media/tv/TvInputManager.java b/media/java/android/media/tv/TvInputManager.java
index f438d29..41666c7 100644
--- a/media/java/android/media/tv/TvInputManager.java
+++ b/media/java/android/media/tv/TvInputManager.java
@@ -369,21 +369,13 @@
BROADCAST_INFO_TYPE_COMMAND, BROADCAST_INFO_TYPE_TIMELINE})
public @interface BroadcastInfoType {}
- /** @hide */
public static final int BROADCAST_INFO_TYPE_TS = 1;
- /** @hide */
public static final int BROADCAST_INFO_TYPE_TABLE = 2;
- /** @hide */
public static final int BROADCAST_INFO_TYPE_SECTION = 3;
- /** @hide */
public static final int BROADCAST_INFO_TYPE_PES = 4;
- /** @hide */
public static final int BROADCAST_INFO_STREAM_EVENT = 5;
- /** @hide */
public static final int BROADCAST_INFO_TYPE_DSMCC = 6;
- /** @hide */
public static final int BROADCAST_INFO_TYPE_COMMAND = 7;
- /** @hide */
public static final int BROADCAST_INFO_TYPE_TIMELINE = 8;
/** @hide */
@@ -394,17 +386,14 @@
/**
* Signal lost.
- * @hide
*/
public static final int SIGNAL_STRENGTH_LOST = 1;
/**
* Weak signal.
- * @hide
*/
public static final int SIGNAL_STRENGTH_WEAK = 2;
/**
* Strong signal.
- * @hide
*/
public static final int SIGNAL_STRENGTH_STRONG = 3;
diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java
index 1a9cab0..70acf25 100755
--- a/media/java/android/media/tv/TvInputService.java
+++ b/media/java/android/media/tv/TvInputService.java
@@ -106,9 +106,9 @@
* @hide
*/
@IntDef(prefix = "PRIORITY_HINT_USE_CASE_TYPE_",
- value = {PRIORITY_HINT_USE_CASE_TYPE_BACKGROUND, PRIORITY_HINT_USE_CASE_TYPE_SCAN,
- PRIORITY_HINT_USE_CASE_TYPE_PLAYBACK, PRIORITY_HINT_USE_CASE_TYPE_LIVE,
- PRIORITY_HINT_USE_CASE_TYPE_RECORD})
+ value = {PRIORITY_HINT_USE_CASE_TYPE_BACKGROUND, PRIORITY_HINT_USE_CASE_TYPE_SCAN,
+ PRIORITY_HINT_USE_CASE_TYPE_PLAYBACK, PRIORITY_HINT_USE_CASE_TYPE_LIVE,
+ PRIORITY_HINT_USE_CASE_TYPE_RECORD})
@Retention(RetentionPolicy.SOURCE)
public @interface PriorityHintUseCaseType {}
@@ -872,7 +872,6 @@
* Notifies response for broadcast info.
*
* @param response broadcast info response.
- * @hide
*/
public void notifyBroadcastInfoResponse(@NonNull final BroadcastInfoResponse response) {
executeOrPostRunnableOnMainThread(new Runnable() {
@@ -895,7 +894,7 @@
* Notifies response for advertisement.
*
* @param response advertisement response.
- * @hide
+ * @see android.media.tv.interactive.TvInteractiveAppService.Session#requestAd(AdRequest)
*/
public void notifyAdResponse(@NonNull final AdResponse response) {
executeOrPostRunnableOnMainThread(new Runnable() {
@@ -976,7 +975,6 @@
/**
* Notifies signal strength.
- * @hide
*/
public void notifySignalStrength(@TvInputManager.SignalStrength final int strength) {
executeOrPostRunnableOnMainThread(new Runnable() {
@@ -1112,22 +1110,20 @@
* called when broadcast info is requested.
*
* @param request broadcast info request
- * @hide
*/
public void onRequestBroadcastInfo(@NonNull BroadcastInfoRequest request) {
}
/**
- * @hide
+ * called when broadcast info is removed.
*/
public void onRemoveBroadcastInfo(int requestId) {
}
/**
- * called when advertisement is requested.
+ * Called when advertisement request is received.
*
- * @param request advertisement request
- * @hide
+ * @param request advertisement request received
*/
public void onRequestAd(@NonNull AdRequest request) {
}
@@ -2293,43 +2289,43 @@
private final TvInputManager.SessionCallback mHardwareSessionCallback =
new TvInputManager.SessionCallback() {
- @Override
- public void onSessionCreated(TvInputManager.Session session) {
- mHardwareSession = session;
- SomeArgs args = SomeArgs.obtain();
- if (session != null) {
- args.arg1 = HardwareSession.this;
- args.arg2 = mProxySession;
- args.arg3 = mProxySessionCallback;
- args.arg4 = session.getToken();
- session.tune(TvContract.buildChannelUriForPassthroughInput(
- getHardwareInputId()));
- } else {
- args.arg1 = null;
- args.arg2 = null;
- args.arg3 = mProxySessionCallback;
- args.arg4 = null;
- onRelease();
- }
- mServiceHandler.obtainMessage(ServiceHandler.DO_NOTIFY_SESSION_CREATED, args)
- .sendToTarget();
- }
+ @Override
+ public void onSessionCreated(TvInputManager.Session session) {
+ mHardwareSession = session;
+ SomeArgs args = SomeArgs.obtain();
+ if (session != null) {
+ args.arg1 = HardwareSession.this;
+ args.arg2 = mProxySession;
+ args.arg3 = mProxySessionCallback;
+ args.arg4 = session.getToken();
+ session.tune(TvContract.buildChannelUriForPassthroughInput(
+ getHardwareInputId()));
+ } else {
+ args.arg1 = null;
+ args.arg2 = null;
+ args.arg3 = mProxySessionCallback;
+ args.arg4 = null;
+ onRelease();
+ }
+ mServiceHandler.obtainMessage(ServiceHandler.DO_NOTIFY_SESSION_CREATED,
+ args).sendToTarget();
+ }
- @Override
- public void onVideoAvailable(final TvInputManager.Session session) {
- if (mHardwareSession == session) {
- onHardwareVideoAvailable();
- }
- }
+ @Override
+ public void onVideoAvailable(final TvInputManager.Session session) {
+ if (mHardwareSession == session) {
+ onHardwareVideoAvailable();
+ }
+ }
- @Override
- public void onVideoUnavailable(final TvInputManager.Session session,
- final int reason) {
- if (mHardwareSession == session) {
- onHardwareVideoUnavailable(reason);
- }
- }
- };
+ @Override
+ public void onVideoUnavailable(final TvInputManager.Session session,
+ final int reason) {
+ if (mHardwareSession == session) {
+ onHardwareVideoUnavailable(reason);
+ }
+ }
+ };
/**
* This method will not be called in {@link HardwareSession}. Framework will
diff --git a/media/java/android/media/tv/TvView.java b/media/java/android/media/tv/TvView.java
index 6c25a70..4d63af7 100644
--- a/media/java/android/media/tv/TvView.java
+++ b/media/java/android/media/tv/TvView.java
@@ -1079,21 +1079,20 @@
/**
* This is called when signal strength is updated.
+ *
* @param inputId The ID of the TV input bound to this view.
* @param strength The current signal strength.
- *
- * @hide
*/
- public void onSignalStrength(String inputId, @TvInputManager.SignalStrength int strength) {
+ public void onSignalStrength(
+ @NonNull String inputId, @TvInputManager.SignalStrength int strength) {
}
/**
* This is called when the session has been tuned to the given channel.
*
* @param channelUri The URI of a channel.
- * @hide
*/
- public void onTuned(String inputId, Uri channelUri) {
+ public void onTuned(@NonNull String inputId, @NonNull Uri channelUri) {
}
}
diff --git a/media/java/android/media/tv/interactive/AppLinkInfo.aidl b/media/java/android/media/tv/interactive/AppLinkInfo.aidl
index 7c52d01..6759fc4 100644
--- a/media/java/android/media/tv/interactive/AppLinkInfo.aidl
+++ b/media/java/android/media/tv/interactive/AppLinkInfo.aidl
@@ -16,4 +16,4 @@
package android.media.tv.interactive;
-parcelable AppLinkInfo;
\ No newline at end of file
+parcelable AppLinkInfo;
diff --git a/media/java/android/media/tv/interactive/AppLinkInfo.java b/media/java/android/media/tv/interactive/AppLinkInfo.java
index 5cce443..cd201f7 100644
--- a/media/java/android/media/tv/interactive/AppLinkInfo.java
+++ b/media/java/android/media/tv/interactive/AppLinkInfo.java
@@ -23,7 +23,6 @@
/**
* App link information used by TV interactive app to launch Android apps.
- * @hide
*/
public final class AppLinkInfo implements Parcelable {
private @NonNull String mPackageName;
diff --git a/media/java/android/media/tv/interactive/TvInteractiveAppManager.java b/media/java/android/media/tv/interactive/TvInteractiveAppManager.java
index c5dfaa2..f75aa56 100755
--- a/media/java/android/media/tv/interactive/TvInteractiveAppManager.java
+++ b/media/java/android/media/tv/interactive/TvInteractiveAppManager.java
@@ -28,6 +28,7 @@
import android.media.tv.BroadcastInfoRequest;
import android.media.tv.BroadcastInfoResponse;
import android.media.tv.TvContentRating;
+import android.media.tv.TvInputInfo;
import android.media.tv.TvInputManager;
import android.media.tv.TvTrackInfo;
import android.net.Uri;
@@ -173,18 +174,15 @@
public @interface TeletextAppState {}
/**
- * Show state of Teletext app.
- * @hide
+ * State of Teletext app: show
*/
public static final int TELETEXT_APP_STATE_SHOW = 1;
/**
- * Hide state of Teletext app.
- * @hide
+ * State of Teletext app: hide
*/
public static final int TELETEXT_APP_STATE_HIDE = 2;
/**
- * Error state of Teletext app.
- * @hide
+ * State of Teletext app: error
*/
public static final int TELETEXT_APP_STATE_ERROR = 3;
@@ -192,75 +190,100 @@
* Key for package name in app link.
* <p>Type: String
*
- * @see #registerAppLinkInfo(String, Bundle)
* @see #sendAppLinkCommand(String, Bundle)
- * @hide
*/
- public static final String KEY_PACKAGE_NAME = "package_name";
+ public static final String APP_LINK_KEY_PACKAGE_NAME = "package_name";
/**
* Key for class name in app link.
* <p>Type: String
*
- * @see #registerAppLinkInfo(String, Bundle)
* @see #sendAppLinkCommand(String, Bundle)
- * @hide
*/
- public static final String KEY_CLASS_NAME = "class_name";
-
- /**
- * Key for URI scheme in app link.
- * <p>Type: String
- *
- * @see #registerAppLinkInfo(String, Bundle)
- * @hide
- */
- public static final String KEY_URI_SCHEME = "uri_scheme";
-
- /**
- * Key for URI host in app link.
- * <p>Type: String
- *
- * @see #registerAppLinkInfo(String, Bundle)
- * @hide
- */
- public static final String KEY_URI_HOST = "uri_host";
-
- /**
- * Key for URI prefix in app link.
- * <p>Type: String
- *
- * @see #registerAppLinkInfo(String, Bundle)
- * @hide
- */
- public static final String KEY_URI_PREFIX = "uri_prefix";
+ public static final String APP_LINK_KEY_CLASS_NAME = "class_name";
/**
* Key for command type in app link command.
* <p>Type: String
*
* @see #sendAppLinkCommand(String, Bundle)
- * @hide
*/
- public static final String KEY_COMMAND_TYPE = "command_type";
+ public static final String APP_LINK_KEY_COMMAND_TYPE = "command_type";
/**
* Key for service ID in app link command.
* <p>Type: String
*
* @see #sendAppLinkCommand(String, Bundle)
- * @hide
*/
- public static final String KEY_SERVICE_ID = "service_id";
+ public static final String APP_LINK_KEY_SERVICE_ID = "service_id";
/**
* Key for back URI in app link command.
* <p>Type: String
*
* @see #sendAppLinkCommand(String, Bundle)
- * @hide
*/
- public static final String KEY_BACK_URI = "back_uri";
+ public static final String APP_LINK_KEY_BACK_URI = "back_uri";
+
+ /**
+ * Broadcast intent action to send app command to TV app.
+ *
+ * @see #sendAppLinkCommand(String, Bundle)
+ */
+ public static final String ACTION_APP_LINK_COMMAND =
+ "android.media.tv.interactive.action.APP_LINK_COMMAND";
+
+ /**
+ * Intent key for TV input ID. It's used to send app command to TV app.
+ * <p>Type: String
+ *
+ * @see #sendAppLinkCommand(String, Bundle)
+ * @see #ACTION_APP_LINK_COMMAND
+ */
+ public static final String INTENT_KEY_TV_INPUT_ID = "tv_input_id";
+
+ /**
+ * Intent key for TV interactive app ID. It's used to send app command to TV app.
+ * <p>Type: String
+ *
+ * @see #sendAppLinkCommand(String, Bundle)
+ * @see #ACTION_APP_LINK_COMMAND
+ * @see android.media.tv.interactive.TvInteractiveAppInfo#getId()
+ */
+ public static final String INTENT_KEY_INTERACTIVE_APP_SERVICE_ID = "interactive_app_id";
+
+ /**
+ * Intent key for TV channel URI. It's used to send app command to TV app.
+ * <p>Type: android.net.Uri
+ *
+ * @see #sendAppLinkCommand(String, Bundle)
+ * @see #ACTION_APP_LINK_COMMAND
+ */
+ public static final String INTENT_KEY_CHANNEL_URI = "channel_uri";
+
+ /**
+ * Intent key for broadcast-independent(BI) interactive app type. It's used to send app command
+ * to TV app.
+ * <p>Type: int
+ *
+ * @see #sendAppLinkCommand(String, Bundle)
+ * @see #ACTION_APP_LINK_COMMAND
+ * @see android.media.tv.interactive.TvInteractiveAppInfo#getSupportedTypes()
+ * @see android.media.tv.interactive.TvInteractiveAppView#createBiInteractiveApp(Uri, Bundle)
+ */
+ public static final String INTENT_KEY_BI_INTERACTIVE_APP_TYPE = "bi_interactive_app_type";
+
+ /**
+ * Intent key for broadcast-independent(BI) interactive app URI. It's used to send app command
+ * to TV app.
+ * <p>Type: android.net.Uri
+ *
+ * @see #sendAppLinkCommand(String, Bundle)
+ * @see #ACTION_APP_LINK_COMMAND
+ * @see android.media.tv.interactive.TvInteractiveAppView#createBiInteractiveApp(Uri, Bundle)
+ */
+ public static final String INTENT_KEY_BI_INTERACTIVE_APP_URI = "bi_interactive_app_uri";
private final ITvInteractiveAppManager mService;
private final int mUserId;
@@ -357,7 +380,7 @@
@Override
public void onCommandRequest(
- @TvInteractiveAppService.InteractiveAppServiceCommandType String cmdType,
+ @TvInteractiveAppService.PlaybackCommandType String cmdType,
Bundle parameters,
int seq) {
synchronized (mSessionCallbackRecordMap) {
@@ -558,7 +581,6 @@
* that implements {@link TvInteractiveAppService} interface.
*
* @param iAppServiceId The ID of the TV Interactive App service.
- * @hide
*/
public void onInteractiveAppServiceAdded(@NonNull String iAppServiceId) {
}
@@ -570,7 +592,6 @@
* App service package.
*
* @param iAppServiceId The ID of the TV Interactive App service.
- * @hide
*/
public void onInteractiveAppServiceRemoved(@NonNull String iAppServiceId) {
}
@@ -582,7 +603,6 @@
* re-installed or a newer version of the package exists becomes available/unavailable.
*
* @param iAppServiceId The ID of the TV Interactive App service.
- * @hide
*/
public void onInteractiveAppServiceUpdated(@NonNull String iAppServiceId) {
}
@@ -729,8 +749,7 @@
}
/**
- * Prepares TV Interactive App service for the given type.
- * @hide
+ * Prepares TV Interactive App service environment for the given type.
*/
public void prepare(@NonNull String tvIAppServiceId, int type) {
try {
@@ -742,7 +761,6 @@
/**
* Registers app link info.
- * @hide
*/
public void registerAppLinkInfo(
@NonNull String tvIAppServiceId, @NonNull AppLinkInfo appLinkInfo) {
@@ -755,7 +773,6 @@
/**
* Unregisters app link info.
- * @hide
*/
public void unregisterAppLinkInfo(
@NonNull String tvIAppServiceId, @NonNull AppLinkInfo appLinkInfo) {
@@ -768,9 +785,12 @@
/**
* Sends app link command.
- * @hide
+ *
+ * @param tvIAppServiceId The ID of TV interactive service which the command to be sent to. The
+ * ID can be found in {@link TvInputInfo#getId()}.
+ * @param command The command to be sent.
*/
- public void sendAppLinkCommand(String tvIAppServiceId, Bundle command) {
+ public void sendAppLinkCommand(@NonNull String tvIAppServiceId, @NonNull Bundle command) {
try {
mService.sendAppLinkCommand(tvIAppServiceId, command, mUserId);
} catch (RemoteException e) {
@@ -1560,7 +1580,7 @@
}
void postCommandRequest(
- final @TvInteractiveAppService.InteractiveAppServiceCommandType String cmdType,
+ final @TvInteractiveAppService.PlaybackCommandType String cmdType,
final Bundle parameters) {
mHandler.post(new Runnable() {
@Override
@@ -1708,7 +1728,7 @@
*/
public void onCommandRequest(
Session session,
- @TvInteractiveAppService.InteractiveAppServiceCommandType String cmdType,
+ @TvInteractiveAppService.PlaybackCommandType String cmdType,
Bundle parameters) {
}
diff --git a/media/java/android/media/tv/interactive/TvInteractiveAppService.java b/media/java/android/media/tv/interactive/TvInteractiveAppService.java
index afa1ff7..57730ac 100755
--- a/media/java/android/media/tv/interactive/TvInteractiveAppService.java
+++ b/media/java/android/media/tv/interactive/TvInteractiveAppService.java
@@ -32,6 +32,7 @@
import android.media.tv.BroadcastInfoRequest;
import android.media.tv.BroadcastInfoResponse;
import android.media.tv.TvContentRating;
+import android.media.tv.TvInputInfo;
import android.media.tv.TvInputManager;
import android.media.tv.TvTrackInfo;
import android.media.tv.TvView;
@@ -97,46 +98,82 @@
/** @hide */
@Retention(RetentionPolicy.SOURCE)
- @StringDef(prefix = "INTERACTIVE_APP_SERVICE_COMMAND_TYPE_", value = {
- INTERACTIVE_APP_SERVICE_COMMAND_TYPE_TUNE,
- INTERACTIVE_APP_SERVICE_COMMAND_TYPE_TUNE_NEXT,
- INTERACTIVE_APP_SERVICE_COMMAND_TYPE_TUNE_PREV,
- INTERACTIVE_APP_SERVICE_COMMAND_TYPE_STOP,
- INTERACTIVE_APP_SERVICE_COMMAND_TYPE_SET_STREAM_VOLUME,
- INTERACTIVE_APP_SERVICE_COMMAND_TYPE_SELECT_TRACK
+ @StringDef(prefix = "PLAYBACK_COMMAND_TYPE_", value = {
+ PLAYBACK_COMMAND_TYPE_TUNE,
+ PLAYBACK_COMMAND_TYPE_TUNE_NEXT,
+ PLAYBACK_COMMAND_TYPE_TUNE_PREV,
+ PLAYBACK_COMMAND_TYPE_STOP,
+ PLAYBACK_COMMAND_TYPE_SET_STREAM_VOLUME,
+ PLAYBACK_COMMAND_TYPE_SELECT_TRACK
})
- public @interface InteractiveAppServiceCommandType {}
+ public @interface PlaybackCommandType {}
- /** @hide */
- public static final String INTERACTIVE_APP_SERVICE_COMMAND_TYPE_TUNE = "tune";
- /** @hide */
- public static final String INTERACTIVE_APP_SERVICE_COMMAND_TYPE_TUNE_NEXT = "tune_next";
- /** @hide */
- public static final String INTERACTIVE_APP_SERVICE_COMMAND_TYPE_TUNE_PREV = "tune_previous";
- /** @hide */
- public static final String INTERACTIVE_APP_SERVICE_COMMAND_TYPE_STOP = "stop";
- /** @hide */
- public static final String INTERACTIVE_APP_SERVICE_COMMAND_TYPE_SET_STREAM_VOLUME =
+ /**
+ * Playback command type: tune to the given channel.
+ * @see #COMMAND_PARAMETER_KEY_CHANNEL_URI
+ */
+ public static final String PLAYBACK_COMMAND_TYPE_TUNE = "tune";
+ /**
+ * Playback command type: tune to the next channel.
+ */
+ public static final String PLAYBACK_COMMAND_TYPE_TUNE_NEXT = "tune_next";
+ /**
+ * Playback command type: tune to the previous channel.
+ */
+ public static final String PLAYBACK_COMMAND_TYPE_TUNE_PREV = "tune_previous";
+ /**
+ * Playback command type: stop the playback.
+ */
+ public static final String PLAYBACK_COMMAND_TYPE_STOP = "stop";
+ /**
+ * Playback command type: set the volume.
+ */
+ public static final String PLAYBACK_COMMAND_TYPE_SET_STREAM_VOLUME =
"set_stream_volume";
- /** @hide */
- public static final String INTERACTIVE_APP_SERVICE_COMMAND_TYPE_SELECT_TRACK = "select_track";
- /** @hide */
+ /**
+ * Playback command type: select the given track.
+ */
+ public static final String PLAYBACK_COMMAND_TYPE_SELECT_TRACK = "select_track";
+ /**
+ * Playback command parameter: channel URI.
+ * <p>Type: android.net.Uri
+ *
+ * @see #PLAYBACK_COMMAND_TYPE_TUNE
+ */
public static final String COMMAND_PARAMETER_KEY_CHANNEL_URI = "command_channel_uri";
- /** @hide */
+ /**
+ * Playback command parameter: TV input ID.
+ * <p>Type: String
+ *
+ * @see TvInputInfo#getId()
+ */
public static final String COMMAND_PARAMETER_KEY_INPUT_ID = "command_input_id";
- /** @hide */
+ /**
+ * Playback command parameter: stream volume.
+ * <p>Type: float
+ *
+ * @see #PLAYBACK_COMMAND_TYPE_SET_STREAM_VOLUME
+ */
public static final String COMMAND_PARAMETER_KEY_VOLUME = "command_volume";
- /** @hide */
+ /**
+ * Playback command parameter: track type.
+ * <p>Type: int
+ *
+ * @see #PLAYBACK_COMMAND_TYPE_SELECT_TRACK
+ * @see TvTrackInfo#getType()
+ */
public static final String COMMAND_PARAMETER_KEY_TRACK_TYPE = "command_track_type";
- /** @hide */
+ /**
+ * Playback command parameter: track ID.
+ * <p>Type: String
+ *
+ * @see #PLAYBACK_COMMAND_TYPE_SELECT_TRACK
+ * @see TvTrackInfo#getId()
+ */
public static final String COMMAND_PARAMETER_KEY_TRACK_ID = "command_track_id";
- /** @hide */
- public static final String COMMAND_PARAMETER_KEY_TRACK_SELECT_MODE =
- "command_track_select_mode";
/**
* Command to quiet channel change. No channel banner or channel info is shown.
* <p>Refer to HbbTV Spec 2.0.4 chapter A.2.4.3.
- * @hide
*/
public static final String COMMAND_PARAMETER_KEY_CHANGE_CHANNEL_QUIETLY =
"command_change_channel_quietly";
@@ -145,9 +182,9 @@
private final RemoteCallbackList<ITvInteractiveAppServiceCallback> mCallbacks =
new RemoteCallbackList<>();
- /** @hide */
@Override
- public final IBinder onBind(Intent intent) {
+ @Nullable
+ public final IBinder onBind(@NonNull Intent intent) {
ITvInteractiveAppService.Stub tvIAppServiceBinder = new ITvInteractiveAppService.Stub() {
@Override
public void registerCallback(ITvInteractiveAppServiceCallback cb) {
@@ -208,26 +245,22 @@
/**
* Registers App link info.
- * @hide
*/
- public void onRegisterAppLinkInfo(AppLinkInfo appLinkInfo) {
- // TODO: make it abstract when unhide
+ public void onRegisterAppLinkInfo(@NonNull AppLinkInfo appLinkInfo) {
}
/**
* Unregisters App link info.
- * @hide
*/
- public void onUnregisterAppLinkInfo(AppLinkInfo appLinkInfo) {
- // TODO: make it abstract when unhide
+ public void onUnregisterAppLinkInfo(@NonNull AppLinkInfo appLinkInfo) {
}
/**
- * Sends App link info.
- * @hide
+ * Called when app link command is received.
+ *
+ * @see android.media.tv.interactive.TvInteractiveAppManager#sendAppLinkCommand(String, Bundle)
*/
- public void onAppLinkCommand(Bundle command) {
- // TODO: make it abstract when unhide
+ public void onAppLinkCommand(@NonNull Bundle command) {
}
@@ -317,7 +350,6 @@
*
* @param enable {@code true} if you want to enable the media view. {@code false}
* otherwise.
- * @hide
*/
public void setMediaViewEnabled(final boolean enable) {
mHandler.post(new Runnable() {
@@ -352,7 +384,6 @@
/**
* Resets TvIAppService session.
- * @hide
*/
public void onResetInteractiveApp() {
}
@@ -383,43 +414,37 @@
/**
* To toggle Digital Teletext Application if there is one in AIT app list.
- * @param enable
- * @hide
+ * @param enable {@code true} to enable teletext app; {@code false} otherwise.
*/
public void onSetTeletextAppEnabled(boolean enable) {
}
/**
* Receives current channel URI.
- * @hide
*/
public void onCurrentChannelUri(@Nullable Uri channelUri) {
}
/**
* Receives logical channel number (LCN) of current channel.
- * @hide
*/
public void onCurrentChannelLcn(int lcn) {
}
/**
- * Receives stream volume.
- * @hide
+ * Receives current stream volume.
*/
public void onStreamVolume(float volume) {
}
/**
* Receives track list.
- * @hide
*/
public void onTrackInfoList(@NonNull List<TvTrackInfo> tracks) {
}
/**
* Receives current TV input ID.
- * @hide
*/
public void onCurrentTvInputId(@Nullable String inputId) {
}
@@ -459,7 +484,6 @@
*
* @param width The width of the media view.
* @param height The height of the media view.
- * @hide
*/
public void onMediaViewSizeChanged(int width, int height) {
}
@@ -469,7 +493,6 @@
* implementation can override this method and return its own view.
*
* @return a view attached to the media window
- * @hide
*/
@Nullable
public View onCreateMediaView() {
@@ -478,10 +501,8 @@
/**
* Releases TvInteractiveAppService session.
- * @hide
*/
- public void onRelease() {
- }
+ public abstract void onRelease();
/**
* Called when the corresponding TV input tuned to a channel.
@@ -493,116 +514,109 @@
/**
* Called when the corresponding TV input selected to a track.
- * @hide
*/
- public void onTrackSelected(int type, String trackId) {
+ public void onTrackSelected(@TvTrackInfo.Type int type, @NonNull String trackId) {
}
/**
* Called when the tracks are changed.
- * @hide
*/
- public void onTracksChanged(List<TvTrackInfo> tracks) {
+ public void onTracksChanged(@NonNull List<TvTrackInfo> tracks) {
}
/**
* Called when video is available.
- * @hide
*/
public void onVideoAvailable() {
}
/**
* Called when video is unavailable.
- * @hide
*/
- public void onVideoUnavailable(int reason) {
+ public void onVideoUnavailable(@TvInputManager.VideoUnavailableReason int reason) {
}
/**
* Called when content is allowed.
- * @hide
*/
public void onContentAllowed() {
}
/**
* Called when content is blocked.
- * @hide
*/
- public void onContentBlocked(TvContentRating rating) {
+ public void onContentBlocked(@NonNull TvContentRating rating) {
}
/**
* Called when signal strength is changed.
- * @hide
*/
public void onSignalStrength(@TvInputManager.SignalStrength int strength) {
}
/**
* Called when a broadcast info response is received.
- * @hide
*/
public void onBroadcastInfoResponse(@NonNull BroadcastInfoResponse response) {
}
/**
* Called when an advertisement response is received.
- * @hide
*/
- public void onAdResponse(AdResponse response) {
+ public void onAdResponse(@NonNull AdResponse response) {
}
- /**
- * TODO: JavaDoc of APIs related to input events.
- * @hide
- */
@Override
public boolean onKeyDown(int keyCode, @NonNull KeyEvent event) {
return false;
}
- /**
- * @hide
- */
@Override
public boolean onKeyLongPress(int keyCode, @NonNull KeyEvent event) {
return false;
}
- /**
- * @hide
- */
@Override
public boolean onKeyMultiple(int keyCode, int count, @NonNull KeyEvent event) {
return false;
}
- /**
- * @hide
- */
@Override
public boolean onKeyUp(int keyCode, @NonNull KeyEvent event) {
return false;
}
/**
- * @hide
+ * Implement this method to handle touch screen motion events on the current session.
+ *
+ * @param event The motion event being received.
+ * @return If you handled the event, return {@code true}. If you want to allow the event to
+ * be handled by the next receiver, return {@code false}.
+ * @see View#onTouchEvent
*/
public boolean onTouchEvent(@NonNull MotionEvent event) {
return false;
}
/**
- * @hide
+ * Implement this method to handle trackball events on the current session.
+ *
+ * @param event The motion event being received.
+ * @return If you handled the event, return {@code true}. If you want to allow the event to
+ * be handled by the next receiver, return {@code false}.
+ * @see View#onTrackballEvent
*/
public boolean onTrackballEvent(@NonNull MotionEvent event) {
return false;
}
/**
- * @hide
+ * Implement this method to handle generic motion events on the current session.
+ *
+ * @param event The motion event being received.
+ * @return If you handled the event, return {@code true}. If you want to allow the event to
+ * be handled by the next receiver, return {@code false}.
+ * @see View#onGenericMotionEvent
*/
public boolean onGenericMotionEvent(@NonNull MotionEvent event) {
return false;
@@ -644,7 +658,6 @@
/**
* Requests broadcast related information from the related TV input.
* @param request the request for broadcast info
- * @hide
*/
public void requestBroadcastInfo(@NonNull final BroadcastInfoRequest request) {
executeOrPostRunnableOnMainThread(new Runnable() {
@@ -669,7 +682,6 @@
/**
* Remove broadcast information request from the related TV input.
* @param requestId the ID of the request
- * @hide
*/
public void removeBroadcastInfo(final int requestId) {
executeOrPostRunnableOnMainThread(new Runnable() {
@@ -692,13 +704,13 @@
}
/**
- * requests a specific command to be processed by the related TV input.
+ * Sends a specific playback command to be processed by the related TV input.
+ *
* @param cmdType type of the specific command
* @param parameters parameters of the specific command
- * @hide
*/
- public void requestCommand(
- @InteractiveAppServiceCommandType String cmdType, Bundle parameters) {
+ public void sendPlaybackCommandRequest(
+ @PlaybackCommandType @NonNull String cmdType, @Nullable Bundle parameters) {
executeOrPostRunnableOnMainThread(new Runnable() {
@MainThread
@Override
@@ -720,9 +732,8 @@
/**
* Sets broadcast video bounds.
- * @hide
*/
- public void setVideoBounds(Rect rect) {
+ public void setVideoBounds(@NonNull Rect rect) {
executeOrPostRunnableOnMainThread(new Runnable() {
@MainThread
@Override
@@ -743,7 +754,6 @@
/**
* Requests the URI of the current channel.
- * @hide
*/
public void requestCurrentChannelUri() {
executeOrPostRunnableOnMainThread(new Runnable() {
@@ -766,7 +776,6 @@
/**
* Requests the logic channel number (LCN) of the current channel.
- * @hide
*/
public void requestCurrentChannelLcn() {
executeOrPostRunnableOnMainThread(new Runnable() {
@@ -789,7 +798,6 @@
/**
* Requests stream volume.
- * @hide
*/
public void requestStreamVolume() {
executeOrPostRunnableOnMainThread(new Runnable() {
@@ -812,7 +820,6 @@
/**
* Requests the list of {@link TvTrackInfo}.
- * @hide
*/
public void requestTrackInfoList() {
executeOrPostRunnableOnMainThread(new Runnable() {
@@ -837,7 +844,6 @@
* Requests current TV input ID.
*
* @see android.media.tv.TvInputInfo
- * @hide
*/
public void requestCurrentTvInputId() {
executeOrPostRunnableOnMainThread(new Runnable() {
@@ -859,9 +865,9 @@
}
/**
- * requests an advertisement request to be processed by the related TV input.
- * @param request advertisement request
- * @hide
+ * Sends an advertisement request to be processed by the related TV input.
+ *
+ * @param request The advertisement request
*/
public void requestAd(@NonNull final AdRequest request) {
executeOrPostRunnableOnMainThread(new Runnable() {
@@ -1080,7 +1086,6 @@
/**
* Notifies when the digital teletext app state is changed.
* @param state the current state.
- * @hide
*/
public final void notifyTeletextAppStateChanged(
@TvInteractiveAppManager.TeletextAppState int state) {
diff --git a/media/java/android/media/tv/interactive/TvInteractiveAppView.java b/media/java/android/media/tv/interactive/TvInteractiveAppView.java
index 2922bae..773e54f 100755
--- a/media/java/android/media/tv/interactive/TvInteractiveAppView.java
+++ b/media/java/android/media/tv/interactive/TvInteractiveAppView.java
@@ -170,23 +170,20 @@
}
}
- /** @hide */
@Override
- protected void onAttachedToWindow() {
+ public void onAttachedToWindow() {
super.onAttachedToWindow();
createSessionMediaView();
}
- /** @hide */
@Override
- protected void onDetachedFromWindow() {
+ public void onDetachedFromWindow() {
removeSessionMediaView();
super.onDetachedFromWindow();
}
- /** @hide */
@Override
- protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ public void onLayout(boolean changed, int left, int top, int right, int bottom) {
if (DEBUG) {
Log.d(TAG, "onLayout (left=" + left + ", top=" + top + ", right=" + right
+ ", bottom=" + bottom + ",)");
@@ -199,9 +196,8 @@
}
}
- /** @hide */
@Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
mSurfaceView.measure(widthMeasureSpec, heightMeasureSpec);
int width = mSurfaceView.getMeasuredWidth();
int height = mSurfaceView.getMeasuredHeight();
@@ -211,9 +207,8 @@
childState << MEASURED_HEIGHT_STATE_SHIFT));
}
- /** @hide */
@Override
- protected void onVisibilityChanged(View changedView, int visibility) {
+ public void onVisibilityChanged(@NonNull View changedView, int visibility) {
super.onVisibilityChanged(changedView, visibility);
mSurfaceView.setVisibility(visibility);
if (visibility == View.VISIBLE) {
@@ -244,7 +239,6 @@
/**
* Resets this TvInteractiveAppView.
- * @hide
*/
public void reset() {
if (DEBUG) Log.d(TAG, "reset()");
@@ -330,7 +324,11 @@
/**
* Dispatches an unhandled input event to the next receiver.
- * @hide
+ *
+ * It gives the host application a chance to dispatch the unhandled input events.
+ *
+ * @param event The input event.
+ * @return {@code true} if the event was handled by the view, {@code false} otherwise.
*/
public boolean dispatchUnhandledInputEvent(@NonNull InputEvent event) {
if (mOnUnhandledInputEventListener != null) {
@@ -349,21 +347,28 @@
* @param event The input event.
* @return If you handled the event, return {@code true}. If you want to allow the event to be
* handled by the next receiver, return {@code false}.
- * @hide
*/
public boolean onUnhandledInputEvent(@NonNull InputEvent event) {
return false;
}
/**
- * Registers a callback to be invoked when an input event is not handled
+ * Sets a listener to be invoked when an input event is not handled
* by the TV Interactive App.
*
* @param listener The callback to be invoked when the unhandled input event is received.
- * @hide
*/
- public void setOnUnhandledInputEventListener(@NonNull OnUnhandledInputEventListener listener) {
+ public void setOnUnhandledInputEventListener(
+ @NonNull @CallbackExecutor Executor executor,
+ @NonNull OnUnhandledInputEventListener listener) {
mOnUnhandledInputEventListener = listener;
+ // TODO: handle CallbackExecutor
+ }
+ /**
+ * Clears the {@link OnUnhandledInputEventListener}.
+ */
+ public void clearOnUnhandledInputEventListener() {
+ mOnUnhandledInputEventListener = null;
}
@Override
@@ -427,7 +432,6 @@
/**
* Resets the interactive application.
- * @hide
*/
public void resetInteractiveApp() {
if (DEBUG) {
@@ -440,9 +444,11 @@
/**
* Sends current channel URI to related TV interactive app.
- * @hide
+ *
+ * @param channelUri The current channel URI; {@code null} if there is no currently tuned
+ * channel.
*/
- public void sendCurrentChannelUri(Uri channelUri) {
+ public void sendCurrentChannelUri(@Nullable Uri channelUri) {
if (DEBUG) {
Log.d(TAG, "sendCurrentChannelUri");
}
@@ -453,7 +459,6 @@
/**
* Sends current channel logical channel number (LCN) to related TV interactive app.
- * @hide
*/
public void sendCurrentChannelLcn(int lcn) {
if (DEBUG) {
@@ -466,7 +471,6 @@
/**
* Sends stream volume to related TV interactive app.
- * @hide
*/
public void sendStreamVolume(float volume) {
if (DEBUG) {
@@ -479,9 +483,8 @@
/**
* Sends track info list to related TV interactive app.
- * @hide
*/
- public void sendTrackInfoList(List<TvTrackInfo> tracks) {
+ public void sendTrackInfoList(@Nullable List<TvTrackInfo> tracks) {
if (DEBUG) {
Log.d(TAG, "sendTrackInfoList");
}
@@ -496,7 +499,6 @@
* @param inputId The current TV input ID whose channel is tuned. {@code null} if no channel is
* tuned.
* @see android.media.tv.TvInputInfo
- * @hide
*/
public void sendCurrentTvInputId(@Nullable String inputId) {
if (DEBUG) {
@@ -588,8 +590,11 @@
/**
* To toggle Digital Teletext Application if there is one in AIT app list.
- * @param enable
- * @hide
+ *
+ * <p>A Teletext Application is a broadcast-related application to display text and basic
+ * graphics.
+ *
+ * @param enable {@code true} to enable Teletext app; {@code false} to disable it.
*/
public void setTeletextAppEnabled(boolean enable) {
if (DEBUG) {
@@ -607,17 +612,17 @@
// TODO: unhide the following public APIs
/**
- * This is called when a command is requested to be processed by the related TV input.
+ * This is called when a playback command is requested to be processed by the related TV
+ * input.
*
* @param iAppServiceId The ID of the TV interactive app service bound to this view.
* @param cmdType type of the command
* @param parameters parameters of the command
- * @hide
*/
- public void onCommandRequest(
+ public void onPlaybackCommandRequest(
@NonNull String iAppServiceId,
- @NonNull @TvInteractiveAppService.InteractiveAppServiceCommandType String cmdType,
- @Nullable Bundle parameters) {
+ @NonNull @TvInteractiveAppService.PlaybackCommandType String cmdType,
+ @NonNull Bundle parameters) {
}
/**
@@ -656,7 +661,6 @@
*
* @param iAppServiceId The ID of the TV interactive app service bound to this view.
* @param state digital teletext app current state.
- * @hide
*/
public void onTeletextAppStateChanged(
@NonNull String iAppServiceId,
@@ -664,59 +668,55 @@
}
/**
- * This is called when {@link TvInteractiveAppService.Session#SetVideoBounds} is called.
+ * This is called when {@link TvInteractiveAppService.Session#setVideoBounds(Rect)} is
+ * called.
*
* @param iAppServiceId The ID of the TV interactive app service bound to this view.
- * @hide
*/
public void onSetVideoBounds(@NonNull String iAppServiceId, @NonNull Rect rect) {
}
/**
- * This is called when {@link TvInteractiveAppService.Session#RequestCurrentChannelUri} is
+ * This is called when {@link TvInteractiveAppService.Session#requestCurrentChannelUri()} is
* called.
*
* @param iAppServiceId The ID of the TV interactive app service bound to this view.
- * @hide
*/
public void onRequestCurrentChannelUri(@NonNull String iAppServiceId) {
}
/**
- * This is called when {@link TvInteractiveAppService.Session#RequestCurrentChannelLcn} is
+ * This is called when {@link TvInteractiveAppService.Session#requestCurrentChannelLcn()} is
* called.
*
* @param iAppServiceId The ID of the TV interactive app service bound to this view.
- * @hide
*/
public void onRequestCurrentChannelLcn(@NonNull String iAppServiceId) {
}
/**
- * This is called when {@link TvInteractiveAppService.Session#RequestStreamVolume} is
+ * This is called when {@link TvInteractiveAppService.Session#requestStreamVolume()} is
* called.
*
* @param iAppServiceId The ID of the TV interactive app service bound to this view.
- * @hide
*/
public void onRequestStreamVolume(@NonNull String iAppServiceId) {
}
/**
- * This is called when {@link TvInteractiveAppService.Session#RequestTrackInfoList} is
+ * This is called when {@link TvInteractiveAppService.Session#requestTrackInfoList()} is
* called.
*
* @param iAppServiceId The ID of the TV interactive app service bound to this view.
- * @hide
*/
public void onRequestTrackInfoList(@NonNull String iAppServiceId) {
}
/**
- * This is called when {@link TvIAppService.Session#RequestCurrentTvInputId} is called.
+ * This is called when {@link TvInteractiveAppService.Session#requestCurrentTvInputId()} is
+ * called.
*
* @param iAppServiceId The ID of the TV interactive app service bound to this view.
- * @hide
*/
public void onRequestCurrentTvInputId(@NonNull String iAppServiceId) {
}
@@ -725,7 +725,6 @@
/**
* Interface definition for a callback to be invoked when the unhandled input event is received.
- * @hide
*/
public interface OnUnhandledInputEventListener {
/**
@@ -818,7 +817,7 @@
@Override
public void onCommandRequest(
Session session,
- @TvInteractiveAppService.InteractiveAppServiceCommandType String cmdType,
+ @TvInteractiveAppService.PlaybackCommandType String cmdType,
Bundle parameters) {
if (DEBUG) {
Log.d(TAG, "onCommandRequest (cmdType=" + cmdType + ", parameters="
@@ -833,7 +832,8 @@
mCallbackExecutor.execute(() -> {
synchronized (mCallbackLock) {
if (mCallback != null) {
- mCallback.onCommandRequest(mIAppServiceId, cmdType, parameters);
+ mCallback.onPlaybackCommandRequest(
+ mIAppServiceId, cmdType, parameters);
}
}
});
diff --git a/media/java/android/media/tv/tuner/filter/SharedFilter.java b/media/java/android/media/tv/tuner/filter/SharedFilter.java
index 056c5d5..740ab9c 100644
--- a/media/java/android/media/tv/tuner/filter/SharedFilter.java
+++ b/media/java/android/media/tv/tuner/filter/SharedFilter.java
@@ -92,9 +92,21 @@
synchronized (mCallbackLock) {
if (mCallback != null) {
mCallback.onFilterEvent(this, events);
+ } else {
+ for (FilterEvent event : events) {
+ if (event instanceof MediaEvent) {
+ ((MediaEvent)event).release();
+ }
+ }
}
}
});
+ } else {
+ for (FilterEvent event : events) {
+ if (event instanceof MediaEvent) {
+ ((MediaEvent)event).release();
+ }
+ }
}
}
}
@@ -187,6 +199,8 @@
if (mIsClosed) {
return;
}
+ mCallback = null;
+ mExecutor = null;
nativeSharedClose();
mIsClosed = true;
}
diff --git a/media/jni/android_media_ImageWriter.cpp b/media/jni/android_media_ImageWriter.cpp
index 2e419a6..eca26dc 100644
--- a/media/jni/android_media_ImageWriter.cpp
+++ b/media/jni/android_media_ImageWriter.cpp
@@ -460,8 +460,6 @@
} else {
// Set consumer buffer format to user specified format
android_dataspace nativeDataspace = static_cast<android_dataspace>(dataSpace);
- int userFormat = static_cast<int>(mapHalFormatDataspaceToPublicFormat(
- hardwareBufferFormat, nativeDataspace));
res = native_window_set_buffers_format(anw.get(), hardwareBufferFormat);
if (res != OK) {
ALOGE("%s: Unable to configure consumer native buffer format to %#x",
@@ -478,20 +476,29 @@
return 0;
}
ctx->setBufferDataSpace(nativeDataspace);
- surfaceFormat = userFormat;
+ surfaceFormat = static_cast<int32_t>(mapHalFormatDataspaceToPublicFormat(
+ hardwareBufferFormat, nativeDataspace));
}
ctx->setBufferFormat(surfaceFormat);
env->SetIntField(thiz,
gImageWriterClassInfo.mWriterFormat, reinterpret_cast<jint>(surfaceFormat));
- res = native_window_set_usage(anw.get(), ndkUsage);
- if (res != OK) {
- ALOGE("%s: Configure usage %08x for format %08x failed: %s (%d)",
- __FUNCTION__, static_cast<unsigned int>(ndkUsage),
- surfaceFormat, strerror(-res), res);
- jniThrowRuntimeException(env, "Failed to SW_WRITE_OFTEN configure usage");
- return 0;
+ // ndkUsage == -1 means setUsage in ImageWriter class is not called.
+ // skip usage setting if setUsage in ImageWriter is not called and imageformat is opaque.
+ if (!(ndkUsage == -1 && isFormatOpaque(surfaceFormat))) {
+ if (ndkUsage == -1) {
+ ndkUsage = GRALLOC_USAGE_SW_WRITE_OFTEN;
+ }
+ res = native_window_set_usage(anw.get(), ndkUsage);
+ if (res != OK) {
+ ALOGE("%s: Configure usage %08x for format %08x failed: %s (%d)",
+ __FUNCTION__, static_cast<unsigned int>(ndkUsage),
+ surfaceFormat, strerror(-res), res);
+ jniThrowRuntimeException(env,
+ "Failed to SW_WRITE_OFTEN configure usage");
+ return 0;
+ }
}
int minUndequeuedBufferCount = 0;
@@ -952,7 +959,7 @@
return buffer->getHeight();
}
-static jint Image_getFormat(JNIEnv* env, jobject thiz) {
+static jint Image_getFormat(JNIEnv* env, jobject thiz, jlong dataSpace) {
ALOGV("%s", __FUNCTION__);
GraphicBuffer* buffer;
Image_getNativeContext(env, thiz, &buffer, NULL);
@@ -962,9 +969,9 @@
return 0;
}
- // ImageWriter doesn't support data space yet, assuming it is unknown.
PublicFormat publicFmt = mapHalFormatDataspaceToPublicFormat(buffer->getPixelFormat(),
- HAL_DATASPACE_UNKNOWN);
+ static_cast<android_dataspace>(dataSpace));
+
return static_cast<jint>(publicFmt);
}
@@ -1031,14 +1038,14 @@
}
static jobjectArray Image_createSurfacePlanes(JNIEnv* env, jobject thiz,
- int numPlanes, int writerFormat) {
+ int numPlanes, int writerFormat, long dataSpace) {
ALOGV("%s: create SurfacePlane array with size %d", __FUNCTION__, numPlanes);
int rowStride, pixelStride;
uint8_t *pData;
uint32_t dataSize;
jobject byteBuffer;
- int format = Image_getFormat(env, thiz);
+ int format = Image_getFormat(env, thiz, dataSpace);
if (isFormatOpaque(format) && numPlanes > 0) {
String8 msg;
msg.appendFormat("Format 0x%x is opaque, thus not writable, the number of planes (%d)"
@@ -1108,11 +1115,11 @@
};
static JNINativeMethod gImageMethods[] = {
- {"nativeCreatePlanes", "(II)[Landroid/media/ImageWriter$WriterSurfaceImage$SurfacePlane;",
+ {"nativeCreatePlanes", "(IIJ)[Landroid/media/ImageWriter$WriterSurfaceImage$SurfacePlane;",
(void*)Image_createSurfacePlanes },
{"nativeGetWidth", "()I", (void*)Image_getWidth },
{"nativeGetHeight", "()I", (void*)Image_getHeight },
- {"nativeGetFormat", "()I", (void*)Image_getFormat },
+ {"nativeGetFormat", "(J)I", (void*)Image_getFormat },
{"nativeGetHardwareBuffer", "()Landroid/hardware/HardwareBuffer;",
(void*)Image_getHardwareBuffer },
};
diff --git a/media/jni/android_media_tv_Tuner.cpp b/media/jni/android_media_tv_Tuner.cpp
index 68dd8d0..9ed1ac0 100644
--- a/media/jni/android_media_tv_Tuner.cpp
+++ b/media/jni/android_media_tv_Tuner.cpp
@@ -4147,6 +4147,7 @@
Result r = filterClient->close();
filterClient->decStrong(filter);
+ filterClient = nullptr;
if (shared) {
env->SetLongField(filter, gFields.sharedFilterContext, 0);
} else {
diff --git a/packages/CompanionDeviceManager/res/values-af/strings.xml b/packages/CompanionDeviceManager/res/values-af/strings.xml
index 00a5210..34b573d 100644
--- a/packages/CompanionDeviceManager/res/values-af/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-af/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Laat toe"</string>
<string name="consent_no" msgid="2640796915611404382">"Moenie toelaat nie"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-am/strings.xml b/packages/CompanionDeviceManager/res/values-am/strings.xml
index 2254e1f..d79b653 100644
--- a/packages/CompanionDeviceManager/res/values-am/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-am/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"ፍቀድ"</string>
<string name="consent_no" msgid="2640796915611404382">"አትፍቀድ"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ar/strings.xml b/packages/CompanionDeviceManager/res/values-ar/strings.xml
index 5944dba3..7988111 100644
--- a/packages/CompanionDeviceManager/res/values-ar/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ar/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"السماح"</string>
<string name="consent_no" msgid="2640796915611404382">"عدم السماح"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-as/strings.xml b/packages/CompanionDeviceManager/res/values-as/strings.xml
index e58aed7..17e2cb1 100644
--- a/packages/CompanionDeviceManager/res/values-as/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-as/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"অনুমতি দিয়ক"</string>
<string name="consent_no" msgid="2640796915611404382">"অনুমতি নিদিব"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-az/strings.xml b/packages/CompanionDeviceManager/res/values-az/strings.xml
index 7577776..9d504f1 100644
--- a/packages/CompanionDeviceManager/res/values-az/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-az/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"İcazə verin"</string>
<string name="consent_no" msgid="2640796915611404382">"İcazə verməyin"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-b+sr+Latn/strings.xml b/packages/CompanionDeviceManager/res/values-b+sr+Latn/strings.xml
index 8a63b11..63b5094 100644
--- a/packages/CompanionDeviceManager/res/values-b+sr+Latn/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-b+sr+Latn/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Dozvoli"</string>
<string name="consent_no" msgid="2640796915611404382">"Ne dozvoli"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-be/strings.xml b/packages/CompanionDeviceManager/res/values-be/strings.xml
index bf4fe3e..bd6ead2 100644
--- a/packages/CompanionDeviceManager/res/values-be/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-be/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Дазволіць"</string>
<string name="consent_no" msgid="2640796915611404382">"Не дазваляць"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-bg/strings.xml b/packages/CompanionDeviceManager/res/values-bg/strings.xml
index cc67b13..5f5320e 100644
--- a/packages/CompanionDeviceManager/res/values-bg/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-bg/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Разрешаване"</string>
<string name="consent_no" msgid="2640796915611404382">"Забраняване"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-bn/strings.xml b/packages/CompanionDeviceManager/res/values-bn/strings.xml
index 08ffab0..8bc47eb 100644
--- a/packages/CompanionDeviceManager/res/values-bn/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-bn/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"অনুমতি দিন"</string>
<string name="consent_no" msgid="2640796915611404382">"অনুমতি দেবেন না"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-bs/strings.xml b/packages/CompanionDeviceManager/res/values-bs/strings.xml
index 8b0daaa..8644645 100644
--- a/packages/CompanionDeviceManager/res/values-bs/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-bs/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Dozvoli"</string>
<string name="consent_no" msgid="2640796915611404382">"Nemoj dozvoliti"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ca/strings.xml b/packages/CompanionDeviceManager/res/values-ca/strings.xml
index c98feb3..9a5d4b8 100644
--- a/packages/CompanionDeviceManager/res/values-ca/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ca/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Permet"</string>
<string name="consent_no" msgid="2640796915611404382">"No permetis"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-cs/strings.xml b/packages/CompanionDeviceManager/res/values-cs/strings.xml
index c758b6e..0210500 100644
--- a/packages/CompanionDeviceManager/res/values-cs/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-cs/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Povolit"</string>
<string name="consent_no" msgid="2640796915611404382">"Nepovolovat"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-da/strings.xml b/packages/CompanionDeviceManager/res/values-da/strings.xml
index b026bb1..7e89735 100644
--- a/packages/CompanionDeviceManager/res/values-da/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-da/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Tillad"</string>
<string name="consent_no" msgid="2640796915611404382">"Tillad ikke"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-de/strings.xml b/packages/CompanionDeviceManager/res/values-de/strings.xml
index 345b971..97f017e 100644
--- a/packages/CompanionDeviceManager/res/values-de/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-de/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Zulassen"</string>
<string name="consent_no" msgid="2640796915611404382">"Nicht zulassen"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-el/strings.xml b/packages/CompanionDeviceManager/res/values-el/strings.xml
index 64d500e..926f7151 100644
--- a/packages/CompanionDeviceManager/res/values-el/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-el/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Να επιτρέπεται"</string>
<string name="consent_no" msgid="2640796915611404382">"Να μην επιτρέπεται"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-en-rAU/strings.xml b/packages/CompanionDeviceManager/res/values-en-rAU/strings.xml
index 1756d22..e9452fd 100644
--- a/packages/CompanionDeviceManager/res/values-en-rAU/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-en-rAU/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Allow"</string>
<string name="consent_no" msgid="2640796915611404382">"Don\'t allow"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-en-rCA/strings.xml b/packages/CompanionDeviceManager/res/values-en-rCA/strings.xml
index 1756d22..e9452fd 100644
--- a/packages/CompanionDeviceManager/res/values-en-rCA/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-en-rCA/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Allow"</string>
<string name="consent_no" msgid="2640796915611404382">"Don\'t allow"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-en-rGB/strings.xml b/packages/CompanionDeviceManager/res/values-en-rGB/strings.xml
index 1756d22..e9452fd 100644
--- a/packages/CompanionDeviceManager/res/values-en-rGB/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-en-rGB/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Allow"</string>
<string name="consent_no" msgid="2640796915611404382">"Don\'t allow"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-en-rIN/strings.xml b/packages/CompanionDeviceManager/res/values-en-rIN/strings.xml
index 1756d22..e9452fd 100644
--- a/packages/CompanionDeviceManager/res/values-en-rIN/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-en-rIN/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Allow"</string>
<string name="consent_no" msgid="2640796915611404382">"Don\'t allow"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-en-rXC/strings.xml b/packages/CompanionDeviceManager/res/values-en-rXC/strings.xml
index efda04e..2ed5310 100644
--- a/packages/CompanionDeviceManager/res/values-en-rXC/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-en-rXC/strings.xml
@@ -32,4 +32,6 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Allow"</string>
<string name="consent_no" msgid="2640796915611404382">"Don’t allow"</string>
+ <string name="permission_sync_confirmation_title" msgid="667074294393493186">"Transfer app permissions to your watch"</string>
+ <string name="permission_sync_summary" msgid="8873391306499120778">"To make it easier to set up your watch, apps installed on your watch during setup will use the same permissions as your phone.\n\n These permissions may include access to your watch’s microphone and location."</string>
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml b/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml
index 90e33a5..705615d 100644
--- a/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Permitir"</string>
<string name="consent_no" msgid="2640796915611404382">"No permitir"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-es/strings.xml b/packages/CompanionDeviceManager/res/values-es/strings.xml
index 78ac63f..b682490 100644
--- a/packages/CompanionDeviceManager/res/values-es/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-es/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Permitir"</string>
<string name="consent_no" msgid="2640796915611404382">"No permitir"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-et/strings.xml b/packages/CompanionDeviceManager/res/values-et/strings.xml
index 165dc97..34c0fb2 100644
--- a/packages/CompanionDeviceManager/res/values-et/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-et/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Luba"</string>
<string name="consent_no" msgid="2640796915611404382">"Ära luba"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-eu/strings.xml b/packages/CompanionDeviceManager/res/values-eu/strings.xml
index d424359..808baf4 100644
--- a/packages/CompanionDeviceManager/res/values-eu/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-eu/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Eman baimena"</string>
<string name="consent_no" msgid="2640796915611404382">"Ez eman baimenik"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-fa/strings.xml b/packages/CompanionDeviceManager/res/values-fa/strings.xml
index d9053fd..6dea7ef 100644
--- a/packages/CompanionDeviceManager/res/values-fa/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-fa/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"مجاز بودن"</string>
<string name="consent_no" msgid="2640796915611404382">"مجاز نبودن"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-fi/strings.xml b/packages/CompanionDeviceManager/res/values-fi/strings.xml
index e76f89d..5772ebf 100644
--- a/packages/CompanionDeviceManager/res/values-fi/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-fi/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Salli"</string>
<string name="consent_no" msgid="2640796915611404382">"Älä salli"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-fr-rCA/strings.xml b/packages/CompanionDeviceManager/res/values-fr-rCA/strings.xml
index f6a4855..c09f1d6 100644
--- a/packages/CompanionDeviceManager/res/values-fr-rCA/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-fr-rCA/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Autoriser"</string>
<string name="consent_no" msgid="2640796915611404382">"Ne pas autoriser"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-fr/strings.xml b/packages/CompanionDeviceManager/res/values-fr/strings.xml
index a214b89..63dd6a3 100644
--- a/packages/CompanionDeviceManager/res/values-fr/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-fr/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Autoriser"</string>
<string name="consent_no" msgid="2640796915611404382">"Ne pas autoriser"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-gl/strings.xml b/packages/CompanionDeviceManager/res/values-gl/strings.xml
index c179378..8b31f97 100644
--- a/packages/CompanionDeviceManager/res/values-gl/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-gl/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Permitir"</string>
<string name="consent_no" msgid="2640796915611404382">"Non permitir"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-gu/strings.xml b/packages/CompanionDeviceManager/res/values-gu/strings.xml
index ff9a89e..077ff27 100644
--- a/packages/CompanionDeviceManager/res/values-gu/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-gu/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"મંજૂરી આપો"</string>
<string name="consent_no" msgid="2640796915611404382">"મંજૂરી આપશો નહીં"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-hi/strings.xml b/packages/CompanionDeviceManager/res/values-hi/strings.xml
index 557e1f8..57f18cd 100644
--- a/packages/CompanionDeviceManager/res/values-hi/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-hi/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"अनुमति दें"</string>
<string name="consent_no" msgid="2640796915611404382">"अनुमति न दें"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-hr/strings.xml b/packages/CompanionDeviceManager/res/values-hr/strings.xml
index 453a4dd..a8bc9e6 100644
--- a/packages/CompanionDeviceManager/res/values-hr/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-hr/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Dopusti"</string>
<string name="consent_no" msgid="2640796915611404382">"Nemoj dopustiti"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-hu/strings.xml b/packages/CompanionDeviceManager/res/values-hu/strings.xml
index dacc4e4..a862475 100644
--- a/packages/CompanionDeviceManager/res/values-hu/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-hu/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Engedélyezés"</string>
<string name="consent_no" msgid="2640796915611404382">"Tiltás"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-hy/strings.xml b/packages/CompanionDeviceManager/res/values-hy/strings.xml
index 9b79f4b..4eefc0b 100644
--- a/packages/CompanionDeviceManager/res/values-hy/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-hy/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Թույլատրել"</string>
<string name="consent_no" msgid="2640796915611404382">"Չթույլատրել"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-in/strings.xml b/packages/CompanionDeviceManager/res/values-in/strings.xml
index 684167e..533e81d 100644
--- a/packages/CompanionDeviceManager/res/values-in/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-in/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Izinkan"</string>
<string name="consent_no" msgid="2640796915611404382">"Jangan izinkan"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-is/strings.xml b/packages/CompanionDeviceManager/res/values-is/strings.xml
index cdfc47a..25438ce 100644
--- a/packages/CompanionDeviceManager/res/values-is/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-is/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Leyfa"</string>
<string name="consent_no" msgid="2640796915611404382">"Ekki leyfa"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-it/strings.xml b/packages/CompanionDeviceManager/res/values-it/strings.xml
index fc7100a..8f23b6a 100644
--- a/packages/CompanionDeviceManager/res/values-it/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-it/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Consenti"</string>
<string name="consent_no" msgid="2640796915611404382">"Non consentire"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-iw/strings.xml b/packages/CompanionDeviceManager/res/values-iw/strings.xml
index 295df783..ec21a10 100644
--- a/packages/CompanionDeviceManager/res/values-iw/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-iw/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"יש אישור"</string>
<string name="consent_no" msgid="2640796915611404382">"אין אישור"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ja/strings.xml b/packages/CompanionDeviceManager/res/values-ja/strings.xml
index a9438be..f6ef81a 100644
--- a/packages/CompanionDeviceManager/res/values-ja/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ja/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"許可"</string>
<string name="consent_no" msgid="2640796915611404382">"許可しない"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ka/strings.xml b/packages/CompanionDeviceManager/res/values-ka/strings.xml
index 8354f4a..9440227 100644
--- a/packages/CompanionDeviceManager/res/values-ka/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ka/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"დაშვება"</string>
<string name="consent_no" msgid="2640796915611404382">"არ დაიშვას"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-kk/strings.xml b/packages/CompanionDeviceManager/res/values-kk/strings.xml
index 722b570..e99a61c 100644
--- a/packages/CompanionDeviceManager/res/values-kk/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-kk/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Рұқсат беру"</string>
<string name="consent_no" msgid="2640796915611404382">"Рұқсат бермеу"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-km/strings.xml b/packages/CompanionDeviceManager/res/values-km/strings.xml
index d47d6c4..0f8820e 100644
--- a/packages/CompanionDeviceManager/res/values-km/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-km/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"អនុញ្ញាត"</string>
<string name="consent_no" msgid="2640796915611404382">"កុំអនុញ្ញាត"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-kn/strings.xml b/packages/CompanionDeviceManager/res/values-kn/strings.xml
index ba9f8ff..81e956d 100644
--- a/packages/CompanionDeviceManager/res/values-kn/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-kn/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"ಅನುಮತಿಸಿ"</string>
<string name="consent_no" msgid="2640796915611404382">"ಅನುಮತಿಸಬೇಡಿ"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ko/strings.xml b/packages/CompanionDeviceManager/res/values-ko/strings.xml
index 8faab71..b2e5062 100644
--- a/packages/CompanionDeviceManager/res/values-ko/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ko/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"허용"</string>
<string name="consent_no" msgid="2640796915611404382">"허용 안함"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ky/strings.xml b/packages/CompanionDeviceManager/res/values-ky/strings.xml
index eec1775..6f05848 100644
--- a/packages/CompanionDeviceManager/res/values-ky/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ky/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Уруксат берүү"</string>
<string name="consent_no" msgid="2640796915611404382">"Уруксат берилбесин"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-lo/strings.xml b/packages/CompanionDeviceManager/res/values-lo/strings.xml
index ed24422..314329f 100644
--- a/packages/CompanionDeviceManager/res/values-lo/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-lo/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"ອະນຸຍາດ"</string>
<string name="consent_no" msgid="2640796915611404382">"ບໍ່ອະນຸຍາດ"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-lt/strings.xml b/packages/CompanionDeviceManager/res/values-lt/strings.xml
index 8472d79..b3c789c 100644
--- a/packages/CompanionDeviceManager/res/values-lt/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-lt/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Leisti"</string>
<string name="consent_no" msgid="2640796915611404382">"Neleisti"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-lv/strings.xml b/packages/CompanionDeviceManager/res/values-lv/strings.xml
index 8b27a08..be7a95e 100644
--- a/packages/CompanionDeviceManager/res/values-lv/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-lv/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Atļaut"</string>
<string name="consent_no" msgid="2640796915611404382">"Neatļaut"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-mk/strings.xml b/packages/CompanionDeviceManager/res/values-mk/strings.xml
index e6131e6..29d9660 100644
--- a/packages/CompanionDeviceManager/res/values-mk/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-mk/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Дозволи"</string>
<string name="consent_no" msgid="2640796915611404382">"Не дозволувај"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ml/strings.xml b/packages/CompanionDeviceManager/res/values-ml/strings.xml
index e35a733..ec09d65 100644
--- a/packages/CompanionDeviceManager/res/values-ml/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ml/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"അനുവദിക്കുക"</string>
<string name="consent_no" msgid="2640796915611404382">"അനുവദിക്കരുത്"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-mn/strings.xml b/packages/CompanionDeviceManager/res/values-mn/strings.xml
index 1ea1c9b..f27698c 100644
--- a/packages/CompanionDeviceManager/res/values-mn/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-mn/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Зөвшөөрөх"</string>
<string name="consent_no" msgid="2640796915611404382">"Бүү зөвшөөр"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-mr/strings.xml b/packages/CompanionDeviceManager/res/values-mr/strings.xml
index 1936ede..685250d 100644
--- a/packages/CompanionDeviceManager/res/values-mr/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-mr/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"अनुमती द्या"</string>
<string name="consent_no" msgid="2640796915611404382">"अनुमती देऊ नका"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ms/strings.xml b/packages/CompanionDeviceManager/res/values-ms/strings.xml
index fb69cb1..e594d61 100644
--- a/packages/CompanionDeviceManager/res/values-ms/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ms/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Benarkan"</string>
<string name="consent_no" msgid="2640796915611404382">"Jangan benarkan"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-my/strings.xml b/packages/CompanionDeviceManager/res/values-my/strings.xml
index 31596a4..7d3ef90 100644
--- a/packages/CompanionDeviceManager/res/values-my/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-my/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"ခွင့်ပြုရန်"</string>
<string name="consent_no" msgid="2640796915611404382">"ခွင့်မပြုပါ"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-nb/strings.xml b/packages/CompanionDeviceManager/res/values-nb/strings.xml
index 52afcf0..23c7fbf 100644
--- a/packages/CompanionDeviceManager/res/values-nb/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-nb/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Tillat"</string>
<string name="consent_no" msgid="2640796915611404382">"Ikke tillat"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ne/strings.xml b/packages/CompanionDeviceManager/res/values-ne/strings.xml
index 9b42c1e..4615733 100644
--- a/packages/CompanionDeviceManager/res/values-ne/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ne/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"अनुमति दिनुहोस्"</string>
<string name="consent_no" msgid="2640796915611404382">"अनुमति नदिनुहोस्"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-nl/strings.xml b/packages/CompanionDeviceManager/res/values-nl/strings.xml
index 354cb93..83acc79 100644
--- a/packages/CompanionDeviceManager/res/values-nl/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-nl/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Toestaan"</string>
<string name="consent_no" msgid="2640796915611404382">"Niet toestaan"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-or/strings.xml b/packages/CompanionDeviceManager/res/values-or/strings.xml
index b58ebd34..8d3bb65 100644
--- a/packages/CompanionDeviceManager/res/values-or/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-or/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"ଅନୁମତି ଦିଅନ୍ତୁ"</string>
<string name="consent_no" msgid="2640796915611404382">"ଅନୁମତି ଦିଅନ୍ତୁ ନାହିଁ"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-pa/strings.xml b/packages/CompanionDeviceManager/res/values-pa/strings.xml
index f2a5c29..692d67f 100644
--- a/packages/CompanionDeviceManager/res/values-pa/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-pa/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"ਇਜਾਜ਼ਤ ਦਿਓ"</string>
<string name="consent_no" msgid="2640796915611404382">"ਇਜਾਜ਼ਤ ਨਾ ਦਿਓ"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-pl/strings.xml b/packages/CompanionDeviceManager/res/values-pl/strings.xml
index 9356792..3de6c5b 100644
--- a/packages/CompanionDeviceManager/res/values-pl/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-pl/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Zezwól"</string>
<string name="consent_no" msgid="2640796915611404382">"Nie zezwalaj"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-pt-rBR/strings.xml b/packages/CompanionDeviceManager/res/values-pt-rBR/strings.xml
index 7d79608..b440215 100644
--- a/packages/CompanionDeviceManager/res/values-pt-rBR/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-pt-rBR/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Permitir"</string>
<string name="consent_no" msgid="2640796915611404382">"Não permitir"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-pt-rPT/strings.xml b/packages/CompanionDeviceManager/res/values-pt-rPT/strings.xml
index bc30ed8..73982a6 100644
--- a/packages/CompanionDeviceManager/res/values-pt-rPT/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-pt-rPT/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Permitir"</string>
<string name="consent_no" msgid="2640796915611404382">"Não permitir"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-pt/strings.xml b/packages/CompanionDeviceManager/res/values-pt/strings.xml
index 7d79608..b440215 100644
--- a/packages/CompanionDeviceManager/res/values-pt/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-pt/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Permitir"</string>
<string name="consent_no" msgid="2640796915611404382">"Não permitir"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ro/strings.xml b/packages/CompanionDeviceManager/res/values-ro/strings.xml
index dd38f1f..d3e725f 100644
--- a/packages/CompanionDeviceManager/res/values-ro/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ro/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Permiteți"</string>
<string name="consent_no" msgid="2640796915611404382">"Nu permiteți"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ru/strings.xml b/packages/CompanionDeviceManager/res/values-ru/strings.xml
index 8e2b4d8..5983a59 100644
--- a/packages/CompanionDeviceManager/res/values-ru/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ru/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Разрешить"</string>
<string name="consent_no" msgid="2640796915611404382">"Запретить"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-si/strings.xml b/packages/CompanionDeviceManager/res/values-si/strings.xml
index 489ecf9..83a5156 100644
--- a/packages/CompanionDeviceManager/res/values-si/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-si/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"ඉඩ දෙන්න"</string>
<string name="consent_no" msgid="2640796915611404382">"ඉඩ නොදෙන්න"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-sk/strings.xml b/packages/CompanionDeviceManager/res/values-sk/strings.xml
index cbee372..3fe111c 100644
--- a/packages/CompanionDeviceManager/res/values-sk/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-sk/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Povoliť"</string>
<string name="consent_no" msgid="2640796915611404382">"Nepovoliť"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-sl/strings.xml b/packages/CompanionDeviceManager/res/values-sl/strings.xml
index 53eb85d..a3c9a07 100644
--- a/packages/CompanionDeviceManager/res/values-sl/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-sl/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Dovoli"</string>
<string name="consent_no" msgid="2640796915611404382">"Ne dovoli"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-sq/strings.xml b/packages/CompanionDeviceManager/res/values-sq/strings.xml
index 0704b9b..bb9ae13 100644
--- a/packages/CompanionDeviceManager/res/values-sq/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-sq/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Lejo"</string>
<string name="consent_no" msgid="2640796915611404382">"Mos lejo"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-sr/strings.xml b/packages/CompanionDeviceManager/res/values-sr/strings.xml
index eb768a2..6da288c 100644
--- a/packages/CompanionDeviceManager/res/values-sr/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-sr/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Дозволи"</string>
<string name="consent_no" msgid="2640796915611404382">"Не дозволи"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-sv/strings.xml b/packages/CompanionDeviceManager/res/values-sv/strings.xml
index 24db58d..5c821f2 100644
--- a/packages/CompanionDeviceManager/res/values-sv/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-sv/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Tillåt"</string>
<string name="consent_no" msgid="2640796915611404382">"Tillåt inte"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-sw/strings.xml b/packages/CompanionDeviceManager/res/values-sw/strings.xml
index d06f1c6..588addc 100644
--- a/packages/CompanionDeviceManager/res/values-sw/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-sw/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Ruhusu"</string>
<string name="consent_no" msgid="2640796915611404382">"Usiruhusu"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ta/strings.xml b/packages/CompanionDeviceManager/res/values-ta/strings.xml
index d58d2ae..9bbc9f5 100644
--- a/packages/CompanionDeviceManager/res/values-ta/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ta/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"அனுமதி"</string>
<string name="consent_no" msgid="2640796915611404382">"அனுமதிக்க வேண்டாம்"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-te/strings.xml b/packages/CompanionDeviceManager/res/values-te/strings.xml
index 9e9fec5..759eded 100644
--- a/packages/CompanionDeviceManager/res/values-te/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-te/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"అనుమతించు"</string>
<string name="consent_no" msgid="2640796915611404382">"అనుమతించవద్దు"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-th/strings.xml b/packages/CompanionDeviceManager/res/values-th/strings.xml
index 9d9c91d..233e242 100644
--- a/packages/CompanionDeviceManager/res/values-th/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-th/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"อนุญาต"</string>
<string name="consent_no" msgid="2640796915611404382">"ไม่อนุญาต"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-tl/strings.xml b/packages/CompanionDeviceManager/res/values-tl/strings.xml
index 436097c..d5ee345 100644
--- a/packages/CompanionDeviceManager/res/values-tl/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-tl/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Payagan"</string>
<string name="consent_no" msgid="2640796915611404382">"Huwag payagan"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-tr/strings.xml b/packages/CompanionDeviceManager/res/values-tr/strings.xml
index 3a256a7..6129ea9 100644
--- a/packages/CompanionDeviceManager/res/values-tr/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-tr/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"İzin ver"</string>
<string name="consent_no" msgid="2640796915611404382">"İzin verme"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-uk/strings.xml b/packages/CompanionDeviceManager/res/values-uk/strings.xml
index 9f40a0c..82aa0d7 100644
--- a/packages/CompanionDeviceManager/res/values-uk/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-uk/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Дозволити"</string>
<string name="consent_no" msgid="2640796915611404382">"Не дозволяти"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-ur/strings.xml b/packages/CompanionDeviceManager/res/values-ur/strings.xml
index 3c1fe5d..db8b472 100644
--- a/packages/CompanionDeviceManager/res/values-ur/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ur/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"اجازت دیں"</string>
<string name="consent_no" msgid="2640796915611404382">"اجازت نہ دیں"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-uz/strings.xml b/packages/CompanionDeviceManager/res/values-uz/strings.xml
index ff5e4b9..e937f87 100644
--- a/packages/CompanionDeviceManager/res/values-uz/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-uz/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Ruxsat"</string>
<string name="consent_no" msgid="2640796915611404382">"Ruxsat berilmasin"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-vi/strings.xml b/packages/CompanionDeviceManager/res/values-vi/strings.xml
index f52dde1..b17f61a 100644
--- a/packages/CompanionDeviceManager/res/values-vi/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-vi/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Cho phép"</string>
<string name="consent_no" msgid="2640796915611404382">"Không cho phép"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-zh-rCN/strings.xml b/packages/CompanionDeviceManager/res/values-zh-rCN/strings.xml
index f1facc1..61ffa09 100644
--- a/packages/CompanionDeviceManager/res/values-zh-rCN/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-zh-rCN/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"允许"</string>
<string name="consent_no" msgid="2640796915611404382">"不允许"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-zh-rHK/strings.xml b/packages/CompanionDeviceManager/res/values-zh-rHK/strings.xml
index aed008f..6842261 100644
--- a/packages/CompanionDeviceManager/res/values-zh-rHK/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-zh-rHK/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"允許"</string>
<string name="consent_no" msgid="2640796915611404382">"不允許"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-zh-rTW/strings.xml b/packages/CompanionDeviceManager/res/values-zh-rTW/strings.xml
index 22a9d9c..c9449e6 100644
--- a/packages/CompanionDeviceManager/res/values-zh-rTW/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-zh-rTW/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"允許"</string>
<string name="consent_no" msgid="2640796915611404382">"不允許"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/CompanionDeviceManager/res/values-zu/strings.xml b/packages/CompanionDeviceManager/res/values-zu/strings.xml
index 5c5756b..e8ac64b 100644
--- a/packages/CompanionDeviceManager/res/values-zu/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-zu/strings.xml
@@ -32,4 +32,8 @@
<string name="summary_generic" msgid="2346762210105903720"></string>
<string name="consent_yes" msgid="8344487259618762872">"Vumela"</string>
<string name="consent_no" msgid="2640796915611404382">"Ungavumeli"</string>
+ <!-- no translation found for permission_sync_confirmation_title (667074294393493186) -->
+ <skip />
+ <!-- no translation found for permission_sync_summary (8873391306499120778) -->
+ <skip />
</resources>
diff --git a/packages/ConnectivityT/framework-t/src/android/net/NetworkIdentity.java b/packages/ConnectivityT/framework-t/src/android/net/NetworkIdentity.java
index d3d5a08..77fc171 100644
--- a/packages/ConnectivityT/framework-t/src/android/net/NetworkIdentity.java
+++ b/packages/ConnectivityT/framework-t/src/android/net/NetworkIdentity.java
@@ -434,7 +434,8 @@
@NonNull
public Builder setRatType(@Annotation.NetworkType int ratType) {
if (!CollectionUtils.contains(TelephonyManager.getAllNetworkTypes(), ratType)
- && ratType != TelephonyManager.NETWORK_TYPE_UNKNOWN) {
+ && ratType != TelephonyManager.NETWORK_TYPE_UNKNOWN
+ && ratType != NetworkTemplate.NETWORK_TYPE_5G_NSA) {
throw new IllegalArgumentException("Invalid ratType " + ratType);
}
mRatType = ratType;
diff --git a/packages/ConnectivityT/framework-t/src/android/net/NetworkTemplate.java b/packages/ConnectivityT/framework-t/src/android/net/NetworkTemplate.java
index cad8075..dba3991 100644
--- a/packages/ConnectivityT/framework-t/src/android/net/NetworkTemplate.java
+++ b/packages/ConnectivityT/framework-t/src/android/net/NetworkTemplate.java
@@ -652,7 +652,9 @@
*
* @hide
*/
- public boolean matches(NetworkIdentity ident) {
+ @SystemApi(client = MODULE_LIBRARIES)
+ public boolean matches(@NonNull NetworkIdentity ident) {
+ Objects.requireNonNull(ident);
if (!matchesMetered(ident)) return false;
if (!matchesRoaming(ident)) return false;
if (!matchesDefaultNetwork(ident)) return false;
diff --git a/packages/DynamicSystemInstallationService/res/values-gl/strings.xml b/packages/DynamicSystemInstallationService/res/values-gl/strings.xml
index 58a80a7..7ead44b 100644
--- a/packages/DynamicSystemInstallationService/res/values-gl/strings.xml
+++ b/packages/DynamicSystemInstallationService/res/values-gl/strings.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="keyguard_description" msgid="8582605799129954556">"Pon o teu contrasinal e vai a Dynamic System Updates"</string>
+ <string name="keyguard_description" msgid="8582605799129954556">"Pon o teu contrasinal e vai a Actualizacións dinámicas do sistema"</string>
<string name="notification_install_completed" msgid="6252047868415172643">"O sistema dinámico está listo. Para utilizalo, reinicia o dispositivo."</string>
<string name="notification_install_inprogress" msgid="7383334330065065017">"Instalación en curso"</string>
<string name="notification_install_failed" msgid="4066039210317521404">"Produciuse un erro durante a instalación"</string>
diff --git a/packages/PrintSpooler/res/values-te/strings.xml b/packages/PrintSpooler/res/values-te/strings.xml
index a1ed2ca..038029d 100644
--- a/packages/PrintSpooler/res/values-te/strings.xml
+++ b/packages/PrintSpooler/res/values-te/strings.xml
@@ -88,7 +88,7 @@
<string name="no_connection_to_printer" msgid="2159246915977282728">"ప్రింటర్కు కనెక్షన్ లేదు"</string>
<string name="reason_unknown" msgid="5507940196503246139">"తెలియదు"</string>
<string name="print_service_security_warning_title" msgid="2160752291246775320">"<xliff:g id="SERVICE">%1$s</xliff:g>ని ఉపయోగించాలా?"</string>
- <string name="print_service_security_warning_summary" msgid="1427434625361692006">"మీ పత్రం ప్రింటర్కు వెళ్లే మార్గంలో ఒకటి లేదా అంతకంటే ఎక్కువ సర్వర్ల గుండా వెళ్లవచ్చు."</string>
+ <string name="print_service_security_warning_summary" msgid="1427434625361692006">"మీ డాక్యుమెంట్ ప్రింటర్కు వెళ్లే మార్గంలో ఒకటి లేదా అంతకంటే ఎక్కువ సర్వర్ల గుండా వెళ్లవచ్చు."</string>
<string-array name="color_mode_labels">
<item msgid="7602948745415174937">"నలుపు & తెలుపు"</item>
<item msgid="2762241247228983754">"రంగు"</item>
diff --git a/packages/SettingsLib/CollapsingToolbarBaseActivity/res/layout-v31/collapsing_toolbar_base_layout.xml b/packages/SettingsLib/CollapsingToolbarBaseActivity/res/layout-v31/collapsing_toolbar_base_layout.xml
index 907863e..e3714db 100644
--- a/packages/SettingsLib/CollapsingToolbarBaseActivity/res/layout-v31/collapsing_toolbar_base_layout.xml
+++ b/packages/SettingsLib/CollapsingToolbarBaseActivity/res/layout-v31/collapsing_toolbar_base_layout.xml
@@ -1,71 +1,25 @@
<?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.
- -->
+ 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.
+-->
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/content_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
- <com.google.android.material.appbar.AppBarLayout
- android:id="@+id/app_bar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:fitsSystemWindows="true"
- android:outlineAmbientShadowColor="@android:color/transparent"
- android:outlineSpotShadowColor="@android:color/transparent"
- android:background="?android:attr/colorPrimary"
- android:theme="@style/Theme.CollapsingToolbar.Settings">
-
- <com.google.android.material.appbar.CollapsingToolbarLayout
- android:id="@+id/collapsing_toolbar"
- android:layout_width="match_parent"
- android:layout_height="@dimen/settingslib_toolbar_layout_height"
- android:clipToPadding="false"
- app:forceApplySystemWindowInsetTop="true"
- app:extraMultilineHeightEnabled="true"
- app:contentScrim="@color/settingslib_colorSurfaceHeader"
- app:maxLines="3"
- app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
- app:scrimAnimationDuration="50"
- app:scrimVisibleHeightTrigger="@dimen/settingslib_scrim_visible_height_trigger"
- app:statusBarScrim="@null"
- app:titleCollapseMode="fade"
- app:collapsedTitleTextAppearance="@style/CollapsingToolbarTitle.Collapsed"
- app:expandedTitleTextAppearance="@style/CollapsingToolbarTitle.Expanded"
- app:expandedTitleMarginStart="@dimen/expanded_title_margin_start"
- app:expandedTitleMarginEnd="@dimen/expanded_title_margin_end"
- app:toolbarId="@id/action_bar">
-
- <Toolbar
- android:id="@+id/action_bar"
- android:layout_width="match_parent"
- android:layout_height="?attr/actionBarSize"
- android:theme="?android:attr/actionBarTheme"
- android:transitionName="shared_element_view"
- app:layout_collapseMode="pin"/>
-
- </com.google.android.material.appbar.CollapsingToolbarLayout>
- </com.google.android.material.appbar.AppBarLayout>
-
- <FrameLayout
- android:id="@+id/content_frame"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
+ <include layout="@layout/collapsing_toolbar_content_layout"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
diff --git a/packages/SettingsLib/CollapsingToolbarBaseActivity/res/layout-v31/collapsing_toolbar_content_layout.xml b/packages/SettingsLib/CollapsingToolbarBaseActivity/res/layout-v31/collapsing_toolbar_content_layout.xml
new file mode 100644
index 0000000..25f0771
--- /dev/null
+++ b/packages/SettingsLib/CollapsingToolbarBaseActivity/res/layout-v31/collapsing_toolbar_content_layout.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<merge
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/app_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:fitsSystemWindows="true"
+ android:outlineAmbientShadowColor="@android:color/transparent"
+ android:outlineSpotShadowColor="@android:color/transparent"
+ android:background="?android:attr/colorPrimary"
+ android:theme="@style/Theme.CollapsingToolbar.Settings">
+
+ <com.google.android.material.appbar.CollapsingToolbarLayout
+ android:id="@+id/collapsing_toolbar"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/settingslib_toolbar_layout_height"
+ android:clipToPadding="false"
+ app:forceApplySystemWindowInsetTop="true"
+ app:extraMultilineHeightEnabled="true"
+ app:contentScrim="@color/settingslib_colorSurfaceHeader"
+ app:maxLines="3"
+ app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
+ app:scrimAnimationDuration="50"
+ app:scrimVisibleHeightTrigger="@dimen/settingslib_scrim_visible_height_trigger"
+ app:statusBarScrim="@null"
+ app:titleCollapseMode="fade"
+ app:collapsedTitleTextAppearance="@style/CollapsingToolbarTitle.Collapsed"
+ app:expandedTitleTextAppearance="@style/CollapsingToolbarTitle.Expanded"
+ app:expandedTitleMarginStart="@dimen/expanded_title_margin_start"
+ app:expandedTitleMarginEnd="@dimen/expanded_title_margin_end"
+ app:toolbarId="@id/action_bar">
+
+ <Toolbar
+ android:id="@+id/action_bar"
+ android:layout_width="match_parent"
+ android:layout_height="?attr/actionBarSize"
+ android:theme="?android:attr/actionBarTheme"
+ android:transitionName="shared_element_view"
+ app:layout_collapseMode="pin"/>
+
+ </com.google.android.material.appbar.CollapsingToolbarLayout>
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <FrameLayout
+ android:id="@+id/content_frame"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
+</merge>
\ No newline at end of file
diff --git a/packages/SettingsLib/CollapsingToolbarBaseActivity/res/layout-v31/support_toolbar.xml b/packages/SettingsLib/CollapsingToolbarBaseActivity/res/layout-v31/support_toolbar.xml
new file mode 100644
index 0000000..e57bff3
--- /dev/null
+++ b/packages/SettingsLib/CollapsingToolbarBaseActivity/res/layout-v31/support_toolbar.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<androidx.appcompat.widget.Toolbar
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/support_action_bar"
+ android:layout_width="match_parent"
+ android:layout_height="?attr/actionBarSize"
+ android:theme="?android:attr/actionBarTheme"
+ android:transitionName="shared_element_view"
+ app:layout_collapseMode="pin" />
\ No newline at end of file
diff --git a/packages/SettingsLib/CollapsingToolbarBaseActivity/res/values-v31/attrs.xml b/packages/SettingsLib/CollapsingToolbarBaseActivity/res/values-v31/attrs.xml
new file mode 100644
index 0000000..6ddfb42
--- /dev/null
+++ b/packages/SettingsLib/CollapsingToolbarBaseActivity/res/values-v31/attrs.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<resources>
+ <declare-styleable name="CollapsingCoordinatorLayout">
+ <!-- assign a title of collapsing toolbar title. -->
+ <attr name="collapsing_toolbar_title" format="string" />
+ <attr name="content_frame_height_match_parent" format="boolean" />
+ </declare-styleable>
+</resources>
\ No newline at end of file
diff --git a/packages/SettingsLib/CollapsingToolbarBaseActivity/src/com/android/settingslib/collapsingtoolbar/widget/CollapsingCoordinatorLayout.java b/packages/SettingsLib/CollapsingToolbarBaseActivity/src/com/android/settingslib/collapsingtoolbar/widget/CollapsingCoordinatorLayout.java
new file mode 100644
index 0000000..eec73ff
--- /dev/null
+++ b/packages/SettingsLib/CollapsingToolbarBaseActivity/src/com/android/settingslib/collapsingtoolbar/widget/CollapsingCoordinatorLayout.java
@@ -0,0 +1,211 @@
+/*
+ * 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.collapsingtoolbar.widget;
+
+import android.app.ActionBar;
+import android.app.Activity;
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.text.TextUtils;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Toolbar;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.coordinatorlayout.widget.CoordinatorLayout;
+
+import com.android.settingslib.collapsingtoolbar.R;
+
+import com.google.android.material.appbar.AppBarLayout;
+import com.google.android.material.appbar.CollapsingToolbarLayout;
+
+/**
+ * This widget is wrapping the collapsing toolbar and can be directly used by the
+ * {@link AppCompatActivity}.
+ */
+public class CollapsingCoordinatorLayout extends CoordinatorLayout {
+ private static final String TAG = "CollapsingCoordinatorLayout";
+ private static final float TOOLBAR_LINE_SPACING_MULTIPLIER = 1.1f;
+
+ private CharSequence mToolbarTitle;
+ private boolean mIsMatchParentHeight;
+ private CollapsingToolbarLayout mCollapsingToolbarLayout;
+ private AppBarLayout mAppBarLayout;
+
+ public CollapsingCoordinatorLayout(@NonNull Context context) {
+ this(context, /* attrs= */ null);
+ }
+
+ public CollapsingCoordinatorLayout(@NonNull Context context, @Nullable AttributeSet attrs) {
+ this(context, attrs, /* defStyleAttr= */ 0);
+ }
+
+ public CollapsingCoordinatorLayout(@NonNull Context context, @Nullable AttributeSet attrs,
+ int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ mIsMatchParentHeight = false;
+ if (attrs != null) {
+ final TypedArray a = context.obtainStyledAttributes(attrs,
+ R.styleable.CollapsingCoordinatorLayout);
+ mToolbarTitle = a.getText(
+ R.styleable.CollapsingCoordinatorLayout_collapsing_toolbar_title);
+ mIsMatchParentHeight = a.getBoolean(
+ R.styleable.CollapsingCoordinatorLayout_content_frame_height_match_parent,
+ false);
+ a.recycle();
+ }
+ init();
+ }
+
+ @Override
+ public void addView(View child, int index, ViewGroup.LayoutParams params) {
+ if (child.getId() == R.id.content_frame && mIsMatchParentHeight) {
+ // User want to change the height of content_frame view as match_parent.
+ params.height = ViewGroup.LayoutParams.MATCH_PARENT;
+ }
+
+ final ViewGroup contentView = findViewById(R.id.content_frame);
+ if (contentView != null && isContentFrameChild(child.getId())) {
+ contentView.addView(child, index, params);
+ } else {
+ super.addView(child, index, params);
+ }
+ }
+
+ private boolean isContentFrameChild(int id) {
+ if (id == R.id.app_bar || id == R.id.content_frame) {
+ return false;
+ }
+ return true;
+ }
+
+ private void init() {
+ inflate(getContext(), R.layout.collapsing_toolbar_content_layout, this);
+ mCollapsingToolbarLayout = findViewById(R.id.collapsing_toolbar);
+ mAppBarLayout = findViewById(R.id.app_bar);
+ if (mCollapsingToolbarLayout != null) {
+ mCollapsingToolbarLayout.setLineSpacingMultiplier(TOOLBAR_LINE_SPACING_MULTIPLIER);
+ if (!TextUtils.isEmpty(mToolbarTitle)) {
+ mCollapsingToolbarLayout.setTitle(mToolbarTitle);
+ }
+ }
+ disableCollapsingToolbarLayoutScrollingBehavior();
+ }
+
+ /**
+ * Initialize some attributes of {@link ActionBar}.
+ *
+ * @param activity The host activity using the CollapsingCoordinatorLayout.
+ */
+ public void initSettingsStyleToolBar(Activity activity) {
+ if (activity == null) {
+ Log.w(TAG, "initSettingsStyleToolBar: activity is null");
+ return;
+ }
+
+ if (activity instanceof AppCompatActivity) {
+ initSupportToolbar((AppCompatActivity) activity);
+ return;
+ }
+
+ final Toolbar toolbar = findViewById(R.id.action_bar);
+ activity.setActionBar(toolbar);
+
+ // Enable title and home button by default
+ final ActionBar actionBar = activity.getActionBar();
+ if (actionBar != null) {
+ actionBar.setDisplayHomeAsUpEnabled(true);
+ actionBar.setHomeButtonEnabled(true);
+ actionBar.setDisplayShowTitleEnabled(true);
+ }
+ }
+
+ /**
+ * Initialize some attributes of {@link ActionBar} and assign the title of collapsing toolbar.
+ *
+ * @param activity The host activity using the CollapsingCoordinatorLayout.
+ * @param title The new title of collapsing toolbar.
+ */
+ public void initSettingsStyleToolBar(Activity activity, CharSequence title) {
+ if (activity == null) {
+ Log.w(TAG, "initSettingsStyleToolBar: activity is null");
+ return;
+ }
+ initSettingsStyleToolBar(activity);
+ if (!TextUtils.isEmpty(title) && mCollapsingToolbarLayout != null) {
+ mToolbarTitle = title;
+ mCollapsingToolbarLayout.setTitle(mToolbarTitle);
+ }
+ }
+
+ /**
+ * Returns an instance of collapsing toolbar.
+ */
+ public CollapsingToolbarLayout getCollapsingToolbarLayout() {
+ return mCollapsingToolbarLayout;
+ }
+
+ /**
+ * Return an instance of app bar.
+ */
+ public AppBarLayout getAppBarLayout() {
+ return mAppBarLayout;
+ }
+
+ private void disableCollapsingToolbarLayoutScrollingBehavior() {
+ if (mAppBarLayout == null) {
+ return;
+ }
+ final CoordinatorLayout.LayoutParams params =
+ (CoordinatorLayout.LayoutParams) mAppBarLayout.getLayoutParams();
+ final AppBarLayout.Behavior behavior = new AppBarLayout.Behavior();
+ behavior.setDragCallback(
+ new AppBarLayout.Behavior.DragCallback() {
+ @Override
+ public boolean canDrag(@NonNull AppBarLayout appBarLayout) {
+ return false;
+ }
+ });
+ params.setBehavior(behavior);
+ }
+
+ // This API is for supportActionBar of {@link AppCompatActivity}
+ private void initSupportToolbar(AppCompatActivity appCompatActivity) {
+ if (mCollapsingToolbarLayout == null) {
+ return;
+ }
+
+ mCollapsingToolbarLayout.removeAllViews();
+ inflate(getContext(), R.layout.support_toolbar, mCollapsingToolbarLayout);
+ final androidx.appcompat.widget.Toolbar supportToolbar =
+ mCollapsingToolbarLayout.findViewById(R.id.support_action_bar);
+
+ appCompatActivity.setSupportActionBar(supportToolbar);
+
+ // Enable title and home button by default
+ final androidx.appcompat.app.ActionBar actionBar = appCompatActivity.getSupportActionBar();
+ if (actionBar != null) {
+ actionBar.setDisplayHomeAsUpEnabled(true);
+ actionBar.setHomeButtonEnabled(true);
+ actionBar.setDisplayShowTitleEnabled(true);
+ }
+ }
+}
diff --git a/packages/SettingsLib/res/values-af/strings.xml b/packages/SettingsLib/res/values-af/strings.xml
index 13a5caf..7f5e8c4 100644
--- a/packages/SettingsLib/res/values-af/strings.xml
+++ b/packages/SettingsLib/res/values-af/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Nie geregistreer nie"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Onbeskikbaar"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC word ewekansig gemaak"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d toestelle is gekoppel</item>
- <item quantity="one">%1$d toestel is gekoppel</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 toestelle is gekoppel}=1{1 toestel is gekoppel}other{# toestelle is gekoppel}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Meer tyd."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Minder tyd."</string>
<string name="cancel" msgid="5665114069455378395">"Kanselleer"</string>
diff --git a/packages/SettingsLib/res/values-am/strings.xml b/packages/SettingsLib/res/values-am/strings.xml
index 7ad455a..0810032 100644
--- a/packages/SettingsLib/res/values-am/strings.xml
+++ b/packages/SettingsLib/res/values-am/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"አልተመዘገበም"</string>
<string name="status_unavailable" msgid="5279036186589861608">"አይገኝም"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"ማክ በዘፈቀደ ይሰራል"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d መሣሪያዎች ተገናኝተዋል</item>
- <item quantity="other">%1$d መሣሪያዎች ተገናኝተዋል</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"ተጨማሪ ጊዜ።"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"ያነሰ ጊዜ።"</string>
<string name="cancel" msgid="5665114069455378395">"ይቅር"</string>
diff --git a/packages/SettingsLib/res/values-ar/strings.xml b/packages/SettingsLib/res/values-ar/strings.xml
index a4646f1..6ebf521 100644
--- a/packages/SettingsLib/res/values-ar/strings.xml
+++ b/packages/SettingsLib/res/values-ar/strings.xml
@@ -526,14 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"غير مُسجَّل"</string>
<string name="status_unavailable" msgid="5279036186589861608">"غير متاح"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"يتم اختيار عنوان MAC بشكل انتقائي."</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="zero">عدد الأجهزة المتصلة %1$d</item>
- <item quantity="two">عدد الأجهزة المتصلة %1$d</item>
- <item quantity="few">عدد الأجهزة المتصلة %1$d</item>
- <item quantity="many">عدد الأجهزة المتصلة %1$d</item>
- <item quantity="other">عدد الأجهزة المتصلة %1$d</item>
- <item quantity="one">عدد الأجهزة المتصلة %1$d</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"وقت أكثر."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"وقت أقل."</string>
<string name="cancel" msgid="5665114069455378395">"إلغاء"</string>
diff --git a/packages/SettingsLib/res/values-as/strings.xml b/packages/SettingsLib/res/values-as/strings.xml
index c304921..a5c9324 100644
--- a/packages/SettingsLib/res/values-as/strings.xml
+++ b/packages/SettingsLib/res/values-as/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"পঞ্জীকৃত নহয়"</string>
<string name="status_unavailable" msgid="5279036186589861608">"উপলব্ধ নহয়"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC ক্ৰমানুসৰি ছেট কৰা হোৱা নাই"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$dটা ডিভাইচ সংযোগ হ’ল</item>
- <item quantity="other">%1$dটা ডিভাইচ সংযোগ হ’ল</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"অধিক সময়।"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"কম সময়।"</string>
<string name="cancel" msgid="5665114069455378395">"বাতিল কৰক"</string>
diff --git a/packages/SettingsLib/res/values-az/strings.xml b/packages/SettingsLib/res/values-az/strings.xml
index 6e3947e..eafb2cb 100644
--- a/packages/SettingsLib/res/values-az/strings.xml
+++ b/packages/SettingsLib/res/values-az/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Qeydiyyatsız"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Əlçatmazdır"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC ixtiyari olaraq seçildi"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d cihaz qoşuludur</item>
- <item quantity="one">%1$d cihaz qoşuludur</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Daha çox vaxt."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Daha az vaxt."</string>
<string name="cancel" msgid="5665114069455378395">"Ləğv edin"</string>
diff --git a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
index a05dae9..21fcbdc 100644
--- a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
+++ b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
@@ -526,11 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Nije registrovan"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Nedostupno"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC adresa je nasumično izabrana"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">Povezan je %1$d uređaj</item>
- <item quantity="few">Povezana su %1$d uređaja</item>
- <item quantity="other">Povezano je %1$d uređaja</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 uređaja je povezano}=1{1 uređaj je povezan}one{# uređaj je povezan}few{# uređaja su povezana}other{# uređaja je povezano}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Više vremena."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Manje vremena."</string>
<string name="cancel" msgid="5665114069455378395">"Otkaži"</string>
diff --git a/packages/SettingsLib/res/values-be/strings.xml b/packages/SettingsLib/res/values-be/strings.xml
index e3b0567..8610554 100644
--- a/packages/SettingsLib/res/values-be/strings.xml
+++ b/packages/SettingsLib/res/values-be/strings.xml
@@ -526,12 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Не зарэгістраваны"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Адсутнічае"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Выпадковы MAC-адрас"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d прылада падключана</item>
- <item quantity="few">%1$d прылады падключаны</item>
- <item quantity="many">%1$d прылад падключана</item>
- <item quantity="other">%1$d прылады падключана</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Больш часу."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Менш часу."</string>
<string name="cancel" msgid="5665114069455378395">"Скасаваць"</string>
diff --git a/packages/SettingsLib/res/values-bg/strings.xml b/packages/SettingsLib/res/values-bg/strings.xml
index a8eaaf0..a2a5411 100644
--- a/packages/SettingsLib/res/values-bg/strings.xml
+++ b/packages/SettingsLib/res/values-bg/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Не е регистрирано"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Няма данни"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC адресът е рандомизиран"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d устройства са свързани</item>
- <item quantity="one">%1$d устройство е свързано</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Повече време."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"По-малко време."</string>
<string name="cancel" msgid="5665114069455378395">"Отказ"</string>
diff --git a/packages/SettingsLib/res/values-bn/strings.xml b/packages/SettingsLib/res/values-bn/strings.xml
index c28e927..f7cf7e5 100644
--- a/packages/SettingsLib/res/values-bn/strings.xml
+++ b/packages/SettingsLib/res/values-bn/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"রেজিস্টার করা নয়"</string>
<string name="status_unavailable" msgid="5279036186589861608">"অনুপলভ্য"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC র্যান্ডমাইজ করা হয়েছে"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$dটি ডিভাইস কানেক্ট রয়েছে</item>
- <item quantity="other">%1$dটি ডিভাইস কানেক্ট রয়েছে</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{০টি ডিভাইস কানেক্ট করা হয়েছে}=1{১টি ডিভাইস কানেক্ট করা হয়েছে}one{#টি ডিভাইস কানেক্ট করা হয়েছে}other{#টি ডিভাইস কানেক্ট করা হয়েছে}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"আরও বেশি।"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"আরও কম।"</string>
<string name="cancel" msgid="5665114069455378395">"বাতিল"</string>
diff --git a/packages/SettingsLib/res/values-bs/strings.xml b/packages/SettingsLib/res/values-bs/strings.xml
index 232c22f..3f70e82 100644
--- a/packages/SettingsLib/res/values-bs/strings.xml
+++ b/packages/SettingsLib/res/values-bs/strings.xml
@@ -526,11 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Nije registrirano"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Nije dostupno"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC adresa je nasumično odabrana"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">Povezan je %1$d uređaj</item>
- <item quantity="few">Povezana su %1$duređaja</item>
- <item quantity="other">Povezano je %1$d uređaja</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{Povezano je 0 uređaja}=1{Povezan je 1 uređaj}one{Povezan je # uređaj}few{Povezana su # uređaja}other{Povezano je # uređaja}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Više vremena."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Manje vremena."</string>
<string name="cancel" msgid="5665114069455378395">"Otkaži"</string>
diff --git a/packages/SettingsLib/res/values-ca/strings.xml b/packages/SettingsLib/res/values-ca/strings.xml
index bc393c3..49de565 100644
--- a/packages/SettingsLib/res/values-ca/strings.xml
+++ b/packages/SettingsLib/res/values-ca/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Sense registrar"</string>
<string name="status_unavailable" msgid="5279036186589861608">"No disponible"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"L\'adreça MAC és aleatòria"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d dispositius connectats</item>
- <item quantity="one">%1$d dispositiu connectat</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Més temps"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Menys temps"</string>
<string name="cancel" msgid="5665114069455378395">"Cancel·la"</string>
diff --git a/packages/SettingsLib/res/values-cs/strings.xml b/packages/SettingsLib/res/values-cs/strings.xml
index f758365..bc755c5 100644
--- a/packages/SettingsLib/res/values-cs/strings.xml
+++ b/packages/SettingsLib/res/values-cs/strings.xml
@@ -526,12 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Neregistrováno"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Není k dispozici"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Adresa MAC je vybrána náhodně"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="few">Připojena %1$d zařízení</item>
- <item quantity="many">Připojeno %1$d zařízení</item>
- <item quantity="other">Připojeno %1$d zařízení</item>
- <item quantity="one">Připojeno %1$d zařízení</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Delší doba"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Kratší doba"</string>
<string name="cancel" msgid="5665114069455378395">"Zrušit"</string>
diff --git a/packages/SettingsLib/res/values-da/strings.xml b/packages/SettingsLib/res/values-da/strings.xml
index 0fd2569..21dc551 100644
--- a/packages/SettingsLib/res/values-da/strings.xml
+++ b/packages/SettingsLib/res/values-da/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Ikke registreret"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Utilgængelig"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC-adressen er tilfældig"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d enhed er tilsluttet</item>
- <item quantity="other">%1$d enheder er tilsluttet</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Mere tid."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Mindre tid."</string>
<string name="cancel" msgid="5665114069455378395">"Annuller"</string>
diff --git a/packages/SettingsLib/res/values-de/strings.xml b/packages/SettingsLib/res/values-de/strings.xml
index f75685b..bd6c74e 100644
--- a/packages/SettingsLib/res/values-de/strings.xml
+++ b/packages/SettingsLib/res/values-de/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Nicht registriert"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Nicht verfügbar"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC-Adresse wird zufällig festgelegt"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d Geräte verbunden</item>
- <item quantity="one">%1$d Gerät verbunden</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 Geräte verbunden}=1{1 Gerät verbunden}other{# Geräte verbunden}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Mehr Zeit."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Weniger Zeit."</string>
<string name="cancel" msgid="5665114069455378395">"Abbrechen"</string>
diff --git a/packages/SettingsLib/res/values-el/strings.xml b/packages/SettingsLib/res/values-el/strings.xml
index 5115728..2339f9b 100644
--- a/packages/SettingsLib/res/values-el/strings.xml
+++ b/packages/SettingsLib/res/values-el/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Μη εγγεγραμμένη"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Μη διαθέσιμο"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Η διεύθυνση MAC είναι τυχαία"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d συσκευές συνδέθηκαν</item>
- <item quantity="one">%1$d συσκευή συνδέθηκε</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 συνδεδεμένες συσκευές}=1{1 συνδεδεμένη συσκευή}other{# συνδεδεμένες συσκευές}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Περισσότερη ώρα."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Λιγότερη ώρα."</string>
<string name="cancel" msgid="5665114069455378395">"Ακύρωση"</string>
diff --git a/packages/SettingsLib/res/values-en-rAU/strings.xml b/packages/SettingsLib/res/values-en-rAU/strings.xml
index 1481cee..72100ee 100644
--- a/packages/SettingsLib/res/values-en-rAU/strings.xml
+++ b/packages/SettingsLib/res/values-en-rAU/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Not registered"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Unavailable"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC is randomised"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d devices connected</item>
- <item quantity="one">%1$d device connected</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 device connected}=1{1 device connected}other{# devices connected}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"More time."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Less time."</string>
<string name="cancel" msgid="5665114069455378395">"Cancel"</string>
diff --git a/packages/SettingsLib/res/values-en-rCA/strings.xml b/packages/SettingsLib/res/values-en-rCA/strings.xml
index b3dd58a..41bc981 100644
--- a/packages/SettingsLib/res/values-en-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-en-rCA/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Not registered"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Unavailable"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC is randomised"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d devices connected</item>
- <item quantity="one">%1$d device connected</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 device connected}=1{1 device connected}other{# devices connected}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"More time."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Less time."</string>
<string name="cancel" msgid="5665114069455378395">"Cancel"</string>
diff --git a/packages/SettingsLib/res/values-en-rGB/strings.xml b/packages/SettingsLib/res/values-en-rGB/strings.xml
index 1481cee..72100ee 100644
--- a/packages/SettingsLib/res/values-en-rGB/strings.xml
+++ b/packages/SettingsLib/res/values-en-rGB/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Not registered"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Unavailable"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC is randomised"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d devices connected</item>
- <item quantity="one">%1$d device connected</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 device connected}=1{1 device connected}other{# devices connected}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"More time."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Less time."</string>
<string name="cancel" msgid="5665114069455378395">"Cancel"</string>
diff --git a/packages/SettingsLib/res/values-en-rIN/strings.xml b/packages/SettingsLib/res/values-en-rIN/strings.xml
index 1481cee..72100ee 100644
--- a/packages/SettingsLib/res/values-en-rIN/strings.xml
+++ b/packages/SettingsLib/res/values-en-rIN/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Not registered"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Unavailable"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC is randomised"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d devices connected</item>
- <item quantity="one">%1$d device connected</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 device connected}=1{1 device connected}other{# devices connected}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"More time."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Less time."</string>
<string name="cancel" msgid="5665114069455378395">"Cancel"</string>
diff --git a/packages/SettingsLib/res/values-en-rXC/strings.xml b/packages/SettingsLib/res/values-en-rXC/strings.xml
index 2a6c82c..e88b6b2 100644
--- a/packages/SettingsLib/res/values-en-rXC/strings.xml
+++ b/packages/SettingsLib/res/values-en-rXC/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Not registered"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Unavailable"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC is randomized"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d devices connected</item>
- <item quantity="one">%1$d device connected</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 device connected}=1{1 device connected}other{# devices connected}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"More time."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Less time."</string>
<string name="cancel" msgid="5665114069455378395">"Cancel"</string>
diff --git a/packages/SettingsLib/res/values-es-rUS/strings.xml b/packages/SettingsLib/res/values-es-rUS/strings.xml
index ee0e0bc..f3129c9 100644
--- a/packages/SettingsLib/res/values-es-rUS/strings.xml
+++ b/packages/SettingsLib/res/values-es-rUS/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Sin registrar"</string>
<string name="status_unavailable" msgid="5279036186589861608">"No disponible"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"La dirección MAC es aleatoria"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d dispositivos conectados</item>
- <item quantity="one">%1$d dispositivo conectado</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{Se conectaron 0 dispositivos}=1{Se conectó 1 dispositivo}other{Se conectaron # dispositivos}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Más tiempo"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Menos tiempo"</string>
<string name="cancel" msgid="5665114069455378395">"Cancelar"</string>
diff --git a/packages/SettingsLib/res/values-es/strings.xml b/packages/SettingsLib/res/values-es/strings.xml
index 1f64bad..26dd243 100644
--- a/packages/SettingsLib/res/values-es/strings.xml
+++ b/packages/SettingsLib/res/values-es/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"No registrado"</string>
<string name="status_unavailable" msgid="5279036186589861608">"No disponible"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"La dirección MAC es aleatoria"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d dispositivos conectados</item>
- <item quantity="one">%1$d dispositivo conectado</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Más tiempo."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Menos tiempo."</string>
<string name="cancel" msgid="5665114069455378395">"Cancelar"</string>
diff --git a/packages/SettingsLib/res/values-et/strings.xml b/packages/SettingsLib/res/values-et/strings.xml
index ed7b9dc..ccb2867 100644
--- a/packages/SettingsLib/res/values-et/strings.xml
+++ b/packages/SettingsLib/res/values-et/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Ei ole registreeritud"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Pole saadaval"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC-aadress on juhuslikuks muudetud"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d seadet on ühendatud</item>
- <item quantity="one">%1$d seade on ühendatud</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Pikem aeg."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Lühem aeg."</string>
<string name="cancel" msgid="5665114069455378395">"Tühista"</string>
diff --git a/packages/SettingsLib/res/values-eu/strings.xml b/packages/SettingsLib/res/values-eu/strings.xml
index 5222d8a..e302bce 100644
--- a/packages/SettingsLib/res/values-eu/strings.xml
+++ b/packages/SettingsLib/res/values-eu/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Erregistratu gabe"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Ez dago erabilgarri"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Ausaz aukeratutako MAC helbidea"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d gailu daude konektatuta</item>
- <item quantity="one">%1$d gailu dago konektatuta</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 gailu daude konektatuta}=1{1 gailu dago konektatuta}other{# gailu daude konektatuta}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Denbora gehiago."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Denbora gutxiago."</string>
<string name="cancel" msgid="5665114069455378395">"Utzi"</string>
diff --git a/packages/SettingsLib/res/values-fa/strings.xml b/packages/SettingsLib/res/values-fa/strings.xml
index 1b5f979..bf6ca7d 100644
--- a/packages/SettingsLib/res/values-fa/strings.xml
+++ b/packages/SettingsLib/res/values-fa/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"ثبت نشده است"</string>
<string name="status_unavailable" msgid="5279036186589861608">"در دسترس نیست"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"ویژگی MAC تصادفی است"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d دستگاه متصل</item>
- <item quantity="other">%1$d دستگاه متصل</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{هیچ دستگاهی متصل نیست}=1{یک دستگاه متصل است}one{# دستگاه متصل است}other{# دستگاه متصل است}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"زمان بیشتر."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"زمان کمتر."</string>
<string name="cancel" msgid="5665114069455378395">"لغو"</string>
diff --git a/packages/SettingsLib/res/values-fi/strings.xml b/packages/SettingsLib/res/values-fi/strings.xml
index 4103a9f..3909b31 100644
--- a/packages/SettingsLib/res/values-fi/strings.xml
+++ b/packages/SettingsLib/res/values-fi/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Ei rekisteröity"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Ei käytettävissä"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC-osoite satunnaistetaan"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d laitetta yhdistettynä</item>
- <item quantity="one">%1$d laite yhdistettynä</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Enemmän aikaa"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Vähemmän aikaa"</string>
<string name="cancel" msgid="5665114069455378395">"Peru"</string>
diff --git a/packages/SettingsLib/res/values-fr-rCA/strings.xml b/packages/SettingsLib/res/values-fr-rCA/strings.xml
index ab36e11..dd75461 100644
--- a/packages/SettingsLib/res/values-fr-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-fr-rCA/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Non enregistré"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Non accessible"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Les adresses MAC sont randomisées"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d appareil connecté</item>
- <item quantity="other">%1$d appareils connectés</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Plus longtemps."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Moins longtemps."</string>
<string name="cancel" msgid="5665114069455378395">"Annuler"</string>
diff --git a/packages/SettingsLib/res/values-fr/strings.xml b/packages/SettingsLib/res/values-fr/strings.xml
index 35f2fce..0079b45 100644
--- a/packages/SettingsLib/res/values-fr/strings.xml
+++ b/packages/SettingsLib/res/values-fr/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Non enregistré"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Non disponible"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"La sélection des adresses MAC est aléatoire"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d appareil connecté</item>
- <item quantity="other">%1$d appareils connectés</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Plus longtemps."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Moins longtemps."</string>
<string name="cancel" msgid="5665114069455378395">"Annuler"</string>
diff --git a/packages/SettingsLib/res/values-gl/strings.xml b/packages/SettingsLib/res/values-gl/strings.xml
index 8d23864..4daa939 100644
--- a/packages/SettingsLib/res/values-gl/strings.xml
+++ b/packages/SettingsLib/res/values-gl/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Non rexistrado"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Non dispoñible"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"O enderezo MAC é aleatorio"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d dispositivos conectados</item>
- <item quantity="one">%1$d dispositivo conectado</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Máis tempo."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Menos tempo."</string>
<string name="cancel" msgid="5665114069455378395">"Cancelar"</string>
diff --git a/packages/SettingsLib/res/values-gu/strings.xml b/packages/SettingsLib/res/values-gu/strings.xml
index ac38a64..f9e1b9f 100644
--- a/packages/SettingsLib/res/values-gu/strings.xml
+++ b/packages/SettingsLib/res/values-gu/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"રજિસ્ટર કરેલ નથી"</string>
<string name="status_unavailable" msgid="5279036186589861608">"અનુપલબ્ધ"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MACને રેન્ડમ કરેલ છે"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d ડિવાઇસ કનેક્ટ કર્યું</item>
- <item quantity="other">%1$d ડિવાઇસ કનેક્ટ કર્યા</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{કોઈ ડિવાઇસ કનેક્ટેડ નથી}=1{1 ડિવાઇસ કનેક્ટેડ છે}one{# ડિવાઇસ કનેક્ટેડ છે}other{# ડિવાઇસ કનેક્ટેડ છે}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"વધુ સમય."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"ઓછો સમય."</string>
<string name="cancel" msgid="5665114069455378395">"રદ કરો"</string>
diff --git a/packages/SettingsLib/res/values-hi/strings.xml b/packages/SettingsLib/res/values-hi/strings.xml
index 5c008f0..8bc4119 100644
--- a/packages/SettingsLib/res/values-hi/strings.xml
+++ b/packages/SettingsLib/res/values-hi/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"रजिस्टर नहीं है"</string>
<string name="status_unavailable" msgid="5279036186589861608">"मौजूद नहीं है"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"एमएसी पता रैंडम पर सेट है"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d डिवाइस जुड़ा है</item>
- <item quantity="other">%1$d डिवाइस जुड़े हैं</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"ज़्यादा समय."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"कम समय."</string>
<string name="cancel" msgid="5665114069455378395">"रद्द करें"</string>
diff --git a/packages/SettingsLib/res/values-hr/strings.xml b/packages/SettingsLib/res/values-hr/strings.xml
index d681a1e..ace20cc 100644
--- a/packages/SettingsLib/res/values-hr/strings.xml
+++ b/packages/SettingsLib/res/values-hr/strings.xml
@@ -526,11 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Nije registrirano"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Nije dostupno"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC adresa određena je nasumično"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">Povezan je %1$d uređaj</item>
- <item quantity="few">Povezana su %1$d uređaja</item>
- <item quantity="other">Povezano je %1$d uređaja</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{Povezano je 0 uređaja}=1{Povezan je jedan uređaj}one{Povezan je # uređaj}few{Povezana su # uređaja}other{Povezano je # uređaja}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Više vremena."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Manje vremena."</string>
<string name="cancel" msgid="5665114069455378395">"Odustani"</string>
diff --git a/packages/SettingsLib/res/values-hu/strings.xml b/packages/SettingsLib/res/values-hu/strings.xml
index 57894a0..a0e4216 100644
--- a/packages/SettingsLib/res/values-hu/strings.xml
+++ b/packages/SettingsLib/res/values-hu/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Nem regisztrált"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Nem érhető el"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"A MAC-cím generálása véletlenszerű."</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d eszköz csatlakozik</item>
- <item quantity="one">%1$d eszköz csatlakozik</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Több idő."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Kevesebb idő."</string>
<string name="cancel" msgid="5665114069455378395">"Mégse"</string>
diff --git a/packages/SettingsLib/res/values-hy/strings.xml b/packages/SettingsLib/res/values-hy/strings.xml
index e6ed2b0..34c674b 100644
--- a/packages/SettingsLib/res/values-hy/strings.xml
+++ b/packages/SettingsLib/res/values-hy/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Գրանցված չէ"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Անհասանելի"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC հասցեն պատահականորեն է փոխվում"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">Միացված է %1$d սարք</item>
- <item quantity="other">Միացված է %1$d սարք</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{Թեժ կետին միացված սարքեր չկան}=1{Թեժ կետին 1 սարք է միացված}one{Թեժ կետին # սարք է միացված}other{Թեժ կետին # սարք է միացված}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Ավելացնել ժամանակը:"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Պակասեցնել ժամանակը:"</string>
<string name="cancel" msgid="5665114069455378395">"Չեղարկել"</string>
diff --git a/packages/SettingsLib/res/values-in/strings.xml b/packages/SettingsLib/res/values-in/strings.xml
index 6fbab2b..2748a50 100644
--- a/packages/SettingsLib/res/values-in/strings.xml
+++ b/packages/SettingsLib/res/values-in/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Tidak terdaftar"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Tidak tersedia"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC diacak"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d perangkat terhubung</item>
- <item quantity="one">%1$d perangkat terhubung</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Lebih lama."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Lebih cepat."</string>
<string name="cancel" msgid="5665114069455378395">"Batal"</string>
diff --git a/packages/SettingsLib/res/values-is/strings.xml b/packages/SettingsLib/res/values-is/strings.xml
index fa11dfb..eeaf89b 100644
--- a/packages/SettingsLib/res/values-is/strings.xml
+++ b/packages/SettingsLib/res/values-is/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Ekki skráð"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Ekki tiltækt"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC-vistfang er valið af handahófi"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d tæki tengt</item>
- <item quantity="other">%1$d tæki tengd</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Meiri tími."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Minni tími."</string>
<string name="cancel" msgid="5665114069455378395">"Hætta við"</string>
diff --git a/packages/SettingsLib/res/values-it/strings.xml b/packages/SettingsLib/res/values-it/strings.xml
index 0db0448..e74ac154 100644
--- a/packages/SettingsLib/res/values-it/strings.xml
+++ b/packages/SettingsLib/res/values-it/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Non registrato"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Non disponibile"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Selezione casuale dell\'indirizzo MAC"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d devices connected</item>
- <item quantity="other">%1$d dispositivi connessi</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Più tempo."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Meno tempo."</string>
<string name="cancel" msgid="5665114069455378395">"Annulla"</string>
diff --git a/packages/SettingsLib/res/values-iw/strings.xml b/packages/SettingsLib/res/values-iw/strings.xml
index 7ac5919..5da910b 100644
--- a/packages/SettingsLib/res/values-iw/strings.xml
+++ b/packages/SettingsLib/res/values-iw/strings.xml
@@ -526,12 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"לא רשום"</string>
<string name="status_unavailable" msgid="5279036186589861608">"לא זמין"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"כתובת ה-MAC אקראית"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="two">%1$d מכשירים מחוברים</item>
- <item quantity="many">%1$d מכשירים מחוברים</item>
- <item quantity="other">%1$d מכשירים מחוברים</item>
- <item quantity="one">מכשיר אחד מחובר</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"יותר זמן."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"פחות זמן."</string>
<string name="cancel" msgid="5665114069455378395">"ביטול"</string>
diff --git a/packages/SettingsLib/res/values-ja/strings.xml b/packages/SettingsLib/res/values-ja/strings.xml
index d82ca5d..c104b03 100644
--- a/packages/SettingsLib/res/values-ja/strings.xml
+++ b/packages/SettingsLib/res/values-ja/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"未登録"</string>
<string name="status_unavailable" msgid="5279036186589861608">"不明"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC はランダムに設定されます"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d 台のデバイスが接続されています</item>
- <item quantity="one">%1$d 台のデバイスが接続されています</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{接続されているデバイスはありません}=1{1 台のデバイスが接続されています}other{# 台のデバイスが接続されています}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"長くします。"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"短くします。"</string>
<string name="cancel" msgid="5665114069455378395">"キャンセル"</string>
diff --git a/packages/SettingsLib/res/values-ka/strings.xml b/packages/SettingsLib/res/values-ka/strings.xml
index 02c1084..6c3e68a4 100644
--- a/packages/SettingsLib/res/values-ka/strings.xml
+++ b/packages/SettingsLib/res/values-ka/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"არარეგისტრირებული"</string>
<string name="status_unavailable" msgid="5279036186589861608">"მიუწვდომელია"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC-ის მიმდევრობა არეულია"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">დაკავშირებულია %1$d მოწყობილობა</item>
- <item quantity="one">დაკავშირებულია %1$d მოწყობილობა</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"მეტი დრო."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"ნაკლები დრო."</string>
<string name="cancel" msgid="5665114069455378395">"გაუქმება"</string>
diff --git a/packages/SettingsLib/res/values-kk/strings.xml b/packages/SettingsLib/res/values-kk/strings.xml
index 6c55b62..2b700b5 100644
--- a/packages/SettingsLib/res/values-kk/strings.xml
+++ b/packages/SettingsLib/res/values-kk/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Тіркелмеген"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Қолжетімсіз"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC еркін таңдауға қойылды"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d құрылғы қосылды</item>
- <item quantity="one">%1$d құрылғы қосылды</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Көбірек уақыт."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Азырақ уақыт."</string>
<string name="cancel" msgid="5665114069455378395">"Бас тарту"</string>
diff --git a/packages/SettingsLib/res/values-km/strings.xml b/packages/SettingsLib/res/values-km/strings.xml
index 58a2c7c..c8af0df 100644
--- a/packages/SettingsLib/res/values-km/strings.xml
+++ b/packages/SettingsLib/res/values-km/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"មិនបានចុះឈ្មោះ"</string>
<string name="status_unavailable" msgid="5279036186589861608">"មិនមាន"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC ត្រូវបានជ្រើសរើសដោយចៃដន្យ"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">ឧបករណ៍ %1$d បានភ្ជាប់</item>
- <item quantity="one">ឧបករណ៍ %1$d បានភ្ជាប់</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"រយៈពេលច្រើនជាង។"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"រយៈពេលតិចជាង។"</string>
<string name="cancel" msgid="5665114069455378395">"បោះបង់"</string>
diff --git a/packages/SettingsLib/res/values-kn/strings.xml b/packages/SettingsLib/res/values-kn/strings.xml
index 91e76e2..eeff165 100644
--- a/packages/SettingsLib/res/values-kn/strings.xml
+++ b/packages/SettingsLib/res/values-kn/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"ನೋಂದಾಯಿಸಲಾಗಿಲ್ಲ"</string>
<string name="status_unavailable" msgid="5279036186589861608">"ಲಭ್ಯವಿಲ್ಲ"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC ಯಾದೃಚ್ಛಿಕವಾಗಿದೆ"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d ಸಾಧನಗಳನ್ನು ಸಂಪರ್ಕಿಸಲಾಗಿದೆ</item>
- <item quantity="other">%1$d ಸಾಧನಗಳನ್ನು ಸಂಪರ್ಕಿಸಲಾಗಿದೆ</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 ಸಾಧನವನ್ನು ಕನೆಕ್ಟ್ ಮಾಡಲಾಗಿದೆ}=1{1 ಸಾಧನವನ್ನು ಕನೆಕ್ಟ್ ಮಾಡಲಾಗಿದೆ}one{# ಸಾಧನಗಳನ್ನು ಕನೆಕ್ಟ್ ಮಾಡಲಾಗಿದೆ}other{# ಸಾಧನಗಳನ್ನು ಕನೆಕ್ಟ್ ಮಾಡಲಾಗಿದೆ}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"ಹೆಚ್ಚು ಸಮಯ."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"ಕಡಿಮೆ ಸಮಯ."</string>
<string name="cancel" msgid="5665114069455378395">"ರದ್ದುಮಾಡಿ"</string>
diff --git a/packages/SettingsLib/res/values-ko/strings.xml b/packages/SettingsLib/res/values-ko/strings.xml
index d470560..15bf7bc 100644
--- a/packages/SettingsLib/res/values-ko/strings.xml
+++ b/packages/SettingsLib/res/values-ko/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"등록되지 않음"</string>
<string name="status_unavailable" msgid="5279036186589861608">"사용할 수 없음"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC가 임의 선택됨"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">기기 %1$d개 연결됨</item>
- <item quantity="one">기기 %1$d개 연결됨</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"시간 늘리기"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"시간 줄이기"</string>
<string name="cancel" msgid="5665114069455378395">"취소"</string>
diff --git a/packages/SettingsLib/res/values-ky/strings.xml b/packages/SettingsLib/res/values-ky/strings.xml
index e38bb51a..86f75eb 100644
--- a/packages/SettingsLib/res/values-ky/strings.xml
+++ b/packages/SettingsLib/res/values-ky/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Катталган эмес"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Жеткиликсиз"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC дарегин кокустан тандоо иштетилген"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d түзмөк туташып турат</item>
- <item quantity="one">%1$d түзмөк туташып турат</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 түзмөк туташып турат}=1{1 түзмөк туташып турат}other{# түзмөк туташып турат}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Көбүрөөк убакыт."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Азыраак убакыт."</string>
<string name="cancel" msgid="5665114069455378395">"Жок"</string>
diff --git a/packages/SettingsLib/res/values-lo/strings.xml b/packages/SettingsLib/res/values-lo/strings.xml
index cc02292..6133455 100644
--- a/packages/SettingsLib/res/values-lo/strings.xml
+++ b/packages/SettingsLib/res/values-lo/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"ບໍ່ໄດ້ລົງທະບຽນ"</string>
<string name="status_unavailable" msgid="5279036186589861608">"ບໍ່ມີຂໍ້ມູນ"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC is randomized"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">ເຊື່ອມຕໍ່ %1$d ອຸປະກອນແລ້ວ</item>
- <item quantity="one">ເຊື່ອມຕໍ່ %1$d ອຸປະກອນແລ້ວ</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"ເພີ່ມເວລາ."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"ຫຼຸດເວລາ."</string>
<string name="cancel" msgid="5665114069455378395">"ຍົກເລີກ"</string>
diff --git a/packages/SettingsLib/res/values-lt/strings.xml b/packages/SettingsLib/res/values-lt/strings.xml
index fb645a0..d089a8c 100644
--- a/packages/SettingsLib/res/values-lt/strings.xml
+++ b/packages/SettingsLib/res/values-lt/strings.xml
@@ -526,12 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Neužregistruota"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Užimta"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC parinktas atsitiktine tvarka"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">Prijungtas %1$d įrenginys</item>
- <item quantity="few">Prijungti %1$d įrenginiai</item>
- <item quantity="many">Prijungta %1$d įrenginio</item>
- <item quantity="other">Prijungta %1$d įrenginių</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Daugiau laiko."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Mažiau laiko."</string>
<string name="cancel" msgid="5665114069455378395">"Atšaukti"</string>
diff --git a/packages/SettingsLib/res/values-lv/strings.xml b/packages/SettingsLib/res/values-lv/strings.xml
index 694ff0a..a28e8ab 100644
--- a/packages/SettingsLib/res/values-lv/strings.xml
+++ b/packages/SettingsLib/res/values-lv/strings.xml
@@ -526,11 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Nav reģistrēts"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Nepieejams"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC ir atlasīts nejaušā secībā"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="zero">Pievienotas %1$d ierīces</item>
- <item quantity="one">Pievienota %1$d ierīce</item>
- <item quantity="other">Pievienotas %1$d ierīces</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Vairāk laika."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Mazāk laika."</string>
<string name="cancel" msgid="5665114069455378395">"Atcelt"</string>
diff --git a/packages/SettingsLib/res/values-mk/strings.xml b/packages/SettingsLib/res/values-mk/strings.xml
index 9d412fc..d02e341 100644
--- a/packages/SettingsLib/res/values-mk/strings.xml
+++ b/packages/SettingsLib/res/values-mk/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Не е регистриран"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Недостапно"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC-адресата е рандомизирана"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">Поврзан е %1$d уред</item>
- <item quantity="other">Поврзани се %1$d уреди</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 поврзани уреди}=1{1 поврзан уред}one{# поврзан уред}other{# поврзани уреди}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Повеќе време."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Помалку време."</string>
<string name="cancel" msgid="5665114069455378395">"Откажи"</string>
diff --git a/packages/SettingsLib/res/values-ml/strings.xml b/packages/SettingsLib/res/values-ml/strings.xml
index 82df16c0..c952b25 100644
--- a/packages/SettingsLib/res/values-ml/strings.xml
+++ b/packages/SettingsLib/res/values-ml/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"രജിസ്റ്റർ ചെയ്തിട്ടില്ല"</string>
<string name="status_unavailable" msgid="5279036186589861608">"ലഭ്യമല്ല"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC യാദൃച്ഛികമാക്കിയിരിക്കുന്നു"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d ഉപകരണങ്ങൾ കണക്റ്റ് ചെയ്തു</item>
- <item quantity="one">%1$d ഉപകരണം കണക്റ്റ് ചെയ്തു</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 ഉപകരണം കണക്റ്റ് ചെയ്തു}=1{1 ഉപകരണം കണക്റ്റ് ചെയ്തു}other{# ഉപകരണങ്ങൾ കണക്റ്റ് ചെയ്തു}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"കൂടുതൽ സമയം."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"കുറഞ്ഞ സമയം."</string>
<string name="cancel" msgid="5665114069455378395">"റദ്ദാക്കുക"</string>
diff --git a/packages/SettingsLib/res/values-mn/strings.xml b/packages/SettingsLib/res/values-mn/strings.xml
index 027b722..dd5946b 100644
--- a/packages/SettingsLib/res/values-mn/strings.xml
+++ b/packages/SettingsLib/res/values-mn/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Бүртгээгүй"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Байхгүй"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC хаягийг үүсгэсэн"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d төхөөрөмж холбосон</item>
- <item quantity="one">%1$d төхөөрөмж холбосон</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 төхөөрөмж холбогдсон}=1{1 төхөөрөмж холбогдсон}other{# төхөөрөмж холбогдсон}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Их хугацаа."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Бага хугацаа."</string>
<string name="cancel" msgid="5665114069455378395">"Цуцлах"</string>
diff --git a/packages/SettingsLib/res/values-mr/strings.xml b/packages/SettingsLib/res/values-mr/strings.xml
index 176d764..fdbd313 100644
--- a/packages/SettingsLib/res/values-mr/strings.xml
+++ b/packages/SettingsLib/res/values-mr/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"नोंदवलेले नाही"</string>
<string name="status_unavailable" msgid="5279036186589861608">"उपलब्ध नाही"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC रँडमाइझ केला आहे"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d डिव्हाइस कनेक्ट केली आहेत</item>
- <item quantity="one">%1$d डिव्हाइस कनेक्ट केले आहे</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 device connected}=1{एक डिव्हाइस कनेक्ट केले}other{# डिव्हाइस कनेक्ट केली}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"जास्त वेळ."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"कमी वेळ."</string>
<string name="cancel" msgid="5665114069455378395">"रद्द करा"</string>
diff --git a/packages/SettingsLib/res/values-ms/strings.xml b/packages/SettingsLib/res/values-ms/strings.xml
index 6bf15fe..f3be25f 100644
--- a/packages/SettingsLib/res/values-ms/strings.xml
+++ b/packages/SettingsLib/res/values-ms/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Tidak didaftarkan"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Tidak tersedia"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC dirawakkan"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d peranti disambungkan</item>
- <item quantity="one">%1$d peranti disambungkan</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 peranti disambungkan}=1{1 peranti disambungkan}other{# peranti disambungkan}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Lagi masa."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Kurang masa."</string>
<string name="cancel" msgid="5665114069455378395">"Batal"</string>
diff --git a/packages/SettingsLib/res/values-my/strings.xml b/packages/SettingsLib/res/values-my/strings.xml
index 13fc6ad..7fbfd60 100644
--- a/packages/SettingsLib/res/values-my/strings.xml
+++ b/packages/SettingsLib/res/values-my/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"မှတ်ပုံတင်မထားပါ"</string>
<string name="status_unavailable" msgid="5279036186589861608">"မရရှိနိုင်ပါ။"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC ကို ကျပန်းပေးထားသည်"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">စက် %1$d ခု ချိတ်ဆက်ထားသည်</item>
- <item quantity="one">စက် %1$d ခု ချိတ်ဆက်ထားသည်</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"အချိန်တိုးရန်။"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"အချိန်လျှော့ရန်။"</string>
<string name="cancel" msgid="5665114069455378395">"မလုပ်တော့"</string>
diff --git a/packages/SettingsLib/res/values-nb/strings.xml b/packages/SettingsLib/res/values-nb/strings.xml
index c2e449b..5b999ba 100644
--- a/packages/SettingsLib/res/values-nb/strings.xml
+++ b/packages/SettingsLib/res/values-nb/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Ikke registrert"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Ikke tilgjengelig"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC velges tilfeldig"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d enheter er tilkoblet</item>
- <item quantity="one">%1$d enhet er tilkoblet</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Mer tid."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Mindre tid."</string>
<string name="cancel" msgid="5665114069455378395">"Avbryt"</string>
diff --git a/packages/SettingsLib/res/values-ne/strings.xml b/packages/SettingsLib/res/values-ne/strings.xml
index 85860f0..ea0da04 100644
--- a/packages/SettingsLib/res/values-ne/strings.xml
+++ b/packages/SettingsLib/res/values-ne/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"दर्ता नगरिएको"</string>
<string name="status_unavailable" msgid="5279036186589861608">"अनुपलब्ध"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC क्रमरहित छ"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d डिभाइस कनेक्ट गरिएको छ</item>
- <item quantity="one">%1$d यन्त्र जडान गरियो</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"थप समय।"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"कम समय।"</string>
<string name="cancel" msgid="5665114069455378395">"रद्द गर्नुहोस्"</string>
diff --git a/packages/SettingsLib/res/values-nl/strings.xml b/packages/SettingsLib/res/values-nl/strings.xml
index 2ffa559..957386a 100644
--- a/packages/SettingsLib/res/values-nl/strings.xml
+++ b/packages/SettingsLib/res/values-nl/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Niet geregistreerd"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Niet beschikbaar"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC-adres is willekeurig"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d apparaten verbonden</item>
- <item quantity="one">%1$d apparaat verbonden</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Meer tijd."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Minder tijd."</string>
<string name="cancel" msgid="5665114069455378395">"Annuleren"</string>
diff --git a/packages/SettingsLib/res/values-or/strings.xml b/packages/SettingsLib/res/values-or/strings.xml
index e2fee13..5b15222 100644
--- a/packages/SettingsLib/res/values-or/strings.xml
+++ b/packages/SettingsLib/res/values-or/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"ପଞ୍ଜିକୃତ ହୋଇନାହିଁ"</string>
<string name="status_unavailable" msgid="5279036186589861608">"ଉପଲବ୍ଧ ନାହିଁ"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MACର ଠିକଣା ରାଣ୍ଡମ୍ ଭାବେ ସେଟ୍ କରାଯାଇଛି"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$dଟି ଡିଭାଇସ୍ ସଂଯୁକ୍ତ ହୋଇଛି</item>
- <item quantity="one">%1$dଟି ଡିଭାଇସ୍ ସଂଯୁକ୍ତ ହୋଇଛି</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"ଅଧିକ ସମୟ।"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"କମ୍ ସମୟ।"</string>
<string name="cancel" msgid="5665114069455378395">"ବାତିଲ୍"</string>
diff --git a/packages/SettingsLib/res/values-pa/strings.xml b/packages/SettingsLib/res/values-pa/strings.xml
index 11cd481..d044c04 100644
--- a/packages/SettingsLib/res/values-pa/strings.xml
+++ b/packages/SettingsLib/res/values-pa/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"ਰਜਿਸਟਰ ਨਹੀਂ ਕੀਤੀ ਗਈ"</string>
<string name="status_unavailable" msgid="5279036186589861608">"ਅਣਉਪਲਬਧ"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC ਬੇਤਰਤੀਬਾ ਹੈ"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d ਡੀਵਾਈਸ ਕਨੈਕਟ ਕੀਤਾ ਗਿਆ</item>
- <item quantity="other">%1$d ਡੀਵਾਈਸ ਕਨੈਕਟ ਕੀਤੇ ਗਏ</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"ਹੋਰ ਸਮਾਂ।"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"ਘੱਟ ਸਮਾਂ।"</string>
<string name="cancel" msgid="5665114069455378395">"ਰੱਦ ਕਰੋ"</string>
diff --git a/packages/SettingsLib/res/values-pl/strings.xml b/packages/SettingsLib/res/values-pl/strings.xml
index 0c670bc..44edc09 100644
--- a/packages/SettingsLib/res/values-pl/strings.xml
+++ b/packages/SettingsLib/res/values-pl/strings.xml
@@ -526,12 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Niezarejestrowane"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Niedostępny"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Adres MAC jest randomizowany"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="few">%1$d urządzenia podłączone</item>
- <item quantity="many">%1$d urządzeń podłączonych</item>
- <item quantity="other">%1$d urządzenia podłączonego</item>
- <item quantity="one">%1$d urządzenie podłączone</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Więcej czasu."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Mniej czasu."</string>
<string name="cancel" msgid="5665114069455378395">"Anuluj"</string>
diff --git a/packages/SettingsLib/res/values-pt-rBR/strings.xml b/packages/SettingsLib/res/values-pt-rBR/strings.xml
index 10568a1..7d7635c 100644
--- a/packages/SettingsLib/res/values-pt-rBR/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rBR/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Não registrado"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Não disponível"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"O MAC é randomizado"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d dispositivo conectado</item>
- <item quantity="other">%1$d dispositivos conectados</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 dispositivo conectado}=1{1 dispositivo conectado}one{# dispositivo conectado}other{# dispositivos conectados}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Mais tempo."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Menos tempo."</string>
<string name="cancel" msgid="5665114069455378395">"Cancelar"</string>
diff --git a/packages/SettingsLib/res/values-pt-rPT/strings.xml b/packages/SettingsLib/res/values-pt-rPT/strings.xml
index 5458279..9cccaab 100644
--- a/packages/SettingsLib/res/values-pt-rPT/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rPT/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Não registado"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Indisponível"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"O MAC é aleatório."</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d dispositivo ligado</item>
- <item quantity="other">%1$d dispositivos ligados</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Mais tempo."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Menos tempo."</string>
<string name="cancel" msgid="5665114069455378395">"Cancelar"</string>
diff --git a/packages/SettingsLib/res/values-pt/strings.xml b/packages/SettingsLib/res/values-pt/strings.xml
index 10568a1..7d7635c 100644
--- a/packages/SettingsLib/res/values-pt/strings.xml
+++ b/packages/SettingsLib/res/values-pt/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Não registrado"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Não disponível"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"O MAC é randomizado"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d dispositivo conectado</item>
- <item quantity="other">%1$d dispositivos conectados</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 dispositivo conectado}=1{1 dispositivo conectado}one{# dispositivo conectado}other{# dispositivos conectados}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Mais tempo."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Menos tempo."</string>
<string name="cancel" msgid="5665114069455378395">"Cancelar"</string>
diff --git a/packages/SettingsLib/res/values-ro/strings.xml b/packages/SettingsLib/res/values-ro/strings.xml
index 00fc8ff..3429b02 100644
--- a/packages/SettingsLib/res/values-ro/strings.xml
+++ b/packages/SettingsLib/res/values-ro/strings.xml
@@ -526,11 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Neînregistrat"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Indisponibilă"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC este aleatoriu"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="few">%1$d dispozitive conectate</item>
- <item quantity="other">%1$d de dispozitive conectate</item>
- <item quantity="one">%1$d dispozitiv conectat</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{Niciun dispozitiv conectat}=1{Un dispozitiv conectat}few{# dispozitive conectate}other{# de dispozitive conectate}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Mai mult timp."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Mai puțin timp."</string>
<string name="cancel" msgid="5665114069455378395">"Anulați"</string>
diff --git a/packages/SettingsLib/res/values-ru/strings.xml b/packages/SettingsLib/res/values-ru/strings.xml
index 15e3456..2ecbcb7 100644
--- a/packages/SettingsLib/res/values-ru/strings.xml
+++ b/packages/SettingsLib/res/values-ru/strings.xml
@@ -526,12 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Не зарегистрирован"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Недоступно"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Случайный MAC-адрес"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">Подключено %1$d устройство</item>
- <item quantity="few">Подключено %1$d устройства</item>
- <item quantity="many">Подключено %1$d устройств</item>
- <item quantity="other">Подключено %1$d устройства</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Увеличить продолжительность"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Уменьшить продолжительность"</string>
<string name="cancel" msgid="5665114069455378395">"Отмена"</string>
diff --git a/packages/SettingsLib/res/values-si/strings.xml b/packages/SettingsLib/res/values-si/strings.xml
index d56dd34..8b8a1fb 100644
--- a/packages/SettingsLib/res/values-si/strings.xml
+++ b/packages/SettingsLib/res/values-si/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"ලියාපදිංචි වී නැත"</string>
<string name="status_unavailable" msgid="5279036186589861608">"ලබාගත නොහැක"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC සසම්භාවී වේ"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">උපාංග %1$dක් සම්බන්ධ කරන ලදී</item>
- <item quantity="other">උපාංග %1$dක් සම්බන්ධ කරන ලදී</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"වේලාව වැඩියෙන්."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"වේලාව අඩුවෙන්."</string>
<string name="cancel" msgid="5665114069455378395">"අවලංගු කරන්න"</string>
diff --git a/packages/SettingsLib/res/values-sk/strings.xml b/packages/SettingsLib/res/values-sk/strings.xml
index e7ea915..b088caf 100644
--- a/packages/SettingsLib/res/values-sk/strings.xml
+++ b/packages/SettingsLib/res/values-sk/strings.xml
@@ -526,12 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Neregistrované"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Nie je k dispozícii"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Adresa MAC je náhodná"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="few">%1$d pripojené zariadenia</item>
- <item quantity="many">%1$d pripojeného zariadenia</item>
- <item quantity="other">%1$d pripojených zariadení</item>
- <item quantity="one">%1$d pripojené zariadenie</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Dlhší čas."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Kratší čas."</string>
<string name="cancel" msgid="5665114069455378395">"Zrušiť"</string>
diff --git a/packages/SettingsLib/res/values-sl/strings.xml b/packages/SettingsLib/res/values-sl/strings.xml
index 95a6fb9..c43addb 100644
--- a/packages/SettingsLib/res/values-sl/strings.xml
+++ b/packages/SettingsLib/res/values-sl/strings.xml
@@ -526,12 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Ni registrirana"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Ni na voljo"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Naslov MAC je naključno izbran"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">Povezana je %1$d naprava</item>
- <item quantity="two">Povezani sta %1$d napravi</item>
- <item quantity="few">Povezane so %1$d naprave</item>
- <item quantity="other">Povezanih je %1$d naprav</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 naprav ni povezanih}=1{1 naprava je povezana}one{# naprava je povezana}two{# napravi sta povezani}few{# naprave so povezane}other{# naprav je povezanih}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Daljši čas."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Krajši čas."</string>
<string name="cancel" msgid="5665114069455378395">"Prekliči"</string>
diff --git a/packages/SettingsLib/res/values-sq/strings.xml b/packages/SettingsLib/res/values-sq/strings.xml
index 8524164..b45e653 100644
--- a/packages/SettingsLib/res/values-sq/strings.xml
+++ b/packages/SettingsLib/res/values-sq/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Paregjistruar"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Nuk ofrohet"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Adresa MAC është e rastësishme"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d pajisje të lidhura</item>
- <item quantity="one">%1$d pajisje e lidhur</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Më shumë kohë."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Më pak kohë."</string>
<string name="cancel" msgid="5665114069455378395">"Anulo"</string>
diff --git a/packages/SettingsLib/res/values-sr/strings.xml b/packages/SettingsLib/res/values-sr/strings.xml
index b19198a..2b357b0 100644
--- a/packages/SettingsLib/res/values-sr/strings.xml
+++ b/packages/SettingsLib/res/values-sr/strings.xml
@@ -526,11 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Није регистрован"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Недоступно"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC адреса је насумично изабрана"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">Повезан је %1$d уређај</item>
- <item quantity="few">Повезана су %1$d уређаја</item>
- <item quantity="other">Повезано је %1$d уређаја</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 уређаја је повезано}=1{1 уређај је повезан}one{# уређај је повезан}few{# уређаја су повезана}other{# уређаја је повезано}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Више времена."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Мање времена."</string>
<string name="cancel" msgid="5665114069455378395">"Откажи"</string>
diff --git a/packages/SettingsLib/res/values-sv/strings.xml b/packages/SettingsLib/res/values-sv/strings.xml
index 59cde86..c26c1fe 100644
--- a/packages/SettingsLib/res/values-sv/strings.xml
+++ b/packages/SettingsLib/res/values-sv/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Ej registrerad"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Inte tillgängligt"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC-adressen slumpgenereras"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d enheter är anslutna</item>
- <item quantity="one">%1$d enhet är ansluten</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Längre tid."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Kortare tid."</string>
<string name="cancel" msgid="5665114069455378395">"Avbryt"</string>
diff --git a/packages/SettingsLib/res/values-sw/strings.xml b/packages/SettingsLib/res/values-sw/strings.xml
index 64c2e07..239bb28 100644
--- a/packages/SettingsLib/res/values-sw/strings.xml
+++ b/packages/SettingsLib/res/values-sw/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Haijasajiliwa"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Hamna"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Imechagua anwani ya MAC kwa nasibu"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">Vifaa %1$d vimeunganishwa</item>
- <item quantity="one">Kifaa %1$d kimeunganishwa</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{Hakuna kifaa kimeunganishwa}=1{Kifaa 1 kimeunganishwa}other{Vifaa # vimeunganishwa}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Muda zaidi."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Muda kidogo."</string>
<string name="cancel" msgid="5665114069455378395">"Ghairi"</string>
diff --git a/packages/SettingsLib/res/values-ta/strings.xml b/packages/SettingsLib/res/values-ta/strings.xml
index ccef6b9..cf9fb97 100644
--- a/packages/SettingsLib/res/values-ta/strings.xml
+++ b/packages/SettingsLib/res/values-ta/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"பதிவு செய்யப்படவில்லை"</string>
<string name="status_unavailable" msgid="5279036186589861608">"கிடைக்கவில்லை"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC முகவரி சீரற்றுள்ளது"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d சாதனங்கள் இணைக்கப்பட்டன</item>
- <item quantity="one">%1$d சாதனம் இணைக்கப்பட்டது</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 சாதனம் இணைக்கப்பட்டது}=1{1 சாதனம் இணைக்கப்பட்டது}other{# சாதனங்கள் இணைக்கப்பட்டன}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"நேரத்தை அதிகரிக்கும்."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"நேரத்தைக் குறைக்கும்."</string>
<string name="cancel" msgid="5665114069455378395">"ரத்துசெய்"</string>
diff --git a/packages/SettingsLib/res/values-te/strings.xml b/packages/SettingsLib/res/values-te/strings.xml
index 4013620..2b0e750 100644
--- a/packages/SettingsLib/res/values-te/strings.xml
+++ b/packages/SettingsLib/res/values-te/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"నమోదు కాలేదు"</string>
<string name="status_unavailable" msgid="5279036186589861608">"అందుబాటులో లేదు"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC యాదృచ్ఛికంగా ఉంది"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d పరికరాలు కనెక్ట్ చేయబడ్డాయి</item>
- <item quantity="one">%1$d పరికరం కనెక్ట్ చేయబడింది</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 పరికరం కనెక్ట్ చేయబడింది}=1{1 పరికరం కనెక్ట్ చేయబడింది}other{# పరికరాలు కనెక్ట్ చేయబడ్డాయి}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"ఎక్కువ సమయం."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"తక్కువ సమయం."</string>
<string name="cancel" msgid="5665114069455378395">"రద్దు చేయి"</string>
diff --git a/packages/SettingsLib/res/values-th/strings.xml b/packages/SettingsLib/res/values-th/strings.xml
index c42295f..358431b 100644
--- a/packages/SettingsLib/res/values-th/strings.xml
+++ b/packages/SettingsLib/res/values-th/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"ไม่ได้ลงทะเบียน"</string>
<string name="status_unavailable" msgid="5279036186589861608">"ไม่มี"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC เป็นแบบสุ่ม"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">มีอุปกรณ์ที่เชื่อมต่อ %1$d เครื่อง</item>
- <item quantity="one">มีอุปกรณ์ที่เชื่อมต่อ %1$d เครื่อง</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{มีอุปกรณ์ที่เชื่อมต่ออยู่ 0 เครื่อง}=1{มีอุปกรณ์ที่เชื่อมต่ออยู่ 1 เครื่อง}other{มีอุปกรณ์ที่เชื่อมต่ออยู่ # เครื่อง}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"เวลามากขึ้น"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"เวลาน้อยลง"</string>
<string name="cancel" msgid="5665114069455378395">"ยกเลิก"</string>
diff --git a/packages/SettingsLib/res/values-tl/strings.xml b/packages/SettingsLib/res/values-tl/strings.xml
index ab36a55..2fcd334 100644
--- a/packages/SettingsLib/res/values-tl/strings.xml
+++ b/packages/SettingsLib/res/values-tl/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Hindi nakarehistro"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Hindi available"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Naka-randomize ang MAC"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d device ang nakakonekta</item>
- <item quantity="other">%1$d na device ang nakakonekta</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Dagdagan ang oras."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Bawasan ang oras."</string>
<string name="cancel" msgid="5665114069455378395">"Kanselahin"</string>
diff --git a/packages/SettingsLib/res/values-tr/strings.xml b/packages/SettingsLib/res/values-tr/strings.xml
index ce71496..5e0843b 100644
--- a/packages/SettingsLib/res/values-tr/strings.xml
+++ b/packages/SettingsLib/res/values-tr/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Kaydettirilmedi"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Kullanılamıyor"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC rastgele yapıldı"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d cihaz bağlı</item>
- <item quantity="one">%1$d cihaz bağlı</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Daha uzun süre."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Daha kısa süre."</string>
<string name="cancel" msgid="5665114069455378395">"İptal"</string>
diff --git a/packages/SettingsLib/res/values-uk/strings.xml b/packages/SettingsLib/res/values-uk/strings.xml
index b7d370d2..f7ddb38 100644
--- a/packages/SettingsLib/res/values-uk/strings.xml
+++ b/packages/SettingsLib/res/values-uk/strings.xml
@@ -526,12 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Не зареєстровано"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Недоступно"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Для MAC-адреси вибрано функцію довільного вибору"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">Під’єднано %1$d пристрій</item>
- <item quantity="few">Під’єднано %1$d пристрої</item>
- <item quantity="many">Під’єднано %1$d пристроїв</item>
- <item quantity="other">Під’єднано %1$d пристрою</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Більше часу."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Менше часу."</string>
<string name="cancel" msgid="5665114069455378395">"Скасувати"</string>
diff --git a/packages/SettingsLib/res/values-ur/strings.xml b/packages/SettingsLib/res/values-ur/strings.xml
index c3f4d56..5268d53 100644
--- a/packages/SettingsLib/res/values-ur/strings.xml
+++ b/packages/SettingsLib/res/values-ur/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"رجسٹر نہیں ہے"</string>
<string name="status_unavailable" msgid="5279036186589861608">"غیر دستیاب"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC پتہ رینڈم ہے"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d آلات منسلک ہیں</item>
- <item quantity="one">%1$d آلہ منسلک ہے</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 آلہ منسلک ہے}=1{1 آلہ منسلک ہے}other{# آلات منسلک ہیں}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"زیادہ وقت۔"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"کم وقت۔"</string>
<string name="cancel" msgid="5665114069455378395">"منسوخ کریں"</string>
diff --git a/packages/SettingsLib/res/values-uz/strings.xml b/packages/SettingsLib/res/values-uz/strings.xml
index aa3d8826..845a966 100644
--- a/packages/SettingsLib/res/values-uz/strings.xml
+++ b/packages/SettingsLib/res/values-uz/strings.xml
@@ -526,10 +526,7 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Registratsiya qilinmagan"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Mavjud emas"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Tasodifiy MAC manzil"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d ta qurilma ulangan</item>
- <item quantity="one">%1$d ta qurilma ulangan</item>
- </plurals>
+ <string name="wifi_tether_connected_summary" msgid="5282919920463340158">"{count,plural, =0{0 ta qurilma ulangan}=1{1 ta qurilma ulangan}other{# ta qurilma ulangan}}"</string>
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Ko‘proq vaqt."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Kamroq vaqt."</string>
<string name="cancel" msgid="5665114069455378395">"Bekor qilish"</string>
diff --git a/packages/SettingsLib/res/values-vi/strings.xml b/packages/SettingsLib/res/values-vi/strings.xml
index 7291d06..7046250 100644
--- a/packages/SettingsLib/res/values-vi/strings.xml
+++ b/packages/SettingsLib/res/values-vi/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Chưa được đăng ký"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Không có"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"Địa chỉ MAC được gán ngẫu nhiên"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d thiết bị đã kết nối</item>
- <item quantity="one">%1$d thiết bị đã kết nối</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Nhiều thời gian hơn."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Ít thời gian hơn."</string>
<string name="cancel" msgid="5665114069455378395">"Hủy"</string>
diff --git a/packages/SettingsLib/res/values-zh-rCN/strings.xml b/packages/SettingsLib/res/values-zh-rCN/strings.xml
index 3f1b9ae..caa598d 100644
--- a/packages/SettingsLib/res/values-zh-rCN/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rCN/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"未注册"</string>
<string name="status_unavailable" msgid="5279036186589861608">"无法获取"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC 已随机化"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">已连接 %1$d 个设备</item>
- <item quantity="one">已连接 %1$d 个设备</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"增加时间。"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"减少时间。"</string>
<string name="cancel" msgid="5665114069455378395">"取消"</string>
diff --git a/packages/SettingsLib/res/values-zh-rHK/strings.xml b/packages/SettingsLib/res/values-zh-rHK/strings.xml
index c91a13f..3b1833a 100644
--- a/packages/SettingsLib/res/values-zh-rHK/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rHK/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"未註冊"</string>
<string name="status_unavailable" msgid="5279036186589861608">"無法使用"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC 位址已隨機產生"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d 部已連線的裝置</item>
- <item quantity="one">%1$d 部已連線的裝置</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"增加時間。"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"減少時間。"</string>
<string name="cancel" msgid="5665114069455378395">"取消"</string>
diff --git a/packages/SettingsLib/res/values-zh-rTW/strings.xml b/packages/SettingsLib/res/values-zh-rTW/strings.xml
index 8b469ea..70565bf 100644
--- a/packages/SettingsLib/res/values-zh-rTW/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rTW/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"未註冊"</string>
<string name="status_unavailable" msgid="5279036186589861608">"無法取得"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"MAC 位址已隨機化"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="other">%1$d 個已連線的裝置</item>
- <item quantity="one">%1$d 個已連線的裝置</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"增加時間。"</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"減少時間。"</string>
<string name="cancel" msgid="5665114069455378395">"取消"</string>
diff --git a/packages/SettingsLib/res/values-zu/strings.xml b/packages/SettingsLib/res/values-zu/strings.xml
index 9eac12c..8c6496e 100644
--- a/packages/SettingsLib/res/values-zu/strings.xml
+++ b/packages/SettingsLib/res/values-zu/strings.xml
@@ -526,10 +526,8 @@
<string name="ims_reg_status_not_registered" msgid="2989287366045704694">"Akubhalisiwe"</string>
<string name="status_unavailable" msgid="5279036186589861608">"Ayitholakali"</string>
<string name="wifi_status_mac_randomized" msgid="466382542497832189">"I-MAC ayihleliwe"</string>
- <plurals name="wifi_tether_connected_summary" formatted="false" msgid="6317236306047306139">
- <item quantity="one">%1$d amadivayisi axhunyiwe</item>
- <item quantity="other">%1$d amadivayisi axhunyiwe</item>
- </plurals>
+ <!-- no translation found for wifi_tether_connected_summary (5282919920463340158) -->
+ <skip />
<string name="accessibility_manual_zen_more_time" msgid="5141801092071134235">"Isikhathi esiningi."</string>
<string name="accessibility_manual_zen_less_time" msgid="6828877595848229965">"Isikhathi esincane."</string>
<string name="cancel" msgid="5665114069455378395">"Khansela"</string>
diff --git a/packages/SettingsLib/src/com/android/settingslib/NetworkPolicyEditor.java b/packages/SettingsLib/src/com/android/settingslib/NetworkPolicyEditor.java
index f5aa652..b4e84dd 100644
--- a/packages/SettingsLib/src/com/android/settingslib/NetworkPolicyEditor.java
+++ b/packages/SettingsLib/src/com/android/settingslib/NetworkPolicyEditor.java
@@ -27,9 +27,7 @@
import android.net.NetworkPolicy;
import android.net.NetworkPolicyManager;
import android.net.NetworkTemplate;
-import android.net.wifi.WifiInfo;
import android.os.AsyncTask;
-import android.text.TextUtils;
import android.util.RecurrenceRule;
import com.google.android.collect.Lists;
@@ -124,7 +122,7 @@
if (policy != null) {
return policy;
} else {
- return getPolicy(buildUnquotedNetworkTemplate(template));
+ return getPolicy(template);
}
}
@@ -207,21 +205,4 @@
policy.clearSnooze();
writeAsync();
}
-
- /**
- * Build a revised {@link NetworkTemplate} that matches the same rule, but
- * with an unquoted {@link NetworkTemplate#getNetworkId()}. Used to work
- * around legacy bugs.
- */
- private static NetworkTemplate buildUnquotedNetworkTemplate(NetworkTemplate template) {
- if (template == null) return null;
- final String networkId = template.getNetworkId();
- final String strippedNetworkId = WifiInfo.sanitizeSsid(networkId);
- if (!TextUtils.equals(strippedNetworkId, networkId)) {
- return new NetworkTemplate(
- template.getMatchRule(), template.getSubscriberId(), strippedNetworkId);
- } else {
- return null;
- }
- }
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index 290055c..1c9d9cf 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -504,6 +504,17 @@
}
/**
+ * Get identity address from remote device
+ * @return {@link BluetoothDevice#getIdentityAddress()} if
+ * {@link BluetoothDevice#getIdentityAddress()} is not null otherwise return
+ * {@link BluetoothDevice#getAddress()}
+ */
+ public String getIdentityAddress() {
+ final String identityAddress = mDevice.getIdentityAddress();
+ return TextUtils.isEmpty(identityAddress) ? getAddress() : identityAddress;
+ }
+
+ /**
* Get name from remote device
* @return {@link BluetoothDevice#getAlias()} if
* {@link BluetoothDevice#getAlias()} is not null otherwise return
diff --git a/packages/SettingsLib/src/com/android/settingslib/fuelgauge/BatteryStatus.java b/packages/SettingsLib/src/com/android/settingslib/fuelgauge/BatteryStatus.java
index b56ae38..4939e04 100644
--- a/packages/SettingsLib/src/com/android/settingslib/fuelgauge/BatteryStatus.java
+++ b/packages/SettingsLib/src/com/android/settingslib/fuelgauge/BatteryStatus.java
@@ -88,14 +88,15 @@
}
/**
- * Determine whether the device is plugged in (USB, power, or wireless).
+ * Determine whether the device is plugged in (USB, power, wireless or dock).
*
* @return true if the device is plugged in.
*/
public boolean isPluggedIn() {
return plugged == BatteryManager.BATTERY_PLUGGED_AC
|| plugged == BatteryManager.BATTERY_PLUGGED_USB
- || plugged == BatteryManager.BATTERY_PLUGGED_WIRELESS;
+ || plugged == BatteryManager.BATTERY_PLUGGED_WIRELESS
+ || plugged == BatteryManager.BATTERY_PLUGGED_DOCK;
}
/**
@@ -118,6 +119,15 @@
}
/**
+ * Determine whether the device is plugged in dock.
+ *
+ * @return true if the device is plugged in dock
+ */
+ public boolean isPluggedInDock() {
+ return plugged == BatteryManager.BATTERY_PLUGGED_DOCK;
+ }
+
+ /**
* Whether or not the device is charged. Note that some devices never return 100% for
* battery level, so this allows either battery level or status to determine if the
* battery is charged.
diff --git a/packages/SettingsLib/src/com/android/settingslib/mobile/OWNERS b/packages/SettingsLib/src/com/android/settingslib/mobile/OWNERS
new file mode 100644
index 0000000..ab9b5dc
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/mobile/OWNERS
@@ -0,0 +1,4 @@
+# Default reviewers for this and subdirectories.
+bonianchen@google.com
+
+# Emergency approvers in case the above are not available
diff --git a/packages/SettingsLib/src/com/android/settingslib/net/DataUsageController.java b/packages/SettingsLib/src/com/android/settingslib/net/DataUsageController.java
index cff45c6..30c6645 100644
--- a/packages/SettingsLib/src/com/android/settingslib/net/DataUsageController.java
+++ b/packages/SettingsLib/src/com/android/settingslib/net/DataUsageController.java
@@ -16,7 +16,6 @@
package com.android.settingslib.net;
-import static android.net.TrafficStats.MB_IN_BYTES;
import static android.telephony.TelephonyManager.SIM_STATE_READY;
import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH;
import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
@@ -49,6 +48,7 @@
private static final StringBuilder PERIOD_BUILDER = new StringBuilder(50);
private static final java.util.Formatter PERIOD_FORMATTER = new java.util.Formatter(
PERIOD_BUILDER, Locale.getDefault());
+ private static final long MB_IN_BYTES = 1024 * 1024;
private final Context mContext;
private final NetworkPolicyManager mPolicyManager;
@@ -237,10 +237,8 @@
final int matchRule = networkTemplate.getMatchRule();
switch (matchRule) {
case NetworkTemplate.MATCH_MOBILE:
- case NetworkTemplate.MATCH_MOBILE_WILDCARD:
return ConnectivityManager.TYPE_MOBILE;
case NetworkTemplate.MATCH_WIFI:
- case NetworkTemplate.MATCH_WIFI_WILDCARD:
return ConnectivityManager.TYPE_WIFI;
case NetworkTemplate.MATCH_ETHERNET:
return ConnectivityManager.TYPE_ETHERNET;
diff --git a/packages/SettingsLib/src/com/android/settingslib/net/DataUsageUtils.java b/packages/SettingsLib/src/com/android/settingslib/net/DataUsageUtils.java
index afd44d5..386a47a 100644
--- a/packages/SettingsLib/src/com/android/settingslib/net/DataUsageUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/net/DataUsageUtils.java
@@ -63,14 +63,32 @@
private static NetworkTemplate getNormalizedMobileTemplate(
TelephonyManager telephonyManager, int subId) {
final NetworkTemplate mobileTemplate = getMobileTemplateForSubId(telephonyManager, subId);
- final String[] mergedSubscriberIds = telephonyManager
- .createForSubscriptionId(subId).getMergedImsisFromGroup();
+ final Set<String> mergedSubscriberIds = Set.of(telephonyManager
+ .createForSubscriptionId(subId).getMergedImsisFromGroup());
if (ArrayUtils.isEmpty(mergedSubscriberIds)) {
Log.i(TAG, "mergedSubscriberIds is null.");
return mobileTemplate;
}
- return NetworkTemplate.normalize(mobileTemplate, mergedSubscriberIds);
+ return normalizeMobileTemplate(mobileTemplate, mergedSubscriberIds);
+ }
+
+ private static NetworkTemplate normalizeMobileTemplate(
+ NetworkTemplate template, Set<String> mergedSet) {
+ if (template.getSubscriberIds().isEmpty()) return template;
+ // The input template should have at most 1 subscriberId.
+ final String subscriberId = template.getSubscriberIds().iterator().next();
+
+ if (mergedSet.contains(subscriberId)) {
+ // Requested template subscriber is part of the merge group; return
+ // a template that matches all merged subscribers.
+ return new NetworkTemplate.Builder(template.getMatchRule())
+ .setSubscriberIds(mergedSet)
+ .setWifiNetworkKeys(template.getWifiNetworkKeys())
+ .setMeteredness(NetworkStats.METERED_YES).build();
+ }
+
+ return template;
}
private static NetworkTemplate getMobileTemplateForSubId(
diff --git a/packages/SettingsLib/src/com/android/settingslib/net/NetworkCycleDataForUidLoader.java b/packages/SettingsLib/src/com/android/settingslib/net/NetworkCycleDataForUidLoader.java
index 43c05b8..504390c 100644
--- a/packages/SettingsLib/src/com/android/settingslib/net/NetworkCycleDataForUidLoader.java
+++ b/packages/SettingsLib/src/com/android/settingslib/net/NetworkCycleDataForUidLoader.java
@@ -53,8 +53,9 @@
long totalUsage = 0L;
long totalForeground = 0L;
for (int uid : mUids) {
- final NetworkStats stats = mNetworkStatsManager.queryDetailsForUid(
- mNetworkTemplate, start, end, uid);
+ final NetworkStats stats = mNetworkStatsManager.queryDetailsForUidTagState(
+ mNetworkTemplate, start, end, uid, NetworkStats.Bucket.TAG_NONE,
+ NetworkStats.Bucket.STATE_ALL);
final long usage = getTotalUsage(stats);
if (usage > 0L) {
totalUsage += usage;
diff --git a/packages/SettingsLib/src/com/android/settingslib/net/OWNERS b/packages/SettingsLib/src/com/android/settingslib/net/OWNERS
new file mode 100644
index 0000000..ab9b5dc
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/net/OWNERS
@@ -0,0 +1,4 @@
+# Default reviewers for this and subdirectories.
+bonianchen@google.com
+
+# Emergency approvers in case the above are not available
diff --git a/packages/SettingsLib/src/com/android/settingslib/net/UidDetailProvider.java b/packages/SettingsLib/src/com/android/settingslib/net/UidDetailProvider.java
index 02326ea..623eb33 100644
--- a/packages/SettingsLib/src/com/android/settingslib/net/UidDetailProvider.java
+++ b/packages/SettingsLib/src/com/android/settingslib/net/UidDetailProvider.java
@@ -17,6 +17,7 @@
package com.android.settingslib.net;
import android.app.AppGlobals;
+import android.app.usage.NetworkStats;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.IPackageManager;
@@ -116,13 +117,13 @@
detail.label = res.getString(R.string.process_kernel_label);
detail.icon = pm.getDefaultActivityIcon();
return detail;
- case TrafficStats.UID_REMOVED:
+ case NetworkStats.Bucket.UID_REMOVED:
detail.label = res.getString(UserManager.supportsMultipleUsers()
? R.string.data_usage_uninstalled_apps_users
: R.string.data_usage_uninstalled_apps);
detail.icon = pm.getDefaultActivityIcon();
return detail;
- case TrafficStats.UID_TETHERING:
+ case NetworkStats.Bucket.UID_TETHERING:
final TetheringManager tm = mContext.getSystemService(TetheringManager.class);
detail.label = res.getString(Utils.getTetheringLabel(tm));
detail.icon = pm.getDefaultActivityIcon();
diff --git a/packages/SettingsLib/tests/robotests/res/layout/collapsing_test_layout.xml b/packages/SettingsLib/tests/robotests/res/layout/collapsing_test_layout.xml
new file mode 100644
index 0000000..61b9b3b
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/res/layout/collapsing_test_layout.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.android.settingslib.collapsingtoolbar.widget.CollapsingCoordinatorLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:id="@+id/id_collapsing_test"
+ android:layout_height="match_parent">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/text_hello_world"
+ android:text="Hello World!"/>
+
+</com.android.settingslib.collapsingtoolbar.widget.CollapsingCoordinatorLayout>
\ No newline at end of file
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/collapsingtoolbar/widget/CollapsingCoordinatorLayoutTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/collapsingtoolbar/widget/CollapsingCoordinatorLayoutTest.java
new file mode 100644
index 0000000..06343f5
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/collapsingtoolbar/widget/CollapsingCoordinatorLayoutTest.java
@@ -0,0 +1,90 @@
+/*
+ * 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.collapsingtoolbar.widget;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
+
+import androidx.annotation.Nullable;
+
+import com.android.settingslib.R;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.Robolectric;
+import org.robolectric.RobolectricTestRunner;
+
+/** Tests for {@link CollapsingCoordinatorLayout}. */
+@RunWith(RobolectricTestRunner.class)
+public class CollapsingCoordinatorLayoutTest {
+ private static final String TEXT_HELLO_WORLD = "Hello World!";
+ private static final String TEST_TITLE = "RENO NAKAMURA";
+
+ private TestActivity mActivity;
+
+ @Before
+ public void setUp() {
+ mActivity = Robolectric.buildActivity(TestActivity.class).create().get();
+ }
+
+ @Test
+ public void onCreate_childViewsNumberShouldBeTwo() {
+ CollapsingCoordinatorLayout layout = mActivity.getCollapsingCoordinatorLayout();
+
+ assertThat(layout.getChildCount()).isEqualTo(2);
+ }
+
+ @Test
+ public void onCreate_userAddedChildViewsBeMovedToContentFrame() {
+ CollapsingCoordinatorLayout layout = mActivity.getCollapsingCoordinatorLayout();
+ View contentFrameView = layout.findViewById(R.id.content_frame);
+
+ TextView textView = contentFrameView.findViewById(R.id.text_hello_world);
+
+ assertThat(textView).isNotNull();
+ assertThat(textView.getText().toString()).isEqualTo(TEXT_HELLO_WORLD);
+ }
+
+ @Test
+ public void initSettingsStyleToolBar_assignedTitle() {
+ CollapsingCoordinatorLayout layout = mActivity.getCollapsingCoordinatorLayout();
+
+ layout.initSettingsStyleToolBar(mActivity, TEST_TITLE);
+
+ assertThat(layout.getCollapsingToolbarLayout().getTitle().toString()).isEqualTo(TEST_TITLE);
+ }
+
+ public static class TestActivity extends Activity {
+ private CollapsingCoordinatorLayout mCollapsingCoordinatorLayout;
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setTheme(android.R.style.Theme_Light_NoTitleBar);
+ setContentView(R.layout.collapsing_test_layout);
+ mCollapsingCoordinatorLayout = findViewById(R.id.id_collapsing_test);
+ }
+
+ public CollapsingCoordinatorLayout getCollapsingCoordinatorLayout() {
+ return mCollapsingCoordinatorLayout;
+ }
+ }
+}
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java
index 38ff18a..246466e 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java
@@ -313,6 +313,7 @@
VALIDATORS.put(Global.USER_PREFERRED_REFRESH_RATE, NON_NEGATIVE_FLOAT_VALIDATOR);
VALIDATORS.put(Global.USER_PREFERRED_RESOLUTION_HEIGHT, ANY_INTEGER_VALIDATOR);
VALIDATORS.put(Global.USER_PREFERRED_RESOLUTION_WIDTH, ANY_INTEGER_VALIDATOR);
+ VALIDATORS.put(Global.Wearable.WET_MODE_ON, BOOLEAN_VALIDATOR);
}
}
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
index dec3245..dc7632d 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
@@ -1176,8 +1176,6 @@
com.android.internal.R.bool.config_dreamsActivatedOnDockByDefault);
loadBooleanSetting(stmt, Settings.Secure.SCREENSAVER_ACTIVATE_ON_SLEEP,
com.android.internal.R.bool.config_dreamsActivatedOnSleepByDefault);
- loadStringSetting(stmt, Settings.Secure.SCREENSAVER_COMPONENTS,
- com.android.internal.R.string.config_dreamsDefaultComponent);
loadStringSetting(stmt, Settings.Secure.SCREENSAVER_DEFAULT_COMPONENT,
com.android.internal.R.string.config_dreamsDefaultComponent);
@@ -2362,8 +2360,6 @@
com.android.internal.R.bool.config_dreamsActivatedOnDockByDefault);
loadBooleanSetting(stmt, Settings.Secure.SCREENSAVER_ACTIVATE_ON_SLEEP,
com.android.internal.R.bool.config_dreamsActivatedOnSleepByDefault);
- loadStringSetting(stmt, Settings.Secure.SCREENSAVER_COMPONENTS,
- com.android.internal.R.string.config_dreamsDefaultComponent);
loadStringSetting(stmt, Settings.Secure.SCREENSAVER_DEFAULT_COMPONENT,
com.android.internal.R.string.config_dreamsDefaultComponent);
diff --git a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
index 720fb6c..52a708d 100644
--- a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
+++ b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
@@ -656,7 +656,8 @@
Settings.Global.Wearable.CLOCKWORK_SYSUI_PACKAGE,
Settings.Global.Wearable.CLOCKWORK_SYSUI_MAIN_ACTIVITY,
Settings.Global.Wearable.CLOCKWORK_LONG_PRESS_TO_ASSISTANT_ENABLED,
- Settings.Global.Wearable.WEAR_ACTIVITY_AUTO_RESUME_TIMEOUT_SET_BY_USER);
+ Settings.Global.Wearable.WEAR_ACTIVITY_AUTO_RESUME_TIMEOUT_SET_BY_USER,
+ Settings.Global.Wearable.WET_MODE_ON);
private static final Set<String> BACKUP_DENY_LIST_SECURE_SETTINGS =
newHashSet(
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml
index c6fbfd8..4dddc8c 100644
--- a/packages/Shell/AndroidManifest.xml
+++ b/packages/Shell/AndroidManifest.xml
@@ -309,6 +309,7 @@
<uses-permission android:name="android.permission.COMPANION_APPROVE_WIFI_CONNECTIONS" />
<uses-permission android:name="android.permission.MANAGE_COMPANION_DEVICES" />
<uses-permission android:name="android.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING" />
+ <uses-permission android:name="android.permission.REQUEST_COMPANION_PROFILE_COMPUTER" />
<uses-permission android:name="android.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION" />
<uses-permission android:name="android.permission.REQUEST_COMPANION_PROFILE_WATCH" />
<uses-permission android:name="android.permission.REQUEST_COMPANION_SELF_MANAGED" />
@@ -336,6 +337,9 @@
<!-- Permission needed to run keyguard manager tests in CTS -->
<uses-permission android:name="android.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS" />
+ <!-- Permission needed to add/remove weak escrow token in CTS tests -->
+ <uses-permission android:name="android.permission.MANAGE_WEAK_ESCROW_TOKEN" />
+
<!-- Permission needed to set/clear/verify lockscreen credentials in CTS tests -->
<uses-permission android:name="android.permission.SET_AND_VERIFY_LOCKSCREEN_CREDENTIALS" />
@@ -526,6 +530,7 @@
<!-- Permission needed for CTS test - WifiManagerTest -->
<uses-permission android:name="android.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS" />
<uses-permission android:name="android.permission.WIFI_UPDATE_COEX_UNSAFE_CHANNELS" />
+ <uses-permission android:name="android.permission.OVERRIDE_WIFI_CONFIG" />
<!-- Permission required for CTS tests to enable/disable rate limiting toasts. -->
<uses-permission android:name="android.permission.MANAGE_TOAST_RATE_LIMITING" />
diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java
index c5a01a1..0b8bd97 100644
--- a/packages/Shell/src/com/android/shell/BugreportProgressService.java
+++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java
@@ -72,6 +72,7 @@
import android.util.Log;
import android.util.Pair;
import android.util.Patterns;
+import android.util.PluralsMessageFormatter;
import android.util.SparseArray;
import android.view.ContextThemeWrapper;
import android.view.IWindowManager;
@@ -111,7 +112,9 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@@ -943,9 +946,12 @@
}
setTakingScreenshot(true);
collapseNotificationBar();
- final String msg = mContext.getResources()
- .getQuantityString(com.android.internal.R.plurals.bugreport_countdown,
- mScreenshotDelaySec, mScreenshotDelaySec);
+ Map<String, Object> arguments = new HashMap<>();
+ arguments.put("count", mScreenshotDelaySec);
+ final String msg = PluralsMessageFormatter.format(
+ mContext.getResources(),
+ arguments,
+ com.android.internal.R.string.bugreport_countdown);
Log.i(TAG, msg);
// Show a toast just once, otherwise it might be captured in the screenshot.
Toast.makeText(mContext, msg, Toast.LENGTH_SHORT).show();
diff --git a/packages/SystemUI/res-keyguard/values/strings.xml b/packages/SystemUI/res-keyguard/values/strings.xml
index 1601043..d9db436 100644
--- a/packages/SystemUI/res-keyguard/values/strings.xml
+++ b/packages/SystemUI/res-keyguard/values/strings.xml
@@ -37,6 +37,9 @@
<!-- When the lock screen is showing and the phone plugged in, and the battery is not fully charged, say that it's wirelessly charging. [CHAR LIMIT=50] -->
<string name="keyguard_plugged_in_wireless"><xliff:g id="percentage" example="20%">%s</xliff:g> • Charging wirelessly</string>
+ <!-- When the lock screen is showing and the phone plugged in, and the battery is not fully charged, say that it's dock charging. [CHAR LIMIT=50] -->
+ <string name="keyguard_plugged_in_dock"><xliff:g id="percentage" example="20%">%s</xliff:g> • Charging Dock</string>
+
<!-- When the lock screen is showing and the phone plugged in, and the battery
is not fully charged, say that it's charging. -->
<string name="keyguard_plugged_in"><xliff:g id="percentage">%s</xliff:g> • Charging</string>
@@ -117,10 +120,11 @@
<!-- Message shown when user enters wrong PIN -->
<string name="kg_wrong_pin">Wrong PIN</string>
<!-- Countdown message shown after too many failed unlock attempts -->
- <plurals name="kg_too_many_failed_attempts_countdown">
- <item quantity="one">Try again in 1 second.</item>
- <item quantity="other">Try again in <xliff:g id="number">%d</xliff:g> seconds.</item>
- </plurals>
+ <string name="kg_too_many_failed_attempts_countdown">{count, plural,
+ =1 {Try again in # second.}
+ other {Try again in # seconds.}
+ }
+ </string>
<!-- Instructions for using the SIM PIN unlock screen -->
<string name="kg_sim_pin_instructions">Enter SIM PIN.</string>
<!-- Instructions for using the SIM PIN unlock screen when there's more than one SIM -->
diff --git a/packages/SystemUI/res/drawable/ic_list.xml b/packages/SystemUI/res/drawable/ic_list.xml
deleted file mode 100644
index 7ef5299..0000000
--- a/packages/SystemUI/res/drawable/ic_list.xml
+++ /dev/null
@@ -1,42 +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.
--->
-
-<!-- Remove when Fgs manager tile is removed -->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="48dp"
- android:height="48dp"
- android:viewportWidth="24"
- android:viewportHeight="24">
- <path
- android:pathData="M2,4h4v4h-4z"
- android:fillColor="#000000"/>
- <path
- android:pathData="M8,4h14v4h-14z"
- android:fillColor="#000000"/>
- <path
- android:pathData="M2,10h4v4h-4z"
- android:fillColor="#000000"/>
- <path
- android:pathData="M8,10h14v4h-14z"
- android:fillColor="#000000"/>
- <path
- android:pathData="M2,16h4v4h-4z"
- android:fillColor="#000000"/>
- <path
- android:pathData="M8,16h14v4h-14z"
- android:fillColor="#000000"/>
-</vector>
diff --git a/packages/SystemUI/res/layout/controls_detail_dialog.xml b/packages/SystemUI/res/layout/controls_detail_dialog.xml
index 28fc863..4d2317c 100644
--- a/packages/SystemUI/res/layout/controls_detail_dialog.xml
+++ b/packages/SystemUI/res/layout/controls_detail_dialog.xml
@@ -15,47 +15,52 @@
limitations under the License.
-->
-<LinearLayout
+<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/control_detail_root"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:background="@android:color/black">
+ android:layout_height="match_parent">
<LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_marginBottom="4dp">
- <ImageView
- android:id="@+id/control_detail_close"
- android:contentDescription="@string/accessibility_desc_close"
- android:src="@drawable/ic_arrow_back"
- android:background="?android:attr/selectableItemBackgroundBorderless"
- android:tint="@color/control_primary_text"
- android:layout_width="48dp"
- android:layout_height="48dp"
- android:padding="12dp" />
- <Space
- android:layout_width="0dp"
- android:layout_weight="1"
- android:layout_height="1dp" />
- <ImageView
- android:id="@+id/control_detail_open_in_app"
- android:contentDescription="@string/controls_open_app"
- android:src="@drawable/ic_open_in_new"
- android:background="?android:attr/selectableItemBackgroundBorderless"
- android:tint="@color/control_primary_text"
- android:layout_width="48dp"
- android:layout_height="48dp"
- android:padding="12dp" />
- </LinearLayout>
-
- <FrameLayout
- android:id="@+id/controls_activity_view"
+ android:id="@+id/control_task_view_container"
android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:orientation="vertical" />
-</LinearLayout>
+ android:layout_height="match_parent"
+ android:layout_gravity="right|top"
+ android:layout_marginRight="@dimen/controls_task_view_right_margin"
+ android:orientation="vertical">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:layout_marginBottom="4dp">
+ <ImageView
+ android:id="@+id/control_detail_close"
+ android:contentDescription="@string/accessibility_desc_close"
+ android:src="@drawable/ic_close"
+ android:background="?android:attr/selectableItemBackgroundBorderless"
+ android:tint="@color/control_primary_text"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:padding="12dp" />
+ <Space
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_height="1dp" />
+ <ImageView
+ android:id="@+id/control_detail_open_in_app"
+ android:contentDescription="@string/controls_open_app"
+ android:src="@drawable/ic_open_in_new"
+ android:background="?android:attr/selectableItemBackgroundBorderless"
+ android:tint="@color/control_primary_text"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:padding="12dp" />
+ </LinearLayout>
+
+ <FrameLayout
+ android:id="@+id/controls_activity_view"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+ </LinearLayout>
+</FrameLayout>
diff --git a/packages/SystemUI/res/values-af/strings.xml b/packages/SystemUI/res/values-af/strings.xml
index 10b8ef4..4a5de4c 100644
--- a/packages/SystemUI/res/values-af/strings.xml
+++ b/packages/SystemUI/res/values-af/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Tot sonsopkoms"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Aan om <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Tot <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC is gedeaktiveer"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC is geaktiveer"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Speel <xliff:g id="SONG_NAME">%1$s</xliff:g> deur <xliff:g id="ARTIST_NAME">%2$s</xliff:g> vanaf <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Speel <xliff:g id="SONG_NAME">%1$s</xliff:g> vanaf <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Ontdoen"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Beweeg nader om op <xliff:g id="DEVICENAME">%1$s</xliff:g> te speel"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Speel tans op <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Onaktief, gaan program na"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Nie gekry nie"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Kontrole is nie beskikbaar nie"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Kies gebruiker"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Programme wat op die agtergrond werk"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Stop"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopieer"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Gekopieer"</string>
</resources>
diff --git a/packages/SystemUI/res/values-am/strings.xml b/packages/SystemUI/res/values-am/strings.xml
index 6fe6f53..572877a 100644
--- a/packages/SystemUI/res/values-am/strings.xml
+++ b/packages/SystemUI/res/values-am/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"ጸሐይ እስክትወጣ ድረስ"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g> ላይ ይበራል"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"እስከ <xliff:g id="TIME">%s</xliff:g> ድረስ"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"ኤንኤፍሲ"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"ኤንኤፍሲ ተሰናክሏል"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"ኤንኤፍሲ ነቅቷል"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"ለማየት ይክፈቱ"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"የእርስዎን ካርዶች ማግኘት ላይ ችግር ነበር፣ እባክዎ ቆይተው እንደገና ይሞክሩ"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"የገጽ መቆለፊያ ቅንብሮች"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR ኮድ"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"ለመቃኘት መታ ያድርጉ"</string>
<string name="status_bar_work" msgid="5238641949837091056">"የስራ መገለጫ"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"የአውሮፕላን ሁነታ"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="SONG_NAME">%1$s</xliff:g> በ<xliff:g id="ARTIST_NAME">%2$s</xliff:g> ከ<xliff:g id="APP_LABEL">%3$s</xliff:g> ያጫውቱ"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> ከ<xliff:g id="APP_LABEL">%2$s</xliff:g> ያጫውቱ"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"ቀልብስ"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"በ<xliff:g id="DEVICENAME">%1$s</xliff:g> ላይ ለማጫወት ጠጋ ያድርጉ"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"በ<xliff:g id="DEVICENAME">%1$s</xliff:g> ላይ በማጫወት ላይ"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"ንቁ ያልኾነ፣ መተግበሪያን ይፈትሹ"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"አልተገኘም"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"መቆጣጠሪያ አይገኝም"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"ተጠቃሚን ይምረጡ"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"ከበስተጀርባ የሚሠሩ መተግበሪያዎች"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"መቆሚያ"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"ቅዳ"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"ተቀድቷል"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index 5a0c7a1..89e9306 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -277,6 +277,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"حتى شروق الشمس"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"تفعيل الوضع في <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"حتى <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"تم إيقاف الاتصال القريب المدى"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"تم تفعيل الاتصال القريب المدى"</string>
@@ -461,10 +465,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"فتح القفل للاستخدام"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"حدثت مشكلة أثناء الحصول على البطاقات، يُرجى إعادة المحاولة لاحقًا."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"إعدادات شاشة القفل"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"رمز الاستجابة السريعة"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"انقر للمسح ضوئيًا"</string>
<string name="status_bar_work" msgid="5238641949837091056">"الملف الشخصي للعمل"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"وضع الطيران"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"لن تسمع المنبّه القادم في <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -817,9 +819,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"تشغيل <xliff:g id="SONG_NAME">%1$s</xliff:g> للفنان <xliff:g id="ARTIST_NAME">%2$s</xliff:g> من تطبيق <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"تشغيل <xliff:g id="SONG_NAME">%1$s</xliff:g> من تطبيق <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"تراجع"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"عليك الاقتراب لتشغيل الوسائط على <xliff:g id="DEVICENAME">%1$s</xliff:g>."</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"جارٍ تشغيل الموسيقى على <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"غير نشط، تحقّق من التطبيق."</string>
<string name="controls_error_removed" msgid="6675638069846014366">"لم يتم العثور عليه."</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"عنصر التحكّم غير متوفّر"</string>
@@ -906,8 +914,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"اختيار المستخدم"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"التطبيقات التي يتم تشغيلها في الخلفية"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"إيقاف"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"نسخ"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"تم النسخ."</string>
</resources>
diff --git a/packages/SystemUI/res/values-as/strings.xml b/packages/SystemUI/res/values-as/strings.xml
index bf35ad2..8ae383f 100644
--- a/packages/SystemUI/res/values-as/strings.xml
+++ b/packages/SystemUI/res/values-as/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"সূৰ্যোদয়লৈকে"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g>ত অন কৰক"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> পৰ্যন্ত"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC নিষ্ক্ৰিয় হৈ আছে"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC সক্ষম হৈ আছে"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"ব্যৱহাৰ কৰিবলৈ আনলক কৰক"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"আপোনাৰ কাৰ্ড লাভ কৰোঁতে এটা সমস্যা হৈছে, অনুগ্ৰহ কৰি পাছত পুনৰ চেষ্টা কৰক"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"লক স্ক্ৰীনৰ ছেটিং"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"কিউআৰ ক\'ড"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"স্কেন কৰিবলৈ টিপক"</string>
<string name="status_bar_work" msgid="5238641949837091056">"কৰ্মস্থানৰ প্ৰ\'ফাইল"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"এয়াৰপ্লেইন ম\'ড"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"আপুনি আপোনাৰ পিছৰটো এলাৰ্ম <xliff:g id="WHEN">%1$s</xliff:g> বজাত শুনা নাপাব"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="APP_LABEL">%3$s</xliff:g>ত <xliff:g id="ARTIST_NAME">%2$s</xliff:g>ৰ <xliff:g id="SONG_NAME">%1$s</xliff:g> গীতটো প্লে’ কৰক"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="APP_LABEL">%2$s</xliff:g>ত <xliff:g id="SONG_NAME">%1$s</xliff:g> গীতটো প্লে’ কৰক"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"আনডু কৰক"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g>ত প্লে’ কৰিবলৈ ওচৰলৈ যাওক"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g>ত প্লে\' কৰি থকা হৈছে"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"সক্ৰিয় নহয়, এপ্টো পৰীক্ষা কৰক"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"বিচাৰি পোৱা নগ’ল"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"নিয়ন্ত্ৰণটো উপলব্ধ নহয়"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"ব্যৱহাৰকাৰী বাছনি কৰক"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"নেপথ্যত চলি থকা এপ্"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"বন্ধ কৰক"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"প্ৰতিলিপি কৰক"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"প্ৰতিলিপি কৰা হ’ল"</string>
</resources>
diff --git a/packages/SystemUI/res/values-az/strings.xml b/packages/SystemUI/res/values-az/strings.xml
index d491724..d266152 100644
--- a/packages/SystemUI/res/values-az/strings.xml
+++ b/packages/SystemUI/res/values-az/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Şəfəq vaxtına qədər"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Bu vaxt aktiv olur: <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Bu vaxtadək: <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC deaktiv edilib"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC aktiv edilib"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"İstifadə etmək üçün kiliddən çıxarın"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Kartların əldə edilməsində problem oldu, sonra yenidən cəhd edin"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Kilid ekranı ayarları"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR kodu"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Skanlamaq üçün toxunun"</string>
<string name="status_bar_work" msgid="5238641949837091056">"İş profili"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Təyyarə rejimi"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="ARTIST_NAME">%2$s</xliff:g> tərəfindən <xliff:g id="SONG_NAME">%1$s</xliff:g> mahnısını <xliff:g id="APP_LABEL">%3$s</xliff:g> tətbiqindən oxudun"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> mahnısını <xliff:g id="APP_LABEL">%2$s</xliff:g> tətbiqindən oxudun"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Geri qaytarın"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> cihazında oxutmaq üçün yaxınlaşın"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> cihazında oxudulur"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Aktiv deyil, tətbiqi yoxlayın"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Tapılmadı"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Nəzarət əlçatan deyil"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"İstifadəçi seçin"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Arxa fonda işləyən tətbiqlər"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Dayandırın"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopyalayın"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Kopyalandı"</string>
</resources>
diff --git a/packages/SystemUI/res/values-b+sr+Latn/strings.xml b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
index 955096e..6bdbd79 100644
--- a/packages/SystemUI/res/values-b+sr+Latn/strings.xml
+++ b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
@@ -271,6 +271,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Do izlaska sunca"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Uključuje se u <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Do <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC je onemogućen"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC je omogućen"</string>
@@ -797,9 +801,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Pustite <xliff:g id="SONG_NAME">%1$s</xliff:g> izvođača <xliff:g id="ARTIST_NAME">%2$s</xliff:g> iz aplikacije <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Pustite <xliff:g id="SONG_NAME">%1$s</xliff:g> iz aplikacije <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Opozovi"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Približite da biste puštali muziku na: <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Pušta se na: <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Neaktivno. Vidite aplikaciju"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Nije pronađeno"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Kontrola nije dostupna"</string>
@@ -886,8 +896,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Izaberite korisnika"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Aplikacije pokrenute u pozadini"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Zaustavi"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopiraj"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Kopirano je"</string>
</resources>
diff --git a/packages/SystemUI/res/values-be/strings.xml b/packages/SystemUI/res/values-be/strings.xml
index 4d11111..2d5aa8c 100644
--- a/packages/SystemUI/res/values-be/strings.xml
+++ b/packages/SystemUI/res/values-be/strings.xml
@@ -273,6 +273,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Да ўсходу сонца"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Уключана ў <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Да <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC адключаны"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC уключаны"</string>
@@ -455,10 +459,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Разблакіраваць для выкарыстання"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Узнікла праблема з загрузкай вашых карт. Паўтарыце спробу пазней"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Налады экрана блакіроўкі"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR-код"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Націсніце, каб адсканіраваць"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Працоўны профіль"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Рэжым палёту"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Вы не пачуеце наступны будзільнік <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -805,9 +807,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Прайграйце кампазіцыю \"<xliff:g id="SONG_NAME">%1$s</xliff:g>\" (выканаўца – <xliff:g id="ARTIST_NAME">%2$s</xliff:g>) з дапамогай праграмы \"<xliff:g id="APP_LABEL">%3$s</xliff:g>\""</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Прайграйце кампазіцыю \"<xliff:g id="SONG_NAME">%1$s</xliff:g>\" з дапамогай праграмы \"<xliff:g id="APP_LABEL">%2$s</xliff:g>\""</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Адрабіць"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Каб прайграць мультымедыя на прыладзе \"<xliff:g id="DEVICENAME">%1$s</xliff:g>\", наблізьцеся да яе"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Прайграецца на прыладзе \"<xliff:g id="DEVICENAME">%1$s</xliff:g>\""</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Неактыўна, праверце праграму"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Не знойдзена"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Кіраванне недаступнае"</string>
@@ -894,8 +902,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Выбар карыстальніка"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Праграмы працуюць у фонавым рэжыме"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Спыніць"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Капіраваць"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Скапіравана"</string>
</resources>
diff --git a/packages/SystemUI/res/values-bg/strings.xml b/packages/SystemUI/res/values-bg/strings.xml
index aaa1f3a..ab7a38b 100644
--- a/packages/SystemUI/res/values-bg/strings.xml
+++ b/packages/SystemUI/res/values-bg/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"До изгрев"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Ще се включи в <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"До <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"КБП е деактивирана"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"КБП е активирана"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Отключване с цел използване"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"При извличането на картите ви възникна проблем. Моля, опитайте отново по-късно"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Настройки за заключения екран"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR код"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Докоснете за сканиране"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Потребителски профил в Work"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Самолетен режим"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Няма да чуете следващия си будилник в <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Пускане на <xliff:g id="SONG_NAME">%1$s</xliff:g> на <xliff:g id="ARTIST_NAME">%2$s</xliff:g> от <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Пускане на <xliff:g id="SONG_NAME">%1$s</xliff:g> от <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Отмяна"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Преместете се по-близо, за да се възпроизведе на <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Възпроизвежда се на <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Неактивно, проверете прилож."</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Не е намерено"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Контролата не е налице"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Избор на потребител"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Приложения, които се изпълняват на заден план"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Спиране"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Копиране"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Копирано"</string>
</resources>
diff --git a/packages/SystemUI/res/values-bn/strings.xml b/packages/SystemUI/res/values-bn/strings.xml
index be290af..6e72cc4 100644
--- a/packages/SystemUI/res/values-bn/strings.xml
+++ b/packages/SystemUI/res/values-bn/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"সূর্যোদয় পর্যন্ত"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g>-এ চালু হবে"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> পর্যন্ত"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC অক্ষম করা আছে"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC সক্ষম করা আছে"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"ব্যবহার করতে আনলক করুন"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"আপনার কার্ড সংক্রান্ত তথ্য পেতে সমস্যা হয়েছে, পরে আবার চেষ্টা করুন"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"লক স্ক্রিন সেটিংস"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR কোড"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"স্ক্যান করতে ট্যাপ করুন"</string>
<string name="status_bar_work" msgid="5238641949837091056">"কাজের প্রোফাইল"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"বিমান মোড"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="ARTIST_NAME">%2$s</xliff:g>-এর <xliff:g id="SONG_NAME">%1$s</xliff:g> গানটি <xliff:g id="APP_LABEL">%3$s</xliff:g> অ্যাপে চালান"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> গানটি <xliff:g id="APP_LABEL">%2$s</xliff:g> অ্যাপে চালান"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"আগের অবস্থায় ফিরুন"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g>-এ চালাতে আরও কাছে আনুন"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g>-এ ভিডিও চালানো হচ্ছে"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"বন্ধ আছে, অ্যাপ চেক করুন"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"খুঁজে পাওয়া যায়নি"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"কন্ট্রোল উপলভ্য নেই"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"ব্যবহারকারী বেছে নিন"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"ব্যাকগ্রাউন্ডে অ্যাপ চলছে"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"বন্ধ করুন"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"কপি করুন"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"কপি করা হয়েছে"</string>
</resources>
diff --git a/packages/SystemUI/res/values-bs/strings.xml b/packages/SystemUI/res/values-bs/strings.xml
index eb45708..3fd796d 100644
--- a/packages/SystemUI/res/values-bs/strings.xml
+++ b/packages/SystemUI/res/values-bs/strings.xml
@@ -271,6 +271,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Do svitanja"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Uključuje se u <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Do <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC je onemogućen"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC je omogućen"</string>
@@ -797,9 +801,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Reproducirajte pjesmu <xliff:g id="SONG_NAME">%1$s</xliff:g> izvođača <xliff:g id="ARTIST_NAME">%2$s</xliff:g> pomoću aplikacije <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Reproducirajte pjesmu <xliff:g id="SONG_NAME">%1$s</xliff:g> pomoću aplikacije <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Poništi"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Približite se da reproducirate na uređaju <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Reproducira se na uređaju <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Neaktivno, vidite aplikaciju"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Nije pronađeno"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Kontrola nije dostupna"</string>
@@ -886,8 +896,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Odaberite korisnika"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Aplikacije su aktivne u pozadini"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Zaustavi"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopiraj"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Kopirano"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index 06799a2..88db881c 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Fins a l\'alba"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Activat a les <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Fins a les <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"L\'NFC està desactivada"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"L\'NFC està activada"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Desbloqueja per utilitzar"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Hi ha hagut un problema en obtenir les teves targetes; torna-ho a provar més tard"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Configuració de la pantalla de bloqueig"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Codi QR"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Toca per escanejar"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Perfil de treball"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Mode d\'avió"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"<xliff:g id="WHEN">%1$s</xliff:g> no sentiràs la pròxima alarma"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Reprodueix <xliff:g id="SONG_NAME">%1$s</xliff:g> (<xliff:g id="ARTIST_NAME">%2$s</xliff:g>) des de l\'aplicació <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Reprodueix <xliff:g id="SONG_NAME">%1$s</xliff:g> des de l\'aplicació <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Desfés"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Mou més a prop per reproduir a <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"S\'està reproduint a <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inactiu; comprova l\'aplicació"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"No s\'ha trobat"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"El control no està disponible"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Selecciona un usuari"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Aplicacions que s\'executen en segon pla"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Atura"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copia"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"S\'ha copiat"</string>
</resources>
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index 4b63cd8..dd1f289 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -273,6 +273,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Do svítání"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Zapnout v <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Do <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC je vypnuto"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC je zapnuto"</string>
@@ -456,8 +460,7 @@
<string name="wallet_error_generic" msgid="257704570182963611">"Při načítání karet došlo k problému, zkuste to později"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Nastavení obrazovky uzamčení"</string>
<string name="qr_code_scanner_title" msgid="5660820608548306581">"QR kód"</string>
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Klepnutím naskenujete kód"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Pracovní profil"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Režim Letadlo"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Svůj další budík <xliff:g id="WHEN">%1$s</xliff:g> neuslyšíte"</string>
@@ -804,9 +807,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Přehrát skladbu <xliff:g id="SONG_NAME">%1$s</xliff:g> od interpreta <xliff:g id="ARTIST_NAME">%2$s</xliff:g> z aplikace <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Přehrát skladbu <xliff:g id="SONG_NAME">%1$s</xliff:g> z aplikace <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Vrátit zpět"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Pokud chcete přehrávat na zařízení <xliff:g id="DEVICENAME">%1$s</xliff:g>, přibližte se k němu"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Přehrává se na zařízení <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Neaktivní, zkontrolujte aplikaci"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Nenalezeno"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Ovládání není k dispozici"</string>
@@ -893,8 +902,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Zvolte uživatele"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Aplikace běžící na pozadí"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Konec"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopírovat"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Zkopírováno"</string>
</resources>
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index ad92cad..8011a02 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Indtil solopgang"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Tænd kl. <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Indtil kl. <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC er deaktiveret"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC er aktiveret"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Lås op for at bruge"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Dine kort kunne ikke hentes. Prøv igen senere."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Lås skærmindstillinger"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR-kode"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Tryk for at scanne"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Arbejdsprofil"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Flytilstand"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Du vil ikke kunne høre din næste alarm <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Afspil <xliff:g id="SONG_NAME">%1$s</xliff:g> af <xliff:g id="ARTIST_NAME">%2$s</xliff:g> via <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Afspil <xliff:g id="SONG_NAME">%1$s</xliff:g> via <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Fortryd"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Flyt enheden tættere på for at afspille på <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Afspilles på <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inaktiv. Tjek appen"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Ikke fundet"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Styringselement ikke tilgængeligt"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Vælg bruger"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Apps, der kører i baggrunden"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Stop"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopiér"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Kopieret"</string>
</resources>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index 8b51482..a7c1d2b 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Bis Sonnenaufgang"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"An um <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Bis <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC ist deaktiviert"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC ist aktiviert"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Zum Verwenden entsperren"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Beim Abrufen deiner Karten ist ein Fehler aufgetreten – bitte versuch es später noch einmal"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Einstellungen für den Sperrbildschirm"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR-Code"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Zum Scannen tippen"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Arbeitsprofil"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Flugmodus"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="SONG_NAME">%1$s</xliff:g> von <xliff:g id="ARTIST_NAME">%2$s</xliff:g> über <xliff:g id="APP_LABEL">%3$s</xliff:g> wiedergeben"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> über <xliff:g id="APP_LABEL">%2$s</xliff:g> wiedergeben"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Rückgängig machen"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Gehe für die Wiedergabe näher an <xliff:g id="DEVICENAME">%1$s</xliff:g> heran"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Wird auf <xliff:g id="DEVICENAME">%1$s</xliff:g> abgespielt"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inaktiv – sieh in der App nach"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Nicht gefunden"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Steuerelement nicht verfügbar"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Nutzer auswählen"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Apps, die im Hintergrund ausgeführt werden"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Beenden"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopieren"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Kopiert"</string>
</resources>
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index 9e61f1a..86a035a 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Μέχρι την ανατολή"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Ενεργοποίηση στις <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Έως <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"Το NFC είναι απενεργοποιημένο"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"Το NFC είναι ενεργοποιημένο"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Ξεκλείδωμα για χρήση"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Παρουσιάστηκε πρόβλημα με τη λήψη των καρτών σας. Δοκιμάστε ξανά αργότερα"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Ρυθμίσεις κλειδώματος οθόνης"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Κωδικός QR"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Πατήστε για σάρωση"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Προφίλ εργασίας"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Λειτουργία πτήσης"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Αναπαραγωγή του <xliff:g id="SONG_NAME">%1$s</xliff:g> από <xliff:g id="ARTIST_NAME">%2$s</xliff:g> στην εφαρμογή <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Αναπαραγωγή του <xliff:g id="SONG_NAME">%1$s</xliff:g> στην εφαρμογή <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Αναίρεση"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Πλησιάστε για αναπαραγωγή στη συσκευή <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Αναπαραγωγή στη συσκευή <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Ανενεργό, έλεγχος εφαρμογής"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Δεν βρέθηκε."</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Μη διαθέσιμο στοιχείο ελέγχου"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Επιλογή χρήστη"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Οι εφαρμογές βρίσκονται σε εξέλιξη στο παρασκήνιο"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Διακοπή"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Αντιγραφή"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Αντιγράφηκε"</string>
</resources>
diff --git a/packages/SystemUI/res/values-en-rAU/strings.xml b/packages/SystemUI/res/values-en-rAU/strings.xml
index 79c9ca2..b6e8b0f 100644
--- a/packages/SystemUI/res/values-en-rAU/strings.xml
+++ b/packages/SystemUI/res/values-en-rAU/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Until sunrise"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"On at <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Until <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC is disabled"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC is enabled"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Play <xliff:g id="SONG_NAME">%1$s</xliff:g> by <xliff:g id="ARTIST_NAME">%2$s</xliff:g> from <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Play <xliff:g id="SONG_NAME">%1$s</xliff:g> from <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Undo"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Move closer to play on <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Playing on <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inactive, check app"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Not found"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Control is unavailable"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Select user"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Apps running in the background"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Stop"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copy"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Copied"</string>
</resources>
diff --git a/packages/SystemUI/res/values-en-rCA/strings.xml b/packages/SystemUI/res/values-en-rCA/strings.xml
index 605811d..206042e 100644
--- a/packages/SystemUI/res/values-en-rCA/strings.xml
+++ b/packages/SystemUI/res/values-en-rCA/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Until sunrise"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"On at <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Until <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC is disabled"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC is enabled"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Play <xliff:g id="SONG_NAME">%1$s</xliff:g> by <xliff:g id="ARTIST_NAME">%2$s</xliff:g> from <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Play <xliff:g id="SONG_NAME">%1$s</xliff:g> from <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Undo"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Move closer to play on <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Playing on <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inactive, check app"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Not found"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Control is unavailable"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Select user"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Apps running in the background"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Stop"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copy"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Copied"</string>
</resources>
diff --git a/packages/SystemUI/res/values-en-rGB/strings.xml b/packages/SystemUI/res/values-en-rGB/strings.xml
index 79c9ca2..b6e8b0f 100644
--- a/packages/SystemUI/res/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Until sunrise"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"On at <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Until <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC is disabled"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC is enabled"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Play <xliff:g id="SONG_NAME">%1$s</xliff:g> by <xliff:g id="ARTIST_NAME">%2$s</xliff:g> from <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Play <xliff:g id="SONG_NAME">%1$s</xliff:g> from <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Undo"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Move closer to play on <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Playing on <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inactive, check app"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Not found"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Control is unavailable"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Select user"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Apps running in the background"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Stop"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copy"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Copied"</string>
</resources>
diff --git a/packages/SystemUI/res/values-en-rIN/strings.xml b/packages/SystemUI/res/values-en-rIN/strings.xml
index 79c9ca2..b6e8b0f 100644
--- a/packages/SystemUI/res/values-en-rIN/strings.xml
+++ b/packages/SystemUI/res/values-en-rIN/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Until sunrise"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"On at <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Until <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC is disabled"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC is enabled"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Play <xliff:g id="SONG_NAME">%1$s</xliff:g> by <xliff:g id="ARTIST_NAME">%2$s</xliff:g> from <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Play <xliff:g id="SONG_NAME">%1$s</xliff:g> from <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Undo"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Move closer to play on <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Playing on <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inactive, check app"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Not found"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Control is unavailable"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Select user"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Apps running in the background"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Stop"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copy"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Copied"</string>
</resources>
diff --git a/packages/SystemUI/res/values-en-rXC/strings.xml b/packages/SystemUI/res/values-en-rXC/strings.xml
index 3895548..b9db8f5 100644
--- a/packages/SystemUI/res/values-en-rXC/strings.xml
+++ b/packages/SystemUI/res/values-en-rXC/strings.xml
@@ -269,6 +269,8 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Until sunrise"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"On at <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Until <xliff:g id="TIME">%s</xliff:g>"</string>
+ <string name="quick_settings_dark_mode_secondary_label_on_at_bedtime" msgid="2274300599408864897">"On at bedtime"</string>
+ <string name="quick_settings_dark_mode_secondary_label_until_bedtime_ends" msgid="1790772410777123685">"Until bedtime ends"</string>
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC is disabled"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC is enabled"</string>
@@ -792,7 +794,14 @@
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Play <xliff:g id="SONG_NAME">%1$s</xliff:g> from <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Undo"</string>
<string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Move closer to play on <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
- <string name="media_transfer_playing" msgid="3760048096352107789">"Playing on <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inactive, check app"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Not found"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Control is unavailable"</string>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index f748e9d..0414a18 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Hasta el amanecer"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"A la(s) <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Hasta la(s) <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"La tecnología NFC está inhabilitada"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"La tecnología NFC está habilitada"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Desbloquear para usar"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Ocurrió un problema al obtener las tarjetas; vuelve a intentarlo más tarde"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Configuración de pantalla de bloqueo"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Código QR"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Presiona para escanear"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Perfil de trabajo"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Modo de avión"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Reproduce <xliff:g id="SONG_NAME">%1$s</xliff:g>, de <xliff:g id="ARTIST_NAME">%2$s</xliff:g>, en <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Reproducir <xliff:g id="SONG_NAME">%1$s</xliff:g> en <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Deshacer"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Acércate para reproducir en <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Reproduciendo en <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inactivo. Verifica la app"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"No se encontró"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"El control no está disponible"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Seleccionar usuario"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Apps en ejecución en segundo plano"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Detener"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copiar"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Se copió"</string>
</resources>
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index 0494780..949b87c 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Hasta el amanecer"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"A las <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Hasta las <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"El NFC está desactivado"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"El NFC está activado"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Desbloquear para usar"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Se ha producido un problema al obtener tus tarjetas. Inténtalo de nuevo más tarde."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Ajustes de pantalla de bloqueo"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Código QR"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Toca para escanear"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Perfil de trabajo"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Modo avión"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"No oirás la próxima alarma (<xliff:g id="WHEN">%1$s</xliff:g>)"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Poner <xliff:g id="SONG_NAME">%1$s</xliff:g> de <xliff:g id="ARTIST_NAME">%2$s</xliff:g> en <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Poner <xliff:g id="SONG_NAME">%1$s</xliff:g> en <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Deshacer"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Acércate a <xliff:g id="DEVICENAME">%1$s</xliff:g> para que se reproduzca en ese dispositivo"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Reproduciendo en <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inactivo, comprobar aplicación"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"No se ha encontrado"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Control no disponible"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Seleccionar usuario"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Aplicaciones ejecutándose en segundo plano"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Detener"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copiar"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Copiado"</string>
</resources>
diff --git a/packages/SystemUI/res/values-et/strings.xml b/packages/SystemUI/res/values-et/strings.xml
index 15c10be..68b3699 100644
--- a/packages/SystemUI/res/values-et/strings.xml
+++ b/packages/SystemUI/res/values-et/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Kuni päikesetõusuni"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Sisse kell <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Kuni <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC on keelatud"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC on lubatud"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Avage kasutamiseks"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Teie kaartide hankimisel ilmnes probleem, proovige hiljem uuesti"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Lukustuskuva seaded"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR-kood"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Skannimiseks puudutamine"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Tööprofiil"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Lennukirežiim"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Te ei kuule järgmist äratust kell <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Esita lugu <xliff:g id="SONG_NAME">%1$s</xliff:g> esitajalt <xliff:g id="ARTIST_NAME">%2$s</xliff:g> rakenduses <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Esita lugu <xliff:g id="SONG_NAME">%1$s</xliff:g> rakenduses <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Võta tagasi"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Teisaldage lähemale, et seadmes <xliff:g id="DEVICENAME">%1$s</xliff:g> esitada"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Esitatakse seadmes <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Passiivne, vaadake rakendust"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Ei leitud"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Juhtelement pole saadaval"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Kasutaja valimine"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Taustal töötavad rakendused"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Peata"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopeeri"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Kopeeritud"</string>
</resources>
diff --git a/packages/SystemUI/res/values-eu/strings.xml b/packages/SystemUI/res/values-eu/strings.xml
index 454ad59..5c197a7 100644
--- a/packages/SystemUI/res/values-eu/strings.xml
+++ b/packages/SystemUI/res/values-eu/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Egunsentira arte"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Aktibatze-ordua: <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Desaktibatze-ordua: <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"Desgaituta dago NFC"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"Gaituta dago NFC"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Desblokeatu erabiltzeko"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Arazo bat izan da txartelak eskuratzean. Saiatu berriro geroago."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Pantaila blokeatuaren ezarpenak"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR kodea"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Sakatu eskaneatzeko"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Work profila"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Hegaldi modua"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Erreproduzitu <xliff:g id="SONG_NAME">%1$s</xliff:g> (<xliff:g id="ARTIST_NAME">%2$s</xliff:g>) <xliff:g id="APP_LABEL">%3$s</xliff:g> bidez"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Erreproduzitu <xliff:g id="SONG_NAME">%1$s</xliff:g> <xliff:g id="APP_LABEL">%2$s</xliff:g> bidez"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Desegin"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Gertura ezazu <xliff:g id="DEVICENAME">%1$s</xliff:g> gailuan erreproduzitzeko"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> pantailan erreproduzitzen"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inaktibo; egiaztatu aplikazioa"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Ez da aurkitu"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Ez dago erabilgarri kontrolatzeko aukera"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Hautatu erabiltzaile bat"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Atzeko planoan exekutatzen ari diren aplikazioak"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Gelditu"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopiatu"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Kopiatu da"</string>
</resources>
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index c2c1ffb..6219088 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"تا طلوع آفتاب"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"ساعت <xliff:g id="TIME">%s</xliff:g> روشن میشود"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"تا<xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC غیرفعال است"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC فعال است"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"برای استفاده، قفل را باز کنید"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"هنگام دریافت کارتها مشکلی پیش آمد، لطفاً بعداً دوباره امتحان کنید"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"تنظیمات صفحه قفل"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"رمزینه پاسخسریع"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"برای اسکن کردن، ضربه بزنید"</string>
<string name="status_bar_work" msgid="5238641949837091056">"نمایه کاری"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"حالت هواپیما"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"در ساعت <xliff:g id="WHEN">%1$s</xliff:g>، دیگر صدای زنگ ساعت را نمیشنوید"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="SONG_NAME">%1$s</xliff:g> از <xliff:g id="ARTIST_NAME">%2$s</xliff:g> را ازطریق <xliff:g id="APP_LABEL">%3$s</xliff:g> پخش کنید"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> را ازطریق <xliff:g id="APP_LABEL">%2$s</xliff:g> پخش کنید"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"واگرد"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"برای پخش در <xliff:g id="DEVICENAME">%1$s</xliff:g> به دستگاه نزدیکتر شوید"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"درحال پخش در <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"غیرفعال، برنامه را بررسی کنید"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"پیدا نشد"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"کنترل دردسترس نیست"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"انتخاب کاربر"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"برنامههایی که در پسزمینه اجرا میشود"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"توقف"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"کپی کردن"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"کپی شد"</string>
</resources>
diff --git a/packages/SystemUI/res/values-fi/strings.xml b/packages/SystemUI/res/values-fi/strings.xml
index cd3844f..4556dc9 100644
--- a/packages/SystemUI/res/values-fi/strings.xml
+++ b/packages/SystemUI/res/values-fi/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Auringonnousuun"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Päälle klo <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> asti"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC on poistettu käytöstä"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC on käytössä"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Avaa lukitus ja käytä"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Korttien noutamisessa oli ongelma, yritä myöhemmin uudelleen"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Lukitusnäytön asetukset"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR-koodi"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Skannaa napauttamalla"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Työprofiili"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Lentokonetila"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Et kuule seuraavaa hälytystäsi (<xliff:g id="WHEN">%1$s</xliff:g>)."</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Soita <xliff:g id="SONG_NAME">%1$s</xliff:g> (<xliff:g id="ARTIST_NAME">%2$s</xliff:g>) sovelluksessa <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Soita <xliff:g id="SONG_NAME">%1$s</xliff:g> (<xliff:g id="APP_LABEL">%2$s</xliff:g>)"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Kumoa"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Siirry lähemmäs, jotta <xliff:g id="DEVICENAME">%1$s</xliff:g> voi toistaa tämän"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> toistaa tämän"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Epäaktiivinen, tarkista sovellus"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Ei löydy"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Ohjain ei ole käytettävissä"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Valitse käyttäjä"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Sovellukset jotka ovat käynnissä taustalla"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Lopeta"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopioi"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Kopioitu"</string>
</resources>
diff --git a/packages/SystemUI/res/values-fr-rCA/strings.xml b/packages/SystemUI/res/values-fr-rCA/strings.xml
index 440369d..bda7b05 100644
--- a/packages/SystemUI/res/values-fr-rCA/strings.xml
+++ b/packages/SystemUI/res/values-fr-rCA/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Jusqu\'à l\'aube"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Actif à <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Jusqu\'à <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"CCP"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"CCP désactivée"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"CCP activée"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Déverrouiller pour utiliser"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Un problème est survenu lors de la récupération de vos cartes, veuillez réessayer plus tard"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Paramètres de l\'écran de verrouillage"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Code QR"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Touchez pour numériser"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Profil professionnel"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Mode Avion"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Vous n\'entendrez pas votre prochaine alarme à <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Lecture de <xliff:g id="SONG_NAME">%1$s</xliff:g> par <xliff:g id="ARTIST_NAME">%2$s</xliff:g> à partir de <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Lecture de <xliff:g id="SONG_NAME">%1$s</xliff:g> à partir de <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Annuler"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Rapprochez-vous pour faire jouer le contenu sur <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Lecture sur <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Délai expiré, vérifiez l\'appli"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Introuvable"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"La commande n\'est pas accessible"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Sélect. utilisateur"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Applications exécutées en arrière-plan"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Arrêter"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copier"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Copié"</string>
</resources>
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index 891e85c..ec78946 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Jusqu\'à l\'aube"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"À partir de <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Jusqu\'à <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC désactivée"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"La technologie NFC est activée"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Déverrouiller pour utiliser"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Problème de récupération de vos cartes. Réessayez plus tard"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Paramètres de l\'écran de verrouillage"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Code QR"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Appuyer pour scanner"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Profil professionnel"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Mode Avion"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Mets <xliff:g id="SONG_NAME">%1$s</xliff:g> par <xliff:g id="ARTIST_NAME">%2$s</xliff:g> depuis <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Mets <xliff:g id="SONG_NAME">%1$s</xliff:g> depuis <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Annuler"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Rapprochez-vous pour lire sur <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Lecture sur <xliff:g id="DEVICENAME">%1$s</xliff:g>…"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Délai expiré, vérifier l\'appli"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Introuvable"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Commande indisponible"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Choisir utilisateur"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Applis exécutées en arrière-plan"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Arrêter"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copier"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Copié"</string>
</resources>
diff --git a/packages/SystemUI/res/values-gl/strings.xml b/packages/SystemUI/res/values-gl/strings.xml
index 70a3c68..73af2fe 100644
--- a/packages/SystemUI/res/values-gl/strings.xml
+++ b/packages/SystemUI/res/values-gl/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Ata o amencer"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Activación: <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Utilizarase ata as: <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"A opción NFC está desactivada"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"A opción NFC está activada"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Desbloquear para usar"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Produciuse un problema ao obter as tarxetas. Téntao de novo máis tarde"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Configuración da pantalla de bloqueo"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Código QR"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Tocar para escanear"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Perfil de traballo"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Modo avión"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Non escoitarás a alarma seguinte <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Reproduce <xliff:g id="SONG_NAME">%1$s</xliff:g>, de <xliff:g id="ARTIST_NAME">%2$s</xliff:g>, en <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Reproduce <xliff:g id="SONG_NAME">%1$s</xliff:g> en <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Desfacer"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Achega o dispositivo para reproducir o contido en: <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Estase reproducindo o contido en: <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inactivo. Comproba a app"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Non se atopou"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"O control non está dispoñible"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Seleccionar usuario"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Aplicacións que se están executando en segundo plano"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Deter"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copiar"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Copiouse"</string>
</resources>
diff --git a/packages/SystemUI/res/values-gu/strings.xml b/packages/SystemUI/res/values-gu/strings.xml
index 5f262b5..3cd94b3 100644
--- a/packages/SystemUI/res/values-gu/strings.xml
+++ b/packages/SystemUI/res/values-gu/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"સૂર્યોદય સુધી"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g> વાગ્યે ચાલુ"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> વાગ્યા સુધી"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC અક્ષમ કરેલ છે"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC સક્ષમ કરેલ છે"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"ઉપયોગ કરવા માટે અનલૉક કરો"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"તમારા કાર્ડની માહિતી મેળવવામાં સમસ્યા આવી હતી, કૃપા કરીને થોડા સમય પછી ફરી પ્રયાસ કરો"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"લૉક સ્ક્રીનના સેટિંગ"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR કોડ"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"સ્કૅન કરવા માટે ટૅપ કરો"</string>
<string name="status_bar_work" msgid="5238641949837091056">"ઑફિસની પ્રોફાઇલ"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"એરપ્લેન મોડ"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="APP_LABEL">%3$s</xliff:g> પર <xliff:g id="ARTIST_NAME">%2$s</xliff:g>નું <xliff:g id="SONG_NAME">%1$s</xliff:g> ગીત ચલાવો"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="APP_LABEL">%2$s</xliff:g> પર <xliff:g id="SONG_NAME">%1$s</xliff:g> ગીત ચલાવો"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"છેલ્લો ફેરફાર રદ કરો"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> પર ચલાવવા માટે વધુ નજીક ખસેડો"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> પર ચલાવવામાં આવી રહ્યું છે"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"નિષ્ક્રિય, ઍપને ચેક કરો"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"મળ્યું નથી"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"નિયંત્રણ ઉપલબ્ધ નથી"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"વપરાશકર્તા પસંદ કરો"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"બૅકગ્રાઉન્ડમાં ચાલતી ઍપ"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"રોકો"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"કૉપિ કરો"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"કૉપિ કરવામાં આવી"</string>
</resources>
diff --git a/packages/SystemUI/res/values-hi/strings.xml b/packages/SystemUI/res/values-hi/strings.xml
index 755c480..fd79377 100644
--- a/packages/SystemUI/res/values-hi/strings.xml
+++ b/packages/SystemUI/res/values-hi/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"सुबह तक चालू रहेगी"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g> पर चालू हाेगी"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> तक चालू रहेगी"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"एनएफ़सी"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC बंद है"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC चालू है"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"इस्तेमाल करने के लिए, डिवाइस अनलॉक करें"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"आपके कार्ड की जानकारी पाने में कोई समस्या हुई है. कृपया बाद में कोशिश करें"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"लॉक स्क्रीन की सेटिंग"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"क्यूआर कोड"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"स्कैन करने के लिए टैप करें"</string>
<string name="status_bar_work" msgid="5238641949837091056">"वर्क प्रोफ़ाइल"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"हवाई जहाज़ मोड"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"आपको <xliff:g id="WHEN">%1$s</xliff:g> पर अपना अगला अलार्म नहीं सुनाई देगा"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="APP_LABEL">%3$s</xliff:g> पर, <xliff:g id="ARTIST_NAME">%2$s</xliff:g> का <xliff:g id="SONG_NAME">%1$s</xliff:g> चलाएं"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="APP_LABEL">%2$s</xliff:g> पर, <xliff:g id="SONG_NAME">%1$s</xliff:g> चलाएं"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"पहले जैसा करें"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> पर मीडिया चलाने के लिए, अपने डिवाइस को उसके पास ले जाएं"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> पर चल रहा है"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"काम नहीं कर रहा, ऐप जांचें"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"कंट्रोल नहीं है"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"कंट्रोल मौजूद नहीं है"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"उपयोगकर्ता चुनें"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"बैकग्राउंड में चल रहे ऐप्लिकेशन"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"बंद करें"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"कॉपी करें"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"कॉपी किया गया"</string>
</resources>
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index a5be1e3..2fbaef3 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -271,6 +271,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Do izlaska sunca"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Uključuje se u <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Do <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC je onemogućen"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC je omogućen"</string>
@@ -452,10 +456,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Otključajte da biste koristili"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Pojavio se problem prilikom dohvaćanja kartica, pokušajte ponovo kasnije"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Postavke zaključanog zaslona"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR kôd"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Dodirnite za skeniranje"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Poslovni profil"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Način rada u zrakoplovu"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Nećete čuti sljedeći alarm <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -799,9 +801,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Pustite <xliff:g id="SONG_NAME">%1$s</xliff:g>, <xliff:g id="ARTIST_NAME">%2$s</xliff:g> putem aplikacije <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Pustite <xliff:g id="SONG_NAME">%1$s</xliff:g> putem aplikacije <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Poništi"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Približite se radi reprodukcije na uređaju <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Reproducira se na uređaju <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Neaktivno, provjerite aplik."</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Nije pronađeno"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Kontrola nije dostupna"</string>
@@ -888,8 +896,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Odabir korisnika"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Aplikacije koje se izvode u pozadini"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Zaustavi"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopiraj"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Kopirano"</string>
</resources>
diff --git a/packages/SystemUI/res/values-hu/strings.xml b/packages/SystemUI/res/values-hu/strings.xml
index 0275b72..2b9f3cc 100644
--- a/packages/SystemUI/res/values-hu/strings.xml
+++ b/packages/SystemUI/res/values-hu/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Napfelkeltéig"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Be: <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Eddig: <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"Az NFC ki van kapcsolva"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"Az NFC be van kapcsolva"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Oldja fel a használathoz"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Probléma merült fel a kártyák lekérésekor, próbálja újra később"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Lezárási képernyő beállításai"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR-kód"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Koppintson a beolvasáshoz"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Munkahelyi profil"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Repülős üzemmód"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Nem fogja hallani az ébresztést ekkor: <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="ARTIST_NAME">%2$s</xliff:g> <xliff:g id="SONG_NAME">%1$s</xliff:g> című számának lejátszása innen: <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> lejátszása innen: <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Visszavonás"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Menjen közelebb a következőn való lejátszáshoz: <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Lejátszás folyamatban a(z) <xliff:g id="DEVICENAME">%1$s</xliff:g> eszközön"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inaktív, ellenőrizze az appot"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Nem található"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Nem hozzáférhető vezérlő"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Felhasználóválasztás"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Több alkalmazás is fut a háttérben"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Leállítás"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Másolás"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Másolva"</string>
</resources>
diff --git a/packages/SystemUI/res/values-hy/strings.xml b/packages/SystemUI/res/values-hy/strings.xml
index c32b166..d08731f 100644
--- a/packages/SystemUI/res/values-hy/strings.xml
+++ b/packages/SystemUI/res/values-hy/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Մինչև լուսաբաց"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Կմիանա՝ <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Մինչև <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC-ն անջատված է"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC-ն միացված է"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Ապակողպել՝ օգտագործելու համար"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Չհաջողվեց բեռնել քարտերը։ Նորից փորձեք։"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Կողպէկրանի կարգավորումներ"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR կոդ"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Հպեք՝ սկանավորելու համար"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Android for Work-ի պրոֆիլ"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Ավիառեժիմ"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Նվագարկել <xliff:g id="SONG_NAME">%1$s</xliff:g> երգը <xliff:g id="ARTIST_NAME">%2$s</xliff:g>-ի կատարմամբ <xliff:g id="APP_LABEL">%3$s</xliff:g> հավելվածից"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Նվագարկել <xliff:g id="SONG_NAME">%1$s</xliff:g> երգը <xliff:g id="APP_LABEL">%2$s</xliff:g> հավելվածից"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Հետարկել"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Ավելի մոտ եկեք՝ <xliff:g id="DEVICENAME">%1$s</xliff:g> սարքում նվագարկելու համար"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Նվագարկվում է <xliff:g id="DEVICENAME">%1$s</xliff:g> սարքում"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Ակտիվ չէ, ստուգեք հավելվածը"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Չի գտնվել"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Կառավարման տարրը հասանելի չէ"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Ընտրեք օգտատեր"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Ֆոնային ռեժիմում աշխատող հավելվածներ"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Դադարեցնել"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Պատճենել"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Պատճենվեց"</string>
</resources>
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index 24f8698..a6c2303 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Sampai pagi"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Aktif pada <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Sampai <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC dinonaktifkan"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC diaktifkan"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Buka kunci untuk menggunakan"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Terjadi masalah saat mendapatkan kartu Anda, coba lagi nanti"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Setelan layar kunci"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Kode QR"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Ketuk untuk memindai"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Profil kerja"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Mode pesawat"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Anda tidak akan mendengar alarm berikutnya <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Putar <xliff:g id="SONG_NAME">%1$s</xliff:g> oleh <xliff:g id="ARTIST_NAME">%2$s</xliff:g> dari <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Putar <xliff:g id="SONG_NAME">%1$s</xliff:g> dari <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Urungkan"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Dekatkan untuk memutar di <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Diputar di <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Nonaktif, periksa aplikasi"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Tidak ditemukan"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Kontrol tidak tersedia"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Pilih pengguna"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Aplikasi berjalan di latar belakang"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Berhenti"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Salin"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Disalin"</string>
</resources>
diff --git a/packages/SystemUI/res/values-is/strings.xml b/packages/SystemUI/res/values-is/strings.xml
index a7a43e6..026200c 100644
--- a/packages/SystemUI/res/values-is/strings.xml
+++ b/packages/SystemUI/res/values-is/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Til sólarupprásar"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Virkt kl. <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Til <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"Slökkt á NFC"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"Kveikt á NFC"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Taktu úr lás til að nota"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Vandamál kom upp við að sækja kortin þín. Reyndu aftur síðar"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Stillingar fyrir læstan skjá"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR-kóði"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Ýttu til að skanna"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Vinnusnið"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Flugstilling"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Ekki mun heyrast í vekjaranum <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Spila <xliff:g id="SONG_NAME">%1$s</xliff:g> með <xliff:g id="ARTIST_NAME">%2$s</xliff:g> í <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Spila <xliff:g id="SONG_NAME">%1$s</xliff:g> í <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Afturkalla"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Færðu nær til að spila í <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Spilast í <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Óvirkt, athugaðu forrit"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Fannst ekki"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Stýring er ekki tiltæk"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Velja notanda"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Forrit keyra í bakgrunni"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Stöðva"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Afrita"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Afritað"</string>
</resources>
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index 2f3d50f..120a6a5 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Fino all\'alba"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Attivazione alle <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Fino alle <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC non attiva"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC attiva"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Sblocca per usare"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Si è verificato un problema durante il recupero delle tue carte. Riprova più tardi."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Impostazioni schermata di blocco"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Codice QR"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Tocca per scansionare"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Profilo di lavoro"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Modalità aereo"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Riproduci <xliff:g id="SONG_NAME">%1$s</xliff:g> di <xliff:g id="ARTIST_NAME">%2$s</xliff:g> da <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Riproduci <xliff:g id="SONG_NAME">%1$s</xliff:g> da <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Annulla"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Avvicinati per riprodurre su <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"In riproduzione su <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inattivo, controlla l\'app"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Controllo non trovato"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Il controllo non è disponibile"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Seleziona utente"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"App in esecuzione in background"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Interrompi"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copia"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Copiato"</string>
</resources>
diff --git a/packages/SystemUI/res/values-iw/strings.xml b/packages/SystemUI/res/values-iw/strings.xml
index 757ff77..2825d24 100644
--- a/packages/SystemUI/res/values-iw/strings.xml
+++ b/packages/SystemUI/res/values-iw/strings.xml
@@ -273,6 +273,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"עד הזריחה"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"יתחיל בשעה <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"עד <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC מושבת"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC מופעל"</string>
@@ -455,10 +459,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"יש לבטל את הנעילה כדי להשתמש"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"הייתה בעיה בקבלת הכרטיסים שלך. כדאי לנסות שוב מאוחר יותר"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"הגדרות מסך הנעילה"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"קוד QR"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"צריך להקיש כדי לסרוק"</string>
<string name="status_bar_work" msgid="5238641949837091056">"פרופיל עבודה"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"מצב טיסה"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"לא ניתן יהיה לשמוע את ההתראה הבאה שלך <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -805,9 +807,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"הפעלת <xliff:g id="SONG_NAME">%1$s</xliff:g> של <xliff:g id="ARTIST_NAME">%2$s</xliff:g> מ-<xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"הפעלת <xliff:g id="SONG_NAME">%1$s</xliff:g> מ-<xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"ביטול"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"צריך להתקרב כדי להפעיל מוזיקה במכשיר <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"ההפעלה הועברה למכשיר <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"לא פעיל, יש לבדוק את האפליקציה"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"לא נמצא"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"הפקד לא זמין"</string>
@@ -894,8 +902,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"בחירת משתמש"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"אפליקציות שפועלות ברקע"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"עצירה"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"העתקה"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"הועתק"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index f219de3..1d0537c 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"日の出まで"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g>にオン"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g>まで"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC は無効です"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC は有効です"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="SONG_NAME">%1$s</xliff:g>(アーティスト名: <xliff:g id="ARTIST_NAME">%2$s</xliff:g>)を <xliff:g id="APP_LABEL">%3$s</xliff:g> で再生"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> を <xliff:g id="APP_LABEL">%2$s</xliff:g> で再生"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"元に戻す"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g>で再生するにはもっと近づけてください"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g>で再生しています"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"無効: アプリをご確認ください"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"見つかりませんでした"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"コントロールを使用できません"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"ユーザーの選択"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"バックグラウンドで実行中のアプリ"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"停止"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"コピー"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"コピーしました"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ka/strings.xml b/packages/SystemUI/res/values-ka/strings.xml
index b932c45..5ed24da 100644
--- a/packages/SystemUI/res/values-ka/strings.xml
+++ b/packages/SystemUI/res/values-ka/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"მზის ამოსვლამდე"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"ჩაირთოს <xliff:g id="TIME">%s</xliff:g>-ზე"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g>-მდე"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC გათიშულია"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC ჩართულია"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"დაუკარით <xliff:g id="SONG_NAME">%1$s</xliff:g>, <xliff:g id="ARTIST_NAME">%2$s</xliff:g>, <xliff:g id="APP_LABEL">%3$s</xliff:g>-დან"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"დაუკარით <xliff:g id="SONG_NAME">%1$s</xliff:g> <xliff:g id="APP_LABEL">%2$s</xliff:g>-დან"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"მოქმედების გაუქმება"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"მიიტანეთ უფრო ახლოს, რომ დაუკრათ <xliff:g id="DEVICENAME">%1$s</xliff:g>-ზე"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"მიმდინარეობს დაკვრა <xliff:g id="DEVICENAME">%1$s</xliff:g>-ზე"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"არააქტიურია, გადაამოწმეთ აპი"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"ვერ მოიძებნა"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"კონტროლი მიუწვდომელია"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"მომხმარებლის არჩევა"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"ფონურად მომუშავე აპები"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"შეწყვეტა"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"კოპირება"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"კოპირებულია"</string>
</resources>
diff --git a/packages/SystemUI/res/values-kk/strings.xml b/packages/SystemUI/res/values-kk/strings.xml
index 1ac6c7e..62f1f75 100644
--- a/packages/SystemUI/res/values-kk/strings.xml
+++ b/packages/SystemUI/res/values-kk/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Күн шыққанға дейін"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Қосылу уақыты: <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> дейін"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC өшірулі"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC қосулы"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Пайдалану үшін құлыпты ашу"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Карталарыңыз алынбады, кейінірек қайталап көріңіз."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Экран құлпының параметрлері"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR коды"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Сканерлеу үшін түртіңіз."</string>
<string name="status_bar_work" msgid="5238641949837091056">"Жұмыс профилі"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Ұшақ режимі"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="APP_LABEL">%3$s</xliff:g> қолданбасында <xliff:g id="ARTIST_NAME">%2$s</xliff:g> орындайтын \"<xliff:g id="SONG_NAME">%1$s</xliff:g>\" әнін ойнату"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="APP_LABEL">%2$s</xliff:g> қолданбасында \"<xliff:g id="SONG_NAME">%1$s</xliff:g>\" әнін ойнату"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Қайтару"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> құрылғысында музыка ойнату үшін оған жақындаңыз."</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> құрылғысында ойнатылуда."</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Өшірулі. Қолданба тексеріңіз."</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Табылмады"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Басқару виджеті қолжетімсіз"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Пайдаланушыны таңдау"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Фондық режимде жұмыс істеп тұрған қолданбалар"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Тоқтату"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Көшіру"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Көшірілді"</string>
</resources>
diff --git a/packages/SystemUI/res/values-km/strings.xml b/packages/SystemUI/res/values-km/strings.xml
index bc69da9..1f64cf9 100644
--- a/packages/SystemUI/res/values-km/strings.xml
+++ b/packages/SystemUI/res/values-km/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"រហូតដល់ពេលថ្ងៃរះ"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"បើកនៅម៉ោង <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"រហូតដល់ម៉ោង <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"បានបិទ NFC"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"បានបើក NFC"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"ចាក់ <xliff:g id="SONG_NAME">%1$s</xliff:g> ច្រៀងដោយ <xliff:g id="ARTIST_NAME">%2$s</xliff:g> ពី <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"ចាក់ <xliff:g id="SONG_NAME">%1$s</xliff:g> ពី <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"ត្រឡប់វិញ"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"រំកិលឱ្យកាន់តែជិត ដើម្បីចាក់នៅលើ <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"កំពុងចាក់នៅលើ <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"អសកម្ម ពិនិត្យមើលកម្មវិធី"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"រកមិនឃើញទេ"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"មិនអាចគ្រប់គ្រងបានទេ"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"ជ្រើសរើសអ្នកប្រើប្រាស់"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"កម្មវិធីដែលកំពុងដំណើរការនៅផ្ទៃខាងក្រោយ"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"ឈប់"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"ចម្លង"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"បានចម្លង"</string>
</resources>
diff --git a/packages/SystemUI/res/values-kn/strings.xml b/packages/SystemUI/res/values-kn/strings.xml
index c388d82..2b80b8a 100644
--- a/packages/SystemUI/res/values-kn/strings.xml
+++ b/packages/SystemUI/res/values-kn/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"ಸೂರ್ಯೋದಯದವರೆಗೆ"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g> ಸಮಯದಲ್ಲಿ"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> ವರೆಗೂ"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC ನಿಷ್ಕ್ರಿಯಗೊಂಡಿದೆ"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC ಸಕ್ರಿಯಗೊಂಡಿದೆ"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"ಬಳಸಲು ಅನ್ಲಾಕ್ ಮಾಡಿ"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"ನಿಮ್ಮ ಕಾರ್ಡ್ಗಳನ್ನು ಪಡೆಯುವಾಗ ಸಮಸ್ಯೆ ಉಂಟಾಗಿದೆ, ನಂತರ ಪುನಃ ಪ್ರಯತ್ನಿಸಿ"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"ಲಾಕ್ ಸ್ಕ್ರ್ರೀನ್ ಸೆಟ್ಟಿಂಗ್ಗಳು"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR ಕೋಡ್"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"ಸ್ಕ್ಯಾನ್ ಮಾಡಲು ಟ್ಯಾಪ್ ಮಾಡಿ"</string>
<string name="status_bar_work" msgid="5238641949837091056">"ಕೆಲಸದ ಪ್ರೊಫೈಲ್"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"ಏರ್ಪ್ಲೇನ್ ಮೋಡ್"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"ನಿಮ್ಮ ಮುಂದಿನ <xliff:g id="WHEN">%1$s</xliff:g> ಅಲಾರಮ್ ಅನ್ನು ನೀವು ಆಲಿಸುವುದಿಲ್ಲ"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="ARTIST_NAME">%2$s</xliff:g> ಅವರ <xliff:g id="SONG_NAME">%1$s</xliff:g> ಹಾಡನ್ನು <xliff:g id="APP_LABEL">%3$s</xliff:g> ನಲ್ಲಿ ಪ್ಲೇ ಮಾಡಿ"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> ಹಾಡನ್ನು <xliff:g id="APP_LABEL">%2$s</xliff:g> ನಲ್ಲಿ ಪ್ಲೇ ಮಾಡಿ"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"ರದ್ದುಗೊಳಿಸಿ"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> ನಲ್ಲಿ ಪ್ಲೇ ಮಾಡಲು ಅದರ ಹತ್ತಿರಕ್ಕೆ ಸರಿಯಿರಿ"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> ನಲ್ಲಿ ಪ್ಲೇ ಆಗುತ್ತಿದೆ"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"ನಿಷ್ಕ್ರಿಯ, ಆ್ಯಪ್ ಪರಿಶೀಲಿಸಿ"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"ಕಂಡುಬಂದಿಲ್ಲ"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"ನಿಯಂತ್ರಣ ಲಭ್ಯವಿಲ್ಲ"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"ಬಳಕೆದಾರ ಆಯ್ಕೆಮಾಡಿ"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"ಹಿನ್ನೆಲೆಯಲ್ಲಿ ರನ್ ಆಗುತ್ತಿರುವ ಆ್ಯಪ್ಗಳು"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"ನಿಲ್ಲಿಸಿ"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"ನಕಲಿಸಿ"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"ನಕಲಿಸಲಾಗಿದೆ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index 16b5447..dbe0290 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"일출까지"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g>에 켜짐"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g>까지"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC 사용 중지됨"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC 사용 설정됨"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"잠금 해제하여 사용"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"카드를 가져오는 중에 문제가 발생했습니다. 나중에 다시 시도해 보세요."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"잠금 화면 설정"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR 코드"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"탭하여 스캔"</string>
<string name="status_bar_work" msgid="5238641949837091056">"직장 프로필"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"비행기 모드"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"<xliff:g id="WHEN">%1$s</xliff:g>에 다음 알람을 들을 수 없습니다."</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="APP_LABEL">%3$s</xliff:g>에서 <xliff:g id="ARTIST_NAME">%2$s</xliff:g>의 <xliff:g id="SONG_NAME">%1$s</xliff:g> 재생"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="APP_LABEL">%2$s</xliff:g>에서 <xliff:g id="SONG_NAME">%1$s</xliff:g> 재생"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"실행취소"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g>에서 재생하려면 기기를 더 가까이로 옮기세요."</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g>에서 재생 중"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"비활성. 앱을 확인하세요."</string>
<string name="controls_error_removed" msgid="6675638069846014366">"찾을 수 없음"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"컨트롤을 사용할 수 없음"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"사용자 선택"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"백그라운드에서 실행 중인 앱"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"중지"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"복사"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"복사됨"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ky/strings.xml b/packages/SystemUI/res/values-ky/strings.xml
index 31c8522..f959935 100644
--- a/packages/SystemUI/res/values-ky/strings.xml
+++ b/packages/SystemUI/res/values-ky/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Күн чыкканга чейин"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Саат <xliff:g id="TIME">%s</xliff:g> күйөт"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> чейин"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC өчүрүлгөн"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC иштетилген"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Колдонуу үчүн кулпусун ачыңыз"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Кыйытмаларды алууда ката кетти. Бир аздан кийин кайталап көрүңүз."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Кулпуланган экран жөндөөлөрү"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR коду"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Скандоо үчүн таптап коюңуз"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Жумуш профили"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Учак режими"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="SONG_NAME">%1$s</xliff:g> ырын (аткаруучу: <xliff:g id="ARTIST_NAME">%2$s</xliff:g>) <xliff:g id="APP_LABEL">%3$s</xliff:g> колдонмосунан ойнотуу"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> ырын <xliff:g id="APP_LABEL">%2$s</xliff:g> колдонмосунан ойнотуу"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Кайтаруу"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> түзмөгүндө ойнотуу үчүн жакыныраак жылдырыңыз"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> аркылуу ойнотулууда"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Жигерсиз. Колдонмону текшериңиз"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Табылган жок"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Башкара албайсыз"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Колдонуучуну тандоо"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Фондо иштеп жаткан колдонмолор"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Токтотуу"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Көчүрүү"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Көчүрүлдү"</string>
</resources>
diff --git a/packages/SystemUI/res/values-lo/strings.xml b/packages/SystemUI/res/values-lo/strings.xml
index f3884bc..8e2641f 100644
--- a/packages/SystemUI/res/values-lo/strings.xml
+++ b/packages/SystemUI/res/values-lo/strings.xml
@@ -269,6 +269,8 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"ຈົນກວ່າຕາເວັນຂຶ້ນ"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"ເປີດເວລາ <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"ຈົນຮອດ <xliff:g id="TIME">%s</xliff:g>"</string>
+ <string name="quick_settings_dark_mode_secondary_label_on_at_bedtime" msgid="2274300599408864897">"ເປີດໃນເວລານອນ"</string>
+ <string name="quick_settings_dark_mode_secondary_label_until_bedtime_ends" msgid="1790772410777123685">"ຈົນກວ່າເວລານອນຈະສິ້ນສຸດ"</string>
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC is disabled"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC is enabled"</string>
@@ -449,8 +451,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"ປົດລັອກເພື່ອໃຊ້"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"ເກີດບັນຫາໃນການໂຫຼດບັດຂອງທ່ານ, ກະລຸນາລອງໃໝ່ໃນພາຍຫຼັງ"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"ການຕັ້ງຄ່າໜ້າຈໍລັອກ"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"ລະຫັດ QR"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"ແຕະເພື່ອສະແກນ"</string>
<string name="status_bar_work" msgid="5238641949837091056">"ໂປຣໄຟລ໌ບ່ອນເຮັດວຽກ"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"ໂໝດເຮືອບິນ"</string>
@@ -792,9 +793,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"ຫຼິ້ນ <xliff:g id="SONG_NAME">%1$s</xliff:g> ໂດຍ <xliff:g id="ARTIST_NAME">%2$s</xliff:g> ຈາກ <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"ຫຼິ້ນ <xliff:g id="SONG_NAME">%1$s</xliff:g> ຈາກ <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"ຍົກເລີກ"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"ຍ້າຍໄປໃກ້ຂຶ້ນເພື່ອຫຼິ້ນຢູ່ <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"ກຳລັງຫຼິ້ນຢູ່ <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"ບໍ່ເຮັດວຽກ, ກະລຸນາກວດສອບແອັບ"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"ບໍ່ພົບ"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"ບໍ່ສາມາດໃຊ້ການຄວບຄຸມໄດ້"</string>
@@ -881,8 +888,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"ເລືອກຜູ້ໃຊ້"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"ແອັບທີ່ກຳລັງເອີ້ນໃຊ້ໃນພື້ນຫຼັງ"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"ຢຸດ"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"ສຳເນົາ"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"ສຳເນົາແລ້ວ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index f2918d5..8f966fd 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -273,6 +273,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Iki saulėtekio"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Iki <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"ALR"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"ALR išjungtas"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"ALR įjungtas"</string>
@@ -455,8 +459,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Atrakinti, kad būtų galima naudoti"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Gaunant korteles kilo problema, bandykite dar kartą vėliau"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Užrakinimo ekrano nustatymai"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR kodas"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Palieskite, kad nuskaitytumėte"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Darbo profilis"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Lėktuvo režimas"</string>
@@ -804,9 +807,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Leisti <xliff:g id="ARTIST_NAME">%2$s</xliff:g> – „<xliff:g id="SONG_NAME">%1$s</xliff:g>“ iš „<xliff:g id="APP_LABEL">%3$s</xliff:g>“"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Leisti „<xliff:g id="SONG_NAME">%1$s</xliff:g>“ iš „<xliff:g id="APP_LABEL">%2$s</xliff:g>“"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Anuliuoti"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Prieikite arčiau, kad galėtumėte leisti įrenginyje „<xliff:g id="DEVICENAME">%1$s</xliff:g>“"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Leidžiama įrenginyje „<xliff:g id="DEVICENAME">%1$s</xliff:g>“"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Neaktyvu, patikrinkite progr."</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Nerasta"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Valdiklis nepasiekiamas"</string>
@@ -893,8 +902,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Naudotojo pasirinkimas"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Fone veikiančios programos"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Sustabdyti"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopijuoti"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Nukopijuota"</string>
</resources>
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index 86a5df8..402113f 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -271,6 +271,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Līdz saullēktam"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Plkst. <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Līdz plkst. <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC ir atspējoti"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC ir iespējoti"</string>
@@ -452,10 +456,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Lai izmantotu, atbloķējiet ekrānu"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Ienesot jūsu kartes, radās problēma. Lūdzu, vēlāk mēģiniet vēlreiz."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Bloķēšanas ekrāna iestatījumi"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Ātrās atbildes kods"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Pieskarieties, lai skenētu"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Darba profils"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Lidojuma režīms"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Nākamais signāls (<xliff:g id="WHEN">%1$s</xliff:g>) netiks atskaņots."</string>
@@ -799,9 +801,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Atskaņojiet failu “<xliff:g id="SONG_NAME">%1$s</xliff:g>” (izpildītājs: <xliff:g id="ARTIST_NAME">%2$s</xliff:g>) no lietotnes <xliff:g id="APP_LABEL">%3$s</xliff:g>."</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Atskaņojiet failu “<xliff:g id="SONG_NAME">%1$s</xliff:g>” no lietotnes <xliff:g id="APP_LABEL">%2$s</xliff:g>."</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Atsaukt"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Pārvietojiet savu ierīci tuvāk, lai atskaņotu mūziku ierīcē “<xliff:g id="DEVICENAME">%1$s</xliff:g>”."</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Notiek atskaņošana ierīcē “<xliff:g id="DEVICENAME">%1$s</xliff:g>”"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Neaktīva, pārbaudiet lietotni"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Netika atrasta"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Vadīkla nav pieejama"</string>
@@ -888,8 +896,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Lietotāja atlase"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Lietotnes, kas darbojas fonā"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Apturēt"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopēt"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Nokopēts"</string>
</resources>
diff --git a/packages/SystemUI/res/values-mk/strings.xml b/packages/SystemUI/res/values-mk/strings.xml
index b21f183..296c3f7 100644
--- a/packages/SystemUI/res/values-mk/strings.xml
+++ b/packages/SystemUI/res/values-mk/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"До изгрејсонце"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Се вклучува во <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"До <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC е оневозможено"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC е овозможено"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Пуштете <xliff:g id="SONG_NAME">%1$s</xliff:g> од <xliff:g id="ARTIST_NAME">%2$s</xliff:g> на <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Пуштете <xliff:g id="SONG_NAME">%1$s</xliff:g> на <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Врати"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Приближете се за да пуштите на <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Се репродуцира на <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Неактивна, провери апликација"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Не е најдено"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Контролата не е достапна"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Изберете корисник"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Апликации се извршуваат во заднина"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Крај"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Копирај"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Копирано"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ml/strings.xml b/packages/SystemUI/res/values-ml/strings.xml
index 798ece0..9be8f92 100644
--- a/packages/SystemUI/res/values-ml/strings.xml
+++ b/packages/SystemUI/res/values-ml/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"സൂര്യോദയം വരെ"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g>-ന്"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> വരെ"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC പ്രവർത്തനരഹിതമാക്കി"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC പ്രവർത്തനക്ഷമമാക്കി"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="ARTIST_NAME">%2$s</xliff:g> എന്ന ആർട്ടിസ്റ്റിന്റെ <xliff:g id="SONG_NAME">%1$s</xliff:g> എന്ന ഗാനം <xliff:g id="APP_LABEL">%3$s</xliff:g> ആപ്പിൽ പ്ലേ ചെയ്യുക"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> എന്ന ഗാനം <xliff:g id="APP_LABEL">%2$s</xliff:g> ആപ്പിൽ പ്ലേ ചെയ്യുക"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"പഴയപടിയാക്കുക"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> എന്നതിൽ പ്ലേ ചെയ്യാൻ അടുത്തേക്ക് നീക്കുക"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> എന്നതിൽ പ്ലേ ചെയ്യുന്നു"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"നിഷ്ക്രിയം, ആപ്പ് പരിശോധിക്കൂ"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"കണ്ടെത്തിയില്ല"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"നിയന്ത്രണം ലഭ്യമല്ല"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"ഉപയോക്താവിനെ തിരഞ്ഞെടുക്കൂ"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"ആപ്പുകൾ പശ്ചാത്തലത്തിൽ റൺ ചെയ്യുന്നു"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"നിർത്തുക"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"പകർത്തുക"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"പകർത്തി"</string>
</resources>
diff --git a/packages/SystemUI/res/values-mn/strings.xml b/packages/SystemUI/res/values-mn/strings.xml
index d283916..c701e3b 100644
--- a/packages/SystemUI/res/values-mn/strings.xml
+++ b/packages/SystemUI/res/values-mn/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Нар мандах хүртэл"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g>-д"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> хүртэл"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC-г цуцалсан"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC-г идэвхжүүлсэн"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="ARTIST_NAME">%2$s</xliff:g>-н <xliff:g id="SONG_NAME">%1$s</xliff:g>-г <xliff:g id="APP_LABEL">%3$s</xliff:g> дээр тоглуулах"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g>-г <xliff:g id="APP_LABEL">%2$s</xliff:g> дээр тоглуулах"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Болих"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> дээр тоглуулахын тулд төхөөрөмжөө ойртуулна уу"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> дээр тоглуулж байна"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Идэвхгүй байна, аппыг шалгана уу"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Олдсонгүй"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Хяналт боломжгүй байна"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Хэрэглэгч сонгох"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Ард ажиллаж байгаа аппууд"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Зогсоох"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Хуулах"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Хууллаа"</string>
</resources>
diff --git a/packages/SystemUI/res/values-mr/strings.xml b/packages/SystemUI/res/values-mr/strings.xml
index 933a0e4..33b3817 100644
--- a/packages/SystemUI/res/values-mr/strings.xml
+++ b/packages/SystemUI/res/values-mr/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"सूर्योदयापर्यंत"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g> वाजता सुरू होते"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> पर्यंत"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC अक्षम केले आहे"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC सक्षम केले आहे"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="APP_LABEL">%3$s</xliff:g> मध्ये <xliff:g id="ARTIST_NAME">%2$s</xliff:g> चे <xliff:g id="SONG_NAME">%1$s</xliff:g> प्ले करा"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="APP_LABEL">%2$s</xliff:g> मध्ये <xliff:g id="SONG_NAME">%1$s</xliff:g> प्ले करा"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"पहिल्यासारखे करा"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> वर प्ले करण्यासाठी जवळ जा"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> वर प्ले केला जात आहे"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"निष्क्रिय, ॲप तपासा"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"आढळले नाही"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"नियंत्रण उपलब्ध नाही"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"वापरकर्ता निवडा"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"ॲप्स बॅकग्राउंडमध्ये रन होत आहेत"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"थांबवा"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"कॉपी करा"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"कॉपी केले"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ms/strings.xml b/packages/SystemUI/res/values-ms/strings.xml
index 4cf476b..75b3361 100644
--- a/packages/SystemUI/res/values-ms/strings.xml
+++ b/packages/SystemUI/res/values-ms/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Hingga matahari trbt"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Dihidupkan pada <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Hingga <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC dilumpuhkan"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC didayakan"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Buka kunci untuk menggunakan"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Terdapat masalah sewaktu mendapatkan kad anda. Sila cuba sebentar lagi"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Tetapan skrin kunci"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Kod QR"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Ketik untuk membuat imbasan"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Profil kerja"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Mod pesawat"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Mainkan <xliff:g id="SONG_NAME">%1$s</xliff:g> oleh <xliff:g id="ARTIST_NAME">%2$s</xliff:g> daripada <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Mainkan <xliff:g id="SONG_NAME">%1$s</xliff:g> daripada <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Buat asal"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Alihkan lebih dekat untuk bermain pada<xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Dimainkan pada <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Tidak aktif, semak apl"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Tidak ditemukan"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Kawalan tidak tersedia"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Pilih pengguna"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Apl berjalan di latar"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Berhenti"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Salin"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Disalin"</string>
</resources>
diff --git a/packages/SystemUI/res/values-my/strings.xml b/packages/SystemUI/res/values-my/strings.xml
index 8964ed5..e7217c0 100644
--- a/packages/SystemUI/res/values-my/strings.xml
+++ b/packages/SystemUI/res/values-my/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"နေထွက်ချိန် အထိ"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g> တွင် ဖွင့်မည်"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> အထိ"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC ကို ပိတ်ထားသည်"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC ကို ဖွင့်ထားသည်"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"သုံးရန် လော့ခ်ဖွင့်ပါ"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"သင်၏ကတ်များ ရယူရာတွင် ပြဿနာရှိနေသည်၊ နောက်မှ ထပ်စမ်းကြည့်ပါ"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"လော့ခ်မျက်နှာပြင် ဆက်တင်များ"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR ကုဒ်"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"စကင်ဖတ်ရန် တို့နိုင်သည်"</string>
<string name="status_bar_work" msgid="5238641949837091056">"အလုပ် ပရိုဖိုင်"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"လေယာဉ်ပျံမုဒ်"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"<xliff:g id="WHEN">%1$s</xliff:g> ၌သင့်နောက်ထပ် နှိုးစက်ကို ကြားမည်မဟုတ်ပါ"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="ARTIST_NAME">%2$s</xliff:g> ၏ <xliff:g id="SONG_NAME">%1$s</xliff:g> ကို <xliff:g id="APP_LABEL">%3$s</xliff:g> တွင် ဖွင့်ပါ"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> ကို <xliff:g id="APP_LABEL">%2$s</xliff:g> တွင် ဖွင့်ပါ"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"နောက်ပြန်ရန်"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> တွင်ဖွင့်ရန် အနီးသို့ရွှေ့ပါ"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> တွင်ဖွင့်ထားသည်"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"ရပ်နေသည်၊ အက်ပ်ကို စစ်ဆေးပါ"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"မတွေ့ပါ"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"ထိန်းချုပ်မှု မရနိုင်ပါ"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"အသုံးပြုသူ ရွေးခြင်း"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"နောက်ခံတွင် ဖွင့်ထားသောအက်ပ်များ"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"ရပ်ရန်"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"မိတ္တူကူးရန်"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"ကူးပြီးပါပြီ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index 6e66156..f7299de 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Til soloppgang"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Slås på klokken <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Til <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC er slått av"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC er slått på"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Lås opp for å bruke"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Det oppsto et problem med henting av kortene. Prøv igjen senere"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Innstillinger for låseskjermen"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR-kode"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Trykk for å skanne"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Work-profil"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Flymodus"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Du hører ikke neste innstilte alarm <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Spill av <xliff:g id="SONG_NAME">%1$s</xliff:g> av <xliff:g id="ARTIST_NAME">%2$s</xliff:g> fra <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Spill av <xliff:g id="SONG_NAME">%1$s</xliff:g> fra <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Angre"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Flytt nærmere for å spille av på <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Spilles av på <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inaktiv. Sjekk appen"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Ikke funnet"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Kontrollen er utilgjengelig"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Velg bruker"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Apper som kjører i bakgrunnen"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Stopp"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopiér"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Kopiert"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ne/strings.xml b/packages/SystemUI/res/values-ne/strings.xml
index db64a7e..adacc98 100644
--- a/packages/SystemUI/res/values-ne/strings.xml
+++ b/packages/SystemUI/res/values-ne/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"सूर्योदयसम्म"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g> मा सक्रिय"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> सम्म"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC लाई असक्षम पारिएको छ"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC लाई सक्षम पारिएको छ"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="ARTIST_NAME">%2$s</xliff:g> को <xliff:g id="SONG_NAME">%1$s</xliff:g> बोलको गीत <xliff:g id="APP_LABEL">%3$s</xliff:g> मा बजाउनुहोस्"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> बोलको गीत <xliff:g id="APP_LABEL">%2$s</xliff:g> मा बजाउनुहोस्"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"अन्डू गर्नुहोस्"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> मा प्ले गर्न आफ्नो डिभाइस नजिकै लैजानुहोस्"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> मा प्ले गरिँदै छ"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"निष्क्रिय छ, एप जाँच गर्नु…"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"फेला परेन"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"नियन्त्रण उपलब्ध छैन"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"प्रयोगकर्ता चयन गर्नु…"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"अहिले ब्याकग्राउन्डमा चलिरहेका एप"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"रोक्नुहोस्"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"कपी गर्नुहोस्"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"कपी गरियो"</string>
</resources>
diff --git a/packages/SystemUI/res/values-nl/strings.xml b/packages/SystemUI/res/values-nl/strings.xml
index b895d9e..fbad27a 100644
--- a/packages/SystemUI/res/values-nl/strings.xml
+++ b/packages/SystemUI/res/values-nl/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Tot zonsopgang"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Aan om <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Tot <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC staat uit"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC staat aan"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Ontgrendelen om te gebruiken"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Er is een probleem opgetreden bij het ophalen van je kaarten. Probeer het later opnieuw."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Instellingen voor vergrendelscherm"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR-code"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Tik om te scannen"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Werkprofiel"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Vliegtuigmodus"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="SONG_NAME">%1$s</xliff:g> van <xliff:g id="ARTIST_NAME">%2$s</xliff:g> afspelen via <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> afspelen via <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Ongedaan maken"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Ga dichter naar <xliff:g id="DEVICENAME">%1$s</xliff:g> toe om af te spelen"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Afspelen op <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inactief, check de app"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Niet gevonden"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Beheeroptie niet beschikbaar"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Gebruiker selecteren"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Apps die op de achtergrond worden uitgevoerd"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Stoppen"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopiëren"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Gekopieerd"</string>
</resources>
diff --git a/packages/SystemUI/res/values-or/strings.xml b/packages/SystemUI/res/values-or/strings.xml
index e47513c..406d90a 100644
--- a/packages/SystemUI/res/values-or/strings.xml
+++ b/packages/SystemUI/res/values-or/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"ସକାଳ ପର୍ଯ୍ୟନ୍ତ"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g>ରେ ଚାଲୁ ହେବ"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> ପର୍ଯ୍ୟନ୍ତ"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC ଅକ୍ଷମ କରାଯାଇଛି"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC ସକ୍ଷମ କରାଯାଇଛି"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"ବ୍ୟବହାର କରିବାକୁ ଅନଲକ୍ କରନ୍ତୁ"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"ଆପଣଙ୍କ କାର୍ଡଗୁଡ଼ିକ ପାଇବାରେ ଏକ ସମସ୍ୟା ହୋଇଥିଲା। ଦୟାକରି ପରେ ପୁଣି ଚେଷ୍ଟା କରନ୍ତୁ"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"ସ୍କ୍ରିନ୍ ଲକ୍ ସେଟିଂସ୍"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR କୋଡ"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"ସ୍କାନ କରିବାକୁ ଟାପ କରନ୍ତୁ"</string>
<string name="status_bar_work" msgid="5238641949837091056">"ୱର୍କ ପ୍ରୋଫାଇଲ୍"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"ଏରୋପ୍ଲେନ୍ ମୋଡ୍"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="APP_LABEL">%3$s</xliff:g>ରୁ <xliff:g id="ARTIST_NAME">%2$s</xliff:g>ଙ୍କ <xliff:g id="SONG_NAME">%1$s</xliff:g> ଚଲାନ୍ତୁ"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="APP_LABEL">%2$s</xliff:g>ରୁ <xliff:g id="SONG_NAME">%1$s</xliff:g> ଚଲାନ୍ତୁ"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"ପୂର୍ବବତ୍ କରନ୍ତୁ"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g>ରେ ଚଲାଇବା ପାଇଁ ପାଖକୁ ମୁଭ କରନ୍ତୁ"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g>ରେ ଚାଲୁଛି"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"ନିଷ୍କ୍ରିୟ ଅଛି, ଆପ ଯାଞ୍ଚ କରନ୍ତୁ"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"ମିଳିଲା ନାହିଁ"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"ନିୟନ୍ତ୍ରଣ ଉପଲବ୍ଧ ନାହିଁ"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"ଉପଯୋଗକର୍ତ୍ତା ଚୟନ କର"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"ପୃଷ୍ଠପଟରେ ଚାଲୁଥିବା ଆପଗୁଡ଼ିକ"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"ବନ୍ଦ କରନ୍ତୁ"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"କପି କରନ୍ତୁ"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"କପି କରାଯାଇଛି"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pa/strings.xml b/packages/SystemUI/res/values-pa/strings.xml
index 3eae70a..0d84f52 100644
--- a/packages/SystemUI/res/values-pa/strings.xml
+++ b/packages/SystemUI/res/values-pa/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"ਸੂਰਜ ਚੜ੍ਹਨ ਤੱਕ"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g> ਵਜੇ ਚਾਲੂ"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> ਵਜੇ ਤੱਕ"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC ਨੂੰ ਅਯੋਗ ਬਣਾਇਆ ਗਿਆ ਹੈ"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC ਨੂੰ ਯੋਗ ਬਣਾਇਆ ਗਿਆ ਹੈ"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"ਵਰਤਣ ਲਈ ਅਣਲਾਕ ਕਰੋ"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"ਤੁਹਾਡੇ ਕਾਰਡ ਪ੍ਰਾਪਤ ਕਰਨ ਵਿੱਚ ਕੋਈ ਸਮੱਸਿਆ ਆਈ, ਕਿਰਪਾ ਕਰਕੇ ਬਾਅਦ ਵਿੱਚ ਦੁਬਾਰਾ ਕੋਸ਼ਿਸ਼ ਕਰੋ"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"ਲਾਕ ਸਕ੍ਰੀਨ ਸੈਟਿੰਗਾਂ"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR ਕੋਡ"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"ਸਕੈਨ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ"</string>
<string name="status_bar_work" msgid="5238641949837091056">"ਕਾਰਜ ਪ੍ਰੋਫਾਈਲ"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"ਹਵਾਈ-ਜਹਾਜ਼ ਮੋਡ"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="APP_LABEL">%3$s</xliff:g> ਤੋਂ <xliff:g id="ARTIST_NAME">%2$s</xliff:g> ਦਾ <xliff:g id="SONG_NAME">%1$s</xliff:g> ਚਲਾਓ"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="APP_LABEL">%2$s</xliff:g> ਤੋਂ <xliff:g id="SONG_NAME">%1$s</xliff:g> ਚਲਾਓ"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"ਅਣਕੀਤਾ ਕਰੋ"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> \'ਤੇ ਚਲਾਉਣ ਲਈ ਨੇੜੇ ਲਿਜਾਓ"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> \'ਤੇ ਚਲਾਇਆ ਜਾ ਰਿਹਾ ਹੈ"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"ਅਕਿਰਿਆਸ਼ੀਲ, ਐਪ ਦੀ ਜਾਂਚ ਕਰੋ"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"ਨਹੀਂ ਮਿਲਿਆ"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"ਕੰਟਰੋਲ ਉਪਲਬਧ ਨਹੀਂ ਹੈ"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"ਵਰਤੋਂਕਾਰ ਚੁਣੋ"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"ਬੈਕਗ੍ਰਾਊਂਡ ਵਿੱਚ ਚੱਲ ਰਹੀਆਂ ਐਪਾਂ"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"ਬੰਦ ਕਰੋ"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"ਕਾਪੀ ਕਰੋ"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"ਕਾਪੀ ਕੀਤੀ ਗਈ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index 41ad75a..2ab75d0 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -273,6 +273,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Do wschodu słońca"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Włącz o <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Do <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"Komunikacja NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"Komunikacja NFC jest wyłączona"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"Komunikacja NFC jest włączona"</string>
@@ -455,10 +459,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Odblokuj, aby użyć"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Podczas pobierania kart wystąpił problem. Spróbuj ponownie później."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Ustawienia ekranu blokady"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Kod QR"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Kliknij, aby zeskanować"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Profil służbowy"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Tryb samolotowy"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Nie usłyszysz swojego następnego alarmu <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -805,9 +807,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Odtwórz utwór <xliff:g id="SONG_NAME">%1$s</xliff:g> (<xliff:g id="ARTIST_NAME">%2$s</xliff:g>) w aplikacji <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Odtwórz utwór <xliff:g id="SONG_NAME">%1$s</xliff:g> w aplikacji <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Cofnij"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Przysuń się bliżej, aby odtwarzać na urządzeniu <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Odtwarzam na urządzeniu <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Nieaktywny, sprawdź aplikację"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Nie znaleziono"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Element jest niedostępny"</string>
@@ -894,8 +902,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Wybierz użytkownika"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Aplikacje działające w tle"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Zatrzymaj"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopiuj"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Skopiowano"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pt-rBR/strings.xml b/packages/SystemUI/res/values-pt-rBR/strings.xml
index d21ea54..16b5a09 100644
--- a/packages/SystemUI/res/values-pt-rBR/strings.xml
+++ b/packages/SystemUI/res/values-pt-rBR/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Até o nascer do sol"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Ativar: <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Até: <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"A NFC está desativada"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"A NFC está ativada"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Desbloquear para usar"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Ocorreu um problema ao carregar os cards. Tente novamente mais tarde"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Configurações de tela de bloqueio"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Código QR"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Toque para fazer a leitura"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Perfil de trabalho"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Modo avião"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Tocar <xliff:g id="SONG_NAME">%1$s</xliff:g> de <xliff:g id="ARTIST_NAME">%2$s</xliff:g> no app <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Tocar <xliff:g id="SONG_NAME">%1$s</xliff:g> no app <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Desfazer"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Aproxime os dispositivos para tocar a mídia neste: <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Reproduzido em <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inativo, verifique o app"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Não encontrado"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"O controle está indisponível"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Selecionar usuário"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Apps em execução em segundo plano"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Parar"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copiar"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Copiado"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings.xml b/packages/SystemUI/res/values-pt-rPT/strings.xml
index 556e92a..672379b 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Até ao amanhecer"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Ativado à(s) <xliff:g id="TIME">%s</xliff:g>."</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Até à(s) <xliff:g id="TIME">%s</xliff:g>."</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"O NFC está desativado"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"O NFC está ativado"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Reproduzir <xliff:g id="SONG_NAME">%1$s</xliff:g> de <xliff:g id="ARTIST_NAME">%2$s</xliff:g> a partir da app <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Reproduzir <xliff:g id="SONG_NAME">%1$s</xliff:g> a partir da app <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Anular"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Aproxime-se para reproduzir no dispositivo <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"A reproduzir no dispositivo <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inativa. Consulte a app."</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Não encontrado."</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"O controlo está indisponível"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Selecione utilizador"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Apps em execução em segundo plano"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Parar"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copiar"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Copiado"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml
index d21ea54..16b5a09 100644
--- a/packages/SystemUI/res/values-pt/strings.xml
+++ b/packages/SystemUI/res/values-pt/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Até o nascer do sol"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Ativar: <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Até: <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"A NFC está desativada"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"A NFC está ativada"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Desbloquear para usar"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Ocorreu um problema ao carregar os cards. Tente novamente mais tarde"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Configurações de tela de bloqueio"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Código QR"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Toque para fazer a leitura"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Perfil de trabalho"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Modo avião"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Tocar <xliff:g id="SONG_NAME">%1$s</xliff:g> de <xliff:g id="ARTIST_NAME">%2$s</xliff:g> no app <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Tocar <xliff:g id="SONG_NAME">%1$s</xliff:g> no app <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Desfazer"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Aproxime os dispositivos para tocar a mídia neste: <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Reproduzido em <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inativo, verifique o app"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Não encontrado"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"O controle está indisponível"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Selecionar usuário"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Apps em execução em segundo plano"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Parar"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copiar"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Copiado"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ro/strings.xml b/packages/SystemUI/res/values-ro/strings.xml
index ab3c186..4d13c03 100644
--- a/packages/SystemUI/res/values-ro/strings.xml
+++ b/packages/SystemUI/res/values-ro/strings.xml
@@ -271,6 +271,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Până la răsărit"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Activată la <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Până la <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"Serviciul NFC este dezactivat"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"Serviciul NFC este activat"</string>
@@ -452,8 +456,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Deblocați pentru a folosi"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"A apărut o problemă la preluarea cardurilor. Încercați din nou mai târziu"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Setările ecranului de blocare"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Cod QR"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Atingeți pentru a scana"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Profil de serviciu"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Mod Avion"</string>
@@ -798,9 +801,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Redați <xliff:g id="SONG_NAME">%1$s</xliff:g> de la <xliff:g id="ARTIST_NAME">%2$s</xliff:g> în <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Redați <xliff:g id="SONG_NAME">%1$s</xliff:g> în <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Anulați"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Apropiați-vă pentru a reda pe <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Se redă pe <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inactiv, verificați aplicația"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Nu s-a găsit"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Comanda este indisponibilă"</string>
@@ -887,8 +896,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Alegeți utilizatorul"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Aplicațiile rulează în fundal"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Opriți"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Copiați"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"S-a copiat"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index e92364c..a3e7294 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -273,6 +273,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"До рассвета"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Включить в <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"До <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"Модуль NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"Модуль NFC отключен"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"Модуль NFC включен"</string>
@@ -803,9 +807,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Воспроизвести медиафайл \"<xliff:g id="SONG_NAME">%1$s</xliff:g>\" (исполнитель: <xliff:g id="ARTIST_NAME">%2$s</xliff:g>) из приложения \"<xliff:g id="APP_LABEL">%3$s</xliff:g>\""</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Воспроизвести медиафайл \"<xliff:g id="SONG_NAME">%1$s</xliff:g>\" из приложения \"<xliff:g id="APP_LABEL">%2$s</xliff:g>\""</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Отменить"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Чтобы начать трансляцию на устройстве \"<xliff:g id="DEVICENAME">%1$s</xliff:g>\", подойдите к нему ближе."</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Воспроизводится на устройстве \"<xliff:g id="DEVICENAME">%1$s</xliff:g>\"."</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Нет ответа. Проверьте приложение."</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Не найдено."</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Управление недоступно"</string>
@@ -892,8 +902,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Выберите профиль"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Приложения, работающие в фоновом режиме"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Остановить"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Копировать"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Скопировано."</string>
</resources>
diff --git a/packages/SystemUI/res/values-si/strings.xml b/packages/SystemUI/res/values-si/strings.xml
index 327025c..2cd4865 100644
--- a/packages/SystemUI/res/values-si/strings.xml
+++ b/packages/SystemUI/res/values-si/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"හිරු නගින තෙක්"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g>ට ක්රියාත්මකයි"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> තෙක්"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC අබලයි"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC සබලයි"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"භාවිත කිරීමට අගුලු හරින්න"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"ඔබගේ කාඩ්පත ලබා ගැනීමේ ගැටලුවක් විය, කරුණාකර පසුව නැවත උත්සාහ කරන්න"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"අගුලු තිර සැකසීම්"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR කේතය"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"ස්කෑන් කිරීමට තට්ටු කරන්න"</string>
<string name="status_bar_work" msgid="5238641949837091056">"කාර්යාල පැතිකඩ"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"ගුවන්යානා ප්රකාරය"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"ඔබට ඔබේ ඊළඟ එලාමය <xliff:g id="WHEN">%1$s</xliff:g> නොඇසෙනු ඇත"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="ARTIST_NAME">%2$s</xliff:g>ගේ <xliff:g id="SONG_NAME">%1$s</xliff:g> <xliff:g id="APP_LABEL">%3$s</xliff:g> වෙතින් වාදනය කරන්න"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> <xliff:g id="APP_LABEL">%2$s</xliff:g> වෙතින් වාදනය කරන්න"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"පසුගමනය කරන්න"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> හි වාදනය කිරීමට වඩාත් ළං වන්න"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> හි වාදනය කරමින්"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"අක්රියයි, යෙදුම පරීක්ෂා කරන්න"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"හමු නොවිණි"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"පාලනය ලබා ගත නොහැකිය"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"පරිශීලක තෝරන්න"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"පසුබිමින් ධාවනය වෙමින් පවතින යෙදුම්"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"නවත්වන්න"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"පිටපත් කරන්න"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"පිටපත් කරන ලදි"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index bb8870f..8795548 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -273,6 +273,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Do východu slnka"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Zapne sa o <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Do <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC je deaktivované"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC je aktivované"</string>
@@ -456,8 +460,7 @@
<string name="wallet_error_generic" msgid="257704570182963611">"Pri načítavaní kariet sa vyskytol problém. Skúste to neskôr."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Nastavenia uzamknutej obrazovky"</string>
<string name="qr_code_scanner_title" msgid="5660820608548306581">"QR kód"</string>
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Ak chcete skenovať, klepnite"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Pracovný profil"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Režim v lietadle"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Váš budík o <xliff:g id="WHEN">%1$s</xliff:g> sa nespustí"</string>
@@ -804,9 +807,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Prehrať skladbu <xliff:g id="SONG_NAME">%1$s</xliff:g> od interpreta <xliff:g id="ARTIST_NAME">%2$s</xliff:g> z aplikácie <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Prehrať skladbu <xliff:g id="SONG_NAME">%1$s</xliff:g> z aplikácie <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Späť"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Ak chcete prehrávať v zariadení <xliff:g id="DEVICENAME">%1$s</xliff:g>, priblížte sa"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Prehráva sa v zariadení <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Neaktívne, preverte aplikáciu"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Nenájdené"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Ovládač nie je k dispozícii"</string>
@@ -893,8 +902,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Vyberte používateľa"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Aplikácie spustené na pozadí"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Ukončiť"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopírovať"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Skopírované"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sl/strings.xml b/packages/SystemUI/res/values-sl/strings.xml
index 9c2c32c..2efc74c 100644
--- a/packages/SystemUI/res/values-sl/strings.xml
+++ b/packages/SystemUI/res/values-sl/strings.xml
@@ -273,6 +273,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Do sončnega vzhoda"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Vklop ob <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Do <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"Tehnologija NFC je onemogočena"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"Tehnologija NFC je omogočena"</string>
@@ -455,8 +459,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Odklenite za uporabo"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Pri pridobivanju kartic je prišlo do težave. Poskusite znova pozneje."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Nastavitve zaklepanja zaslona"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Koda QR"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Dotaknite se za optično branje"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Profil za Android Work"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Način za letalo"</string>
@@ -804,9 +807,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Predvajaj skladbo <xliff:g id="SONG_NAME">%1$s</xliff:g> izvajalca <xliff:g id="ARTIST_NAME">%2$s</xliff:g> iz aplikacije <xliff:g id="APP_LABEL">%3$s</xliff:g>."</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Predvajaj skladbo <xliff:g id="SONG_NAME">%1$s</xliff:g> iz aplikacije <xliff:g id="APP_LABEL">%2$s</xliff:g>."</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Razveljavi"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Za predvajanje v napravi <xliff:g id="DEVICENAME">%1$s</xliff:g> bolj približajte telefon."</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Predvajanje v napravi <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Neaktivno, poglejte aplikacijo"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Ni mogoče najti"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Kontrolnik ni na voljo"</string>
@@ -893,8 +902,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Izberite uporabnika"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Aplikacije z izvajanjem v ozadju"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Ustavi"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopiraj"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Kopirano"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sq/strings.xml b/packages/SystemUI/res/values-sq/strings.xml
index 993ab0ce..70b4dec 100644
--- a/packages/SystemUI/res/values-sq/strings.xml
+++ b/packages/SystemUI/res/values-sq/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Deri në lindje të diellit"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Aktiv në <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Deri në <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC është çaktivizuar"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC është aktivizuar"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Shkyçe për ta përdorur"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Pati një problem me marrjen e kartave të tua. Provo përsëri më vonë"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Cilësimet e ekranit të kyçjes"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Kodi QR"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Trokit për të skanuar"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Profili i punës"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Modaliteti i aeroplanit"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Nuk do ta dëgjosh alarmin e radhës në <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Luaj <xliff:g id="SONG_NAME">%1$s</xliff:g> nga <xliff:g id="ARTIST_NAME">%2$s</xliff:g> nga <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Luaj <xliff:g id="SONG_NAME">%1$s</xliff:g> nga <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Zhbëj"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Afrohu për të luajtur në <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Po luhet në <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Joaktive, kontrollo aplikacionin"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Nuk u gjet"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Kontrolli është i padisponueshëm"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Zgjidh përdoruesin"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Aplikacionet që ekzekutohen në sfond"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Ndalo"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopjo"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"U kopjua"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sr/strings.xml b/packages/SystemUI/res/values-sr/strings.xml
index f637f2c..219fb70 100644
--- a/packages/SystemUI/res/values-sr/strings.xml
+++ b/packages/SystemUI/res/values-sr/strings.xml
@@ -271,6 +271,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"До изласка сунца"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Укључује се у <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"До <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC је онемогућен"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC је омогућен"</string>
@@ -797,9 +801,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Пустите <xliff:g id="SONG_NAME">%1$s</xliff:g> извођача <xliff:g id="ARTIST_NAME">%2$s</xliff:g> из апликације <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Пустите <xliff:g id="SONG_NAME">%1$s</xliff:g> из апликације <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Опозови"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Приближите да бисте пуштали музику на: <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Пушта се на: <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Неактивно. Видите апликацију"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Није пронађено"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Контрола није доступна"</string>
@@ -886,8 +896,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Изаберите корисника"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Апликације покренуте у позадини"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Заустави"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Копирај"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Копирано је"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index 04cdcbe..a074e1f 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Till soluppgången"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Aktivera kl. <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Till <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC är inaktiverat"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC är aktiverat"</string>
@@ -450,8 +454,7 @@
<string name="wallet_error_generic" msgid="257704570182963611">"Det gick inte att hämta dina kort. Försök igen senare."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Inställningar för låsskärm"</string>
<string name="qr_code_scanner_title" msgid="5660820608548306581">"QR-kod"</string>
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Tryck för att skanna"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Jobbprofil"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Flygplansläge"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Nästa alarm, kl. <xliff:g id="WHEN">%1$s</xliff:g>, kommer inte att höras"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Spela upp <xliff:g id="SONG_NAME">%1$s</xliff:g> med <xliff:g id="ARTIST_NAME">%2$s</xliff:g> från <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Spela upp <xliff:g id="SONG_NAME">%1$s</xliff:g> från <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Ångra"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Flytta närmare för att spela upp på <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Spelas upp på <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Inaktiv, kolla appen"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Hittades inte"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Styrning är inte tillgänglig"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Välj användare"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Appar som körs i bakgrunden"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Stoppa"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopiera"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Kopierades"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sw/strings.xml b/packages/SystemUI/res/values-sw/strings.xml
index 26184849..f243c19 100644
--- a/packages/SystemUI/res/values-sw/strings.xml
+++ b/packages/SystemUI/res/values-sw/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Hadi macheo"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Itawashwa saa <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Hadi saa <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC imezimwa"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC imewashwa"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Fungua ili utumie"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Hitilafu imetokea wakati wa kuleta kadi zako, tafadhali jaribu tena baadaye"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Mipangilio ya kufunga skrini"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Msimbo wa QR"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Gusa ili uchanganue"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Wasifu wa kazini"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Hali ya ndegeni"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Hutasikia kengele yako inayofuata ya saa <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Cheza <xliff:g id="SONG_NAME">%1$s</xliff:g> ulioimbwa na <xliff:g id="ARTIST_NAME">%2$s</xliff:g> katika <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Cheza <xliff:g id="SONG_NAME">%1$s</xliff:g> katika <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Tendua"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Sogea karibu ili ucheze kwenye <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Inacheza kwenye <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Haitumiki, angalia programu"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Hakipatikani"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Kidhibiti hakipatikani"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Chagua mtumiaji"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Programu zinazotumika chinichini"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Simamisha"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Nakili"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Imenakiliwa"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sw600dp-land/dimens.xml b/packages/SystemUI/res/values-sw600dp-land/dimens.xml
index 3cfe056..89d046b 100644
--- a/packages/SystemUI/res/values-sw600dp-land/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp-land/dimens.xml
@@ -25,4 +25,8 @@
<!-- margin from keyguard status bar to clock. For split shade it should be
keyguard_split_shade_top_margin - status_bar_header_height_keyguard = 8dp -->
<dimen name="keyguard_clock_top_margin">8dp</dimen>
+
+ <!-- Limit the TaskView to this percentage of the overall screen width (0.0 - 1.0) -->
+ <item name="controls_task_view_width_percentage" translatable="false" format="float" type="dimen">0.45</item>
+ <dimen name="controls_task_view_right_margin">8dp</dimen>
</resources>
diff --git a/packages/SystemUI/res/values-ta/strings.xml b/packages/SystemUI/res/values-ta/strings.xml
index e45f072..0b57005 100644
--- a/packages/SystemUI/res/values-ta/strings.xml
+++ b/packages/SystemUI/res/values-ta/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"காலை வரை"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g>க்கு ஆன் செய்"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> வரை"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC முடக்கப்பட்டது"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC இயக்கப்பட்டது"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="ARTIST_NAME">%2$s</xliff:g> இன் <xliff:g id="SONG_NAME">%1$s</xliff:g> பாடலை <xliff:g id="APP_LABEL">%3$s</xliff:g> ஆப்ஸில் பிளேசெய்"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="SONG_NAME">%1$s</xliff:g> பாடலை <xliff:g id="APP_LABEL">%2$s</xliff:g> ஆப்ஸில் பிளேசெய்"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"செயல்தவிர்"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> சாதனத்தில் இயக்க உங்கள் சாதனத்தை அருகில் எடுத்துச் செல்லுங்கள்"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> சாதனத்தில் பிளே ஆகிறது"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"செயலில் இல்லை , சரிபார்க்கவும்"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"இல்லை"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"கட்டுப்பாடு இல்லை"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"பயனரைத் தேர்வுசெய்க"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"பின்னணியில் இயங்கும் ஆப்ஸ்"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"நிறுத்து"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"நகலெடு"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"நகலெடுக்கப்பட்டது"</string>
</resources>
diff --git a/packages/SystemUI/res/values-te/strings.xml b/packages/SystemUI/res/values-te/strings.xml
index 4e41023..d479c0d 100644
--- a/packages/SystemUI/res/values-te/strings.xml
+++ b/packages/SystemUI/res/values-te/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"సూర్యోదయం వరకు"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g> కు ఆన్ అవుతుంది"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> వరకు"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC నిలిపివేయబడింది"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC ప్రారంభించబడింది"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="APP_LABEL">%3$s</xliff:g> నుండి <xliff:g id="ARTIST_NAME">%2$s</xliff:g> పాడిన <xliff:g id="SONG_NAME">%1$s</xliff:g>ను ప్లే చేయండి"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="APP_LABEL">%2$s</xliff:g> నుండి <xliff:g id="SONG_NAME">%1$s</xliff:g>ను ప్లే చేయండి"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"చర్య రద్దు"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g>లో ప్లే చేయడానికి దగ్గరగా వెళ్లండి"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g>లో ప్లే అవుతోంది"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"ఇన్యాక్టివ్, యాప్ చెక్ చేయండి"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"కనుగొనబడలేదు"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"కంట్రోల్ అందుబాటులో లేదు"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"యూజర్ను ఎంచుకోండి"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"యాప్లు బ్యాక్గ్రౌండ్లో రన్ అవుతున్నాయి"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"ఆపివేయండి"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"కాపీ చేయండి"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"కాపీ అయింది"</string>
</resources>
diff --git a/packages/SystemUI/res/values-th/strings.xml b/packages/SystemUI/res/values-th/strings.xml
index 8897186..03d2566 100644
--- a/packages/SystemUI/res/values-th/strings.xml
+++ b/packages/SystemUI/res/values-th/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"จนพระอาทิตย์ขึ้น"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"เปิดเวลา <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"จนถึง <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC ถูกปิดใช้งาน"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"เปิดใช้งาน NFC แล้ว"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"เปิดเพลง <xliff:g id="SONG_NAME">%1$s</xliff:g> ของ <xliff:g id="ARTIST_NAME">%2$s</xliff:g> จาก <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"เปิดเพลง <xliff:g id="SONG_NAME">%1$s</xliff:g> จาก <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"เลิกทำ"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"ขยับเข้ามาใกล้ขึ้นเพื่อเล่นใน <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"กำลังเล่นใน <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"ไม่มีการใช้งาน โปรดตรวจสอบแอป"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"ไม่พบ"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"ใช้การควบคุมไม่ได้"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"เลือกผู้ใช้"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"แอปที่ทำงานอยู่เบื้องหลัง"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"หยุด"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"คัดลอก"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"คัดลอกแล้ว"</string>
</resources>
diff --git a/packages/SystemUI/res/values-tl/strings.xml b/packages/SystemUI/res/values-tl/strings.xml
index 6ab6ef6..c33d211 100644
--- a/packages/SystemUI/res/values-tl/strings.xml
+++ b/packages/SystemUI/res/values-tl/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Hanggang sunrise"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Ma-o-on nang <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Hanggang <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"Naka-disable ang NFC"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"Naka-enable ang NFC"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"I-unlock para magamit"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Nagkaproblema sa pagkuha ng iyong mga card, pakisubukan ulit sa ibang pagkakataon"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Mga setting ng lock screen"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR code"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"I-tap para i-scan"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Profile sa trabaho"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Airplane mode"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Hindi mo maririnig ang iyong susunod na alarm ng <xliff:g id="WHEN">%1$s</xliff:g>"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"I-play ang <xliff:g id="SONG_NAME">%1$s</xliff:g> ni/ng <xliff:g id="ARTIST_NAME">%2$s</xliff:g> mula sa <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"I-play ang <xliff:g id="SONG_NAME">%1$s</xliff:g> mula sa <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"I-undo"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Lumapit pa para mag-play sa <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Nagpe-play sa <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Hindi aktibo, tingnan ang app"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Hindi nahanap"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Hindi available ang kontrol"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Pumili ng user"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Mga app na tumatakbo sa background"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Ihinto"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopyahin"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Nakopya"</string>
</resources>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index ee44b76..ecef9ee 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Sabaha kadar"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Açılacağı saat: <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Şu saate kadar: <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC devre dışı"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC etkin"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Kullanmak için kilidi aç"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Kartlarınız alınırken bir sorun oluştu. Lütfen daha sonra tekrar deneyin"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Kilit ekranı ayarları"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR kodu"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Taramak için dokunun"</string>
<string name="status_bar_work" msgid="5238641949837091056">"İş profili"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Uçak modu"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"<xliff:g id="WHEN">%1$s</xliff:g> olarak ayarlanmış bir sonraki alarmınızı duymayacaksınız"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="APP_LABEL">%3$s</xliff:g> uygulamasından <xliff:g id="ARTIST_NAME">%2$s</xliff:g>, <xliff:g id="SONG_NAME">%1$s</xliff:g> şarkısını çal"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="APP_LABEL">%2$s</xliff:g> uygulamasından <xliff:g id="SONG_NAME">%1$s</xliff:g> şarkısını çal"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Geri al"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> cihazında çalmak için yaklaşın"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> cihazında çalınıyor"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Devre dışı, uygulamaya bakın"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Bulunamadı"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Kontrol kullanılamıyor"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Kullanıcı seçin"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Arka planda çalışan uygulamalar"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Durdur"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopyala"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Kopyalandı"</string>
</resources>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index 27aad2e..4aba37b 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -273,6 +273,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"До сходу сонця"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Вмикається о <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"До <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC вимкнено"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC ввімкнено"</string>
@@ -455,10 +459,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Розблокувати, щоб використовувати"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Не вдалось отримати ваші картки. Повторіть спробу пізніше."</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Параметри блокування екрана"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR-код"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Натисніть, щоб сканувати"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Робочий профіль"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Режим польоту"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Наступний сигнал о <xliff:g id="WHEN">%1$s</xliff:g> не пролунає"</string>
@@ -805,9 +807,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Увімкнути пісню \"<xliff:g id="SONG_NAME">%1$s</xliff:g>\", яку виконує <xliff:g id="ARTIST_NAME">%2$s</xliff:g>, у додатку <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Увімкнути пісню \"<xliff:g id="SONG_NAME">%1$s</xliff:g>\" у додатку <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Відмінити"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Щоб відтворити контент на пристрої <xliff:g id="DEVICENAME">%1$s</xliff:g>, наблизьтеся до нього"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Відтворюється на пристрої <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Неактивно, перейдіть у додаток"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Не знайдено"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Елемент керування недоступний"</string>
@@ -894,8 +902,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Виберіть користувача"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Додатки, що працюють у фоновому режимі"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Зупинити"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Копіювати"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Скопійовано"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ur/strings.xml b/packages/SystemUI/res/values-ur/strings.xml
index 015d520..31c0c48 100644
--- a/packages/SystemUI/res/values-ur/strings.xml
+++ b/packages/SystemUI/res/values-ur/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"طلوع آفتاب تک"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"آن ہوگی بوقت <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> تک"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC غیر فعال ہے"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC فعال ہے"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="APP_LABEL">%3$s</xliff:g> سے <xliff:g id="ARTIST_NAME">%2$s</xliff:g> کا <xliff:g id="SONG_NAME">%1$s</xliff:g> چلائیں"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="APP_LABEL">%2$s</xliff:g> سے <xliff:g id="SONG_NAME">%1$s</xliff:g> چلائیں"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"کالعدم کریں"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g> پر چلانے کے لیے قریب کریں"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> پر چل رہا ہے"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"غیر فعال، ایپ چیک کریں"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"نہیں ملا"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"کنٹرول دستیاب نہیں ہے"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"صارف منتخب کریں"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"ایپس پس منظر میں چل رہی ہیں"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"روکیں"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"کاپی کریں"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"کاپی کر دیا گیا ہے"</string>
</resources>
diff --git a/packages/SystemUI/res/values-uz/strings.xml b/packages/SystemUI/res/values-uz/strings.xml
index ce7fc32..80f5d21 100644
--- a/packages/SystemUI/res/values-uz/strings.xml
+++ b/packages/SystemUI/res/values-uz/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Quyosh chiqqunicha"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"<xliff:g id="TIME">%s</xliff:g> da yoqiladi"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"<xliff:g id="TIME">%s</xliff:g> gacha"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC o‘chiq"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC yoniq"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Foydalanish uchun qulfdan chiqarish"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Bildirgilarni yuklashda xatolik yuz berdi, keyinroq qaytadan urining"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Qulflangan ekran sozlamalari"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"QR kod"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Skanerlash uchun bosing"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Ish profili"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Parvoz rejimi"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Keyingi signal (<xliff:g id="WHEN">%1$s</xliff:g>) chalinmaydi"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"<xliff:g id="APP_LABEL">%3$s</xliff:g> ilovasida ijro etish: <xliff:g id="SONG_NAME">%1$s</xliff:g> – <xliff:g id="ARTIST_NAME">%2$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"<xliff:g id="APP_LABEL">%2$s</xliff:g> ilovasida ijro etilmoqda: <xliff:g id="SONG_NAME">%1$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Qaytarish"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"<xliff:g id="DEVICENAME">%1$s</xliff:g>da ijro etish uchun yaqinroq keling"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"<xliff:g id="DEVICENAME">%1$s</xliff:g> qurilmasida ijro qilinmoqda"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Nofaol. Ilovani tekshiring"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Topilmadi"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Boshqarish imkonsiz"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Foydalanuvchini tanlang"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Orqa fonda ishlayotgan ilovalar"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Stop"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Nusxa olish"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Nusxa olindi"</string>
</resources>
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index e4066d9e..c323236 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Cho đến khi trời sáng"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Bật vào lúc <xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Cho đến <xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC đã được tắt"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC đã được bật"</string>
@@ -449,10 +453,8 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Mở khóa để sử dụng"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Đã xảy ra sự cố khi tải thẻ của bạn. Vui lòng thử lại sau"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Cài đặt màn hình khóa"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Mã QR"</string>
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"Nhấn để quét"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Hồ sơ công việc"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Chế độ máy bay"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"Bạn sẽ không nghe thấy báo thức tiếp theo lúc <xliff:g id="WHEN">%1$s</xliff:g> của mình"</string>
@@ -793,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Phát <xliff:g id="SONG_NAME">%1$s</xliff:g> của <xliff:g id="ARTIST_NAME">%2$s</xliff:g> trên <xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Phát <xliff:g id="SONG_NAME">%1$s</xliff:g> trên <xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Hủy"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Đưa thiết bị đến gần hơn để phát trên <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Đang phát trên <xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Không hoạt động, hãy kiểm tra ứng dụng"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Không tìm thấy"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Không có chức năng điều khiển"</string>
@@ -882,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Chọn người dùng"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Các ứng dụng chạy trong nền"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Dừng"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Sao chép"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Đã sao chép"</string>
</resources>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index 4666a88..b236060 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"在日出时关闭"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"在<xliff:g id="TIME">%s</xliff:g> 开启"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"直到<xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC 已停用"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC 已启用"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"通过<xliff:g id="APP_LABEL">%3$s</xliff:g>播放<xliff:g id="ARTIST_NAME">%2$s</xliff:g>的《<xliff:g id="SONG_NAME">%1$s</xliff:g>》"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"通过<xliff:g id="APP_LABEL">%2$s</xliff:g>播放《<xliff:g id="SONG_NAME">%1$s</xliff:g>》"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"撤消"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"若要在“<xliff:g id="DEVICENAME">%1$s</xliff:g>”上播放,请靠近这台设备"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"正在“<xliff:g id="DEVICENAME">%1$s</xliff:g>”上播放"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"无效,请检查应用"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"未找到"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"控件不可用"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"选择用户"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"正在在后台运行的应用"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"停止"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"复制"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"已复制"</string>
</resources>
diff --git a/packages/SystemUI/res/values-zh-rHK/strings.xml b/packages/SystemUI/res/values-zh-rHK/strings.xml
index f64e78c..4155ccf 100644
--- a/packages/SystemUI/res/values-zh-rHK/strings.xml
+++ b/packages/SystemUI/res/values-zh-rHK/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"在日出時關閉"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"於<xliff:g id="TIME">%s</xliff:g>開啟"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"直至<xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC 已停用"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC 已啟用"</string>
@@ -791,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"在 <xliff:g id="APP_LABEL">%3$s</xliff:g> 播放 <xliff:g id="ARTIST_NAME">%2$s</xliff:g> 的《<xliff:g id="SONG_NAME">%1$s</xliff:g>》"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"在 <xliff:g id="APP_LABEL">%2$s</xliff:g> 播放《<xliff:g id="SONG_NAME">%1$s</xliff:g>》"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"復原"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"如要在「<xliff:g id="DEVICENAME">%1$s</xliff:g>」上播放,請靠近一點"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"正在 <xliff:g id="DEVICENAME">%1$s</xliff:g> 上播放"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"已停用,請檢查應用程式"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"找不到"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"無法使用控制功能"</string>
@@ -880,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"選取使用者"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"正在背景中執行的應用程式"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"停止"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"複製"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"已複製"</string>
</resources>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index 87a6ae8..bf5974f 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"於日出時關閉"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"開啟時間:<xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"關閉時間:<xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"NFC 已停用"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"NFC 已啟用"</string>
@@ -450,8 +454,7 @@
<string name="wallet_error_generic" msgid="257704570182963611">"擷取卡片時發生問題,請稍後再試"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"螢幕鎖定設定"</string>
<string name="qr_code_scanner_title" msgid="5660820608548306581">"QR 圖碼"</string>
- <!-- no translation found for qr_code_scanner_description (7937603775306661863) -->
- <skip />
+ <string name="qr_code_scanner_description" msgid="7937603775306661863">"輕觸即可掃描"</string>
<string name="status_bar_work" msgid="5238641949837091056">"工作資料夾"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"飛航模式"</string>
<string name="zen_alarm_warning" msgid="7844303238486849503">"你不會聽到下一個<xliff:g id="WHEN">%1$s</xliff:g> 的鬧鐘"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"透過「<xliff:g id="APP_LABEL">%3$s</xliff:g>」播放<xliff:g id="ARTIST_NAME">%2$s</xliff:g>的〈<xliff:g id="SONG_NAME">%1$s</xliff:g>〉"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"透過「<xliff:g id="APP_LABEL">%2$s</xliff:g>」播放〈<xliff:g id="SONG_NAME">%1$s</xliff:g>〉"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"復原"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"如要在「<xliff:g id="DEVICENAME">%1$s</xliff:g>」上播放,請靠近一點"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"正在「<xliff:g id="DEVICENAME">%1$s</xliff:g>」上播放"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"無效,請查看應用程式"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"找不到控制項"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"無法使用控制項"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"選取使用者"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"目前在背景執行的應用程式"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"停止"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"複製"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"已複製"</string>
</resources>
diff --git a/packages/SystemUI/res/values-zu/strings.xml b/packages/SystemUI/res/values-zu/strings.xml
index 602845b..3d8e8a4 100644
--- a/packages/SystemUI/res/values-zu/strings.xml
+++ b/packages/SystemUI/res/values-zu/strings.xml
@@ -269,6 +269,10 @@
<string name="quick_settings_dark_mode_secondary_label_until_sunrise" msgid="4404885070316716472">"Kuze kube sekuphumeni kwelanga"</string>
<string name="quick_settings_dark_mode_secondary_label_on_at" msgid="5128758823486361279">"Kuvulwe ngo-<xliff:g id="TIME">%s</xliff:g>"</string>
<string name="quick_settings_dark_mode_secondary_label_until" msgid="2289774641256492437">"Kuze kube ngu-<xliff:g id="TIME">%s</xliff:g>"</string>
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_on_at_bedtime (2274300599408864897) -->
+ <skip />
+ <!-- no translation found for quick_settings_dark_mode_secondary_label_until_bedtime_ends (1790772410777123685) -->
+ <skip />
<string name="quick_settings_nfc_label" msgid="1054317416221168085">"I-NFC"</string>
<string name="quick_settings_nfc_off" msgid="3465000058515424663">"I-NFC ikhutshaziwe"</string>
<string name="quick_settings_nfc_on" msgid="1004976611203202230">"I-NFC inikwe amandla"</string>
@@ -449,8 +453,7 @@
<string name="wallet_secondary_label_device_locked" msgid="5175862019125370506">"Vula ukuze usebenzise"</string>
<string name="wallet_error_generic" msgid="257704570182963611">"Kube khona inkinga yokuthola amakhadi akho, sicela uzame futhi ngemuva kwesikhathi"</string>
<string name="wallet_lockscreen_settings_label" msgid="3539105300870383570">"Amasethingi okukhiya isikrini"</string>
- <!-- no translation found for qr_code_scanner_title (5660820608548306581) -->
- <skip />
+ <string name="qr_code_scanner_title" msgid="5660820608548306581">"Ikhodi ye-QR"</string>
<string name="qr_code_scanner_description" msgid="7937603775306661863">"Thepha ukuze uskene"</string>
<string name="status_bar_work" msgid="5238641949837091056">"Iphrofayela yomsebenzi"</string>
<string name="status_bar_airplane" msgid="4848702508684541009">"Imodi yendiza"</string>
@@ -792,9 +795,15 @@
<string name="controls_media_smartspace_rec_item_description" msgid="2189271793070870883">"Dlala i-<xliff:g id="SONG_NAME">%1$s</xliff:g> ka-<xliff:g id="ARTIST_NAME">%2$s</xliff:g> kusuka ku-<xliff:g id="APP_LABEL">%3$s</xliff:g>"</string>
<string name="controls_media_smartspace_rec_item_no_artist_description" msgid="8703614798636591077">"Dlala i-<xliff:g id="SONG_NAME">%1$s</xliff:g> kusuka ku-<xliff:g id="APP_LABEL">%2$s</xliff:g>"</string>
<string name="media_transfer_undo" msgid="1895606387620728736">"Hlehlisa"</string>
- <!-- no translation found for media_move_closer_to_start_cast (2673104707465013176) -->
+ <string name="media_move_closer_to_start_cast" msgid="2673104707465013176">"Sondeza eduze ukudlala ku-<xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_move_closer_to_end_cast (6495907340926563656) -->
<skip />
- <string name="media_transfer_playing" msgid="3760048096352107789">"Idlala ku-<xliff:g id="DEVICENAME">%1$s</xliff:g>"</string>
+ <!-- no translation found for media_transfer_playing_different_device (7186806382609785610) -->
+ <skip />
+ <!-- no translation found for media_transfer_playing_this_device (1856890686844499172) -->
+ <skip />
+ <!-- no translation found for media_transfer_failed (2640354446629980227) -->
+ <skip />
<string name="controls_error_timeout" msgid="794197289772728958">"Akusebenzi, hlola uhlelo lokusebenza"</string>
<string name="controls_error_removed" msgid="6675638069846014366">"Ayitholakali"</string>
<string name="controls_error_removed_title" msgid="1207794911208047818">"Ukulawula akutholakali"</string>
@@ -881,8 +890,6 @@
<string name="qs_user_switch_dialog_title" msgid="3045189293587781366">"Khetha umsebenzisi"</string>
<string name="fgs_manager_dialog_title" msgid="656091833603337197">"Ama-app ayaqhubeka ngemuva"</string>
<string name="fgs_manager_app_item_stop_button_label" msgid="7188317969020801156">"Misa"</string>
- <!-- no translation found for clipboard_edit_text_copy (770856373439969178) -->
- <skip />
- <!-- no translation found for clipboard_overlay_text_copied (1872624400464891363) -->
- <skip />
+ <string name="clipboard_edit_text_copy" msgid="770856373439969178">"Kopisha"</string>
+ <string name="clipboard_overlay_text_copied" msgid="1872624400464891363">"Ikopishiwe"</string>
</resources>
diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml
index 461a598..81e3e04 100644
--- a/packages/SystemUI/res/values/colors.xml
+++ b/packages/SystemUI/res/values/colors.xml
@@ -194,6 +194,7 @@
<color name="control_enabled_cool_foreground">@color/GM2_blue_300</color>
<color name="control_thumbnail_tint">#33000000</color>
<color name="control_thumbnail_shadow_color">@*android:color/black</color>
+ <color name="controls_task_view_bg">#CC191C1D</color>
<!-- Docked misalignment message -->
<color name="misalignment_text_color">#F28B82</color>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index fc2756e..079f5d0 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -82,7 +82,7 @@
<!-- Tiles native to System UI. Order should match "quick_settings_tiles_default" -->
<string name="quick_settings_tiles_stock" translatable="false">
- internet,bt,flashlight,dnd,alarm,airplane,controls,wallet,rotation,battery,cast,screenrecord,mictoggle,cameratoggle,location,hotspot,inversion,saver,dark,work,night,reverse,reduce_brightness,qr_code_scanner,onehanded,fgsmanager,color_correction
+ internet,bt,flashlight,dnd,alarm,airplane,controls,wallet,rotation,battery,cast,screenrecord,mictoggle,cameratoggle,location,hotspot,inversion,saver,dark,work,night,reverse,reduce_brightness,qr_code_scanner,onehanded,color_correction
</string>
<!-- The tiles to display in QuickSettings -->
@@ -309,6 +309,7 @@
<item>com.android.systemui.globalactions.GlobalActionsComponent</item>
<item>com.android.systemui.ScreenDecorations</item>
<item>com.android.systemui.biometrics.AuthController</item>
+ <item>com.android.systemui.log.SessionTracker</item>
<item>com.android.systemui.SliceBroadcastRelayHandler</item>
<item>com.android.systemui.statusbar.notification.InstantAppNotifier</item>
<item>com.android.systemui.theme.ThemeOverlayController</item>
@@ -581,6 +582,9 @@
<!-- Whether to use the split 2-column notification shade -->
<bool name="config_use_split_notification_shade">false</bool>
+ <!-- Whether notification header should never show section headers. -->
+ <bool name="config_notification_never_show_section_headers">false</bool>
+
<!-- Default udfps icon. Same path as ic_fingerprint.xml -->
<string name="config_udfpsIcon" translatable="false">
M25.5,16.3283C28.47,14.8433 31.9167,14 35.5834,14C39.2501,14 42.6968,14.8433 45.6668,16.3283
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 67d5b2f..af7ef53 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -1052,6 +1052,9 @@
<dimen name="controls_setup_subtitle">14sp</dimen>
<dimen name="controls_setup_vertical_padding">52dp</dimen>
<dimen name="controls_detail_dialog_header_height">52dp</dimen>
+ <!-- Limit the TaskView to this percentage of the overall screen width (0.0 - 1.0) -->
+ <item name="controls_task_view_width_percentage" translatable="false" format="float" type="dimen">1.0</item>
+ <dimen name="controls_task_view_right_margin">0dp</dimen>
<!-- Home Controls activity view detail panel-->
<dimen name="controls_activity_view_corner_radius">@*android:dimen/config_bottomDialogCornerRadius</dimen>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index 7384ccc..75ae52c 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -796,6 +796,9 @@
<!-- Indication on the keyguard that is shown when the device is charging slowly. Should match keyguard_plugged_in_charging_slowly [CHAR LIMIT=50]-->
<string name="keyguard_indication_charging_time_slowly"><xliff:g id="percentage">%2$s</xliff:g> • Charging slowly • Full in <xliff:g id="charging_time_left" example="4 hr, 2 min">%1$s</xliff:g></string>
+ <!-- Indication on the keyguard that is shown when the device is dock charging. [CHAR LIMIT=80]-->
+ <string name="keyguard_indication_charging_time_dock"><xliff:g id="percentage" example="20%">%2$s</xliff:g> • Charging Dock • Full in <xliff:g id="charging_time_left" example="4 hr, 2 min">%1$s</xliff:g></string>
+
<!-- Related to user switcher --><skip/>
<!-- Accessibility label for the button that opens the user switcher. -->
@@ -2355,9 +2358,14 @@
<!-- Title for User Switch dialog. [CHAR LIMIT=20] -->
<string name="qs_user_switch_dialog_title">Select user</string>
- <!-- Title for dialog listing applications currently running in the backing [CHAR LIMIT=NONE]-->
- <string name="fgs_manager_dialog_title">Apps running in the background</string>
- <!-- Label of the button to stop the app from running in the background [CHAR LIMIT=12]-->
+ <!-- Label for the entry point to open the dialog which shows currently running applications [CHAR LIMIT=NONE]-->
+ <plurals name="fgs_manager_footer_label">
+ <item quantity="one"><xliff:g id="count" example="1">%s</xliff:g> active app</item>
+ <item quantity="other"><xliff:g id="count" example="2">%s</xliff:g> active apps</item>
+ </plurals>
+ <!-- Title for dialog listing applications currently running [CHAR LIMIT=NONE]-->
+ <string name="fgs_manager_dialog_title">Active apps</string>
+ <!-- Label of the button to stop an app from running [CHAR LIMIT=12]-->
<string name="fgs_manager_app_item_stop_button_label">Stop</string>
<!-- Label for button to copy edited text back to the clipboard [CHAR LIMIT=20] -->
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index ff5699b..ac98739 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -746,7 +746,7 @@
<style name="Theme.SystemUI.Dialog.Control.DetailPanel" parent="@android:style/Theme.DeviceDefault.Dialog.NoActionBar">
<item name="android:windowFullscreen">false</item>
<item name="android:windowIsFloating">false</item>
- <item name="android:windowBackground">@android:color/black</item>
+ <item name="android:windowBackground">@color/controls_task_view_bg</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
</style>
diff --git a/packages/SystemUI/res/values/tiles_states_strings.xml b/packages/SystemUI/res/values/tiles_states_strings.xml
index a610caa..e273416 100644
--- a/packages/SystemUI/res/values/tiles_states_strings.xml
+++ b/packages/SystemUI/res/values/tiles_states_strings.xml
@@ -308,14 +308,4 @@
<item>Off</item>
<item>On</item>
</string-array>
-
- <!-- State names for fgsmanager tile: unavailable, off, on.
- This subtitle is shown when the tile is in that particular state but does not set its own
- subtitle, so some of these may never appear on screen. They should still be translated as
- if they could appear.[CHAR LIMIT=32] -->
- <string-array name="tile_states_fgsmanager">
- <item>Unavailable</item>
- <item>Off</item>
- <item>On</item>
- </string-array>
</resources>
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
index f86d08d..7f456db 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java
@@ -25,6 +25,7 @@
import android.os.AsyncTask;
import android.os.CountDownTimer;
import android.os.SystemClock;
+import android.util.PluralsMessageFormatter;
import android.view.KeyEvent;
import com.android.internal.util.LatencyTracker;
@@ -38,6 +39,9 @@
import com.android.systemui.classifier.FalsingClassifier;
import com.android.systemui.classifier.FalsingCollector;
+import java.util.HashMap;
+import java.util.Map;
+
public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKeyInputView>
extends KeyguardInputViewController<T> {
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
@@ -152,9 +156,12 @@
@Override
public void onTick(long millisUntilFinished) {
int secondsRemaining = (int) Math.round(millisUntilFinished / 1000.0);
- mMessageAreaController.setMessage(mView.getResources().getQuantityString(
- R.plurals.kg_too_many_failed_attempts_countdown,
- secondsRemaining, secondsRemaining));
+ Map<String, Object> arguments = new HashMap<>();
+ arguments.put("count", secondsRemaining);
+ mMessageAreaController.setMessage(PluralsMessageFormatter.format(
+ mView.getResources(),
+ arguments,
+ R.string.kg_too_many_failed_attempts_countdown));
}
@Override
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
index 238acd5..0b4bc9e 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java
@@ -23,6 +23,7 @@
import android.os.AsyncTask;
import android.os.CountDownTimer;
import android.os.SystemClock;
+import android.util.PluralsMessageFormatter;
import android.view.MotionEvent;
import android.view.View;
@@ -40,7 +41,9 @@
import com.android.systemui.classifier.FalsingCollector;
import com.android.systemui.statusbar.policy.DevicePostureController;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
public class KeyguardPatternViewController
extends KeyguardInputViewController<KeyguardPatternView> {
@@ -366,9 +369,13 @@
@Override
public void onTick(long millisUntilFinished) {
final int secondsRemaining = (int) Math.round(millisUntilFinished / 1000.0);
- mMessageAreaController.setMessage(mView.getResources().getQuantityString(
- R.plurals.kg_too_many_failed_attempts_countdown,
- secondsRemaining, secondsRemaining));
+ Map<String, Object> arguments = new HashMap<>();
+ arguments.put("count", secondsRemaining);
+
+ mMessageAreaController.setMessage(PluralsMessageFormatter.format(
+ mView.getResources(),
+ arguments,
+ R.string.kg_too_many_failed_attempts_countdown));
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/ForegroundServicesDialog.java b/packages/SystemUI/src/com/android/systemui/ForegroundServicesDialog.java
index 710980a..e6d5719 100644
--- a/packages/SystemUI/src/com/android/systemui/ForegroundServicesDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/ForegroundServicesDialog.java
@@ -58,7 +58,7 @@
LayoutInflater mInflater;
- private MetricsLogger mMetricsLogger;
+ private final MetricsLogger mMetricsLogger;
private String[] mPackages;
private PackageItemAdapter mAdapter;
@@ -75,16 +75,15 @@
};
@Inject
- ForegroundServicesDialog() {
+ ForegroundServicesDialog(MetricsLogger metricsLogger) {
super();
+ mMetricsLogger = metricsLogger;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- mMetricsLogger = Dependency.get(MetricsLogger.class);
-
mInflater = LayoutInflater.from(this);
mAdapter = new PackageItemAdapter(this);
diff --git a/packages/SystemUI/src/com/android/systemui/assist/PhoneStateMonitor.java b/packages/SystemUI/src/com/android/systemui/assist/PhoneStateMonitor.java
index 3f5c2c8..aedaf96 100644
--- a/packages/SystemUI/src/com/android/systemui/assist/PhoneStateMonitor.java
+++ b/packages/SystemUI/src/com/android/systemui/assist/PhoneStateMonitor.java
@@ -28,7 +28,6 @@
import androidx.annotation.Nullable;
import com.android.systemui.BootCompleteCache;
-import com.android.systemui.Dependency;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
@@ -78,10 +77,11 @@
@Inject
PhoneStateMonitor(Context context, BroadcastDispatcher broadcastDispatcher,
- Lazy<Optional<StatusBar>> statusBarOptionalLazy, BootCompleteCache bootCompleteCache) {
+ Lazy<Optional<StatusBar>> statusBarOptionalLazy, BootCompleteCache bootCompleteCache,
+ StatusBarStateController statusBarStateController) {
mContext = context;
mStatusBarOptionalLazy = statusBarOptionalLazy;
- mStatusBarStateController = Dependency.get(StatusBarStateController.class);
+ mStatusBarStateController = statusBarStateController;
mDefaultHome = getCurrentDefaultHome();
bootCompleteCache.addListener(() -> mDefaultHome = getCurrentDefaultHome());
diff --git a/packages/SystemUI/src/com/android/systemui/assist/ui/DefaultUiController.java b/packages/SystemUI/src/com/android/systemui/assist/ui/DefaultUiController.java
index 5732145..1c98099 100644
--- a/packages/SystemUI/src/com/android/systemui/assist/ui/DefaultUiController.java
+++ b/packages/SystemUI/src/com/android/systemui/assist/ui/DefaultUiController.java
@@ -35,7 +35,6 @@
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-import com.android.systemui.Dependency;
import com.android.systemui.R;
import com.android.systemui.assist.AssistLogger;
import com.android.systemui.assist.AssistManager;
@@ -46,6 +45,8 @@
import javax.inject.Inject;
+import dagger.Lazy;
+
/**
* Default UiController implementation. Shows white edge lights along the bottom of the phone,
* expanding from the corners to meet in the center.
@@ -65,6 +66,8 @@
protected final AssistLogger mAssistLogger;
private final WindowManager mWindowManager;
+ private final MetricsLogger mMetricsLogger;
+ private final Lazy<AssistManager> mAssistManagerLazy;
private final WindowManager.LayoutParams mLayoutParams;
private final PathInterpolator mProgressInterpolator = new PathInterpolator(.83f, 0, .84f, 1);
@@ -75,10 +78,14 @@
private ValueAnimator mInvocationAnimator = new ValueAnimator();
@Inject
- public DefaultUiController(Context context, AssistLogger assistLogger) {
+ public DefaultUiController(Context context, AssistLogger assistLogger,
+ WindowManager windowManager, MetricsLogger metricsLogger,
+ Lazy<AssistManager> assistManagerLazy) {
mAssistLogger = assistLogger;
mRoot = new FrameLayout(context);
- mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
+ mWindowManager = windowManager;
+ mMetricsLogger = metricsLogger;
+ mAssistManagerLazy = assistManagerLazy;
mLayoutParams = new WindowManager.LayoutParams(
WindowManager.LayoutParams.MATCH_PARENT,
@@ -152,9 +159,9 @@
/* isInvocationComplete = */ false,
/* assistantComponent = */ null,
/* legacyDeviceState = */ null);
- MetricsLogger.action(new LogMaker(MetricsEvent.ASSISTANT)
+ mMetricsLogger.write(new LogMaker(MetricsEvent.ASSISTANT)
.setType(MetricsEvent.TYPE_ACTION)
- .setSubtype(Dependency.get(AssistManager.class).toLoggingSubType(type)));
+ .setSubtype(mAssistManagerLazy.get().toLoggingSubType(type)));
}
// Logs assistant invocation cancelled.
if ((mInvocationAnimator == null || !mInvocationAnimator.isRunning())
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
index fd37b35..21edb24 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
@@ -52,7 +52,6 @@
import android.widget.ScrollView;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.systemui.Dependency;
import com.android.systemui.R;
import com.android.systemui.animation.Interpolators;
import com.android.systemui.keyguard.WakefulnessLifecycle;
@@ -106,7 +105,7 @@
private final float mTranslationY;
- @VisibleForTesting final WakefulnessLifecycle mWakefulnessLifecycle;
+ private final WakefulnessLifecycle mWakefulnessLifecycle;
@VisibleForTesting @ContainerState int mContainerState = STATE_UNKNOWN;
@@ -187,10 +186,12 @@
public AuthContainerView build(int[] sensorIds, boolean credentialAllowed,
@Nullable List<FingerprintSensorPropertiesInternal> fpProps,
- @Nullable List<FaceSensorPropertiesInternal> faceProps) {
+ @Nullable List<FaceSensorPropertiesInternal> faceProps,
+ WakefulnessLifecycle wakefulnessLifecycle) {
mConfig.mSensorIds = sensorIds;
mConfig.mCredentialAllowed = credentialAllowed;
- return new AuthContainerView(mConfig, new Injector(), fpProps, faceProps);
+ return new AuthContainerView(
+ mConfig, new Injector(), fpProps, faceProps, wakefulnessLifecycle);
}
}
@@ -276,7 +277,8 @@
@VisibleForTesting
AuthContainerView(Config config, Injector injector,
@Nullable List<FingerprintSensorPropertiesInternal> fpProps,
- @Nullable List<FaceSensorPropertiesInternal> faceProps) {
+ @Nullable List<FaceSensorPropertiesInternal> faceProps,
+ WakefulnessLifecycle wakefulnessLifecycle) {
super(config.mContext);
mConfig = config;
@@ -289,7 +291,7 @@
mHandler = new Handler(Looper.getMainLooper());
mWindowManager = mContext.getSystemService(WindowManager.class);
- mWakefulnessLifecycle = Dependency.get(WakefulnessLifecycle.class);
+ mWakefulnessLifecycle = wakefulnessLifecycle;
mTranslationY = getResources()
.getDimension(R.dimen.biometric_dialog_animation_translation_offset);
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
index 2b12f67..b0f7e55 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthController.java
@@ -63,6 +63,7 @@
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.doze.DozeReceiver;
+import com.android.systemui.keyguard.WakefulnessLifecycle;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.util.concurrency.Execution;
@@ -130,6 +131,7 @@
@NonNull private final SparseBooleanArray mUdfpsEnrolledForUser;
private SensorPrivacyManager mSensorPrivacyManager;
+ private final WakefulnessLifecycle mWakefulnessLifecycle;
private class BiometricTaskStackListener extends TaskStackListener {
@Override
@@ -168,6 +170,10 @@
mCurrentDialog = null;
mOrientationListener.disable();
+ for (Callback cb : mCallbacks) {
+ cb.onBiometricPromptDismissed();
+ }
+
try {
if (mReceiver != null) {
mReceiver.onDialogDismissed(BiometricPrompt.DISMISSED_REASON_USER_CANCEL,
@@ -198,6 +204,10 @@
mCurrentDialog = null;
mOrientationListener.disable();
+ for (Callback cb : mCallbacks) {
+ cb.onBiometricPromptDismissed();
+ }
+
if (mReceiver != null) {
mReceiver.onDialogDismissed(
BiometricPrompt.DISMISSED_REASON_USER_CANCEL,
@@ -460,6 +470,7 @@
Log.e(TAG, "sendResultAndCleanUp: Receiver is null");
return;
}
+
try {
mReceiver.onDialogDismissed(reason, credentialAttestation);
} catch (RemoteException e) {
@@ -479,9 +490,11 @@
Provider<UdfpsController> udfpsControllerFactory,
Provider<SidefpsController> sidefpsControllerFactory,
@NonNull DisplayManager displayManager,
+ WakefulnessLifecycle wakefulnessLifecycle,
@Main Handler handler) {
super(context);
mExecution = execution;
+ mWakefulnessLifecycle = wakefulnessLifecycle;
mHandler = handler;
mCommandQueue = commandQueue;
mActivityTaskManager = activityTaskManager;
@@ -788,7 +801,8 @@
skipAnimation,
operationId,
requestId,
- multiSensorConfig);
+ multiSensorConfig,
+ mWakefulnessLifecycle);
if (newDialog == null) {
Log.e(TAG, "Unsupported type configuration");
@@ -811,6 +825,9 @@
}
mReceiver = (IBiometricSysuiReceiver) args.arg2;
+ for (Callback cb : mCallbacks) {
+ cb.onBiometricPromptShown();
+ }
mCurrentDialog = newDialog;
mCurrentDialog.show(mWindowManager, savedState);
mOrientationListener.enable();
@@ -821,6 +838,11 @@
if (mCurrentDialog == null) {
Log.w(TAG, "Dialog already dismissed");
}
+
+ for (Callback cb : mCallbacks) {
+ cb.onBiometricPromptDismissed();
+ }
+
mReceiver = null;
mCurrentDialog = null;
mOrientationListener.disable();
@@ -868,7 +890,8 @@
protected AuthDialog buildDialog(PromptInfo promptInfo, boolean requireConfirmation,
int userId, int[] sensorIds, boolean credentialAllowed, String opPackageName,
boolean skipIntro, long operationId, long requestId,
- @BiometricMultiSensorMode int multiSensorConfig) {
+ @BiometricMultiSensorMode int multiSensorConfig,
+ WakefulnessLifecycle wakefulnessLifecycle) {
return new AuthContainerView.Builder(mContext)
.setCallback(this)
.setPromptInfo(promptInfo)
@@ -879,7 +902,7 @@
.setOperationId(operationId)
.setRequestId(requestId)
.setMultiSensorConfig(multiSensorConfig)
- .build(sensorIds, credentialAllowed, mFpProps, mFaceProps);
+ .build(sensorIds, credentialAllowed, mFpProps, mFaceProps, wakefulnessLifecycle);
}
/**
@@ -891,12 +914,22 @@
* Called when authenticators are registered. If authenticators are already
* registered before this call, this callback will never be triggered.
*/
- void onAllAuthenticatorsRegistered();
+ default void onAllAuthenticatorsRegistered() {}
/**
* Called when UDFPS enrollments have changed. This is called after boot and on changes to
* enrollment.
*/
- void onEnrollmentsChanged();
+ default void onEnrollmentsChanged() {}
+
+ /**
+ * Called when the biometric prompt starts showing.
+ */
+ default void onBiometricPromptShown() {}
+
+ /**
+ * Called when the biometric prompt is no longer showing.
+ */
+ default void onBiometricPromptDismissed() {}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDisplayListener.kt b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDisplayListener.kt
index b7404df..dfbe348 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDisplayListener.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDisplayListener.kt
@@ -37,7 +37,7 @@
private val onChanged: () -> Unit
) : DisplayManager.DisplayListener {
- private var lastRotation = context.display?.rotation ?: Surface.ROTATION_0
+ private var lastRotation = Surface.ROTATION_0
override fun onDisplayAdded(displayId: Int) {}
override fun onDisplayRemoved(displayId: Int) {}
@@ -63,6 +63,7 @@
/** Listen for changes. */
fun enable() {
+ lastRotation = context.display?.rotation ?: Surface.ROTATION_0
displayManager.registerDisplayListener(this, handler)
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
index 6581490..5ddfd75 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
@@ -28,6 +28,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.graphics.Point;
import android.graphics.RectF;
import android.hardware.biometrics.SensorLocationInternal;
import android.hardware.display.DisplayManager;
@@ -45,6 +46,7 @@
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
+import android.view.Surface;
import android.view.VelocityTracker;
import android.view.View;
import android.view.WindowManager;
@@ -414,8 +416,33 @@
final long sinceLastLog = mSystemClock.elapsedRealtime() - mTouchLogTime;
if (!isIlluminationRequested && !mGoodCaptureReceived &&
!exceedsVelocityThreshold) {
- onFingerDown((int) event.getRawX(), (int) event.getRawY(), minor,
- major);
+ final int rawX = (int) event.getRawX();
+ final int rawY = (int) event.getRawY();
+ // Default coordinates assume portrait mode.
+ int x = rawX;
+ int y = rawY;
+
+ // Gets the size based on the current rotation of the display.
+ Point p = new Point();
+ mContext.getDisplay().getRealSize(p);
+
+ // Transform x, y to portrait mode if the device is in landscape mode.
+ switch (mContext.getDisplay().getRotation()) {
+ case Surface.ROTATION_90:
+ x = p.y - rawY;
+ y = rawX;
+ break;
+
+ case Surface.ROTATION_270:
+ x = rawY;
+ y = p.x - rawX;
+ break;
+
+ default:
+ // Do nothing to stay in portrait mode.
+ }
+
+ onFingerDown(x, y, minor, major);
Log.v(TAG, "onTouch | finger down: " + touchInfo);
mTouchLogTime = mSystemClock.elapsedRealtime();
mPowerManager.userActivity(mSystemClock.uptimeMillis(),
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt
index 4758ab0..dc3d1b5 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt
@@ -41,12 +41,12 @@
* The activity being launched is specified by {@link android.service.controls.Control#getAppIntent}.
*/
class DetailDialog(
- val activityContext: Context?,
+ val activityContext: Context,
val taskView: TaskView,
val pendingIntent: PendingIntent,
val cvh: ControlViewHolder
) : Dialog(
- activityContext ?: cvh.context,
+ activityContext,
R.style.Theme_SystemUI_Dialog_Control_DetailPanel
) {
companion object {
@@ -58,6 +58,10 @@
}
var detailTaskId = INVALID_TASK_ID
+ private lateinit var taskViewContainer: View
+ private val taskWidthPercentWidth = activityContext.resources.getFloat(
+ R.dimen.controls_task_view_width_percentage
+ )
private val fillInIntent = Intent().apply {
putExtra(EXTRA_USE_PANEL, true)
@@ -75,13 +79,18 @@
val stateCallback = object : TaskView.Listener {
override fun onInitialized() {
- val options = activityContext?.let {
- ActivityOptions.makeCustomAnimation(
- it,
- 0 /* enterResId */,
- 0 /* exitResId */
- )
- } ?: ActivityOptions.makeBasic()
+ taskViewContainer.apply {
+ // For some devices, limit the overall width of the taskView
+ val lp = getLayoutParams()
+ lp.width = (getWidth() * taskWidthPercentWidth).toInt()
+ setLayoutParams(lp)
+ }
+
+ val options = ActivityOptions.makeCustomAnimation(
+ activityContext,
+ 0 /* enterResId */,
+ 0 /* exitResId */
+ )
taskView.startActivity(
pendingIntent,
fillInIntent,
@@ -112,16 +121,14 @@
}
init {
- if (activityContext == null) {
- window.setType(WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY)
- }
-
// To pass touches to the task inside TaskView.
window.addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL)
window.addPrivateFlags(WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY)
setContentView(R.layout.controls_detail_dialog)
+ taskViewContainer = requireViewById<ViewGroup>(R.id.control_task_view_container)
+
requireViewById<ViewGroup>(R.id.controls_activity_view).apply {
addView(taskView)
setAlpha(0f)
@@ -130,6 +137,9 @@
requireViewById<ImageView>(R.id.control_detail_close).apply {
setOnClickListener { _: View -> dismiss() }
}
+ requireViewById<View>(R.id.control_detail_root).apply {
+ setOnClickListener { _: View -> dismiss() }
+ }
requireViewById<ImageView>(R.id.control_detail_open_in_app).apply {
setOnClickListener { v: View ->
@@ -145,17 +155,10 @@
// consume all insets to achieve slide under effect
window.getDecorView().setOnApplyWindowInsetsListener {
v: View, insets: WindowInsets ->
- taskView.apply {
- val l = getPaddingLeft()
- val t = getPaddingTop()
- val r = getPaddingRight()
- setPadding(l, t, r, insets.getInsets(Type.systemBars()).bottom)
- }
-
val l = v.getPaddingLeft()
- val b = v.getPaddingBottom()
val r = v.getPaddingRight()
- v.setPadding(l, insets.getInsets(Type.systemBars()).top, r, b)
+ val insets = insets.getInsets(Type.systemBars())
+ v.setPadding(l, insets.top, r, insets.bottom)
WindowInsets.CONSUMED
}
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java
index bbe9dbd..96e2302 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java
@@ -29,6 +29,7 @@
import com.android.systemui.globalactions.GlobalActionsComponent;
import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.keyguard.dagger.KeyguardModule;
+import com.android.systemui.log.SessionTracker;
import com.android.systemui.media.systemsounds.HomeSoundEffectController;
import com.android.systemui.power.PowerUI;
import com.android.systemui.privacy.television.TvOngoingPrivacyChip;
@@ -66,6 +67,12 @@
@ClassKey(AuthController.class)
public abstract CoreStartable bindAuthController(AuthController service);
+ /** Inject into SessionTracker. */
+ @Binds
+ @IntoMap
+ @ClassKey(SessionTracker.class)
+ public abstract CoreStartable bindSessionTracker(SessionTracker service);
+
/** Inject into GarbageMonitor.Service. */
@Binds
@IntoMap
diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.java b/packages/SystemUI/src/com/android/systemui/flags/Flags.java
index e24df30..490f7c1 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/Flags.java
+++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.java
@@ -55,6 +55,9 @@
public static final BooleanFlag NSSL_DEBUG_REMOVE_ANIMATION =
new BooleanFlag(106, false);
+ public static final BooleanFlag NEW_PIPELINE_CRASH_ON_CALL_TO_OLD_PIPELINE =
+ new BooleanFlag(107, false);
+
/***************************************/
// 200 - keyguard/lockscreen
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 08e1654..701d139 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -113,6 +113,7 @@
import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.NotificationShadeDepthController;
+import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.phone.BiometricUnlockController;
import com.android.systemui.statusbar.phone.DozeParameters;
@@ -318,6 +319,7 @@
// the properties of the keyguard
private final KeyguardUpdateMonitor mUpdateMonitor;
+ private final Lazy<NotificationShadeWindowController> mNotificationShadeWindowControllerLazy;
/**
* Last SIM state reported by the telephony system.
@@ -833,7 +835,8 @@
ScreenOffAnimationController screenOffAnimationController,
Lazy<NotificationShadeDepthController> notificationShadeDepthController,
ScreenOnCoordinator screenOnCoordinator,
- InteractionJankMonitor interactionJankMonitor) {
+ InteractionJankMonitor interactionJankMonitor,
+ Lazy<NotificationShadeWindowController> notificationShadeWindowControllerLazy) {
super(context);
mFalsingCollector = falsingCollector;
mLockPatternUtils = lockPatternUtils;
@@ -850,6 +853,7 @@
dumpManager.registerDumpable(getClass().getName(), this);
mDeviceConfig = deviceConfig;
mScreenOnCoordinator = screenOnCoordinator;
+ mNotificationShadeWindowControllerLazy = notificationShadeWindowControllerLazy;
mShowHomeOverLockscreen = mDeviceConfig.getBoolean(
DeviceConfig.NAMESPACE_SYSTEMUI,
NAV_BAR_HANDLE_SHOW_OVER_LOCKSCREEN,
@@ -1837,10 +1841,14 @@
Trace.beginSection(
"KeyguardViewMediator#handleMessage START_KEYGUARD_EXIT_ANIM");
StartKeyguardExitAnimParams params = (StartKeyguardExitAnimParams) msg.obj;
- handleStartKeyguardExitAnimation(params.startTime, params.fadeoutDuration,
- params.mApps, params.mWallpapers, params.mNonApps,
- params.mFinishedCallback);
- mFalsingCollector.onSuccessfulUnlock();
+ mNotificationShadeWindowControllerLazy.get().batchApplyWindowLayoutParams(
+ () -> {
+ handleStartKeyguardExitAnimation(params.startTime,
+ params.fadeoutDuration,
+ params.mApps, params.mWallpapers, params.mNonApps,
+ params.mFinishedCallback);
+ mFalsingCollector.onSuccessfulUnlock();
+ });
Trace.endSection();
break;
case CANCEL_KEYGUARD_EXIT_ANIM:
@@ -2139,10 +2147,12 @@
mKeyguardGoingAwayRunnable.run();
} else {
// TODO(bc-unlock): Fill parameters
- handleStartKeyguardExitAnimation(
- SystemClock.uptimeMillis() + mHideAnimation.getStartOffset(),
- mHideAnimation.getDuration(), null /* apps */, null /* wallpapers */,
- null /* nonApps */, null /* finishedCallback */);
+ mNotificationShadeWindowControllerLazy.get().batchApplyWindowLayoutParams(() -> {
+ handleStartKeyguardExitAnimation(
+ SystemClock.uptimeMillis() + mHideAnimation.getStartOffset(),
+ mHideAnimation.getDuration(), null /* apps */, null /* wallpapers */,
+ null /* nonApps */, null /* finishedCallback */);
+ });
}
}
Trace.endSection();
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java b/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java
index dd844e8d..f14d130 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java
@@ -44,6 +44,7 @@
import com.android.systemui.navigationbar.NavigationModeController;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.NotificationShadeDepthController;
+import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.phone.DozeParameters;
import com.android.systemui.statusbar.phone.KeyguardLiftController;
@@ -98,7 +99,8 @@
ScreenOffAnimationController screenOffAnimationController,
Lazy<NotificationShadeDepthController> notificationShadeDepthController,
ScreenOnCoordinator screenOnCoordinator,
- InteractionJankMonitor interactionJankMonitor) {
+ InteractionJankMonitor interactionJankMonitor,
+ Lazy<NotificationShadeWindowController> notificationShadeWindowController) {
return new KeyguardViewMediator(
context,
falsingCollector,
@@ -122,7 +124,8 @@
screenOffAnimationController,
notificationShadeDepthController,
screenOnCoordinator,
- interactionJankMonitor
+ interactionJankMonitor,
+ notificationShadeWindowController
);
}
diff --git a/packages/SystemUI/src/com/android/systemui/log/SessionTracker.java b/packages/SystemUI/src/com/android/systemui/log/SessionTracker.java
new file mode 100644
index 0000000..0656f5e
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/log/SessionTracker.java
@@ -0,0 +1,203 @@
+/*
+ * 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.systemui.log;
+
+import static android.app.StatusBarManager.ALL_SESSIONS;
+import static android.app.StatusBarManager.SESSION_BIOMETRIC_PROMPT;
+import static android.app.StatusBarManager.SESSION_KEYGUARD;
+
+import android.annotation.Nullable;
+import android.content.Context;
+import android.os.RemoteException;
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+
+import com.android.internal.logging.InstanceId;
+import com.android.internal.logging.InstanceIdSequence;
+import com.android.internal.statusbar.IStatusBarService;
+import com.android.keyguard.KeyguardUpdateMonitor;
+import com.android.keyguard.KeyguardUpdateMonitorCallback;
+import com.android.systemui.CoreStartable;
+import com.android.systemui.biometrics.AuthController;
+import com.android.systemui.dagger.SysUISingleton;
+import com.android.systemui.statusbar.policy.KeyguardStateController;
+
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.inject.Inject;
+
+/**
+ * Track Session InstanceIds to be used for metrics logging to correlate logs in the same
+ * session. Can be used across processes via StatusBarManagerService#registerSessionListener
+ */
+@SysUISingleton
+public class SessionTracker extends CoreStartable {
+ private static final String TAG = "SessionTracker";
+ private static final boolean DEBUG = false;
+
+ // At most 20 bits: ~1m possibilities, ~0.5% probability of collision in 100 values
+ private final InstanceIdSequence mInstanceIdGenerator = new InstanceIdSequence(1 << 20);
+
+ private final IStatusBarService mStatusBarManagerService;
+ private final AuthController mAuthController;
+ private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
+ private final KeyguardStateController mKeyguardStateController;
+ private final Map<Integer, InstanceId> mSessionToInstanceId = new HashMap<>();
+
+ private boolean mKeyguardSessionStarted;
+
+ @Inject
+ public SessionTracker(
+ Context context,
+ IStatusBarService statusBarService,
+ AuthController authController,
+ KeyguardUpdateMonitor keyguardUpdateMonitor,
+ KeyguardStateController keyguardStateController
+ ) {
+ super(context);
+ mStatusBarManagerService = statusBarService;
+ mAuthController = authController;
+ mKeyguardUpdateMonitor = keyguardUpdateMonitor;
+ mKeyguardStateController = keyguardStateController;
+ }
+
+ @Override
+ public void start() {
+ mAuthController.addCallback(mAuthControllerCallback);
+ mKeyguardUpdateMonitor.registerCallback(mKeyguardUpdateMonitorCallback);
+ mKeyguardStateController.addCallback(mKeyguardStateCallback);
+
+ mKeyguardSessionStarted = mKeyguardStateController.isShowing();
+ if (mKeyguardSessionStarted) {
+ startSession(SESSION_KEYGUARD);
+ }
+ }
+
+ /**
+ * Get the session ID associated with the passed session type.
+ */
+ public @Nullable InstanceId getSessionId(int type) {
+ return mSessionToInstanceId.getOrDefault(type, null);
+ }
+
+ private void startSession(int type) {
+ if (mSessionToInstanceId.getOrDefault(type, null) != null) {
+ Log.e(TAG, "session [" + getString(type) + "] was already started");
+ return;
+ }
+
+ final InstanceId instanceId = mInstanceIdGenerator.newInstanceId();
+ mSessionToInstanceId.put(type, instanceId);
+ try {
+ if (DEBUG) {
+ Log.d(TAG, "Session start for [" + getString(type) + "] id=" + instanceId);
+ }
+ mStatusBarManagerService.onSessionStarted(type, instanceId);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Unable to send onSessionStarted for session="
+ + "[" + getString(type) + "]", e);
+ }
+ }
+
+ private void endSession(int type) {
+ if (mSessionToInstanceId.getOrDefault(type, null) == null) {
+ Log.e(TAG, "session [" + getString(type) + "] was not started");
+ return;
+ }
+
+ final InstanceId instanceId = mSessionToInstanceId.get(type);
+ mSessionToInstanceId.put(type, null);
+ try {
+ if (DEBUG) {
+ Log.d(TAG, "Session end for [" + getString(type) + "] id=" + instanceId);
+ }
+ mStatusBarManagerService.onSessionEnded(type, instanceId);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Unable to send onSessionEnded for session="
+ + "[" + getString(type) + "]", e);
+ }
+ }
+
+ public KeyguardUpdateMonitorCallback mKeyguardUpdateMonitorCallback =
+ new KeyguardUpdateMonitorCallback() {
+ @Override
+ public void onStartedGoingToSleep(int why) {
+ // we need to register to the KeyguardUpdateMonitor lifecycle b/c it gets called
+ // before the WakefulnessLifecycle
+ if (mKeyguardSessionStarted) {
+ return;
+ }
+
+ mKeyguardSessionStarted = true;
+ startSession(SESSION_KEYGUARD);
+ }
+ };
+
+
+ public KeyguardStateController.Callback mKeyguardStateCallback =
+ new KeyguardStateController.Callback() {
+ public void onKeyguardShowingChanged() {
+ boolean wasSessionStarted = mKeyguardSessionStarted;
+ boolean keyguardShowing = mKeyguardStateController.isShowing();
+ if (keyguardShowing && !wasSessionStarted) {
+ mKeyguardSessionStarted = true;
+ startSession(SESSION_KEYGUARD);
+ } else if (!keyguardShowing && wasSessionStarted) {
+ mKeyguardSessionStarted = false;
+ endSession(SESSION_KEYGUARD);
+ }
+ }
+ };
+
+ public AuthController.Callback mAuthControllerCallback = new AuthController.Callback() {
+ @Override
+ public void onBiometricPromptShown() {
+ startSession(SESSION_BIOMETRIC_PROMPT);
+ }
+
+ @Override
+ public void onBiometricPromptDismissed() {
+ endSession(SESSION_BIOMETRIC_PROMPT);
+ }
+ };
+
+ @Override
+ public void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter pw, @NonNull String[] args) {
+ for (int session : ALL_SESSIONS) {
+ pw.println(" " + getString(session)
+ + " instanceId=" + mSessionToInstanceId.get(session));
+ }
+ }
+
+ /**
+ * @return the string representation of a SINGLE SessionFlag. Combined SessionFlags will be
+ * considered unknown.
+ */
+ public static String getString(int sessionType) {
+ if (sessionType == SESSION_KEYGUARD) {
+ return "KEYGUARD";
+ } else if (sessionType == SESSION_BIOMETRIC_PROMPT) {
+ return "BIOMETRIC_PROMPT";
+ }
+
+ return "unknownType=" + sessionType;
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java
index e465ae4..85c9644 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java
@@ -77,6 +77,10 @@
@Override
public int getItemCount() {
+ if (mController.isZeroMode()) {
+ // Add extra one for "pair new" or dynamic group
+ return mController.getMediaDevices().size() + 1;
+ }
return mController.getMediaDevices().size();
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/nearby/MediaNearbyDevicesManager.kt b/packages/SystemUI/src/com/android/systemui/media/nearby/MediaNearbyDevicesManager.kt
new file mode 100644
index 0000000..0453fdb
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/media/nearby/MediaNearbyDevicesManager.kt
@@ -0,0 +1,51 @@
+/*
+ * 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.systemui.media.nearby
+
+import com.android.systemui.dagger.SysUISingleton
+
+/**
+ * A manager that returns information about devices that are nearby and can receive media transfers.
+ */
+@SysUISingleton
+class MediaNearbyDevicesManager {
+
+ /** Returns a list containing the current nearby devices. */
+ fun getCurrentNearbyDevices(): List<NearbyDevice> {
+ // TODO(b/216313420): Implement this function.
+ return emptyList()
+ }
+
+ /**
+ * Registers [callback] to be notified each time a device's range changes or when a new device
+ * comes within range.
+ */
+ fun registerNearbyDevicesCallback(
+ callback: (device: NearbyDevice) -> Unit
+ ) {
+ // TODO(b/216313420): Implement this function.
+ }
+
+ /**
+ * Un-registers [callback]. See [registerNearbyDevicesCallback].
+ */
+ fun unregisterNearbyDevicesCallback(
+ callback: (device: NearbyDevice) -> Unit
+ ) {
+ // TODO(b/216313420): Implement this function.
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/media/nearby/NearbyDevice.kt b/packages/SystemUI/src/com/android/systemui/media/nearby/NearbyDevice.kt
new file mode 100644
index 0000000..96b853f
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/media/nearby/NearbyDevice.kt
@@ -0,0 +1,49 @@
+/*
+ * 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.systemui.media.nearby
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * A parcelable representing a nearby device that can be used for media transfer.
+ *
+ * This class includes:
+ * - [routeId] identifying the media route
+ * - [rangeZone] specifying how far away the device with the media route is from this device.
+ */
+class NearbyDevice(parcel: Parcel) : Parcelable {
+ var routeId: String? = null
+ @RangeZone val rangeZone: Int
+
+ init {
+ routeId = parcel.readString() ?: "unknown"
+ rangeZone = parcel.readInt()
+ }
+
+ override fun describeContents() = 0
+
+ override fun writeToParcel(out: Parcel, flags: Int) {
+ out.writeString(routeId)
+ out.writeInt(rangeZone)
+ }
+
+ companion object CREATOR : Parcelable.Creator<NearbyDevice?> {
+ override fun createFromParcel(parcel: Parcel) = NearbyDevice(parcel)
+ override fun newArray(size: Int) = arrayOfNulls<NearbyDevice?>(size)
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/media/nearby/RangeZone.kt b/packages/SystemUI/src/com/android/systemui/media/nearby/RangeZone.kt
new file mode 100644
index 0000000..3c890bc
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/media/nearby/RangeZone.kt
@@ -0,0 +1,44 @@
+/*
+ * 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.systemui.media.nearby
+
+import androidx.annotation.IntDef
+import kotlin.annotation.AnnotationRetention
+
+@IntDef(
+ RangeZone.RANGE_UNKNOWN,
+ RangeZone.RANGE_FAR,
+ RangeZone.RANGE_LONG,
+ RangeZone.RANGE_CLOSE,
+ RangeZone.RANGE_WITHIN_REACH
+)
+@Retention(AnnotationRetention.SOURCE)
+/** The various range zones a device can be in, in relation to the current device. */
+annotation class RangeZone {
+ companion object {
+ /** Unknown distance range. */
+ const val RANGE_UNKNOWN = 0
+ /** Distance is very far away from the peer device. */
+ const val RANGE_FAR = 1
+ /** Distance is relatively long from the peer device, typically a few meters. */
+ const val RANGE_LONG = 2
+ /** Distance is close to the peer device, typically with one or two meter. */
+ const val RANGE_CLOSE = 3
+ /** Distance is very close to the peer device, typically within one meter or less. */
+ const val RANGE_WITHIN_REACH = 4
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
index ad4a2f4..dbd641b 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
@@ -58,7 +58,6 @@
import com.android.settingslib.Utils;
import com.android.settingslib.fuelgauge.BatterySaverUtils;
import com.android.settingslib.utils.PowerUtil;
-import com.android.systemui.Dependency;
import com.android.systemui.R;
import com.android.systemui.SystemUIApplication;
import com.android.systemui.dagger.SysUISingleton;
@@ -421,7 +420,7 @@
new Intent(Intent.ACTION_VIEW)
.setData(Uri.parse(url))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- Dependency.get(ActivityStarter.class).startActivity(helpIntent,
+ mActivityStarter.startActivity(helpIntent,
true /* dismissShade */, resultCode -> {
mHighTempDialog = null;
});
@@ -456,7 +455,7 @@
new Intent(Intent.ACTION_VIEW)
.setData(Uri.parse(url))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- Dependency.get(ActivityStarter.class).startActivity(helpIntent,
+ mActivityStarter.startActivity(helpIntent,
true /* dismissShade */, resultCode -> {
mThermalShutdownDialog = null;
});
@@ -516,7 +515,7 @@
helpIntent.setClassName("com.android.settings",
"com.android.settings.HelpTrampoline");
helpIntent.putExtra(Intent.EXTRA_TEXT, contextString);
- Dependency.get(ActivityStarter.class).startActivity(helpIntent,
+ mActivityStarter.startActivity(helpIntent,
true /* dismissShade */, resultCode -> {
mUsbHighTempDialog = null;
});
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
index 37a0f59..642af59 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
@@ -43,7 +43,6 @@
import com.android.settingslib.fuelgauge.Estimate;
import com.android.settingslib.utils.ThreadUtils;
import com.android.systemui.CoreStartable;
-import com.android.systemui.Dependency;
import com.android.systemui.R;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.dagger.SysUISingleton;
@@ -80,13 +79,13 @@
@VisibleForTesting
final Receiver mReceiver = new Receiver();
- private PowerManager mPowerManager;
- private WarningsUI mWarnings;
+ private final PowerManager mPowerManager;
+ private final WarningsUI mWarnings;
private InattentiveSleepWarningView mOverlayView;
private final Configuration mLastConfiguration = new Configuration();
private int mPlugType = 0;
private int mInvalidCharger = 0;
- private EnhancedEstimates mEnhancedEstimates;
+ private final EnhancedEstimates mEnhancedEstimates;
private Future mLastShowWarningTask;
private boolean mEnableSkinTemperatureWarning;
private boolean mEnableUsbTemperatureAlarm;
@@ -113,18 +112,20 @@
@Inject
public PowerUI(Context context, BroadcastDispatcher broadcastDispatcher,
- CommandQueue commandQueue, Lazy<Optional<StatusBar>> statusBarOptionalLazy) {
+ CommandQueue commandQueue, Lazy<Optional<StatusBar>> statusBarOptionalLazy,
+ WarningsUI warningsUI, EnhancedEstimates enhancedEstimates,
+ PowerManager powerManager) {
super(context);
mBroadcastDispatcher = broadcastDispatcher;
mCommandQueue = commandQueue;
mStatusBarOptionalLazy = statusBarOptionalLazy;
+ mWarnings = warningsUI;
+ mEnhancedEstimates = enhancedEstimates;
+ mPowerManager = powerManager;
}
public void start() {
- mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
mScreenOffTime = mPowerManager.isScreenOn() ? -1 : SystemClock.elapsedRealtime();
- mWarnings = Dependency.get(WarningsUI.class);
- mEnhancedEstimates = Dependency.get(EnhancedEstimates.class);
mLastConfiguration.setTo(mContext.getResources().getConfiguration());
ContentObserver obs = new ContentObserver(mHandler) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java b/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java
index 1dba536..ded6ae0 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java
@@ -85,6 +85,7 @@
private final QSPanelController mQsPanelController;
private final QuickQSPanelController mQuickQSPanelController;
private final QuickStatusBarHeader mQuickStatusBarHeader;
+ private final QSFgsManagerFooter mFgsManagerFooter;
private final QSSecurityFooter mSecurityFooter;
private final QS mQs;
private final View mQSFooterActions;
@@ -151,7 +152,8 @@
public QSAnimator(QS qs, QuickQSPanel quickPanel, QuickStatusBarHeader quickStatusBarHeader,
QSPanelController qsPanelController,
QuickQSPanelController quickQSPanelController, QSTileHost qsTileHost,
- QSSecurityFooter securityFooter, @Main Executor executor, TunerService tunerService,
+ QSFgsManagerFooter fgsManagerFooter, QSSecurityFooter securityFooter,
+ @Main Executor executor, TunerService tunerService,
QSExpansionPathInterpolator qsExpansionPathInterpolator,
@Named(QS_FOOTER) FooterActionsView qsFooterActionsView,
@Named(QQS_FOOTER) FooterActionsView qqsFooterActionsView) {
@@ -162,6 +164,7 @@
mQuickStatusBarHeader = quickStatusBarHeader;
mQQSFooterActions = qqsFooterActionsView;
mQSFooterActions = qsFooterActionsView;
+ mFgsManagerFooter = fgsManagerFooter;
mSecurityFooter = securityFooter;
mHost = qsTileHost;
mExecutor = executor;
@@ -481,6 +484,7 @@
// Fade in the security footer and the divider as we reach the final position
Builder builder = new Builder().setStartDelay(EXPANDED_TILE_DELAY);
+ builder.addFloat(mFgsManagerFooter.getView(), "alpha", 0, 1);
builder.addFloat(mSecurityFooter.getView(), "alpha", 0, 1);
if (mQsPanelController.shouldUseHorizontalLayout()
&& mQsPanelController.mMediaHost.hostView != null) {
@@ -490,6 +494,7 @@
mQsPanelController.mMediaHost.hostView.setAlpha(1.0f);
}
mAllPagesDelayedAnimator = builder.build();
+ mAllViews.add(mFgsManagerFooter.getView());
mAllViews.add(mSecurityFooter.getView());
translationYBuilder.setInterpolator(mQSExpansionPathInterpolator.getYInterpolator());
qqsTranslationYBuilder.setInterpolator(mQSExpansionPathInterpolator.getYInterpolator());
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSFgsManagerFooter.java b/packages/SystemUI/src/com/android/systemui/qs/QSFgsManagerFooter.java
new file mode 100644
index 0000000..082de16
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSFgsManagerFooter.java
@@ -0,0 +1,117 @@
+/*
+ * 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.systemui.qs;
+
+import static android.provider.DeviceConfig.NAMESPACE_SYSTEMUI;
+
+import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.TASK_MANAGER_ENABLED;
+import static com.android.systemui.qs.dagger.QSFragmentModule.QS_FGS_MANAGER_FOOTER_VIEW;
+
+import android.content.Context;
+import android.provider.DeviceConfig;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.android.systemui.R;
+import com.android.systemui.dagger.qualifiers.Background;
+import com.android.systemui.dagger.qualifiers.Main;
+import com.android.systemui.fgsmanager.FgsManagerDialogFactory;
+import com.android.systemui.statusbar.policy.RunningFgsController;
+
+import java.util.concurrent.Executor;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+/**
+ * Footer entry point for the foreground service manager
+ */
+public class QSFgsManagerFooter implements View.OnClickListener {
+
+ private final View mRootView;
+ private final TextView mFooterText;
+ private final Context mContext;
+ private final Executor mMainExecutor;
+ private final Executor mExecutor;
+ private final RunningFgsController mRunningFgsController;
+ private final FgsManagerDialogFactory mFgsManagerDialogFactory;
+
+ private boolean mIsInitialized = false;
+ private boolean mIsAvailable = false;
+
+ @Inject
+ QSFgsManagerFooter(@Named(QS_FGS_MANAGER_FOOTER_VIEW) View rootView,
+ @Main Executor mainExecutor, RunningFgsController runningFgsController,
+ @Background Executor executor,
+ FgsManagerDialogFactory fgsManagerDialogFactory) {
+ mRootView = rootView;
+ mFooterText = mRootView.findViewById(R.id.footer_text);
+ ImageView icon = mRootView.findViewById(R.id.primary_footer_icon);
+ icon.setImageResource(R.drawable.ic_info_outline);
+ mContext = rootView.getContext();
+ mMainExecutor = mainExecutor;
+ mExecutor = executor;
+ mRunningFgsController = runningFgsController;
+ mFgsManagerDialogFactory = fgsManagerDialogFactory;
+ }
+
+ public void init() {
+ if (mIsInitialized) {
+ return;
+ }
+
+ mRootView.setOnClickListener(this);
+
+ mRunningFgsController.addCallback(packages -> refreshState());
+
+ DeviceConfig.addOnPropertiesChangedListener(NAMESPACE_SYSTEMUI, mExecutor,
+ (DeviceConfig.OnPropertiesChangedListener) properties -> {
+ mIsAvailable = properties.getBoolean(TASK_MANAGER_ENABLED, mIsAvailable);
+ });
+ mIsAvailable = DeviceConfig.getBoolean(NAMESPACE_SYSTEMUI, TASK_MANAGER_ENABLED, false);
+
+ mIsInitialized = true;
+ }
+
+ @Override
+ public void onClick(View view) {
+ mFgsManagerDialogFactory.create(mRootView);
+ }
+
+ public void refreshState() {
+ mExecutor.execute(this::handleRefreshState);
+ }
+
+ public View getView() {
+ return mRootView;
+ }
+
+ private boolean isAvailable() {
+ return mIsAvailable;
+ }
+
+ public void handleRefreshState() {
+ int numPackages = mRunningFgsController.getPackagesWithFgs().size();
+ mMainExecutor.execute(() -> {
+ mFooterText.setText(mContext.getResources().getQuantityString(
+ R.plurals.fgs_manager_footer_label, numPackages, numPackages));
+ mRootView.setVisibility(numPackages > 0 && isAvailable() ? View.VISIBLE : View.GONE);
+ });
+ }
+
+}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 38061a8..6b515c8 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -86,6 +86,8 @@
new ArrayList<>();
@Nullable
+ protected View mFgsManagerFooter;
+ @Nullable
protected View mSecurityFooter;
@Nullable
@@ -448,7 +450,12 @@
switchToParent(mSecurityFooter, mHeaderContainer, 0);
} else {
// Add after the footer
- int index = indexOfChild(mFooter);
+ int index;
+ if (mFgsManagerFooter != null) {
+ index = indexOfChild(mFgsManagerFooter);
+ } else {
+ index = indexOfChild(mFooter);
+ }
switchToParent(mSecurityFooter, this, index + 1);
}
}
@@ -722,6 +729,17 @@
switchSecurityFooter(shouldUseSplitNotificationShade);
}
+ /**
+ * Set the fgs manager footer view and switch it into the right place
+ * @param view the view in question
+ */
+ public void setFgsManagerFooter(View view) {
+ mFgsManagerFooter = view;
+ // Add after the footer
+ int index = indexOfChild(mFooter);
+ switchToParent(mFgsManagerFooter, this, index + 1);
+ }
+
protected void setPageMargin(int pageMargin) {
if (mTileLayout instanceof PagedTileLayout) {
((PagedTileLayout) mTileLayout).setPageMargin(pageMargin);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java
index 001c740e..cbfe944 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanelController.java
@@ -57,6 +57,7 @@
public class QSPanelController extends QSPanelControllerBase<QSPanel> {
public static final String QS_REMOVE_LABELS = "sysui_remove_labels";
+ private final QSFgsManagerFooter mQSFgsManagerFooter;
private final QSSecurityFooter mQsSecurityFooter;
private final TunerService mTunerService;
private final QSCustomizerController mQsCustomizerController;
@@ -94,7 +95,8 @@
};
@Inject
- QSPanelController(QSPanel view, QSSecurityFooter qsSecurityFooter, TunerService tunerService,
+ QSPanelController(QSPanel view, QSFgsManagerFooter qsFgsManagerFooter,
+ QSSecurityFooter qsSecurityFooter, TunerService tunerService,
QSTileHost qstileHost, QSCustomizerController qsCustomizerController,
@Named(QS_USING_MEDIA_PLAYER) boolean usingMediaPlayer,
@Named(QS_PANEL) MediaHost mediaHost,
@@ -105,6 +107,7 @@
FalsingManager falsingManager, CommandQueue commandQueue) {
super(view, qstileHost, qsCustomizerController, usingMediaPlayer, mediaHost,
metricsLogger, uiEventLogger, qsLogger, dumpManager);
+ mQSFgsManagerFooter = qsFgsManagerFooter;
mQsSecurityFooter = qsSecurityFooter;
mTunerService = tunerService;
mQsCustomizerController = qsCustomizerController;
@@ -128,6 +131,7 @@
mMediaHost.init(MediaHierarchyManager.LOCATION_QS);
mQsCustomizerController.init();
mBrightnessSliderController.init();
+ mQSFgsManagerFooter.init();
}
private void updateMediaExpansion() {
@@ -146,6 +150,7 @@
refreshAllTiles();
}
mView.addOnConfigurationChangedListener(mOnConfigurationChangedListener);
+ mView.setFgsManagerFooter(mQSFgsManagerFooter.getView());
mView.setSecurityFooter(mQsSecurityFooter.getView(), mShouldUseSplitNotificationShade);
switchTileLayout(true);
mBrightnessMirrorHandler.onQsPanelAttached();
@@ -230,6 +235,7 @@
public void refreshAllTiles() {
mBrightnessController.checkRestrictionAndSetEnabled();
super.refreshAllTiles();
+ mQSFgsManagerFooter.refreshState();
mQsSecurityFooter.refreshState();
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java b/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java
index d3bad16..90cf92a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java
@@ -181,6 +181,7 @@
}
private void clearAccessibilityState() {
+ mNeedsFocus = false;
if (mAccessibilityAction == ACTION_ADD) {
// Remove blank tile from last spot
mTiles.remove(--mEditIndex);
@@ -415,9 +416,6 @@
int oldLeft, int oldTop, int oldRight, int oldBottom) {
holder.mTileView.removeOnLayoutChangeListener(this);
holder.mTileView.requestAccessibilityFocus();
- if (mAccessibilityAction == ACTION_NONE) {
- holder.mTileView.clearAccessibilityFocus();
- }
}
});
mNeedsFocus = false;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/dagger/QSFragmentModule.java b/packages/SystemUI/src/com/android/systemui/qs/dagger/QSFragmentModule.java
index 11e5b6e..1958caf 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/dagger/QSFragmentModule.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/dagger/QSFragmentModule.java
@@ -53,6 +53,7 @@
*/
@Module
public interface QSFragmentModule {
+ String QS_FGS_MANAGER_FOOTER_VIEW = "qs_fgs_manager_footer";
String QS_SECURITY_FOOTER_VIEW = "qs_security_footer";
String QQS_FOOTER = "qqs_footer";
String QS_FOOTER = "qs_footer";
@@ -205,4 +206,15 @@
static StatusIconContainer providesStatusIconContainer(QuickStatusBarHeader qsHeader) {
return qsHeader.findViewById(R.id.statusIcons);
}
+
+ /** */
+ @Provides
+ @QSScope
+ @Named(QS_FGS_MANAGER_FOOTER_VIEW)
+ static View providesQSFgsManagerFooterView(
+ @QSThemedContext LayoutInflater layoutInflater,
+ QSPanel qsPanel
+ ) {
+ return layoutInflater.inflate(R.layout.quick_settings_security_footer, qsPanel, false);
+ }
}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java
index 5e68f61..86fc4de 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSFactoryImpl.java
@@ -39,7 +39,6 @@
import com.android.systemui.qs.tiles.DataSaverTile;
import com.android.systemui.qs.tiles.DeviceControlsTile;
import com.android.systemui.qs.tiles.DndTile;
-import com.android.systemui.qs.tiles.FgsManagerTile;
import com.android.systemui.qs.tiles.FlashlightTile;
import com.android.systemui.qs.tiles.HotspotTile;
import com.android.systemui.qs.tiles.InternetTile;
@@ -99,7 +98,6 @@
private final Provider<QuickAccessWalletTile> mQuickAccessWalletTileProvider;
private final Provider<QRCodeScannerTile> mQRCodeScannerTileProvider;
private final Provider<OneHandedModeTile> mOneHandedModeTileProvider;
- private final Provider<FgsManagerTile> mFgsManagerTileProvider;
private final Lazy<QSHost> mQsHostLazy;
private final Provider<CustomTile.Builder> mCustomTileBuilderProvider;
@@ -137,7 +135,6 @@
Provider<QuickAccessWalletTile> quickAccessWalletTileProvider,
Provider<QRCodeScannerTile> qrCodeScannerTileProvider,
Provider<OneHandedModeTile> oneHandedModeTileProvider,
- Provider<FgsManagerTile> fgsManagerTileProvider,
Provider<ColorCorrectionTile> colorCorrectionTileProvider) {
mQsHostLazy = qsHostLazy;
mCustomTileBuilderProvider = customTileBuilderProvider;
@@ -171,7 +168,6 @@
mQuickAccessWalletTileProvider = quickAccessWalletTileProvider;
mQRCodeScannerTileProvider = qrCodeScannerTileProvider;
mOneHandedModeTileProvider = oneHandedModeTileProvider;
- mFgsManagerTileProvider = fgsManagerTileProvider;
mColorCorrectionTileProvider = colorCorrectionTileProvider;
}
@@ -246,8 +242,6 @@
return mQRCodeScannerTileProvider.get();
case "onehanded":
return mOneHandedModeTileProvider.get();
- case "fgsmanager":
- return mFgsManagerTileProvider.get();
case "color_correction":
return mColorCorrectionTileProvider.get();
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt
index 7efb983..821dfa5f 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt
@@ -653,7 +653,6 @@
"qr_code_scanner" to R.array.tile_states_qr_code_scanner,
"alarm" to R.array.tile_states_alarm,
"onehanded" to R.array.tile_states_onehanded,
- "fgsmanager" to R.array.tile_states_fgsmanager,
"color_correction" to R.array.tile_states_color_correction
)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/FgsManagerTile.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/FgsManagerTile.kt
deleted file mode 100644
index 939a297..0000000
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/FgsManagerTile.kt
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.systemui.qs.tiles
-
-import android.content.Intent
-import android.os.Handler
-import android.os.Looper
-import android.provider.DeviceConfig
-import android.view.View
-import com.android.internal.config.sysui.SystemUiDeviceConfigFlags
-import com.android.internal.logging.MetricsLogger
-import com.android.systemui.DejankUtils
-import com.android.systemui.R
-import com.android.systemui.dagger.qualifiers.Background
-import com.android.systemui.dagger.qualifiers.Main
-import com.android.systemui.fgsmanager.FgsManagerDialogFactory
-import com.android.systemui.plugins.ActivityStarter
-import com.android.systemui.plugins.FalsingManager
-import com.android.systemui.plugins.qs.QSTile
-import com.android.systemui.plugins.statusbar.StatusBarStateController
-import com.android.systemui.qs.QSHost
-import com.android.systemui.qs.logging.QSLogger
-import com.android.systemui.qs.tileimpl.QSTileImpl
-import com.android.systemui.statusbar.policy.RunningFgsController
-import com.android.systemui.statusbar.policy.RunningFgsController.UserPackageTime
-import java.util.concurrent.Executor
-import javax.inject.Inject
-
-/**
- * Quicksettings tile for the foreground services manager (task manager)
- */
-class FgsManagerTile @Inject constructor(
- host: QSHost?,
- @Background backgroundLooper: Looper?,
- @Background private val backgroundExecutor: Executor?,
- @Main mainHandler: Handler?,
- falsingManager: FalsingManager?,
- metricsLogger: MetricsLogger?,
- statusBarStateController: StatusBarStateController?,
- activityStarter: ActivityStarter?,
- qsLogger: QSLogger?,
- private val fgsManagerDialogFactory: FgsManagerDialogFactory,
- private val runningFgsController: RunningFgsController
-) : QSTileImpl<QSTile.State>(host, backgroundLooper, mainHandler, falsingManager, metricsLogger,
- statusBarStateController, activityStarter, qsLogger), RunningFgsController.Callback {
-
- override fun handleInitialize() {
- super.handleInitialize()
- mUiHandler.post { runningFgsController.observe(lifecycle, this) }
- }
-
- override fun isAvailable(): Boolean {
- return DejankUtils.whitelistIpcs<Boolean> {
- DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
- SystemUiDeviceConfigFlags.TASK_MANAGER_ENABLED, false)
- }
- }
-
- override fun newTileState(): QSTile.State {
- return QSTile.State()
- }
-
- override fun handleClick(view: View?) {
- mUiHandler.post { fgsManagerDialogFactory.create(view) }
- }
-
- override fun handleUpdateState(state: QSTile.State?, arg: Any?) {
- state?.label = tileLabel
- state?.secondaryLabel = runningFgsController.getPackagesWithFgs().size.toString()
- state?.handlesLongClick = false
- state?.icon = ResourceIcon.get(R.drawable.ic_list)
- }
-
- override fun getMetricsCategory(): Int = 0
-
- override fun getLongClickIntent(): Intent? = null
-
- // Inline the string so we don't waste translator time since this isn't used in the mocks.
- // TODO If mocks change need to remember to move this to strings.xml
- override fun getTileLabel(): CharSequence = "Active apps"
-
- override fun onFgsPackagesChanged(packages: List<UserPackageTime>) = refreshState()
-}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
index d7d1de0..991a68f 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
@@ -398,6 +398,11 @@
min = mBrightnessMin;
max = mBrightnessMax;
}
+
+ // Ensure the slider is in a fixed position first, then check if we should animate.
+ if (mSliderAnimator != null && mSliderAnimator.isStarted()) {
+ mSliderAnimator.cancel();
+ }
// convertGammaToLinearFloat returns 0-1
if (BrightnessSynchronizer.floatEquals(brightnessValue,
convertGammaToLinearFloat(mControl.getValue(), min, max))) {
@@ -420,9 +425,6 @@
mControl.setValue(target);
mControlValueInitialized = true;
}
- if (mSliderAnimator != null && mSliderAnimator.isStarted()) {
- mSliderAnimator.cancel();
- }
mSliderAnimator = ValueAnimator.ofInt(mControl.getValue(), target);
mSliderAnimator.addUpdateListener((ValueAnimator animation) -> {
mExternalChange = true;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index 963a0d7..6335f88 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -151,6 +151,7 @@
private boolean mPowerPluggedIn;
private boolean mPowerPluggedInWired;
private boolean mPowerPluggedInWireless;
+ private boolean mPowerPluggedInDock;
private boolean mPowerCharged;
private boolean mBatteryOverheated;
private boolean mEnableBatteryDefender;
@@ -786,6 +787,10 @@
chargingId = hasChargingTime
? R.string.keyguard_indication_charging_time_wireless
: R.string.keyguard_plugged_in_wireless;
+ } else if (mPowerPluggedInDock) {
+ chargingId = hasChargingTime
+ ? R.string.keyguard_indication_charging_time_dock
+ : R.string.keyguard_plugged_in_dock;
} else {
chargingId = hasChargingTime
? R.string.keyguard_indication_charging_time
@@ -911,6 +916,7 @@
boolean wasPluggedIn = mPowerPluggedIn;
mPowerPluggedInWired = status.isPluggedInWired() && isChargingOrFull;
mPowerPluggedInWireless = status.isPluggedInWireless() && isChargingOrFull;
+ mPowerPluggedInDock = status.isPluggedInDock() && isChargingOrFull;
mPowerPluggedIn = status.isPluggedIn() && isChargingOrFull;
mPowerCharged = status.isCharged();
mChargingWattage = status.maxChargingWattage;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeWindowController.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeWindowController.java
index 4adf2bc..ebd610b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeWindowController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeWindowController.java
@@ -19,6 +19,7 @@
import android.graphics.Region;
import android.view.ViewGroup;
+import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.systemui.statusbar.phone.StatusBarWindowCallback;
@@ -192,6 +193,14 @@
default void setLightRevealScrimOpaque(boolean opaque) {}
/**
+ * Defer any application of window {@link WindowManager.LayoutParams} until {@code scope} is
+ * fully applied.
+ */
+ default void batchApplyWindowLayoutParams(@NonNull Runnable scope) {
+ scope.run();
+ }
+
+ /**
* Custom listener to pipe data back to plugins about whether or not the status bar would be
* collapsed if not for the plugin.
* TODO: Find cleaner way to do this.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt
index 1432f78..f6a55e6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt
@@ -21,6 +21,7 @@
import android.widget.Toast
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
+import com.android.systemui.util.Compile
import javax.inject.Inject
class NotifPipelineFlags @Inject constructor(
@@ -31,8 +32,16 @@
if (!isNewPipelineEnabled()) {
return true
}
- Log.d("NotifPipeline", "Old pipeline code running w/ new pipeline enabled", Exception())
- Toast.makeText(context, "Old pipeline code running!", Toast.LENGTH_SHORT).show()
+
+ if (Compile.IS_DEBUG) {
+ Toast.makeText(context, "Old pipeline code running!", Toast.LENGTH_SHORT).show()
+ }
+ if (featureFlags.isEnabled(Flags.NEW_PIPELINE_CRASH_ON_CALL_TO_OLD_PIPELINE)) {
+ throw RuntimeException("Old pipeline code running with new pipeline enabled")
+ } else {
+ Log.d("NotifPipeline", "Old pipeline code running with new pipeline enabled",
+ Exception())
+ }
return false
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/SectionHeaderVisibilityProvider.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/SectionHeaderVisibilityProvider.kt
index 03b978e..68bdd18 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/SectionHeaderVisibilityProvider.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/SectionHeaderVisibilityProvider.kt
@@ -16,7 +16,9 @@
package com.android.systemui.statusbar.notification
+import android.content.Context
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.R
import javax.inject.Inject
/**
@@ -29,6 +31,10 @@
* visibility when it invalidates, and we just store that state here.)
*/
@SysUISingleton
-class SectionHeaderVisibilityProvider @Inject constructor() {
+class SectionHeaderVisibilityProvider @Inject constructor(
+ context: Context
+) {
+ var neverShowSectionHeaders = context.resources.getBoolean(R.bool.config_notification_never_show_section_headers)
+ private set
var sectionHeadersVisible = true
-}
\ No newline at end of file
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.java
index 733be9c..0ce07cb 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.java
@@ -220,8 +220,10 @@
}
private void invalidateListFromFilter(String reason) {
- mSectionHeaderVisibilityProvider.setSectionHeadersVisible(
- mStatusBarStateController.getState() != StatusBarState.KEYGUARD);
+ boolean onKeyguard = mStatusBarStateController.getState() == StatusBarState.KEYGUARD;
+ boolean neverShowSections = mSectionHeaderVisibilityProvider.getNeverShowSectionHeaders();
+ boolean showSections = !onKeyguard && !neverShowSections;
+ mSectionHeaderVisibilityProvider.setSectionHeadersVisible(showSections);
mNotifFilter.invalidateList();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
index 769f689..34009f5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
@@ -162,6 +162,7 @@
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationShadeDepthController;
+import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.NotificationShelfController;
import com.android.systemui.statusbar.PulseExpansionHandler;
import com.android.systemui.statusbar.QsFrameTranslateController;
@@ -741,6 +742,7 @@
KeyguardStateController keyguardStateController,
StatusBarStateController statusBarStateController,
StatusBarWindowStateController statusBarWindowStateController,
+ NotificationShadeWindowController notificationShadeWindowController,
DozeLog dozeLog,
DozeParameters dozeParameters, CommandQueue commandQueue, VibratorHelper vibratorHelper,
LatencyTracker latencyTracker, PowerManager powerManager,
@@ -800,6 +802,7 @@
dozeLog,
keyguardStateController,
(SysuiStatusBarStateController) statusBarStateController,
+ notificationShadeWindowController,
vibratorHelper,
statusBarKeyguardViewManager,
latencyTracker,
@@ -3928,6 +3931,15 @@
mKeyguardStatusViewController.animateFoldToAod();
}
+ /**
+ * Cancels fold to AOD transition and resets view state
+ */
+ public void cancelFoldToAodAnimation() {
+ cancelAnimation();
+ resetAlpha();
+ resetTranslation();
+ }
+
/** */
public void setImportantForAccessibility(int mode) {
mView.setImportantForAccessibility(mode);
@@ -4046,6 +4058,10 @@
mView.setTranslationX(0f);
}
+ public void resetAlpha() {
+ mView.setAlpha(1f);
+ }
+
public ViewPropertyAnimator fadeOut(long startDelayMs, long durationMs, Runnable endAction) {
return mView.animate().alpha(0).setStartDelay(startDelayMs).setDuration(
durationMs).setInterpolator(Interpolators.ALPHA_OUT).withLayer().withEndAction(
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java
index c859e70..474653b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImpl.java
@@ -111,6 +111,12 @@
private final SysuiColorExtractor mColorExtractor;
private final ScreenOffAnimationController mScreenOffAnimationController;
private float mFaceAuthDisplayBrightness = LayoutParams.BRIGHTNESS_OVERRIDE_NONE;
+ /**
+ * Layout params would be aggregated and dispatched all at once if this is > 0.
+ *
+ * @see #batchApplyWindowLayoutParams(Runnable)
+ */
+ private int mDeferWindowLayoutParams;
@Inject
public NotificationShadeWindowControllerImpl(Context context, WindowManager windowManager,
@@ -437,6 +443,20 @@
}
}
+ private void applyWindowLayoutParams() {
+ if (mDeferWindowLayoutParams == 0 && mLp != null && mLp.copyFrom(mLpChanged) != 0) {
+ mWindowManager.updateViewLayout(mNotificationShadeView, mLp);
+ }
+ }
+
+ @Override
+ public void batchApplyWindowLayoutParams(Runnable scope) {
+ mDeferWindowLayoutParams++;
+ scope.run();
+ mDeferWindowLayoutParams--;
+ applyWindowLayoutParams();
+ }
+
private void apply(State state) {
applyKeyguardFlags(state);
applyFocusableFlag(state);
@@ -451,9 +471,8 @@
applyHasTopUi(state);
applyNotTouchable(state);
applyStatusBarColorSpaceAgnosticFlag(state);
- if (mLp != null && mLp.copyFrom(mLpChanged) != 0) {
- mWindowManager.updateViewLayout(mNotificationShadeView, mLp);
- }
+ applyWindowLayoutParams();
+
if (mHasTopUi != mHasTopUiChanged) {
whitelistIpcs(() -> {
try {
@@ -739,6 +758,7 @@
pw.println(TAG + ":");
pw.println(" mKeyguardMaxRefreshRate=" + mKeyguardMaxRefreshRate);
pw.println(" mKeyguardPreferredRefreshRate=" + mKeyguardPreferredRefreshRate);
+ pw.println(" mDeferWindowLayoutParams=" + mDeferWindowLayoutParams);
pw.println(mCurrentState);
if (mNotificationShadeView != null && mNotificationShadeView.getViewRootImpl() != null) {
mNotificationShadeView.getViewRootImpl().dump(" ", pw);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
index 05ac2a3..54d0b03 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
@@ -57,6 +57,7 @@
import com.android.systemui.flags.Flags;
import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
import com.android.systemui.plugins.FalsingManager;
+import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.VibratorHelper;
@@ -180,6 +181,7 @@
private boolean mExpandLatencyTracking;
private final PanelView mView;
private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
+ private final NotificationShadeWindowController mNotificationShadeWindowController;
protected final Resources mResources;
protected final KeyguardStateController mKeyguardStateController;
protected final SysuiStatusBarStateController mStatusBarStateController;
@@ -222,6 +224,7 @@
DozeLog dozeLog,
KeyguardStateController keyguardStateController,
SysuiStatusBarStateController statusBarStateController,
+ NotificationShadeWindowController notificationShadeWindowController,
VibratorHelper vibratorHelper,
StatusBarKeyguardViewManager statusBarKeyguardViewManager,
LatencyTracker latencyTracker,
@@ -263,6 +266,7 @@
mResources = mView.getResources();
mKeyguardStateController = keyguardStateController;
mStatusBarStateController = statusBarStateController;
+ mNotificationShadeWindowController = notificationShadeWindowController;
mFlingAnimationUtils = flingAnimationUtilsBuilder
.reset()
.setMaxLengthSeconds(0.6f)
@@ -760,34 +764,36 @@
if (isNaN(h)) {
Log.wtf(TAG, "ExpandedHeight set to NaN");
}
- if (mExpandLatencyTracking && h != 0f) {
- DejankUtils.postAfterTraversal(
- () -> mLatencyTracker.onActionEnd(LatencyTracker.ACTION_EXPAND_PANEL));
- mExpandLatencyTracking = false;
- }
- float maxPanelHeight = getMaxPanelHeight();
- if (mHeightAnimator == null) {
- if (mTracking) {
- float overExpansionPixels = Math.max(0, h - maxPanelHeight);
- setOverExpansionInternal(overExpansionPixels, true /* isFromGesture */);
+ mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> {
+ if (mExpandLatencyTracking && h != 0f) {
+ DejankUtils.postAfterTraversal(
+ () -> mLatencyTracker.onActionEnd(LatencyTracker.ACTION_EXPAND_PANEL));
+ mExpandLatencyTracking = false;
}
- mExpandedHeight = Math.min(h, maxPanelHeight);
- } else {
- mExpandedHeight = h;
- }
+ float maxPanelHeight = getMaxPanelHeight();
+ if (mHeightAnimator == null) {
+ if (mTracking) {
+ float overExpansionPixels = Math.max(0, h - maxPanelHeight);
+ setOverExpansionInternal(overExpansionPixels, true /* isFromGesture */);
+ }
+ mExpandedHeight = Math.min(h, maxPanelHeight);
+ } else {
+ mExpandedHeight = h;
+ }
- // If we are closing the panel and we are almost there due to a slow decelerating
- // interpolator, abort the animation.
- if (mExpandedHeight < 1f && mExpandedHeight != 0f && mClosing) {
- mExpandedHeight = 0f;
- if (mHeightAnimator != null) {
- mHeightAnimator.end();
+ // If we are closing the panel and we are almost there due to a slow decelerating
+ // interpolator, abort the animation.
+ if (mExpandedHeight < 1f && mExpandedHeight != 0f && mClosing) {
+ mExpandedHeight = 0f;
+ if (mHeightAnimator != null) {
+ mHeightAnimator.end();
+ }
}
- }
- mExpandedFraction = Math.min(1f,
- maxPanelHeight == 0 ? 0 : mExpandedHeight / maxPanelHeight);
- onHeightUpdated(mExpandedHeight);
- updatePanelExpansionAndVisibility();
+ mExpandedFraction = Math.min(1f,
+ maxPanelHeight == 0 ? 0 : mExpandedHeight / maxPanelHeight);
+ onHeightUpdated(mExpandedHeight);
+ updatePanelExpansionAndVisibility();
+ });
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index 455ffdc..80ae070 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -2998,7 +2998,7 @@
}
private void onLaunchTransitionFadingEnded() {
- mNotificationPanelViewController.setAlpha(1.0f);
+ mNotificationPanelViewController.resetAlpha();
mNotificationPanelViewController.onAffordanceLaunchEnded();
releaseGestureWakeLock();
runLaunchTransitionEndRunnable();
@@ -3029,7 +3029,7 @@
}
updateScrimController();
mPresenter.updateMediaMetaData(false, true);
- mNotificationPanelViewController.setAlpha(1);
+ mNotificationPanelViewController.resetAlpha();
mNotificationPanelViewController.fadeOut(
FADE_KEYGUARD_START_DELAY, FADE_KEYGUARD_DURATION,
this::onLaunchTransitionFadingEnded);
@@ -3130,7 +3130,7 @@
releaseGestureWakeLock();
mNotificationPanelViewController.onAffordanceLaunchEnded();
mNotificationPanelViewController.cancelAnimation();
- mNotificationPanelViewController.setAlpha(1f);
+ mNotificationPanelViewController.resetAlpha();
mNotificationPanelViewController.resetTranslation();
mNotificationPanelViewController.resetViewGroupFade();
updateDozingState();
@@ -3591,26 +3591,28 @@
public void onStartedWakingUp() {
String tag = "StatusBar#onStartedWakingUp";
DejankUtils.startDetectingBlockingIpcs(tag);
- mDeviceInteractive = true;
- mWakeUpCoordinator.setWakingUp(true);
- if (!mKeyguardBypassController.getBypassEnabled()) {
- mHeadsUpManager.releaseAllImmediately();
- }
- updateVisibleToUser();
- updateIsKeyguard();
- mDozeServiceHost.stopDozing();
- // This is intentionally below the stopDozing call above, since it avoids that we're
- // unnecessarily animating the wakeUp transition. Animations should only be enabled
- // once we fully woke up.
- updateRevealEffect(true /* wakingUp */);
- updateNotificationPanelTouchState();
+ mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> {
+ mDeviceInteractive = true;
+ mWakeUpCoordinator.setWakingUp(true);
+ if (!mKeyguardBypassController.getBypassEnabled()) {
+ mHeadsUpManager.releaseAllImmediately();
+ }
+ updateVisibleToUser();
+ updateIsKeyguard();
+ mDozeServiceHost.stopDozing();
+ // This is intentionally below the stopDozing call above, since it avoids that we're
+ // unnecessarily animating the wakeUp transition. Animations should only be enabled
+ // once we fully woke up.
+ updateRevealEffect(true /* wakingUp */);
+ updateNotificationPanelTouchState();
- // If we are waking up during the screen off animation, we should undo making the
- // expanded visible (we did that so the LightRevealScrim would be visible).
- if (mScreenOffAnimationController.shouldHideLightRevealScrimOnWakeUp()) {
- makeExpandedInvisible();
- }
+ // If we are waking up during the screen off animation, we should undo making the
+ // expanded visible (we did that so the LightRevealScrim would be visible).
+ if (mScreenOffAnimationController.shouldHideLightRevealScrimOnWakeUp()) {
+ makeExpandedInvisible();
+ }
+ });
DejankUtils.stopDetectingBlockingIpcs(tag);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java
index 59969c0..5e91a25 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java
@@ -30,6 +30,7 @@
import android.content.PermissionChecker;
import android.content.pm.PackageManager;
import android.content.pm.UserInfo;
+import android.database.ContentObserver;
import android.location.LocationManager;
import android.os.Handler;
import android.os.Looper;
@@ -43,6 +44,8 @@
import androidx.annotation.VisibleForTesting;
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
+import com.android.internal.logging.UiEvent;
+import com.android.internal.logging.UiEventLogger;
import com.android.systemui.BootCompleteCache;
import com.android.systemui.appops.AppOpItem;
import com.android.systemui.appops.AppOpsController;
@@ -53,6 +56,7 @@
import com.android.systemui.settings.UserTracker;
import com.android.systemui.util.DeviceConfigProxy;
import com.android.systemui.util.Utils;
+import com.android.systemui.util.settings.SecureSettings;
import java.util.ArrayList;
import java.util.List;
@@ -71,30 +75,48 @@
private final DeviceConfigProxy mDeviceConfigProxy;
private final BootCompleteCache mBootCompleteCache;
private final UserTracker mUserTracker;
+ private final UiEventLogger mUiEventLogger;
private final H mHandler;
private final Handler mBackgroundHandler;
private final PackageManager mPackageManager;
+ private final ContentObserver mContentObserver;
+ private final SecureSettings mSecureSettings;
private boolean mAreActiveLocationRequests;
private boolean mShouldDisplayAllAccesses;
- private boolean mShowSystemAccesses;
+ private boolean mShowSystemAccessesFlag;
+ private boolean mShowSystemAccessesSetting;
@Inject
public LocationControllerImpl(Context context, AppOpsController appOpsController,
DeviceConfigProxy deviceConfigProxy,
@Main Looper mainLooper, @Background Handler backgroundHandler,
BroadcastDispatcher broadcastDispatcher, BootCompleteCache bootCompleteCache,
- UserTracker userTracker, PackageManager packageManager) {
+ UserTracker userTracker, PackageManager packageManager, UiEventLogger uiEventLogger,
+ SecureSettings secureSettings) {
mContext = context;
mAppOpsController = appOpsController;
mDeviceConfigProxy = deviceConfigProxy;
mBootCompleteCache = bootCompleteCache;
mHandler = new H(mainLooper);
mUserTracker = userTracker;
+ mUiEventLogger = uiEventLogger;
+ mSecureSettings = secureSettings;
mBackgroundHandler = backgroundHandler;
mPackageManager = packageManager;
mShouldDisplayAllAccesses = getAllAccessesSetting();
- mShowSystemAccesses = getShowSystemSetting();
+ mShowSystemAccessesFlag = getShowSystemFlag();
+ mShowSystemAccessesSetting = getShowSystemSetting();
+ mContentObserver = new ContentObserver(mBackgroundHandler) {
+ @Override
+ public void onChange(boolean selfChange) {
+ mShowSystemAccessesSetting = getShowSystemSetting();
+ }
+ };
+
+ // Register to listen for changes in Settings.Secure settings.
+ mSecureSettings.registerContentObserver(
+ Settings.Secure.LOCATION_SHOW_SYSTEM_OPS, mContentObserver);
// Register to listen for changes in DeviceConfig settings.
mDeviceConfigProxy.addOnPropertiesChangedListener(
@@ -102,7 +124,7 @@
backgroundHandler::post,
properties -> {
mShouldDisplayAllAccesses = getAllAccessesSetting();
- mShowSystemAccesses = getShowSystemSetting();
+ mShowSystemAccessesFlag = getShowSystemSetting();
updateActiveLocationRequests();
});
@@ -191,10 +213,15 @@
SystemUiDeviceConfigFlags.PROPERTY_LOCATION_INDICATORS_SMALL_ENABLED, false);
}
- private boolean getShowSystemSetting() {
+ private boolean getShowSystemFlag() {
return mDeviceConfigProxy.getBoolean(DeviceConfig.NAMESPACE_PRIVACY,
SystemUiDeviceConfigFlags.PROPERTY_LOCATION_INDICATORS_SHOW_SYSTEM, false);
}
+
+ private boolean getShowSystemSetting() {
+ return mSecureSettings.getInt(Settings.Secure.LOCATION_SHOW_SYSTEM_OPS, 0) == 1;
+ }
+
/**
* Returns true if there currently exist active high power location requests.
*/
@@ -222,6 +249,10 @@
}
boolean hadActiveLocationRequests = mAreActiveLocationRequests;
boolean shouldDisplay = false;
+ boolean showSystem = mShowSystemAccessesFlag || mShowSystemAccessesSetting;
+ boolean systemAppOp = false;
+ boolean nonSystemAppOp = false;
+ boolean isSystemApp;
List<AppOpItem> appOpsItems = mAppOpsController.getActiveAppOps();
final List<UserInfo> profiles = mUserTracker.getUserProfiles();
@@ -229,18 +260,38 @@
for (int i = 0; i < numItems; i++) {
if (appOpsItems.get(i).getCode() == OP_FINE_LOCATION
|| appOpsItems.get(i).getCode() == OP_COARSE_LOCATION) {
- if (mShowSystemAccesses) {
- shouldDisplay = true;
+ isSystemApp = isSystemApp(profiles, appOpsItems.get(i));
+ if (isSystemApp) {
+ systemAppOp = true;
} else {
- shouldDisplay |= !isSystemApp(profiles, appOpsItems.get(i));
+ nonSystemAppOp = true;
}
+
+ shouldDisplay = showSystem || shouldDisplay || !isSystemApp;
}
}
- mAreActiveLocationRequests = areActiveHighPowerLocationRequests() || shouldDisplay;
+ boolean highPowerOp = areActiveHighPowerLocationRequests();
+ mAreActiveLocationRequests = highPowerOp || shouldDisplay;
if (mAreActiveLocationRequests != hadActiveLocationRequests) {
mHandler.sendEmptyMessage(H.MSG_LOCATION_ACTIVE_CHANGED);
}
+
+ // Log each of the types of location access that would cause the location indicator to be
+ // shown, regardless of device's setting state. This is used to understand how often a
+ // user would see the location indicator based on any settings state the device could be in.
+ if (!hadActiveLocationRequests && (highPowerOp || systemAppOp || nonSystemAppOp)) {
+ if (highPowerOp) {
+ mUiEventLogger.log(
+ LocationIndicatorEvent.LOCATION_INDICATOR_MONITOR_HIGH_POWER);
+ }
+ if (systemAppOp) {
+ mUiEventLogger.log(LocationIndicatorEvent.LOCATION_INDICATOR_SYSTEM_APP);
+ }
+ if (nonSystemAppOp) {
+ mUiEventLogger.log(LocationIndicatorEvent.LOCATION_INDICATOR_NON_SYSTEM_APP);
+ }
+ }
}
private boolean isSystemApp(List<UserInfo> profiles, AppOpItem item) {
@@ -283,6 +334,11 @@
mAreActiveLocationRequests = areActiveHighPowerLocationRequests();
if (mAreActiveLocationRequests != hadActiveLocationRequests) {
mHandler.sendEmptyMessage(H.MSG_LOCATION_ACTIVE_CHANGED);
+ if (mAreActiveLocationRequests) {
+ // Log that the indicator was shown for a high power op.
+ mUiEventLogger.log(
+ LocationIndicatorEvent.LOCATION_INDICATOR_MONITOR_HIGH_POWER);
+ }
}
}
}
@@ -341,4 +397,24 @@
cb -> cb.onLocationSettingsChanged(isEnabled));
}
}
-}
+
+ /**
+ * Enum for events which prompt the location indicator to appear.
+ */
+ enum LocationIndicatorEvent implements UiEventLogger.UiEventEnum {
+ @UiEvent(doc = "Location indicator shown for high power access")
+ LOCATION_INDICATOR_MONITOR_HIGH_POWER(935),
+ @UiEvent(doc = "Location indicator shown for system app access")
+ LOCATION_INDICATOR_SYSTEM_APP(936),
+ @UiEvent(doc = "Location indicator shown for non system app access")
+ LOCATION_INDICATOR_NON_SYSTEM_APP(937);
+
+ private final int mId;
+ LocationIndicatorEvent(int id) {
+ mId = id;
+ }
+ @Override public int getId() {
+ return mId;
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/VpnStatusObserver.kt b/packages/SystemUI/src/com/android/systemui/statusbar/tv/VpnStatusObserver.kt
index e25a105..c199744 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/VpnStatusObserver.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/VpnStatusObserver.kt
@@ -25,7 +25,6 @@
import com.android.internal.messages.nano.SystemMessageProto
import com.android.internal.net.VpnConfig
import com.android.systemui.CoreStartable
-import com.android.systemui.Dependency
import com.android.systemui.R
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.statusbar.policy.SecurityController
@@ -35,12 +34,13 @@
* Observes if a vpn connection is active and displays a notification to the user
*/
@SysUISingleton
-class VpnStatusObserver @Inject constructor(context: Context) : CoreStartable(context),
+class VpnStatusObserver @Inject constructor(
+ context: Context,
+ private val securityController: SecurityController
+) : CoreStartable(context),
SecurityController.SecurityControllerCallback {
private var vpnConnected = false
- private val securityController: SecurityController =
- Dependency.get(SecurityController::class.java)
private val notificationManager = NotificationManager.from(context)
private val notificationChannel = createNotificationChannel()
private val vpnConnectedNotificationBuilder = createVpnConnectedNotificationBuilder()
diff --git a/packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt b/packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt
index aaf35af..c481fc9 100644
--- a/packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt
+++ b/packages/SystemUI/src/com/android/systemui/unfold/FoldAodAnimationController.kt
@@ -16,8 +16,10 @@
package com.android.systemui.unfold
+import android.os.Handler
import android.os.PowerManager
import android.provider.Settings
+import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.keyguard.KeyguardViewMediator
import com.android.systemui.keyguard.WakefulnessLifecycle
import com.android.systemui.statusbar.LightRevealScrim
@@ -37,6 +39,7 @@
class FoldAodAnimationController
@Inject
constructor(
+ @Main private val handler: Handler,
private val keyguardViewMediatorLazy: Lazy<KeyguardViewMediator>,
private val wakefulnessLifecycle: WakefulnessLifecycle,
private val globalSettings: GlobalSettings
@@ -50,6 +53,14 @@
private var shouldPlayAnimation = false
private val statusListeners = arrayListOf<FoldAodAnimationStatus>()
+ private val startAnimationRunnable = Runnable {
+ statusBar.notificationPanelViewController.startFoldToAodAnimation {
+ // End action
+ isAnimationPlaying = false
+ keyguardViewMediatorLazy.get().maybeHandlePendingLock()
+ }
+ }
+
private var isAnimationPlaying = false
override fun initialize(statusBar: StatusBar, lightRevealScrim: LightRevealScrim) {
@@ -79,6 +90,11 @@
}
override fun onStartedWakingUp() {
+ if (isAnimationPlaying) {
+ handler.removeCallbacks(startAnimationRunnable)
+ statusBar.notificationPanelViewController.cancelFoldToAodAnimation();
+ }
+
shouldPlayAnimation = false
isAnimationPlaying = false
}
@@ -115,11 +131,10 @@
fun onScreenTurnedOn() {
if (shouldPlayAnimation) {
- statusBar.notificationPanelViewController.startFoldToAodAnimation {
- // End action
- isAnimationPlaying = false
- keyguardViewMediatorLazy.get().maybeHandlePendingLock()
- }
+ handler.removeCallbacks(startAnimationRunnable)
+
+ // Post starting the animation to the next frame to avoid junk due to inset changes
+ handler.post(startAnimationRunnable)
shouldPlayAnimation = false
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/util/leak/DumpTruck.java b/packages/SystemUI/src/com/android/systemui/util/leak/DumpTruck.java
index be5e0a0..089650c 100644
--- a/packages/SystemUI/src/com/android/systemui/util/leak/DumpTruck.java
+++ b/packages/SystemUI/src/com/android/systemui/util/leak/DumpTruck.java
@@ -26,8 +26,6 @@
import androidx.core.content.FileProvider;
-import com.android.systemui.Dependency;
-
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
@@ -35,7 +33,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@@ -53,12 +50,14 @@
private static final int BUFSIZ = 1024 * 1024; // 1MB
private final Context context;
+ private GarbageMonitor mGarbageMonitor;
private Uri hprofUri;
private long rss;
final StringBuilder body = new StringBuilder();
- public DumpTruck(Context context) {
+ public DumpTruck(Context context, GarbageMonitor garbageMonitor) {
this.context = context;
+ mGarbageMonitor = garbageMonitor;
}
/**
@@ -68,8 +67,6 @@
* @return this, for chaining
*/
public DumpTruck captureHeaps(List<Long> pids) {
- final GarbageMonitor gm = Dependency.get(GarbageMonitor.class);
-
final File dumpDir = new File(context.getCacheDir(), FILEPROVIDER_PATH);
dumpDir.mkdirs();
hprofUri = null;
@@ -83,16 +80,14 @@
for (Long pidL : pids) {
final int pid = pidL.intValue();
body.append(" pid ").append(pid);
- if (gm != null) {
- GarbageMonitor.ProcessMemInfo info = gm.getMemInfo(pid);
- if (info != null) {
- body.append(":")
- .append(" up=")
- .append(info.getUptime())
- .append(" rss=")
- .append(info.currentRss);
- rss = info.currentRss;
- }
+ GarbageMonitor.ProcessMemInfo info = mGarbageMonitor.getMemInfo(pid);
+ if (info != null) {
+ body.append(":")
+ .append(" up=")
+ .append(info.getUptime())
+ .append(" rss=")
+ .append(info.currentRss);
+ rss = info.currentRss;
}
if (pid == myPid) {
final String path =
diff --git a/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java b/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java
index 612b7cb..9fed158 100644
--- a/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java
+++ b/packages/SystemUI/src/com/android/systemui/util/leak/GarbageMonitor.java
@@ -150,7 +150,7 @@
mTrackedGarbage = leakDetector.getTrackedGarbage();
mLeakReporter = leakReporter;
- mDumpTruck = new DumpTruck(mContext);
+ mDumpTruck = new DumpTruck(mContext, this);
dumpManager.registerDumpable(getClass().getSimpleName(), this);
diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java b/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java
index 31b17f8..6fefce2 100644
--- a/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java
+++ b/packages/SystemUI/src/com/android/systemui/wmshell/WMShell.java
@@ -41,7 +41,6 @@
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.systemui.CoreStartable;
-import com.android.systemui.Dependency;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.WMComponent;
import com.android.systemui.dagger.qualifiers.Main;
@@ -125,6 +124,7 @@
private final SysUiState mSysUiState;
private final WakefulnessLifecycle mWakefulnessLifecycle;
private final ProtoTracer mProtoTracer;
+ private final UserInfoController mUserInfoController;
private final Executor mSysUiMainExecutor;
private boolean mIsSysUiStateValid;
@@ -153,6 +153,7 @@
SysUiState sysUiState,
ProtoTracer protoTracer,
WakefulnessLifecycle wakefulnessLifecycle,
+ UserInfoController userInfoController,
@Main Executor sysUiMainExecutor) {
super(context);
mCommandQueue = commandQueue;
@@ -171,6 +172,7 @@
mShellCommandHandler = shellCommandHandler;
mCompatUIOptional = sizeCompatUIOptional;
mDragAndDropOptional = dragAndDropOptional;
+ mUserInfoController = userInfoController;
mSysUiMainExecutor = sysUiMainExecutor;
}
@@ -231,8 +233,7 @@
});
// The media session listener needs to be re-registered when switching users
- UserInfoController userInfoController = Dependency.get(UserInfoController.class);
- userInfoController.addCallback((String name, Drawable picture, String userAccount) ->
+ mUserInfoController.addCallback((String name, Drawable picture, String userAccount) ->
pip.registerSessionListenerForCurrentUser());
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.java
index 0b399cf..ae1268d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.java
@@ -56,6 +56,7 @@
import android.widget.ScrollView;
import com.android.systemui.SysuiTestCase;
+import com.android.systemui.keyguard.WakefulnessLifecycle;
import org.junit.Before;
import org.junit.Test;
@@ -75,6 +76,7 @@
private @Mock AuthDialogCallback mCallback;
private @Mock UserManager mUserManager;
+ private @Mock WakefulnessLifecycle mWakefulnessLifecycle;
@Before
public void setup() {
@@ -263,15 +265,17 @@
componentInfo,
FingerprintSensorProperties.TYPE_REAR,
false /* resetLockoutRequiresHardwareAuthToken */));
- mAuthContainer = new TestableAuthContainer(config, fpProps, null /* faceProps */);
+ mAuthContainer = new TestableAuthContainer(config, fpProps, null /* faceProps */,
+ mWakefulnessLifecycle);
}
private class TestableAuthContainer extends AuthContainerView {
TestableAuthContainer(AuthContainerView.Config config,
@Nullable List<FingerprintSensorPropertiesInternal> fpProps,
- @Nullable List<FaceSensorPropertiesInternal> faceProps) {
+ @Nullable List<FaceSensorPropertiesInternal> faceProps,
+ WakefulnessLifecycle wakefulnessLifecycle) {
- super(config, new MockInjector(), fpProps, faceProps);
+ super(config, new MockInjector(), fpProps, faceProps, wakefulnessLifecycle);
}
@Override
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 08c7714..5d39eef 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthControllerTest.java
@@ -69,6 +69,7 @@
import com.android.internal.R;
import com.android.systemui.SysuiTestCase;
+import com.android.systemui.keyguard.WakefulnessLifecycle;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.util.concurrency.Execution;
import com.android.systemui.util.concurrency.FakeExecution;
@@ -117,6 +118,8 @@
private SidefpsController mSidefpsController;
@Mock
private DisplayManager mDisplayManager;
+ @Mock
+ private WakefulnessLifecycle mWakefulnessLifecycle;
@Captor
ArgumentCaptor<IFingerprintAuthenticatorsRegisteredCallback> mAuthenticatorsRegisteredCaptor;
@Captor
@@ -625,6 +628,34 @@
verify(mDisplayManager).unregisterDisplayListener(any());
}
+ @Test
+ public void testOnBiometricPromptShownCallback() {
+ // GIVEN a callback is registered
+ AuthController.Callback callback = mock(AuthController.Callback.class);
+ mAuthController.addCallback(callback);
+
+ // WHEN dialog is shown
+ showDialog(new int[]{1} /* sensorIds */, false /* credentialAllowed */);
+
+ // THEN callback should be received
+ verify(callback).onBiometricPromptShown();
+ }
+
+ @Test
+ public void testOnBiometricPromptDismissedCallback() {
+ // GIVEN a callback is registered
+ AuthController.Callback callback = mock(AuthController.Callback.class);
+ mAuthController.addCallback(callback);
+
+ // WHEN dialog is shown and then dismissed
+ showDialog(new int[]{1} /* sensorIds */, false /* credentialAllowed */);
+ mAuthController.onDismissed(AuthDialogCallback.DISMISSED_USER_CANCELED,
+ null /* credentialAttestation */);
+
+ // THEN callback should be received
+ verify(callback).onBiometricPromptDismissed();
+ }
+
// Helpers
private void showDialog(int[] sensorIds, boolean credentialAllowed) {
@@ -677,14 +708,15 @@
Provider<SidefpsController> sidefpsControllerFactory) {
super(context, execution, commandQueue, activityTaskManager, windowManager,
fingerprintManager, faceManager, udfpsControllerFactory,
- sidefpsControllerFactory, mDisplayManager, mHandler);
+ sidefpsControllerFactory, mDisplayManager, mWakefulnessLifecycle, mHandler);
}
@Override
protected AuthDialog buildDialog(PromptInfo promptInfo,
boolean requireConfirmation, int userId, int[] sensorIds, boolean credentialAllowed,
String opPackageName, boolean skipIntro, long operationId, long requestId,
- @BiometricManager.BiometricMultiSensorMode int multiSensorConfig) {
+ @BiometricManager.BiometricMultiSensorMode int multiSensorConfig,
+ WakefulnessLifecycle wakefulnessLifecycle) {
mLastBiometricPromptInfo = promptInfo;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/BiometricDisplayListenerTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/BiometricDisplayListenerTest.java
new file mode 100644
index 0000000..40f335d
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/BiometricDisplayListenerTest.java
@@ -0,0 +1,193 @@
+/*
+ * 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.systemui.biometrics;
+
+import static com.android.systemui.biometrics.BiometricDisplayListener.SensorType.SideFingerprint;
+import static com.android.systemui.biometrics.BiometricDisplayListener.SensorType.UnderDisplayFingerprint;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.same;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.hardware.display.DisplayManager;
+import android.os.Handler;
+import android.testing.AndroidTestingRunner;
+import android.testing.TestableLooper;
+import android.testing.TestableLooper.RunWithLooper;
+import android.view.Display;
+import android.view.Surface;
+import android.view.Surface.Rotation;
+
+import androidx.test.filters.SmallTest;
+
+import com.android.systemui.SysuiTestCase;
+
+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 kotlin.Unit;
+import kotlin.jvm.functions.Function0;
+
+@SmallTest
+@RunWith(AndroidTestingRunner.class)
+@RunWithLooper(setAsMainLooper = true)
+public class BiometricDisplayListenerTest extends SysuiTestCase {
+
+ // Dependencies
+ @Mock private DisplayManager mDisplayManager;
+ @Mock private Display mDisplay;
+ @Mock private Function0<Unit> mOnChangedCallback;
+ @Mock private UnderDisplayFingerprint mUdfpsType;
+ @Mock private SideFingerprint mSidefpsType;
+ private Handler mHandler;
+ private Context mContextSpy;
+
+ // Captors
+ @Captor private ArgumentCaptor<DisplayManager.DisplayListener> mDisplayListenerCaptor;
+
+ @Before
+ public void setUp() throws Exception {
+ MockitoAnnotations.initMocks(this);
+
+ // Set up mocks
+ mContextSpy = spy(mContext);
+ when(mContextSpy.getDisplay()).thenReturn(mDisplay);
+
+ // Create a real handler with a TestableLooper.
+ TestableLooper testableLooper = TestableLooper.get(this);
+ mHandler = new Handler(testableLooper.getLooper());
+ }
+
+ @Test
+ public void registersDisplayListener_whenEnabled() {
+ BiometricDisplayListener listener = new BiometricDisplayListener(
+ mContextSpy, mDisplayManager, mHandler, mUdfpsType, mOnChangedCallback);
+
+ listener.enable();
+ verify(mDisplayManager).registerDisplayListener(any(), same(mHandler));
+ }
+
+ @Test
+ public void unregistersDisplayListener_whenDisabled() {
+ BiometricDisplayListener listener = new BiometricDisplayListener(
+ mContextSpy, mDisplayManager, mHandler, mUdfpsType, mOnChangedCallback);
+
+ listener.enable();
+ listener.disable();
+ verify(mDisplayManager).unregisterDisplayListener(any());
+ }
+
+ @Test
+ public void detectsRotationChanges_forUdfps_relativeToRotationWhenEnabled() {
+ // Create a listener when the rotation is portrait.
+ when(mDisplay.getRotation()).thenReturn(Surface.ROTATION_0);
+ BiometricDisplayListener listener = new BiometricDisplayListener(
+ mContextSpy, mDisplayManager, mHandler, mUdfpsType, mOnChangedCallback);
+
+ // Rotate the device to landscape and then enable the listener.
+ when(mDisplay.getRotation()).thenReturn(Surface.ROTATION_90);
+ listener.enable();
+ verify(mDisplayManager).registerDisplayListener(mDisplayListenerCaptor.capture(),
+ same(mHandler));
+
+ // Rotate the device back to portrait and ensure the rotation is detected.
+ when(mDisplay.getRotation()).thenReturn(Surface.ROTATION_0);
+ mDisplayListenerCaptor.getValue().onDisplayChanged(999);
+ verify(mOnChangedCallback).invoke();
+ }
+
+ @Test
+ public void callsOnChanged_forUdfps_onlyWhenRotationChanges() {
+ final @Rotation int[] rotations =
+ new int[]{
+ Surface.ROTATION_0,
+ Surface.ROTATION_90,
+ Surface.ROTATION_180,
+ Surface.ROTATION_270
+ };
+
+ for (@Rotation int rot1 : rotations) {
+ for (@Rotation int rot2 : rotations) {
+ // Make the third rotation the same as the first one to simplify this test.
+ @Rotation int rot3 = rot1;
+
+ // Clean up prior interactions.
+ reset(mDisplayManager);
+ reset(mDisplay);
+ reset(mOnChangedCallback);
+
+ // Set up the mock for 3 invocations.
+ when(mDisplay.getRotation()).thenReturn(rot1, rot2, rot3);
+
+ BiometricDisplayListener listener = new BiometricDisplayListener(
+ mContextSpy, mDisplayManager, mHandler, mUdfpsType, mOnChangedCallback);
+ listener.enable();
+
+ // The listener should record the current rotation and register a display listener.
+ verify(mDisplay).getRotation();
+ verify(mDisplayManager)
+ .registerDisplayListener(mDisplayListenerCaptor.capture(), same(mHandler));
+
+ // Test the first rotation since the listener was enabled.
+ mDisplayListenerCaptor.getValue().onDisplayChanged(123);
+ if (rot2 != rot1) {
+ verify(mOnChangedCallback).invoke();
+ } else {
+ verify(mOnChangedCallback, never()).invoke();
+ }
+
+ // Test continued rotations.
+ mDisplayListenerCaptor.getValue().onDisplayChanged(123);
+ if (rot3 != rot2) {
+ verify(mOnChangedCallback, times(2)).invoke();
+ } else {
+ verify(mOnChangedCallback, never()).invoke();
+ }
+ }
+ }
+ }
+
+ @Test
+ public void callsOnChanged_forSideFingerprint_whenAnythingDisplayChanges() {
+ // Any rotation will do for this test, we just need to return something.
+ when(mDisplay.getRotation()).thenReturn(Surface.ROTATION_0);
+
+ BiometricDisplayListener listener = new BiometricDisplayListener(
+ mContextSpy, mDisplayManager, mHandler, mSidefpsType, mOnChangedCallback);
+ listener.enable();
+
+ // The listener should register a display listener.
+ verify(mDisplayManager)
+ .registerDisplayListener(mDisplayListenerCaptor.capture(), same(mHandler));
+
+ // mOnChangedCallback should be invoked for all calls to onDisplayChanged.
+ mDisplayListenerCaptor.getValue().onDisplayChanged(123);
+ mDisplayListenerCaptor.getValue().onDisplayChanged(123);
+ verify(mOnChangedCallback, times(2)).invoke();
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
index 9827d21..da8ab27 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
@@ -51,6 +51,7 @@
import com.android.systemui.dump.DumpManager;
import com.android.systemui.navigationbar.NavigationModeController;
import com.android.systemui.statusbar.NotificationShadeDepthController;
+import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.phone.DozeParameters;
import com.android.systemui.statusbar.phone.ScreenOffAnimationController;
@@ -68,6 +69,8 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import dagger.Lazy;
+
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
@SmallTest
@@ -94,6 +97,7 @@
private @Mock ScreenOffAnimationController mScreenOffAnimationController;
private @Mock InteractionJankMonitor mInteractionJankMonitor;
private @Mock ScreenOnCoordinator mScreenOnCoordinator;
+ private @Mock Lazy<NotificationShadeWindowController> mNotificationShadeWindowControllerLazy;
private DeviceConfigProxy mDeviceConfig = new DeviceConfigProxyFake();
private FakeExecutor mUiBgExecutor = new FakeExecutor(new FakeSystemClock());
@@ -197,7 +201,8 @@
mScreenOffAnimationController,
() -> mNotificationShadeDepthController,
mScreenOnCoordinator,
- mInteractionJankMonitor);
+ mInteractionJankMonitor,
+ mNotificationShadeWindowControllerLazy);
mViewMediator.start();
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/log/SessionTrackerTest.java b/packages/SystemUI/tests/src/com/android/systemui/log/SessionTrackerTest.java
new file mode 100644
index 0000000..b8e9cf4
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/log/SessionTrackerTest.java
@@ -0,0 +1,229 @@
+/*
+ * 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.systemui.log;
+
+import static android.app.StatusBarManager.ALL_SESSIONS;
+import static android.app.StatusBarManager.SESSION_BIOMETRIC_PROMPT;
+import static android.app.StatusBarManager.SESSION_KEYGUARD;
+
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertNull;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.os.RemoteException;
+import android.testing.AndroidTestingRunner;
+import android.testing.TestableLooper;
+
+import androidx.test.filters.SmallTest;
+
+import com.android.internal.logging.InstanceId;
+import com.android.internal.statusbar.IStatusBarService;
+import com.android.keyguard.KeyguardUpdateMonitor;
+import com.android.keyguard.KeyguardUpdateMonitorCallback;
+import com.android.systemui.SysuiTestCase;
+import com.android.systemui.biometrics.AuthController;
+import com.android.systemui.statusbar.policy.KeyguardStateController;
+
+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;
+
+@RunWith(AndroidTestingRunner.class)
+@TestableLooper.RunWithLooper
+@SmallTest
+public class SessionTrackerTest extends SysuiTestCase {
+ @Mock
+ private IStatusBarService mStatusBarService;
+ @Mock
+ private AuthController mAuthController;
+ @Mock
+ private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
+ @Mock
+ private KeyguardStateController mKeyguardStateController;
+
+ @Captor
+ ArgumentCaptor<KeyguardUpdateMonitorCallback> mKeyguardUpdateMonitorCallbackCaptor;
+ KeyguardUpdateMonitorCallback mKeyguardUpdateMonitorCallback;
+
+ @Captor
+ ArgumentCaptor<KeyguardStateController.Callback> mKeyguardStateCallbackCaptor;
+ KeyguardStateController.Callback mKeyguardStateCallback;
+
+ @Captor
+ ArgumentCaptor<AuthController.Callback> mAuthControllerCallbackCaptor;
+ AuthController.Callback mAuthControllerCallback;
+
+ private SessionTracker mSessionTracker;
+
+ @Before
+ public void setup() throws RemoteException {
+ MockitoAnnotations.initMocks(this);
+
+ mSessionTracker = new SessionTracker(
+ mContext,
+ mStatusBarService,
+ mAuthController,
+ mKeyguardUpdateMonitor,
+ mKeyguardStateController
+ );
+ }
+
+ @Test
+ public void testOnStartShowingKeyguard() throws RemoteException {
+ // GIVEN the keyguard is showing before start
+ when(mKeyguardStateController.isShowing()).thenReturn(true);
+
+ // WHEN started
+ mSessionTracker.start();
+
+ // THEN keyguard session has a session id
+ assertNotNull(mSessionTracker.getSessionId(SESSION_KEYGUARD));
+
+ // THEN send event to status bar service
+ verify(mStatusBarService).onSessionStarted(eq(SESSION_KEYGUARD), any(InstanceId.class));
+ }
+
+ @Test
+ public void testNoSessions() throws RemoteException {
+ // GIVEN no sessions
+ when(mKeyguardStateController.isShowing()).thenReturn(false);
+
+ // WHEN started
+ mSessionTracker.start();
+
+ // THEN all sessions are null
+ for (int sessionType : ALL_SESSIONS) {
+ assertNull(mSessionTracker.getSessionId(sessionType));
+ }
+ }
+
+ @Test
+ public void testBiometricPromptShowing() throws RemoteException {
+ // GIVEN session tracker started w/o any sessions
+ mSessionTracker.start();
+ captureAuthControllerCallback();
+
+ // WHEN auth controller shows the biometric prompt
+ mAuthControllerCallback.onBiometricPromptShown();
+
+ // THEN the biometric prompt session has a session id
+ assertNotNull(mSessionTracker.getSessionId(SESSION_BIOMETRIC_PROMPT));
+
+ // THEN session started event gets sent to status bar service
+ verify(mStatusBarService).onSessionStarted(
+ eq(SESSION_BIOMETRIC_PROMPT), any(InstanceId.class));
+ }
+
+ @Test
+ public void testBiometricPromptDismissed() throws RemoteException {
+ // GIVEN session tracker started w/o any sessions
+ mSessionTracker.start();
+ captureAuthControllerCallback();
+
+ // WHEN auth controller shows the biometric prompt and then hides it
+ mAuthControllerCallback.onBiometricPromptShown();
+ mAuthControllerCallback.onBiometricPromptDismissed();
+
+ // THEN the biometric prompt session no longer has a session id
+ assertNull(mSessionTracker.getSessionId(SESSION_BIOMETRIC_PROMPT));
+
+ // THEN session end event gets sent to status bar service
+ verify(mStatusBarService).onSessionEnded(
+ eq(SESSION_BIOMETRIC_PROMPT), any(InstanceId.class));
+ }
+
+ @Test
+ public void testKeyguardSessionOnDeviceStartsSleeping() throws RemoteException {
+ // GIVEN session tracker started w/o any sessions
+ mSessionTracker.start();
+ captureKeyguardUpdateMonitorCallback();
+
+ // WHEN device starts going to sleep
+ mKeyguardUpdateMonitorCallback.onStartedGoingToSleep(0);
+
+ // THEN the keyguard session has a session id
+ assertNotNull(mSessionTracker.getSessionId(SESSION_KEYGUARD));
+
+ // THEN session start event gets sent to status bar service
+ verify(mStatusBarService).onSessionStarted(
+ eq(SESSION_KEYGUARD), any(InstanceId.class));
+ }
+
+ @Test
+ public void testKeyguardSessionOnKeyguardShowingChange() throws RemoteException {
+ // GIVEN session tracker started w/o any sessions
+ mSessionTracker.start();
+ captureKeyguardStateControllerCallback();
+
+ // WHEN keyguard becomes visible (ie: from lockdown)
+ when(mKeyguardStateController.isShowing()).thenReturn(true);
+ mKeyguardStateCallback.onKeyguardShowingChanged();
+
+ // THEN the keyguard session has a session id
+ assertNotNull(mSessionTracker.getSessionId(SESSION_KEYGUARD));
+
+ // THEN session start event gets sent to status bar service
+ verify(mStatusBarService).onSessionStarted(
+ eq(SESSION_KEYGUARD), any(InstanceId.class));
+ }
+
+ @Test
+ public void testKeyguardSessionOnKeyguardNotShowing() throws RemoteException {
+ // GIVEN session tracker started w/o any sessions
+ mSessionTracker.start();
+ captureKeyguardStateControllerCallback();
+
+ // WHEN keyguard was showing and now it's not
+ when(mKeyguardStateController.isShowing()).thenReturn(true);
+ mKeyguardStateCallback.onKeyguardShowingChanged();
+ when(mKeyguardStateController.isShowing()).thenReturn(false);
+ mKeyguardStateCallback.onKeyguardShowingChanged();
+
+ // THEN the keyguard session no longer has a session id
+ assertNull(mSessionTracker.getSessionId(SESSION_KEYGUARD));
+
+ // THEN session end event gets sent to status bar service
+ verify(mStatusBarService).onSessionEnded(
+ eq(SESSION_KEYGUARD), any(InstanceId.class));
+ }
+
+ void captureKeyguardUpdateMonitorCallback() {
+ verify(mKeyguardUpdateMonitor).registerCallback(
+ mKeyguardUpdateMonitorCallbackCaptor.capture());
+ mKeyguardUpdateMonitorCallback = mKeyguardUpdateMonitorCallbackCaptor.getValue();
+ }
+
+ void captureKeyguardStateControllerCallback() {
+ verify(mKeyguardStateController).addCallback(
+ mKeyguardStateCallbackCaptor.capture());
+ mKeyguardStateCallback = mKeyguardStateCallbackCaptor.getValue();
+ }
+
+ void captureAuthControllerCallback() {
+ verify(mAuthController).addCallback(
+ mAuthControllerCallbackCaptor.capture());
+ mAuthControllerCallback = mAuthControllerCallbackCaptor.getValue();
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputAdapterTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputAdapterTest.java
index 89c0712..421ae03 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputAdapterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputAdapterTest.java
@@ -100,7 +100,7 @@
public void getItemCount_zeroMode_containExtraOneForPairNew() {
when(mMediaOutputController.isZeroMode()).thenReturn(true);
- assertThat(mMediaOutputAdapter.getItemCount()).isEqualTo(mMediaDevices.size());
+ assertThat(mMediaOutputAdapter.getItemCount()).isEqualTo(mMediaDevices.size() + 1);
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java b/packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java
index e73e5ff..721809c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/power/PowerUITest.java
@@ -28,7 +28,6 @@
import static org.mockito.Mockito.when;
import android.content.BroadcastReceiver;
-import android.content.Context;
import android.content.IntentFilter;
import android.os.BatteryManager;
import android.os.Handler;
@@ -81,9 +80,9 @@
private static final int OLD_BATTERY_LEVEL_10 = 10;
private static final long VERY_BELOW_SEVERE_HYBRID_THRESHOLD = TimeUnit.MINUTES.toMillis(15);
public static final int BATTERY_LEVEL_10 = 10;
- private WarningsUI mMockWarnings;
+ @Mock private WarningsUI mMockWarnings;
private PowerUI mPowerUI;
- private EnhancedEstimates mEnhancedEstimates;
+ @Mock private EnhancedEstimates mEnhancedEstimates;
@Mock private PowerManager mPowerManager;
@Mock private IThermalService mThermalServiceMock;
private IThermalEventListener mUsbThermalEventListener;
@@ -96,13 +95,9 @@
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
- mMockWarnings = mDependency.injectMockDependency(WarningsUI.class);
- mEnhancedEstimates = mDependency.injectMockDependency(EnhancedEstimates.class);
when(mStatusBarOptionalLazy.get()).thenReturn(Optional.of(mStatusBar));
- mContext.addMockSystemService(Context.POWER_SERVICE, mPowerManager);
-
createPowerUi();
mSkinThermalEventListener = mPowerUI.new SkinThermalEventListener();
mUsbThermalEventListener = mPowerUI.new UsbThermalEventListener();
@@ -690,7 +685,8 @@
private void createPowerUi() {
mPowerUI = new PowerUI(
- mContext, mBroadcastDispatcher, mCommandQueue, mStatusBarOptionalLazy);
+ mContext, mBroadcastDispatcher, mCommandQueue, mStatusBarOptionalLazy,
+ mMockWarnings, mEnhancedEstimates, mPowerManager);
mPowerUI.mThermalService = mThermalServiceMock;
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerTest.java
index 3242adb..b5ce706 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSPanelControllerTest.java
@@ -80,6 +80,8 @@
@Mock
private TunerService mTunerService;
@Mock
+ private QSFgsManagerFooter mQSFgsManagerFooter;
+ @Mock
private QSSecurityFooter mQSSecurityFooter;
@Mock
private QSLogger mQSLogger;
@@ -127,8 +129,8 @@
.thenReturn(mQSTileRevealController);
when(mMediaHost.getDisappearParameters()).thenReturn(new DisappearParameters());
- mController = new QSPanelController(mQSPanel, mQSSecurityFooter, mTunerService,
- mQSTileHost, mQSCustomizerController, true, mMediaHost,
+ mController = new QSPanelController(mQSPanel, mQSFgsManagerFooter, mQSSecurityFooter,
+ mTunerService, mQSTileHost, mQSCustomizerController, true, mMediaHost,
mQSTileRevealControllerFactory, mDumpManager, mMetricsLogger, mUiEventLogger,
mQSLogger, mBrightnessControllerFactory, mToggleSliderViewControllerFactory,
mFalsingManager, mCommandQueue
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSFactoryImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSFactoryImplTest.kt
index 968b12a..88b133e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSFactoryImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tileimpl/QSFactoryImplTest.kt
@@ -34,7 +34,6 @@
import com.android.systemui.qs.tiles.DataSaverTile
import com.android.systemui.qs.tiles.DeviceControlsTile
import com.android.systemui.qs.tiles.DndTile
-import com.android.systemui.qs.tiles.FgsManagerTile
import com.android.systemui.qs.tiles.FlashlightTile
import com.android.systemui.qs.tiles.HotspotTile
import com.android.systemui.qs.tiles.InternetTile
@@ -92,7 +91,6 @@
"wallet" to QuickAccessWalletTile::class.java,
"qr_code_scanner" to QRCodeScannerTile::class.java,
"onehanded" to OneHandedModeTile::class.java,
- "fgsmanager" to FgsManagerTile::class.java,
"color_correction" to ColorCorrectionTile::class.java
)
@@ -133,7 +131,6 @@
@Mock private lateinit var quickAccessWalletTile: QuickAccessWalletTile
@Mock private lateinit var qrCodeScannerTile: QRCodeScannerTile
@Mock private lateinit var oneHandedModeTile: OneHandedModeTile
- @Mock private lateinit var fgsManagerTile: FgsManagerTile
@Mock private lateinit var colorCorrectionTile: ColorCorrectionTile
private lateinit var factory: QSFactoryImpl
@@ -178,7 +175,6 @@
{ quickAccessWalletTile },
{ qrCodeScannerTile },
{ oneHandedModeTile },
- { fgsManagerTile },
{ colorCorrectionTile }
)
// When adding/removing tiles, fix also [specMap]
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java
index 1c8b35a..dee88db 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java
@@ -23,7 +23,6 @@
import static com.android.systemui.statusbar.StatusBarState.KEYGUARD;
import static com.android.systemui.statusbar.StatusBarState.SHADE;
import static com.android.systemui.statusbar.StatusBarState.SHADE_LOCKED;
-import static com.android.systemui.statusbar.notification.ViewGroupFadeHelper.reset;
import static com.google.common.truth.Truth.assertThat;
@@ -38,6 +37,7 @@
import static org.mockito.Mockito.doAnswer;
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.when;
@@ -120,6 +120,7 @@
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationShadeDepthController;
+import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.NotificationShelfController;
import com.android.systemui.statusbar.PulseExpansionHandler;
import com.android.systemui.statusbar.QsFrameTranslateController;
@@ -365,6 +366,8 @@
private StatusBarWindowStateController mStatusBarWindowStateController;
@Mock
private KeyguardUnlockAnimationController mKeyguardUnlockAnimationController;
+ @Mock
+ private NotificationShadeWindowController mNotificationShadeWindowController;
private Optional<SysUIUnfoldComponent> mSysUIUnfoldComponent = Optional.empty();
private SysuiStatusBarStateController mStatusBarStateController;
private NotificationPanelViewController mNotificationPanelViewController;
@@ -490,7 +493,10 @@
.thenReturn(true);
when(mInteractionJankMonitor.end(anyInt()))
.thenReturn(true);
- reset(mView);
+ doAnswer(invocation -> {
+ ((Runnable) invocation.getArgument(0)).run();
+ return null;
+ }).when(mNotificationShadeWindowController).batchApplyWindowLayoutParams(any());
mMainHandler = new Handler(Looper.getMainLooper());
@@ -505,6 +511,7 @@
mCommunalStateController, mKeyguardStateController,
mStatusBarStateController,
mStatusBarWindowStateController,
+ mNotificationShadeWindowController,
mDozeLog, mDozeParameters, mCommandQueue, mVibratorHelper,
mLatencyTracker, mPowerManager, mAccessibilityManager, 0, mUpdateMonitor,
mCommunalSourceMonitor, mMetricsLogger, mActivityManager, mConfigurationController,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImplTest.java
index a5651f3..671ab59 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationShadeWindowControllerImplTest.java
@@ -26,6 +26,7 @@
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.clearInvocations;
+import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -225,4 +226,17 @@
assertThat((mLayoutParameters.getValue().flags & FLAG_NOT_FOCUSABLE) != 0).isTrue();
assertThat((mLayoutParameters.getValue().flags & FLAG_ALT_FOCUSABLE_IM) == 0).isTrue();
}
+
+ @Test
+ public void batchApplyWindowLayoutParams_doesNotDispatchEvents() {
+ mNotificationShadeWindowController.setForceDozeBrightness(true);
+ verify(mWindowManager).updateViewLayout(any(), any());
+
+ clearInvocations(mWindowManager);
+ mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> {
+ mNotificationShadeWindowController.setForceDozeBrightness(false);
+ verify(mWindowManager, never()).updateViewLayout(any(), any());
+ });
+ verify(mWindowManager).updateViewLayout(any(), any());
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
index f4f5bfa..b7c00fe 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
@@ -367,6 +367,10 @@
when(mStatusBarComponentFactory.create()).thenReturn(mStatusBarComponent);
when(mStatusBarComponent.getNotificationShadeWindowViewController()).thenReturn(
mNotificationShadeWindowViewController);
+ doAnswer(invocation -> {
+ ((Runnable) invocation.getArgument(0)).run();
+ return null;
+ }).when(mNotificationShadeWindowController).batchApplyWindowLayoutParams(any());
mShadeController = new ShadeControllerImpl(mCommandQueue,
mStatusBarStateController, mNotificationShadeWindowController,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/LocationControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/LocationControllerImplTest.java
index 2126dda..f5554c5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/LocationControllerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/LocationControllerImplTest.java
@@ -14,6 +14,8 @@
package com.android.systemui.statusbar.policy;
+import static com.google.common.truth.Truth.assertThat;
+
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
@@ -27,6 +29,7 @@
import android.os.Handler;
import android.os.UserHandle;
import android.provider.DeviceConfig;
+import android.provider.Settings;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
@@ -34,6 +37,7 @@
import androidx.test.filters.SmallTest;
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
+import com.android.internal.logging.testing.UiEventLoggerFake;
import com.android.systemui.BootCompleteCache;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.appops.AppOpItem;
@@ -43,6 +47,7 @@
import com.android.systemui.statusbar.policy.LocationController.LocationChangeCallback;
import com.android.systemui.util.DeviceConfigProxy;
import com.android.systemui.util.DeviceConfigProxyFake;
+import com.android.systemui.util.settings.SecureSettings;
import com.google.common.collect.ImmutableList;
@@ -60,9 +65,11 @@
private LocationControllerImpl mLocationController;
private TestableLooper mTestableLooper;
private DeviceConfigProxy mDeviceConfigProxy;
+ private UiEventLoggerFake mUiEventLogger;
@Mock private AppOpsController mAppOpsController;
@Mock private UserTracker mUserTracker;
+ @Mock private SecureSettings mSecureSettings;
@Before
public void setup() {
@@ -72,6 +79,7 @@
when(mUserTracker.getUserProfiles())
.thenReturn(ImmutableList.of(new UserInfo(0, "name", 0)));
mDeviceConfigProxy = new DeviceConfigProxyFake();
+ mUiEventLogger = new UiEventLoggerFake();
mTestableLooper = TestableLooper.get(this);
mLocationController = new LocationControllerImpl(mContext,
@@ -82,7 +90,9 @@
mock(BroadcastDispatcher.class),
mock(BootCompleteCache.class),
mUserTracker,
- mContext.getPackageManager());
+ mContext.getPackageManager(),
+ mUiEventLogger,
+ mSecureSettings);
mTestableLooper.processAllMessages();
}
@@ -160,6 +170,10 @@
mTestableLooper.processAllMessages();
verify(callback, times(1)).onLocationActiveChanged(anyBoolean());
+ assertThat(mUiEventLogger.numLogs()).isEqualTo(1);
+ assertThat(mUiEventLogger.eventId(0)).isEqualTo(
+ LocationControllerImpl.LocationIndicatorEvent.LOCATION_INDICATOR_MONITOR_HIGH_POWER
+ .getId());
}
@Test
@@ -194,7 +208,7 @@
}
@Test
- public void testCallbackNotified_additionalOps_shouldShowSystem() {
+ public void testCallbackNotified_additionalOps_shouldNotShowSystem() {
LocationChangeCallback callback = mock(LocationChangeCallback.class);
mLocationController.addCallback(callback);
mDeviceConfigProxy.setProperty(
@@ -219,7 +233,9 @@
@Test
- public void testCallbackNotified_additionalOps_shouldNotShowSystem() {
+ public void testCallbackNotified_additionalOps_shouldShowSystem() {
+ when(mSecureSettings.getInt(Settings.Secure.LOCATION_SHOW_SYSTEM_OPS, 0))
+ .thenReturn(1);
LocationChangeCallback callback = mock(LocationChangeCallback.class);
mLocationController.addCallback(callback);
mDeviceConfigProxy.setProperty(
@@ -251,6 +267,66 @@
mTestableLooper.processAllMessages();
verify(callback, times(1)).onLocationActiveChanged(false);
+
+ when(mSecureSettings.getInt(Settings.Secure.LOCATION_SHOW_SYSTEM_OPS, 0))
+ .thenReturn(0);
+ mLocationController.onActiveStateChanged(AppOpsManager.OP_FINE_LOCATION, 0,
+ "com.google.android.gms", true);
+
+ mTestableLooper.processAllMessages();
+
+ // onLocationActive(true) was not called again because the setting is disabled.
+ verify(callback, times(1)).onLocationActiveChanged(true);
+ }
+
+ @Test
+ public void testCallbackNotified_verifyMetrics() {
+ LocationChangeCallback callback = mock(LocationChangeCallback.class);
+ mLocationController.addCallback(callback);
+ mDeviceConfigProxy.setProperty(
+ DeviceConfig.NAMESPACE_PRIVACY,
+ SystemUiDeviceConfigFlags.PROPERTY_LOCATION_INDICATORS_SMALL_ENABLED,
+ "true",
+ true);
+ mTestableLooper.processAllMessages();
+
+ when(mAppOpsController.getActiveAppOps())
+ .thenReturn(ImmutableList.of(
+ new AppOpItem(AppOpsManager.OP_FINE_LOCATION, 0, "com.google.android.gms",
+ System.currentTimeMillis()),
+ new AppOpItem(AppOpsManager.OP_COARSE_LOCATION, 0,
+ "com.google.android.googlequicksearchbox",
+ System.currentTimeMillis()),
+ new AppOpItem(AppOpsManager.OP_MONITOR_HIGH_POWER_LOCATION, 0,
+ "com.google.android.apps.maps",
+ System.currentTimeMillis())));
+ mLocationController.onActiveStateChanged(AppOpsManager.OP_FINE_LOCATION, 0,
+ "com.google.android.gms", true);
+
+ mTestableLooper.processAllMessages();
+
+ verify(callback, times(1)).onLocationActiveChanged(true);
+ assertThat(mUiEventLogger.numLogs()).isEqualTo(3);
+ assertThat(mUiEventLogger.eventId(0)).isEqualTo(
+ LocationControllerImpl.LocationIndicatorEvent.LOCATION_INDICATOR_MONITOR_HIGH_POWER
+ .getId());
+ // Even though the system access wasn't shown due to the device settings, ensure it was
+ // still logged.
+ assertThat(mUiEventLogger.eventId(1)).isEqualTo(
+ LocationControllerImpl.LocationIndicatorEvent.LOCATION_INDICATOR_SYSTEM_APP
+ .getId());
+ assertThat(mUiEventLogger.eventId(2)).isEqualTo(
+ LocationControllerImpl.LocationIndicatorEvent.LOCATION_INDICATOR_NON_SYSTEM_APP
+ .getId());
+ mUiEventLogger.getLogs().clear();
+
+ when(mAppOpsController.getActiveAppOps()).thenReturn(ImmutableList.of());
+ mLocationController.onActiveStateChanged(AppOpsManager.OP_FINE_LOCATION, 0,
+ "com.google.android.gms", false);
+ mTestableLooper.processAllMessages();
+
+ verify(callback, times(1)).onLocationActiveChanged(false);
+ assertThat(mUiEventLogger.numLogs()).isEqualTo(0);
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/WMShellTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/WMShellTest.java
index 2f2e536..6593823 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/WMShellTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/WMShellTest.java
@@ -32,6 +32,7 @@
import com.android.systemui.navigationbar.NavigationModeController;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.policy.ConfigurationController;
+import com.android.systemui.statusbar.policy.UserInfoController;
import com.android.systemui.tracing.ProtoTracer;
import com.android.wm.shell.ShellCommandHandler;
import com.android.wm.shell.common.ShellExecutor;
@@ -79,6 +80,7 @@
@Mock ProtoTracer mProtoTracer;
@Mock ShellCommandHandler mShellCommandHandler;
@Mock CompatUI mCompatUI;
+ @Mock UserInfoController mUserInfoController;
@Mock ShellExecutor mSysUiMainExecutor;
@Mock DragAndDrop mDragAndDrop;
@@ -92,7 +94,7 @@
Optional.of(mDragAndDrop),
mCommandQueue, mConfigurationController, mKeyguardUpdateMonitor,
mNavigationModeController, mScreenLifecycle, mSysUiState, mProtoTracer,
- mWakefulnessLifecycle, mSysUiMainExecutor);
+ mWakefulnessLifecycle, mUserInfoController, mSysUiMainExecutor);
}
@Test
diff --git a/proto/src/system_messages.proto b/proto/src/system_messages.proto
index 196c6aa..e89dda9 100644
--- a/proto/src/system_messages.proto
+++ b/proto/src/system_messages.proto
@@ -362,5 +362,11 @@
// Notify the user that some accessibility service has view and control permissions.
// package: android
NOTE_A11Y_VIEW_AND_CONTROL_ACCESS = 1005;
+
+ // Notify the user an abusive background app has been detected.
+ // Package: android
+ // Note: this is a base ID, multiple notifications will be posted for each
+ // abusive apps, with notification ID based off this ID.
+ NOTE_ABUSIVE_BG_APPS_BASE = 0xc1b2508; // 203105544
}
}
diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
index 78d9095..2168fb1 100644
--- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
+++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
@@ -89,6 +89,7 @@
import android.util.AtomicFile;
import android.util.AttributeSet;
import android.util.IntArray;
+import android.util.Log;
import android.util.LongSparseArray;
import android.util.Pair;
import android.util.Slog;
@@ -1935,6 +1936,14 @@
private void scheduleNotifyUpdateAppWidgetLocked(Widget widget, RemoteViews updateViews) {
long requestId = UPDATE_COUNTER.incrementAndGet();
if (widget != null) {
+ if (widget.trackingUpdate) {
+ // This is the first update, end the trace
+ widget.trackingUpdate = false;
+ Log.i(TAG, "Widget update received " + widget.toString());
+ Trace.asyncTraceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER,
+ "appwidget update-intent " + widget.provider.id.toString(),
+ widget.appWidgetId);
+ }
widget.updateSequenceNos.put(ID_VIEWS_UPDATE, requestId);
}
if (widget == null || widget.provider == null || widget.provider.zombie
@@ -2011,6 +2020,15 @@
private void scheduleNotifyAppWidgetRemovedLocked(Widget widget) {
long requestId = UPDATE_COUNTER.incrementAndGet();
if (widget != null) {
+ if (widget.trackingUpdate) {
+ // Widget is being removed without any update, end the trace
+ widget.trackingUpdate = false;
+ Log.i(TAG, "Widget removed " + widget.toString());
+ Trace.asyncTraceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER,
+ "appwidget update-intent " + widget.provider.id.toString(),
+ widget.appWidgetId);
+ }
+
widget.updateSequenceNos.clear();
}
if (widget == null || widget.provider == null || widget.provider.zombie
@@ -2724,6 +2742,13 @@
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER,
"appwidget init " + provider.id.componentName.getPackageName());
sendEnableIntentLocked(provider);
+ provider.widgets.forEach(widget -> {
+ widget.trackingUpdate = true;
+ Trace.asyncTraceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER,
+ "appwidget update-intent " + provider.id.toString(),
+ widget.appWidgetId);
+ Log.i(TAG, "Widget update scheduled on unlock " + widget.toString());
+ });
int[] appWidgetIds = getWidgetIds(provider.widgets);
sendUpdateIntentLocked(provider, appWidgetIds);
registerForBroadcastsLocked(provider, appWidgetIds);
@@ -4249,6 +4274,7 @@
Host host;
// Map of request type to updateSequenceNo.
SparseLongArray updateSequenceNos = new SparseLongArray(2);
+ boolean trackingUpdate = false;
@Override
public String toString() {
diff --git a/services/autofill/java/com/android/server/autofill/ui/FillUi.java b/services/autofill/java/com/android/server/autofill/ui/FillUi.java
index 27ea3d6..8fbdd81 100644
--- a/services/autofill/java/com/android/server/autofill/ui/FillUi.java
+++ b/services/autofill/java/com/android/server/autofill/ui/FillUi.java
@@ -32,6 +32,7 @@
import android.service.autofill.Dataset.DatasetFieldFilter;
import android.service.autofill.FillResponse;
import android.text.TextUtils;
+import android.util.PluralsMessageFormatter;
import android.util.Slog;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
@@ -63,7 +64,9 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Objects;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@@ -898,8 +901,11 @@
if (count <= 0) {
text = mContext.getString(R.string.autofill_picker_no_suggestions);
} else {
- text = mContext.getResources().getQuantityString(
- R.plurals.autofill_picker_some_suggestions, count, count);
+ Map<String, Object> arguments = new HashMap<>();
+ arguments.put("count", count);
+ text = PluralsMessageFormatter.format(mContext.getResources(),
+ arguments,
+ R.string.autofill_picker_some_suggestions);
}
mListView.announceForAccessibility(text);
}
diff --git a/services/companion/java/com/android/server/companion/PermissionsUtils.java b/services/companion/java/com/android/server/companion/PermissionsUtils.java
index b981ff1..7ebe33e 100644
--- a/services/companion/java/com/android/server/companion/PermissionsUtils.java
+++ b/services/companion/java/com/android/server/companion/PermissionsUtils.java
@@ -22,6 +22,7 @@
import static android.app.AppOpsManager.MODE_ALLOWED;
import static android.companion.AssociationRequest.DEVICE_PROFILE_APP_STREAMING;
import static android.companion.AssociationRequest.DEVICE_PROFILE_AUTOMOTIVE_PROJECTION;
+import static android.companion.AssociationRequest.DEVICE_PROFILE_COMPUTER;
import static android.companion.AssociationRequest.DEVICE_PROFILE_WATCH;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.os.Binder.getCallingPid;
@@ -62,6 +63,7 @@
Manifest.permission.REQUEST_COMPANION_PROFILE_APP_STREAMING);
map.put(DEVICE_PROFILE_AUTOMOTIVE_PROJECTION,
Manifest.permission.REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION);
+ map.put(DEVICE_PROFILE_COMPUTER, Manifest.permission.REQUEST_COMPANION_PROFILE_COMPUTER);
DEVICE_PROFILE_TO_PERMISSION = unmodifiableMap(map);
}
diff --git a/services/core/java/android/os/BatteryStatsInternal.java b/services/core/java/android/os/BatteryStatsInternal.java
index e996eb4..d49cc11 100644
--- a/services/core/java/android/os/BatteryStatsInternal.java
+++ b/services/core/java/android/os/BatteryStatsInternal.java
@@ -20,6 +20,7 @@
import com.android.internal.os.SystemServerCpuThreadReader.SystemServiceCpuThreadTimes;
import java.util.Collection;
+import java.util.List;
/**
* Battery stats local system service interface. This is used to pass internal data out of
@@ -42,6 +43,17 @@
public abstract SystemServiceCpuThreadTimes getSystemServiceCpuThreadTimes();
/**
+ * Returns BatteryUsageStats, which contains power attribution data on a per-subsystem
+ * and per-UID basis.
+ *
+ * <p>
+ * Note: This is a slow running method and should be called from non-blocking threads only.
+ * </p>
+ */
+ public abstract List<BatteryUsageStats> getBatteryUsageStats(
+ List<BatteryUsageStatsQuery> queries);
+
+ /**
* Inform battery stats how many deferred jobs existed when the app got launched and how
* long ago was the last job execution for the app.
* @param uid the uid of the app.
diff --git a/services/core/java/com/android/server/BatteryService.java b/services/core/java/com/android/server/BatteryService.java
index 5d48d78..2f8dea7 100644
--- a/services/core/java/com/android/server/BatteryService.java
+++ b/services/core/java/com/android/server/BatteryService.java
@@ -323,13 +323,20 @@
if (mHealthInfo.batteryStatus == BatteryManager.BATTERY_STATUS_UNKNOWN) {
return true;
}
- if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_AC) != 0 && mHealthInfo.chargerAcOnline) {
+ if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_AC) != 0
+ && mHealthInfo.chargerAcOnline) {
return true;
}
- if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_USB) != 0 && mHealthInfo.chargerUsbOnline) {
+ if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_USB) != 0
+ && mHealthInfo.chargerUsbOnline) {
return true;
}
- if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_WIRELESS) != 0 && mHealthInfo.chargerWirelessOnline) {
+ if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_WIRELESS) != 0
+ && mHealthInfo.chargerWirelessOnline) {
+ return true;
+ }
+ if ((plugTypeSet & BatteryManager.BATTERY_PLUGGED_DOCK) != 0
+ && mHealthInfo.chargerDockOnline) {
return true;
}
return false;
@@ -442,6 +449,8 @@
return BatteryManager.BATTERY_PLUGGED_USB;
} else if (healthInfo.chargerWirelessOnline) {
return BatteryManager.BATTERY_PLUGGED_WIRELESS;
+ } else if (healthInfo.chargerDockOnline) {
+ return BatteryManager.BATTERY_PLUGGED_DOCK;
} else {
return BATTERY_PLUGGED_NONE;
}
@@ -1118,6 +1127,8 @@
batteryPluggedValue = OsProtoEnums.BATTERY_PLUGGED_USB;
} else if (mHealthInfo.chargerWirelessOnline) {
batteryPluggedValue = OsProtoEnums.BATTERY_PLUGGED_WIRELESS;
+ } else if (mHealthInfo.chargerDockOnline) {
+ batteryPluggedValue = OsProtoEnums.BATTERY_PLUGGED_DOCK;
}
proto.write(BatteryServiceDumpProto.PLUGGED, batteryPluggedValue);
proto.write(
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index 8551d88..39ac5ef 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -34,10 +34,6 @@
import static android.net.NetworkPolicyManager.FIREWALL_CHAIN_NAME_RESTRICTED;
import static android.net.NetworkPolicyManager.FIREWALL_CHAIN_NAME_STANDBY;
import static android.net.NetworkPolicyManager.FIREWALL_RULE_DEFAULT;
-import static android.net.NetworkStats.SET_DEFAULT;
-import static android.net.NetworkStats.STATS_PER_UID;
-import static android.net.NetworkStats.TAG_NONE;
-import static android.net.TrafficStats.UID_TETHERING;
import static com.android.net.module.util.NetworkStatsUtils.LIMIT_GLOBAL_ALERT;
@@ -58,7 +54,6 @@
import android.net.NetworkStack;
import android.net.NetworkStats;
import android.net.RouteInfo;
-import android.net.TetherStatsParcel;
import android.net.UidRangeParcel;
import android.net.util.NetdService;
import android.os.BatteryStats;
@@ -1286,40 +1281,9 @@
private class NetdTetheringStatsProvider extends ITetheringStatsProvider.Stub {
@Override
public NetworkStats getTetherStats(int how) {
- // We only need to return per-UID stats. Per-device stats are already counted by
- // interface counters.
- if (how != STATS_PER_UID) {
- return new NetworkStats(SystemClock.elapsedRealtime(), 0);
- }
-
- final TetherStatsParcel[] tetherStatsVec;
- try {
- tetherStatsVec = mNetdService.tetherGetStats();
- } catch (RemoteException | ServiceSpecificException e) {
- throw new IllegalStateException("problem parsing tethering stats: ", e);
- }
-
- final NetworkStats stats = new NetworkStats(SystemClock.elapsedRealtime(),
- tetherStatsVec.length);
- final NetworkStats.Entry entry = new NetworkStats.Entry();
-
- for (TetherStatsParcel tetherStats : tetherStatsVec) {
- try {
- entry.iface = tetherStats.iface;
- entry.uid = UID_TETHERING;
- entry.set = SET_DEFAULT;
- entry.tag = TAG_NONE;
- entry.rxBytes = tetherStats.rxBytes;
- entry.rxPackets = tetherStats.rxPackets;
- entry.txBytes = tetherStats.txBytes;
- entry.txPackets = tetherStats.txPackets;
- stats.combineValues(entry);
- } catch (ArrayIndexOutOfBoundsException e) {
- throw new IllegalStateException("invalid tethering stats " + e);
- }
- }
-
- return stats;
+ // Remove the implementation of NetdTetheringStatsProvider#getTetherStats
+ // since all callers are migrated to use INetd#tetherGetStats directly.
+ throw new UnsupportedOperationException();
}
@Override
@@ -1330,20 +1294,9 @@
@Override
public NetworkStats getNetworkStatsTethering(int how) {
- NetworkStack.checkNetworkStackPermission(mContext);
-
- final NetworkStats stats = new NetworkStats(SystemClock.elapsedRealtime(), 1);
- synchronized (mTetheringStatsProviders) {
- for (ITetheringStatsProvider provider: mTetheringStatsProviders.keySet()) {
- try {
- stats.combineAllValues(provider.getTetherStats(how));
- } catch (RemoteException e) {
- Log.e(TAG, "Problem reading tethering stats from " +
- mTetheringStatsProviders.get(provider) + ": " + e);
- }
- }
- }
- return stats;
+ // Remove the implementation of getNetworkStatsTethering since all callers are migrated
+ // to use INetd#tetherGetStats directly.
+ throw new UnsupportedOperationException();
}
@Override
diff --git a/services/core/java/com/android/server/SystemService.java b/services/core/java/com/android/server/SystemService.java
index 9923274..ed545a6 100644
--- a/services/core/java/com/android/server/SystemService.java
+++ b/services/core/java/com/android/server/SystemService.java
@@ -227,6 +227,76 @@
}
/**
+ * Class representing the types of "onUser" events that we are being informed about as having
+ * finished.
+ *
+ * @hide
+ */
+ public static final class UserCompletedEventType {
+ /**
+ * Flag representing the {@link #onUserStarting} event.
+ * @hide
+ */
+ public static final int EVENT_TYPE_USER_STARTING = 1 << 0;
+ /**
+ * Flag representing the {@link #onUserUnlocked} event.
+ * @hide
+ */
+ public static final int EVENT_TYPE_USER_UNLOCKED = 1 << 1;
+ /**
+ * Flag representing the {@link #onUserSwitching} event.
+ * @hide
+ */
+ public static final int EVENT_TYPE_USER_SWITCHING = 1 << 2;
+
+ /**
+ * @hide
+ */
+ @IntDef(flag = true, prefix = "EVENT_TYPE_USER_", value = {
+ EVENT_TYPE_USER_STARTING,
+ EVENT_TYPE_USER_UNLOCKED,
+ EVENT_TYPE_USER_SWITCHING
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface EventTypesFlag {
+ }
+
+ private @EventTypesFlag int mEventType;
+
+ /** @hide */
+ UserCompletedEventType(@EventTypesFlag int eventType) {
+ mEventType = eventType;
+ }
+
+ /** Returns whether one of the events is {@link #onUserStarting}. */
+ public boolean includesOnUserStarting() {
+ return (mEventType & EVENT_TYPE_USER_STARTING) != 0;
+ }
+
+ /** Returns whether one of the events is {@link #onUserUnlocked}. */
+ public boolean includesOnUserUnlocked() {
+ return (mEventType & EVENT_TYPE_USER_UNLOCKED) != 0;
+ }
+
+ /** Returns whether one of the events is {@link #onUserSwitching}. */
+ public boolean includesOnUserSwitching() {
+ return (mEventType & EVENT_TYPE_USER_SWITCHING) != 0;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder("{");
+ // List each in reverse order (to line up with binary better).
+ if (includesOnUserSwitching()) sb.append("|Switching");
+ if (includesOnUserUnlocked()) sb.append("|Unlocked");
+ if (includesOnUserStarting()) sb.append("|Starting");
+ if (sb.length() > 1) sb.append("|");
+ sb.append("}");
+ return sb.toString();
+ }
+ }
+
+ /**
* Initializes the system service.
* <p>
* Subclasses must define a single argument constructor that accepts the context
@@ -407,6 +477,33 @@
}
/**
+ * Called some time <i>after</i> an onUser... event has completed, for the events delineated in
+ * {@link UserCompletedEventType}. May include more than one event.
+ *
+ * <p>
+ * This can be useful for processing tasks that must run after such an event but are non-urgent.
+ *
+ * There are no strict guarantees about how long after the event this will be called, only that
+ * it will be called if applicable. There is no guarantee about the order in which each service
+ * is informed, and these calls may be made in parallel using a thread pool.
+ *
+ * <p>Note that if the event is no longer applicable (for example, we switched to user 10, but
+ * before this method was called, we switched to user 11), the event will not be included in the
+ * {@code eventType} (i.e. user 10 won't mention the switch - even though it happened, it is no
+ * longer applicable).
+ *
+ * <p>This method is only called when the service {@link #isUserSupported(TargetUser) supports}
+ * this user.
+ *
+ * @param user target user completing the event (e.g. user being switched to)
+ * @param eventType the types of onUser event applicable (e.g. user starting and being unlocked)
+ *
+ * @hide
+ */
+ public void onUserCompletedEvent(@NonNull TargetUser user, UserCompletedEventType eventType) {
+ }
+
+ /**
* Publish the service so it is accessible to other services and apps.
*
* @param name the name of the new service
diff --git a/services/core/java/com/android/server/SystemServiceManager.java b/services/core/java/com/android/server/SystemServiceManager.java
index e7f4de2..0bc3fcc 100644
--- a/services/core/java/com/android/server/SystemServiceManager.java
+++ b/services/core/java/com/android/server/SystemServiceManager.java
@@ -36,6 +36,7 @@
import com.android.internal.os.SystemServerClassLoaderFactory;
import com.android.internal.util.Preconditions;
import com.android.server.SystemService.TargetUser;
+import com.android.server.SystemService.UserCompletedEventType;
import com.android.server.am.EventLogTags;
import com.android.server.pm.UserManagerInternal;
import com.android.server.utils.TimingsTraceAndSlog;
@@ -73,6 +74,7 @@
private static final String USER_SWITCHING = "Switch"; // Logged as onSwitchUser
private static final String USER_STOPPING = "Stop"; // Logged as onStopUser
private static final String USER_STOPPED = "Cleanup"; // Logged as onCleanupUser
+ private static final String USER_COMPLETED_EVENT = "CompletedEvent"; // onCompletedEventUser
// Whether to use multiple threads to run user lifecycle phases in parallel.
private static boolean sUseLifecycleThreadPool = true;
@@ -404,6 +406,26 @@
}
}
+ /**
+ * Called some time <i>after</i> an onUser... event has completed, for the events delineated in
+ * {@link UserCompletedEventType}.
+ *
+ * @param eventFlags the events that completed, per {@link UserCompletedEventType}, or 0.
+ * @see SystemService#onUserCompletedEvent
+ */
+ public void onUserCompletedEvent(@UserIdInt int userId,
+ @UserCompletedEventType.EventTypesFlag int eventFlags) {
+ EventLog.writeEvent(EventLogTags.SSM_USER_COMPLETED_EVENT, userId, eventFlags);
+ if (eventFlags == 0) {
+ return;
+ }
+ onUser(TimingsTraceAndSlog.newAsyncLog(),
+ USER_COMPLETED_EVENT,
+ /* prevUser= */ null,
+ getTargetUser(userId),
+ new UserCompletedEventType(eventFlags));
+ }
+
private void onUser(@NonNull String onWhat, @UserIdInt int userId) {
onUser(TimingsTraceAndSlog.newAsyncLog(), onWhat, /* prevUser= */ null,
getTargetUser(userId));
@@ -411,19 +433,23 @@
private void onUser(@NonNull TimingsTraceAndSlog t, @NonNull String onWhat,
@Nullable TargetUser prevUser, @NonNull TargetUser curUser) {
+ onUser(t, onWhat, prevUser, curUser, /* completedEventType=*/ null);
+ }
+
+ private void onUser(@NonNull TimingsTraceAndSlog t, @NonNull String onWhat,
+ @Nullable TargetUser prevUser, @NonNull TargetUser curUser,
+ @Nullable UserCompletedEventType completedEventType) {
final int curUserId = curUser.getUserIdentifier();
// NOTE: do not change label below, or it might break performance tests that rely on it.
t.traceBegin("ssm." + onWhat + "User-" + curUserId);
Slog.i(TAG, "Calling on" + onWhat + "User " + curUserId
+ (prevUser != null ? " (from " + prevUser + ")" : ""));
- final int serviceLen = mServices.size();
- // Limit the lifecycle parallelization to all users other than the system user
- // and only for the user start lifecycle phase for now.
- final boolean useThreadPool = sUseLifecycleThreadPool
- && curUserId != UserHandle.USER_SYSTEM
- && onWhat.equals(USER_STARTING);
+
+ final boolean useThreadPool = useThreadPool(curUserId, onWhat);
final ExecutorService threadPool =
useThreadPool ? Executors.newFixedThreadPool(mNumUserPoolThreads) : null;
+
+ final int serviceLen = mServices.size();
for (int i = 0; i < serviceLen; i++) {
final SystemService service = mServices.get(i);
final String serviceName = service.getClass().getName();
@@ -446,8 +472,7 @@
}
continue;
}
- // Only submit this service to the thread pool if it's in the "other" category.
- final boolean submitToThreadPool = useThreadPool && i >= sOtherServicesStartIndex;
+ final boolean submitToThreadPool = useThreadPool && useThreadPoolForService(onWhat, i);
if (!submitToThreadPool) {
t.traceBegin("ssm.on" + onWhat + "User-" + curUserId + "_" + serviceName);
}
@@ -459,7 +484,7 @@
break;
case USER_STARTING:
if (submitToThreadPool) {
- threadPool.submit(getOnStartUserRunnable(t, service, curUser));
+ threadPool.submit(getOnUserStartingRunnable(t, service, curUser));
} else {
service.onUserStarting(curUser);
}
@@ -476,6 +501,10 @@
case USER_STOPPED:
service.onUserStopped(curUser);
break;
+ case USER_COMPLETED_EVENT:
+ threadPool.submit(getOnUserCompletedEventRunnable(
+ t, service, serviceName, curUser, completedEventType));
+ break;
default:
throw new IllegalArgumentException(onWhat + " what?");
}
@@ -498,9 +527,11 @@
} catch (InterruptedException e) {
Slog.wtf(TAG, "User lifecycle thread pool was interrupted while awaiting completion"
+ " of " + onWhat + " of user " + curUser, e);
- Slog.e(TAG, "Couldn't terminate, disabling thread pool. "
- + "Please capture a bug report.");
- sUseLifecycleThreadPool = false;
+ if (!onWhat.equals(USER_COMPLETED_EVENT)) {
+ Slog.e(TAG, "Couldn't terminate, disabling thread pool. "
+ + "Please capture a bug report.");
+ sUseLifecycleThreadPool = false;
+ }
}
if (!terminated) {
Slog.wtf(TAG, "User lifecycle thread pool was not terminated.");
@@ -509,7 +540,38 @@
t.traceEnd(); // main entry
}
- private Runnable getOnStartUserRunnable(TimingsTraceAndSlog oldTrace, SystemService service,
+ /**
+ * Whether the given onWhat should use a thread pool.
+ * IMPORTANT: changing the logic to return true won't necessarily make it multi-threaded.
+ * There needs to be a corresponding logic change in onUser() to actually submit
+ * to a threadPool for the given onWhat.
+ */
+ private boolean useThreadPool(int userId, @NonNull String onWhat) {
+ switch (onWhat) {
+ case USER_STARTING:
+ // Limit the lifecycle parallelization to all users other than the system user
+ // and only for the user start lifecycle phase for now.
+ return sUseLifecycleThreadPool && userId != UserHandle.USER_SYSTEM;
+ case USER_COMPLETED_EVENT:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ private boolean useThreadPoolForService(@NonNull String onWhat, int serviceIndex) {
+ switch (onWhat) {
+ case USER_STARTING:
+ // Only submit this service to the thread pool if it's in the "other" category.
+ return serviceIndex >= sOtherServicesStartIndex;
+ case USER_COMPLETED_EVENT:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ private Runnable getOnUserStartingRunnable(TimingsTraceAndSlog oldTrace, SystemService service,
TargetUser curUser) {
return () -> {
final TimingsTraceAndSlog t = new TimingsTraceAndSlog(oldTrace);
@@ -531,6 +593,22 @@
};
}
+ private Runnable getOnUserCompletedEventRunnable(TimingsTraceAndSlog oldTrace,
+ SystemService service, String serviceName, TargetUser curUser,
+ UserCompletedEventType eventType) {
+ return () -> {
+ final TimingsTraceAndSlog t = new TimingsTraceAndSlog(oldTrace);
+ final int curUserId = curUser.getUserIdentifier();
+ t.traceBegin("ssm.on" + USER_COMPLETED_EVENT + "User-" + curUserId
+ + "_" + eventType + "_" + serviceName);
+ long time = SystemClock.elapsedRealtime();
+ service.onUserCompletedEvent(curUser, eventType);
+ warnIfTooLong(SystemClock.elapsedRealtime() - time, service,
+ "on" + USER_COMPLETED_EVENT + "User-" + curUserId);
+ t.traceEnd();
+ };
+ }
+
/** Sets the safe mode flag for services to query. */
void setSafeMode(boolean safeMode) {
mSafeMode = safeMode;
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index e14dce8..b5c0a67 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -2975,9 +2975,21 @@
Binder.restoreCallingIdentity(origId);
}
+ notifyBindingServiceEventLocked(callerApp, callingPackage);
+
return 1;
}
+ @GuardedBy("mAm")
+ private void notifyBindingServiceEventLocked(ProcessRecord callerApp, String callingPackage) {
+ final ApplicationInfo ai = callerApp.info;
+ final String callerPackage = ai != null ? ai.packageName : callingPackage;
+ if (callerPackage != null) {
+ mAm.mHandler.obtainMessage(ActivityManagerService.DISPATCH_BINDING_SERVICE_EVENT,
+ callerApp.uid, 0, callerPackage).sendToTarget();
+ }
+ }
+
private void maybeLogBindCrossProfileService(
int userId, String callingPackage, int callingUid) {
if (UserHandle.isCore(callingUid)) {
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index eec6e27..ae4f79e7 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -153,8 +153,12 @@
import android.app.ActivityManager;
import android.app.ActivityManager.PendingIntentInfo;
import android.app.ActivityManager.ProcessCapability;
+import android.app.ActivityManager.RestrictionLevel;
import android.app.ActivityManager.RunningTaskInfo;
import android.app.ActivityManagerInternal;
+import android.app.ActivityManagerInternal.BindServiceEventListener;
+import android.app.ActivityManagerInternal.BroadcastEventListener;
+import android.app.ActivityManagerInternal.ForegroundServiceStateListener;
import android.app.ActivityTaskManager.RootTaskInfo;
import android.app.ActivityThread;
import android.app.AnrController;
@@ -186,7 +190,6 @@
import android.app.PendingIntent;
import android.app.ProcessMemoryState;
import android.app.ProfilerInfo;
-import android.app.PropertyInvalidatedCache;
import android.app.SyncNotedAppOp;
import android.app.WaitResult;
import android.app.backup.BackupManager.OperationType;
@@ -233,11 +236,9 @@
import android.content.pm.ProviderInfo;
import android.content.pm.ProviderInfoList;
import android.content.pm.ResolveInfo;
-import com.android.server.pm.pkg.SELinuxUtil;
import android.content.pm.ServiceInfo;
import android.content.pm.TestUtilityService;
import android.content.pm.UserInfo;
-import com.android.server.pm.pkg.parsing.ParsingPackageUtils;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -396,6 +397,8 @@
import com.android.server.pm.UserManagerInternal;
import com.android.server.pm.parsing.pkg.AndroidPackage;
import com.android.server.pm.permission.PermissionManagerServiceInternal;
+import com.android.server.pm.pkg.SELinuxUtil;
+import com.android.server.pm.pkg.parsing.ParsingPackageUtils;
import com.android.server.uri.GrantUri;
import com.android.server.uri.NeededUriGrants;
import com.android.server.uri.UriGrantsManagerInternal;
@@ -438,6 +441,7 @@
import java.util.Map;
import java.util.Set;
import java.util.UUID;
+import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicInteger;
@@ -1373,6 +1377,25 @@
= new ProcessMap<ArrayList<ProcessRecord>>();
/**
+ * The list of foreground service state change listeners.
+ */
+ @GuardedBy("this")
+ final ArrayList<ForegroundServiceStateListener> mForegroundServiceStateListeners =
+ new ArrayList<>();
+
+ /**
+ * The list of broadcast event listeners.
+ */
+ final CopyOnWriteArrayList<BroadcastEventListener> mBroadcastEventListeners =
+ new CopyOnWriteArrayList<>();
+
+ /**
+ * The list of bind service event listeners.
+ */
+ final CopyOnWriteArrayList<BindServiceEventListener> mBindServiceEventListeners =
+ new CopyOnWriteArrayList<>();
+
+ /**
* Set if the systemServer made a call to enterSafeMode.
*/
@GuardedBy("this")
@@ -1456,6 +1479,8 @@
final UidObserverController mUidObserverController;
+ final AppRestrictionController mAppRestrictionController;
+
private final class AppDeathRecipient implements IBinder.DeathRecipient {
final ProcessRecord mApp;
final int mPid;
@@ -1512,6 +1537,8 @@
static final int KILL_APP_ZYGOTE_MSG = 71;
static final int BINDER_HEAVYHITTER_AUTOSAMPLER_TIMEOUT_MSG = 72;
static final int WAIT_FOR_CONTENT_PROVIDER_TIMEOUT_MSG = 73;
+ static final int DISPATCH_SENDING_BROADCAST_EVENT = 74;
+ static final int DISPATCH_BINDING_SERVICE_EVENT = 75;
static final int FIRST_BROADCAST_QUEUE_MSG = 200;
@@ -1829,6 +1856,14 @@
((ContentProviderRecord) msg.obj).onProviderPublishStatusLocked(false);
}
} break;
+ case DISPATCH_SENDING_BROADCAST_EVENT: {
+ mBroadcastEventListeners.forEach(l ->
+ l.onSendingBroadcast((String) msg.obj, msg.arg1));
+ } break;
+ case DISPATCH_BINDING_SERVICE_EVENT: {
+ mBindServiceEventListeners.forEach(l ->
+ l.onBindingService((String) msg.obj, msg.arg1));
+ } break;
}
}
}
@@ -2269,6 +2304,7 @@
mPendingIntentController = hasHandlerThread
? new PendingIntentController(handlerThread.getLooper(), mUserController,
mConstants) : null;
+ mAppRestrictionController = new AppRestrictionController(mContext, this);
mProcStartHandlerThread = null;
mProcStartHandler = null;
mHiddenApiBlacklist = null;
@@ -2378,6 +2414,8 @@
mPendingIntentController = new PendingIntentController(
mHandlerThread.getLooper(), mUserController, mConstants);
+ mAppRestrictionController = new AppRestrictionController(mContext, this);
+
mUseFifoUiScheduling = SystemProperties.getInt("sys.use_fifo_ui", 0) != 0;
mTrackingAssociations = "1".equals(SystemProperties.get("debug.track-associations"));
@@ -2871,51 +2909,13 @@
return mode == AppOpsManager.MODE_ALLOWED;
}
- /**
- * Checks whether the calling package is trusted.
- *
- * The calling package is trusted if it's from system or the supposed package name matches the
- * UID making the call.
- *
- * @throws SecurityException if the package name and UID don't match.
- */
- private void verifyCallingPackage(String callingPackage) {
- final int callingUid = Binder.getCallingUid();
- // The caller is System or Shell.
- if (callingUid == SYSTEM_UID || isCallerShell()) {
- return;
- }
-
- // Handle the special UIDs that don't have real package (audioserver, cameraserver, etc).
- final String resolvedPackage = AppOpsManager.resolvePackageName(callingUid,
- null /* packageName */);
- if (resolvedPackage != null && resolvedPackage.equals(callingPackage)) {
- return;
- }
-
- final int claimedUid = getPackageManagerInternal().getPackageUid(callingPackage,
- 0 /* flags */, UserHandle.getUserId(callingUid));
- if (callingUid == claimedUid) {
- return;
- }
-
- throw new SecurityException(
- "Claimed calling package " + callingPackage + " does not match the calling UID "
- + Binder.getCallingUid());
- }
-
- private void enforceUsageStatsPermission(String callingPackage, String func) {
- verifyCallingPackage(callingPackage);
- // Since the protection level of PACKAGE_USAGE_STATS has 'appop', apps may grant this
- // permission via that way. We need to check both app-ops and permission.
- if (!hasUsageStatsPermission(callingPackage)) {
- enforceCallingPermission(android.Manifest.permission.PACKAGE_USAGE_STATS, func);
- }
- }
-
@Override
public int getPackageProcessState(String packageName, String callingPackage) {
- enforceUsageStatsPermission(callingPackage, "getPackageProcessState");
+ if (!hasUsageStatsPermission(callingPackage)) {
+ enforceCallingPermission(android.Manifest.permission.PACKAGE_USAGE_STATS,
+ "getPackageProcessState");
+ }
+
final int[] procState = {PROCESS_STATE_NONEXISTENT};
synchronized (mProcLock) {
mProcessList.forEachLruProcessesLOSP(false, proc -> {
@@ -7004,7 +7004,11 @@
@Override
public int getUidProcessState(int uid, String callingPackage) {
- enforceUsageStatsPermission(callingPackage, "getUidProcessState");
+ if (!hasUsageStatsPermission(callingPackage)) {
+ enforceCallingPermission(android.Manifest.permission.PACKAGE_USAGE_STATS,
+ "getUidProcessState");
+ }
+
synchronized (mProcLock) {
return mProcessList.getUidProcStateLOSP(uid);
}
@@ -7012,7 +7016,11 @@
@Override
public @ProcessCapability int getUidProcessCapabilities(int uid, String callingPackage) {
- enforceUsageStatsPermission(callingPackage, "getUidProcessCapabilities");
+ if (!hasUsageStatsPermission(callingPackage)) {
+ enforceCallingPermission(android.Manifest.permission.PACKAGE_USAGE_STATS,
+ "getUidProcessState");
+ }
+
synchronized (mProcLock) {
return mProcessList.getUidProcessCapabilityLOSP(uid);
}
@@ -7021,7 +7029,10 @@
@Override
public void registerUidObserver(IUidObserver observer, int which, int cutpoint,
String callingPackage) {
- enforceUsageStatsPermission(callingPackage, "registerUidObserver");
+ if (!hasUsageStatsPermission(callingPackage)) {
+ enforceCallingPermission(android.Manifest.permission.PACKAGE_USAGE_STATS,
+ "registerUidObserver");
+ }
mUidObserverController.register(observer, which, cutpoint, callingPackage,
Binder.getCallingUid());
}
@@ -7033,7 +7044,10 @@
@Override
public boolean isUidActive(int uid, String callingPackage) {
- enforceUsageStatsPermission(callingPackage, "isUidActive");
+ if (!hasUsageStatsPermission(callingPackage)) {
+ enforceCallingPermission(android.Manifest.permission.PACKAGE_USAGE_STATS,
+ "isUidActive");
+ }
synchronized (mProcLock) {
if (isUidActiveLOSP(uid)) {
return true;
@@ -7774,6 +7788,7 @@
mUserController.onSystemReady();
mAppOpsService.systemReady();
mProcessList.onSystemReady();
+ mAppRestrictionController.onSystemReady();
mSystemReady = true;
t.traceEnd();
}
@@ -9057,6 +9072,10 @@
}
mComponentAliasResolver.dump(pw);
}
+ if (dumpAll) {
+ pw.println("-------------------------------------------------------------------------------");
+ mAppRestrictionController.dump(pw, "");
+ }
}
/**
@@ -14859,8 +14878,16 @@
final void updateProcessForegroundLocked(ProcessRecord proc, boolean isForeground,
int fgServiceTypes, boolean oomAdj) {
final ProcessServiceRecord psr = proc.mServices;
- if (isForeground != psr.hasForegroundServices()
+ final boolean foregroundStateChanged = isForeground != psr.hasForegroundServices();
+ if (foregroundStateChanged
|| psr.getForegroundServiceTypes() != fgServiceTypes) {
+ if (foregroundStateChanged) {
+ // Notify internal listeners.
+ for (int i = mForegroundServiceStateListeners.size() - 1; i >= 0; i--) {
+ mForegroundServiceStateListeners.get(i).onForegroundServiceStateChanged(
+ proc.info.packageName, proc.info.uid, proc.getPid(), isForeground);
+ }
+ }
psr.setHasForegroundServices(isForeground, fgServiceTypes);
ArrayList<ProcessRecord> curProcs = mForegroundPackages.get(proc.info.packageName,
proc.info.uid);
@@ -15859,6 +15886,7 @@
synchronized (mProcLock) {
mDeviceIdleAllowlist = allAppids;
mDeviceIdleExceptIdleAllowlist = exceptIdleAppids;
+ mAppRestrictionController.setDeviceIdleAllowlist(allAppids, exceptIdleAppids);
}
}
}
@@ -16846,6 +16874,47 @@
public void setStopUserOnSwitch(int value) {
ActivityManagerService.this.setStopUserOnSwitch(value);
}
+
+ @Override
+ public @RestrictionLevel int getRestrictionLevel(int uid) {
+ return mAppRestrictionController.getRestrictionLevel(uid);
+ }
+
+ @Override
+ public @RestrictionLevel int getRestrictionLevel(String pkg, @UserIdInt int userId) {
+ return mAppRestrictionController.getRestrictionLevel(pkg, userId);
+ }
+
+ @Override
+ public boolean isBgAutoRestrictedBucketFeatureFlagEnabled() {
+ return mAppRestrictionController.isBgAutoRestrictedBucketFeatureFlagEnabled();
+ }
+
+ @Override
+ public void addAppBackgroundRestrictionListener(
+ @NonNull ActivityManagerInternal.AppBackgroundRestrictionListener listener) {
+ mAppRestrictionController.addAppBackgroundRestrictionListener(listener);
+ }
+
+ @Override
+ public void addForegroundServiceStateListener(
+ @NonNull ForegroundServiceStateListener listener) {
+ synchronized (ActivityManagerService.this) {
+ mForegroundServiceStateListeners.add(listener);
+ }
+ }
+
+ @Override
+ public void addBroadcastEventListener(@NonNull BroadcastEventListener listener) {
+ // It's a CopyOnWriteArrayList, so no lock is needed.
+ mBroadcastEventListeners.add(listener);
+ }
+
+ @Override
+ public void addBindServiceEventListener(@NonNull BindServiceEventListener listener) {
+ // It's a CopyOnWriteArrayList, so no lock is needed.
+ mBindServiceEventListeners.add(listener);
+ }
}
long inputDispatchingTimedOut(int pid, final boolean aboveSystem, String reason) {
@@ -17013,6 +17082,14 @@
}
}
+ @Override
+ @ReasonCode
+ public int getBackgroundRestrictionExemptionReason(int uid) {
+ enforceCallingPermission(android.Manifest.permission.DEVICE_POWER,
+ "getBackgroundRestrictionExemptionReason()");
+ return mAppRestrictionController.getBackgroundRestrictionExemptionReason(uid);
+ }
+
/**
* Force the settings cache to be loaded
*/
diff --git a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
index 4705b7b..043ea08 100644
--- a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
+++ b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
@@ -338,6 +338,8 @@
return runGetIsolatedProcesses(pw);
case "set-stop-user-on-switch":
return runSetStopUserOnSwitch(pw);
+ case "set-bg-abusive-uids":
+ return runSetBgAbusiveUids(pw);
default:
return handleDefaultCommands(cmd);
}
@@ -3225,6 +3227,43 @@
return 0;
}
+ // TODO(b/203105544) STOPSHIP - For debugging only, to be removed before shipping.
+ private int runSetBgAbusiveUids(PrintWriter pw) throws RemoteException {
+ final String arg = getNextArg();
+ final AppBatteryTracker batteryTracker =
+ mInternal.mAppRestrictionController.getAppStateTracker(AppBatteryTracker.class);
+ if (batteryTracker == null) {
+ getErrPrintWriter().println("Unable to get bg battery tracker");
+ return -1;
+ }
+ if (arg == null) {
+ batteryTracker.mDebugUidPercentages.clear();
+ return 0;
+ }
+ String[] pairs = arg.split(",");
+ int[] uids = new int[pairs.length];
+ double[] values = new double[pairs.length];
+ try {
+ for (int i = 0; i < pairs.length; i++) {
+ String[] pair = pairs[i].split("=");
+ if (pair.length != 2) {
+ getErrPrintWriter().println("Malformed input");
+ return -1;
+ }
+ uids[i] = Integer.parseInt(pair[0]);
+ values[i] = Double.parseDouble(pair[1]);
+ }
+ } catch (NumberFormatException e) {
+ getErrPrintWriter().println("Malformed input");
+ return -1;
+ }
+ batteryTracker.mDebugUidPercentages.clear();
+ for (int i = 0; i < pairs.length; i++) {
+ batteryTracker.mDebugUidPercentages.put(uids[i], values[i]);
+ }
+ return 0;
+ }
+
private Resources getResources(PrintWriter pw) throws RemoteException {
// system resources does not contain all the device configuration, construct it manually.
Configuration config = mInterface.getConfiguration();
@@ -3562,6 +3601,8 @@
pw.println(" Sets whether the current user (and its profiles) should be stopped"
+ " when switching to a different user.");
pw.println(" Without arguments, it resets to the value defined by platform.");
+ pw.println(" set-bg-abusive-uids [uid=percentage][,uid=percentage...]");
+ pw.println(" Force setting the battery usage of the given UID.");
pw.println();
Intent.printIntentArgsHelp(pw, "");
}
diff --git a/services/core/java/com/android/server/am/AppBatteryExemptionTracker.java b/services/core/java/com/android/server/am/AppBatteryExemptionTracker.java
new file mode 100644
index 0000000..75de3a1
--- /dev/null
+++ b/services/core/java/com/android/server/am/AppBatteryExemptionTracker.java
@@ -0,0 +1,458 @@
+/*
+ * 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.server.am;
+
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
+import static com.android.server.am.AppRestrictionController.DEVICE_CONFIG_SUBNAMESPACE_PREFIX;
+import static com.android.server.am.BaseAppStateDurationsTracker.EVENT_NUM;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.content.Context;
+import android.os.SystemClock;
+import android.util.Pair;
+import android.util.Slog;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.am.AppBatteryExemptionTracker.AppBatteryExemptionPolicy;
+import com.android.server.am.AppBatteryExemptionTracker.UidBatteryStates;
+import com.android.server.am.AppBatteryTracker.AppBatteryPolicy;
+import com.android.server.am.BaseAppStateDurationsTracker.EventListener;
+import com.android.server.am.BaseAppStateTimeEvents.BaseTimeEvent;
+import com.android.server.am.BaseAppStateTracker.Injector;
+
+import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+import java.util.Iterator;
+import java.util.LinkedList;
+
+/**
+ * A helper class to track the current drains that should be excluded from the current drain
+ * accounting, examples are media playback, location sharing, etc.
+ *
+ * <p>
+ * Note: as the {@link AppBatteryTracker#getUidBatteryUsage} could return the battery usage data
+ * from most recent polling due to throttling, the battery usage of a certain event here
+ * would NOT be the exactly same amount that it actually costs.
+ * </p>
+ */
+final class AppBatteryExemptionTracker
+ extends BaseAppStateDurationsTracker<AppBatteryExemptionPolicy, UidBatteryStates>
+ implements BaseAppStateEvents.Factory<UidBatteryStates>, EventListener {
+ private static final String TAG = TAG_WITH_CLASS_NAME ? "AppBatteryExemptionTracker" : TAG_AM;
+
+ private static final boolean DEBUG_BACKGROUND_BATTERY_EXEMPTION_TRACKER = false;
+
+ // As it's a UID-based tracker, anywhere which requires a package name, use this default name.
+ private static final String DEFAULT_NAME = "";
+
+ AppBatteryExemptionTracker(Context context, AppRestrictionController controller) {
+ this(context, controller, null, null);
+ }
+
+ AppBatteryExemptionTracker(Context context, AppRestrictionController controller,
+ Constructor<? extends Injector<AppBatteryExemptionPolicy>> injector,
+ Object outerContext) {
+ super(context, controller, injector, outerContext);
+ mInjector.setPolicy(new AppBatteryExemptionPolicy(mInjector, this));
+ }
+
+ @Override
+ void onSystemReady() {
+ super.onSystemReady();
+ mAppRestrictionController.forEachTracker(tracker -> {
+ if (tracker instanceof BaseAppStateDurationsTracker) {
+ ((BaseAppStateDurationsTracker) tracker).registerEventListener(this);
+ }
+ });
+ }
+
+ @Override
+ public UidBatteryStates createAppStateEvents(int uid, String packageName) {
+ return new UidBatteryStates(uid, TAG, mInjector.getPolicy());
+ }
+
+ @Override
+ public UidBatteryStates createAppStateEvents(UidBatteryStates other) {
+ return new UidBatteryStates(other);
+ }
+
+ @Override
+ public void onNewEvent(int uid, String packageName, boolean start, long now, int eventType) {
+ if (!mInjector.getPolicy().isEnabled()) {
+ return;
+ }
+ final double batteryUsage = mAppRestrictionController.getUidBatteryUsage(uid);
+ synchronized (mLock) {
+ UidBatteryStates pkg = mPkgEvents.get(uid, DEFAULT_NAME);
+ if (pkg == null) {
+ pkg = createAppStateEvents(uid, DEFAULT_NAME);
+ mPkgEvents.put(uid, DEFAULT_NAME, pkg);
+ }
+ pkg.addEvent(start, now, batteryUsage, eventType);
+ }
+ }
+
+ private void onTrackerEnabled(boolean enabled) {
+ if (!enabled) {
+ synchronized (mLock) {
+ mPkgEvents.clear();
+ }
+ }
+ }
+
+ /**
+ * @return The to-be-exempted battery usage of the given UID in the given duration; it could
+ * be considered as "exempted" due to various use cases, i.e. media playback.
+ */
+ double getUidBatteryExemptedUsageSince(int uid, long since, long now) {
+ if (!mInjector.getPolicy().isEnabled()) {
+ return 0.0d;
+ }
+ Pair<Double, Double> result;
+ synchronized (mLock) {
+ final UidBatteryStates pkg = mPkgEvents.get(uid, DEFAULT_NAME);
+ if (pkg == null) {
+ return 0.0d;
+ }
+ result = pkg.getBatteryUsageSince(since, now);
+ }
+ if (result.second > 0.0d) {
+ // We have an open event (just start, no stop), get the battery usage till now.
+ final double batteryUsage = mAppRestrictionController.getUidBatteryUsage(uid);
+ return result.first + batteryUsage - result.second;
+ }
+ return result.first;
+ }
+
+ static final class UidBatteryStates extends BaseAppStateDurations<UidStateEventWithBattery> {
+ UidBatteryStates(int uid, @NonNull String tag,
+ @NonNull MaxTrackingDurationConfig maxTrackingDurationConfig) {
+ super(uid, DEFAULT_NAME, EVENT_NUM, tag, maxTrackingDurationConfig);
+ }
+
+ UidBatteryStates(@NonNull UidBatteryStates other) {
+ super(other);
+ }
+
+ /**
+ * @param start {@code true} if it's a start event.
+ * @param now The timestamp when this event occurred.
+ * @param batteryUsage The background current drain since the system boots.
+ * @param eventType One of EVENT_TYPE_* defined in the class BaseAppStateDurationsTracker.
+ */
+ void addEvent(boolean start, long now, double batteryUsage, int eventType) {
+ if (start) {
+ addEvent(start, new UidStateEventWithBattery(start, now, batteryUsage, null),
+ eventType);
+ } else {
+ final UidStateEventWithBattery last = getLastEvent(eventType);
+ if (last == null || !last.isStart()) {
+ if (DEBUG_BACKGROUND_BATTERY_EXEMPTION_TRACKER) {
+ Slog.wtf(TAG, "Unexpected stop event " + eventType);
+ }
+ return;
+ }
+ addEvent(start, new UidStateEventWithBattery(start, now,
+ batteryUsage - last.getBatteryUsage(), last), eventType);
+ }
+ }
+
+ UidStateEventWithBattery getLastEvent(int eventType) {
+ return mEvents[eventType] != null ? mEvents[eventType].peekLast() : null;
+ }
+
+ /**
+ * @return The pair of bg battery usage of given duration; the first value in the pair
+ * is the aggregated battery usage of all event pairs in this duration; while
+ * the second value is the battery usage since the system boots, if there is
+ * an open event(just start, no stop) at the end of the duration.
+ */
+ Pair<Double, Double> getBatteryUsageSince(long since, long now, int eventType) {
+ return getBatteryUsageSince(since, now, mEvents[eventType]);
+ }
+
+ private Pair<Double, Double> getBatteryUsageSince(long since, long now,
+ LinkedList<UidStateEventWithBattery> events) {
+ if (events == null || events.size() == 0) {
+ return Pair.create(0.0d, 0.0d);
+ }
+ double batteryUsage = 0.0d;
+ UidStateEventWithBattery lastEvent = null;
+ for (UidStateEventWithBattery event : events) {
+ lastEvent = event;
+ if (event.getTimestamp() < since || event.isStart()) {
+ continue;
+ }
+ batteryUsage += event.getBatteryUsage(since, Math.min(now, event.getTimestamp()));
+ if (now <= event.getTimestamp()) {
+ break;
+ }
+ }
+ return Pair.create(batteryUsage, lastEvent.isStart() ? lastEvent.getBatteryUsage() : 0);
+ }
+
+ /**
+ * @return The aggregated battery usage amongst all the event types we're tracking.
+ */
+ Pair<Double, Double> getBatteryUsageSince(long since, long now) {
+ LinkedList<UidStateEventWithBattery> result = new LinkedList<>();
+ for (int i = 0; i < mEvents.length; i++) {
+ result = add(result, mEvents[i]);
+ }
+ return getBatteryUsageSince(since, now, result);
+ }
+
+ /**
+ * Merge the two given duration table and return the result.
+ */
+ @VisibleForTesting
+ @Override
+ LinkedList<UidStateEventWithBattery> add(LinkedList<UidStateEventWithBattery> durations,
+ LinkedList<UidStateEventWithBattery> otherDurations) {
+ if (otherDurations == null || otherDurations.size() == 0) {
+ return durations;
+ }
+ if (durations == null || durations.size() == 0) {
+ return (LinkedList<UidStateEventWithBattery>) otherDurations.clone();
+ }
+ final Iterator<UidStateEventWithBattery> itl = durations.iterator();
+ final Iterator<UidStateEventWithBattery> itr = otherDurations.iterator();
+ UidStateEventWithBattery l = itl.next(), r = itr.next();
+ LinkedList<UidStateEventWithBattery> dest = new LinkedList<>();
+ boolean actl = false, actr = false, overlapping = false;
+ double batteryUsage = 0.0d;
+ long recentActTs = 0, overlappingDuration = 0;
+ for (long lts = l.getTimestamp(), rts = r.getTimestamp();
+ lts != Long.MAX_VALUE || rts != Long.MAX_VALUE;) {
+ final boolean actCur = actl || actr;
+ final UidStateEventWithBattery earliest;
+ if (lts == rts) {
+ earliest = l;
+ // we'll deal with the double counting problem later.
+ batteryUsage += actl ? l.getBatteryUsage() : 0.0d;
+ batteryUsage += actr ? r.getBatteryUsage() : 0.0d;
+ overlappingDuration += overlapping && (actl || actr)
+ ? (lts - recentActTs) : 0;
+ actl = !actl;
+ actr = !actr;
+ lts = itl.hasNext() ? (l = itl.next()).getTimestamp() : Long.MAX_VALUE;
+ rts = itr.hasNext() ? (r = itr.next()).getTimestamp() : Long.MAX_VALUE;
+ } else if (lts < rts) {
+ earliest = l;
+ batteryUsage += actl ? l.getBatteryUsage() : 0.0d;
+ overlappingDuration += overlapping && actl ? (lts - recentActTs) : 0;
+ actl = !actl;
+ lts = itl.hasNext() ? (l = itl.next()).getTimestamp() : Long.MAX_VALUE;
+ } else {
+ earliest = r;
+ batteryUsage += actr ? r.getBatteryUsage() : 0.0d;
+ overlappingDuration += overlapping && actr ? (rts - recentActTs) : 0;
+ actr = !actr;
+ rts = itr.hasNext() ? (r = itr.next()).getTimestamp() : Long.MAX_VALUE;
+ }
+ overlapping = actl && actr;
+ if (actl || actr) {
+ recentActTs = earliest.getTimestamp();
+ }
+ if (actCur != (actl || actr)) {
+ final UidStateEventWithBattery event =
+ (UidStateEventWithBattery) earliest.clone();
+ if (actCur) {
+ // It's an stop/end event, update the start timestamp and batteryUsage.
+ final UidStateEventWithBattery lastEvent = dest.peekLast();
+ final long startTs = lastEvent.getTimestamp();
+ final long duration = event.getTimestamp() - startTs;
+ final long durationWithOverlapping = duration + overlappingDuration;
+ // Get the proportional batteryUsage.
+ if (durationWithOverlapping != 0) {
+ batteryUsage *= duration * 1.0d / durationWithOverlapping;
+ } else {
+ batteryUsage = 0.0d;
+ }
+ event.update(lastEvent, batteryUsage);
+ batteryUsage = 0.0d;
+ overlappingDuration = 0;
+ }
+ dest.add(event);
+ }
+ }
+ return dest;
+ }
+ }
+
+ private void trimDurations() {
+ final long now = SystemClock.elapsedRealtime();
+ trim(Math.max(0, now - mInjector.getPolicy().getMaxTrackingDuration()));
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ // We're dumping the data in AppBatteryTracker actually, so just dump the policy here.
+ mInjector.getPolicy().dump(pw, prefix);
+ }
+
+ /**
+ * A basic event marking a certain event, i.e., a FGS start/stop;
+ * it'll record the background battery usage data over the start/stop.
+ */
+ static final class UidStateEventWithBattery extends BaseTimeEvent {
+ /**
+ * Whether or not this is a start event.
+ */
+ private boolean mIsStart;
+
+ /**
+ * The known background battery usage; it will be the total bg battery usage since
+ * the system boots if the {@link #mIsStart} is true, but will be the delta of the bg
+ * battery usage since the start event if the {@link #mIsStart} is false.
+ */
+ private double mBatteryUsage;
+
+ /**
+ * The peer event of this pair (a pair of start/stop events).
+ */
+ private @Nullable UidStateEventWithBattery mPeer;
+
+ UidStateEventWithBattery(boolean isStart, long now, double batteryUsage,
+ @Nullable UidStateEventWithBattery peer) {
+ super(now);
+ mIsStart = isStart;
+ mBatteryUsage = batteryUsage;
+ mPeer = peer;
+ if (peer != null) {
+ peer.mPeer = this;
+ }
+ }
+
+ UidStateEventWithBattery(UidStateEventWithBattery other) {
+ super(other);
+ mIsStart = other.mIsStart;
+ mBatteryUsage = other.mBatteryUsage;
+ // Don't copy the peer object though.
+ }
+
+ @Override
+ void trimTo(long timestamp) {
+ // We don't move the stop event.
+ if (!mIsStart || timestamp < mTimestamp) {
+ return;
+ }
+ if (mPeer != null) {
+ // Reduce the bg battery usage proportionally.
+ final double batteryUsage = mPeer.getBatteryUsage();
+ mPeer.mBatteryUsage = mPeer.getBatteryUsage(timestamp, mPeer.mTimestamp);
+ // Update the battery data of the start event too.
+ mBatteryUsage += batteryUsage - mPeer.mBatteryUsage;
+ }
+ mTimestamp = timestamp;
+ }
+
+ void update(@NonNull UidStateEventWithBattery peer, double batteryUsage) {
+ mPeer = peer;
+ peer.mPeer = this;
+ mBatteryUsage = batteryUsage;
+ }
+
+ boolean isStart() {
+ return mIsStart;
+ }
+
+ double getBatteryUsage(long start, long end) {
+ if (mIsStart || start >= mTimestamp || end <= start) {
+ return 0.0d;
+ }
+ start = Math.max(start, mPeer.mTimestamp);
+ end = Math.min(end, mTimestamp);
+ final long totalDur = mTimestamp - mPeer.mTimestamp;
+ final long inputDur = end - start;
+ return totalDur != 0 ? mBatteryUsage * (1.0d * inputDur) / totalDur : 0.0d;
+ }
+
+ double getBatteryUsage() {
+ return mBatteryUsage;
+ }
+
+ @Override
+ public Object clone() {
+ return new UidStateEventWithBattery(this);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == null) {
+ return false;
+ }
+ if (other.getClass() != UidStateEventWithBattery.class) {
+ return false;
+ }
+ final UidStateEventWithBattery otherEvent = (UidStateEventWithBattery) other;
+ return otherEvent.mIsStart == mIsStart
+ && otherEvent.mTimestamp == mTimestamp
+ && Double.compare(otherEvent.mBatteryUsage, mBatteryUsage) == 0;
+ }
+
+ @Override
+ public int hashCode() {
+ return (Boolean.hashCode(mIsStart) * 31
+ + Long.hashCode(mTimestamp)) * 31
+ + Double.hashCode(mBatteryUsage);
+ }
+ }
+
+ static final class AppBatteryExemptionPolicy
+ extends BaseAppStateEventsPolicy<AppBatteryExemptionTracker> {
+ /**
+ * Whether or not we should enable the exemption of certain battery drains.
+ */
+ static final String KEY_BG_BATTERY_EXEMPTION_ENABLED =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "battery_exemption_enabled";
+
+ /**
+ * Default value to {@link #mTrackerEnabled}.
+ */
+ static final boolean DEFAULT_BG_BATTERY_EXEMPTION_ENABLED = true;
+
+ AppBatteryExemptionPolicy(@NonNull Injector injector,
+ @NonNull AppBatteryExemptionTracker tracker) {
+ super(injector, tracker,
+ KEY_BG_BATTERY_EXEMPTION_ENABLED, DEFAULT_BG_BATTERY_EXEMPTION_ENABLED,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_WINDOW,
+ AppBatteryPolicy.DEFAULT_BG_CURRENT_DRAIN_WINDOW_MS);
+ }
+
+ @Override
+ public void onMaxTrackingDurationChanged(long maxDuration) {
+ mTracker.mBgHandler.post(mTracker::trimDurations);
+ }
+
+ @Override
+ public void onTrackerEnabled(boolean enabled) {
+ mTracker.onTrackerEnabled(enabled);
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ pw.print(prefix);
+ pw.println("APP BATTERY EXEMPTION TRACKER POLICY SETTINGS:");
+ final String indent = " ";
+ prefix = indent + prefix;
+ super.dump(pw, prefix);
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/AppBatteryTracker.java b/services/core/java/com/android/server/am/AppBatteryTracker.java
new file mode 100644
index 0000000..8a21a0f
--- /dev/null
+++ b/services/core/java/com/android/server/am/AppBatteryTracker.java
@@ -0,0 +1,1178 @@
+/*
+ * 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.server.am;
+
+import static android.Manifest.permission.ACCESS_BACKGROUND_LOCATION;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_ADAPTIVE_BUCKET;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_BACKGROUND_RESTRICTED;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_RESTRICTED_BUCKET;
+import static android.app.ActivityManager.isLowRamDeviceStatic;
+import static android.app.usage.UsageStatsManager.REASON_MAIN_FORCED_BY_SYSTEM;
+import static android.app.usage.UsageStatsManager.REASON_MAIN_USAGE;
+import static android.app.usage.UsageStatsManager.REASON_SUB_FORCED_SYSTEM_FLAG_ABUSE;
+import static android.app.usage.UsageStatsManager.REASON_SUB_USAGE_USER_INTERACTION;
+import static android.content.pm.PackageManager.PERMISSION_GRANTED;
+import static android.os.BatteryConsumer.POWER_COMPONENT_ANY;
+import static android.os.BatteryConsumer.PROCESS_STATE_BACKGROUND;
+import static android.os.BatteryConsumer.PROCESS_STATE_FOREGROUND;
+import static android.os.BatteryConsumer.PROCESS_STATE_FOREGROUND_SERVICE;
+import static android.os.PowerExemptionManager.REASON_DENIED;
+import static android.util.TimeUtils.formatTime;
+
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
+import static com.android.server.am.AppRestrictionController.DEVICE_CONFIG_SUBNAMESPACE_PREFIX;
+import static com.android.server.am.BaseAppStateTracker.ONE_DAY;
+import static com.android.server.am.BaseAppStateTracker.ONE_MINUTE;
+
+import android.annotation.NonNull;
+import android.annotation.UserIdInt;
+import android.app.ActivityManager.RestrictionLevel;
+import android.content.Context;
+import android.content.pm.ServiceInfo;
+import android.os.BatteryConsumer;
+import android.os.BatteryStatsInternal;
+import android.os.BatteryUsageStats;
+import android.os.BatteryUsageStatsQuery;
+import android.os.PowerExemptionManager;
+import android.os.PowerExemptionManager.ReasonCode;
+import android.os.SystemClock;
+import android.os.UidBatteryConsumer;
+import android.os.UserHandle;
+import android.provider.DeviceConfig;
+import android.util.ArraySet;
+import android.util.Slog;
+import android.util.SparseArray;
+import android.util.SparseBooleanArray;
+import android.util.SparseDoubleArray;
+import android.util.TimeUtils;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.ArrayUtils;
+import com.android.server.am.AppBatteryTracker.AppBatteryPolicy;
+import com.android.server.am.AppRestrictionController.UidBatteryUsageProvider;
+import com.android.server.am.BaseAppStateTracker.Injector;
+import com.android.server.pm.UserManagerInternal;
+
+import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * The battery usage tracker for apps, currently we are focusing on background + FGS battery here.
+ */
+final class AppBatteryTracker extends BaseAppStateTracker<AppBatteryPolicy>
+ implements UidBatteryUsageProvider {
+ static final String TAG = TAG_WITH_CLASS_NAME ? "AppBatteryTracker" : TAG_AM;
+
+ static final boolean DEBUG_BACKGROUND_BATTERY_TRACKER = false;
+
+ // As we don't support realtime per-UID battery usage stats yet, we're polling the stats
+ // in a regular time basis.
+ private final long mBatteryUsageStatsPollingIntervalMs;
+
+ // The timestamp when this system_server was started.
+ private long mBootTimestamp;
+
+ static final long BATTERY_USAGE_STATS_POLLING_INTERVAL_MS_LONG = 30 * ONE_MINUTE; // 30 mins
+ static final long BATTERY_USAGE_STATS_POLLING_INTERVAL_MS_DEBUG = 2_000L; // 2s
+
+ private final long mBatteryUsageStatsPollingMinIntervalMs;
+
+ /**
+ * The battery stats query is expensive, so we'd throttle the query.
+ */
+ static final long BATTERY_USAGE_STATS_POLLING_MIN_INTERVAL_MS_LONG = 5 * ONE_MINUTE; // 5 mins
+ static final long BATTERY_USAGE_STATS_POLLING_MIN_INTERVAL_MS_DEBUG = 2_000L; // 2s
+
+ static final BatteryConsumer.Dimensions BATT_DIMEN_FG =
+ new BatteryConsumer.Dimensions(POWER_COMPONENT_ANY, PROCESS_STATE_FOREGROUND);
+ static final BatteryConsumer.Dimensions BATT_DIMEN_BG =
+ new BatteryConsumer.Dimensions(POWER_COMPONENT_ANY, PROCESS_STATE_BACKGROUND);
+ static final BatteryConsumer.Dimensions BATT_DIMEN_FGS =
+ new BatteryConsumer.Dimensions(POWER_COMPONENT_ANY, PROCESS_STATE_FOREGROUND_SERVICE);
+
+ private final Runnable mBgBatteryUsageStatsPolling = this::updateBatteryUsageStatsAndCheck;
+ private final Runnable mBgBatteryUsageStatsCheck = this::checkBatteryUsageStats;
+
+ /**
+ * This tracks the user ids which are or were active during the last polling window,
+ * the index is the user id, and the value is if it's still running or not by now.
+ */
+ @GuardedBy("mLock")
+ private final SparseBooleanArray mActiveUserIdStates = new SparseBooleanArray();
+
+ /**
+ * When was the last battery usage sampled.
+ */
+ @GuardedBy("mLock")
+ private long mLastBatteryUsageSamplingTs;
+
+ /**
+ * Whether or not there is an ongoing battery stats update.
+ */
+ @GuardedBy("mLock")
+ private boolean mBatteryUsageStatsUpdatePending;
+
+ /**
+ * The current known battery usage data for each UID, since the system boots.
+ */
+ @GuardedBy("mLock")
+ private final SparseDoubleArray mUidBatteryUsage = new SparseDoubleArray();
+
+ /**
+ * The battery usage for each UID, in the rolling window of the past.
+ */
+ @GuardedBy("mLock")
+ private final SparseDoubleArray mUidBatteryUsageInWindow = new SparseDoubleArray();
+
+ /**
+ * The uid battery usage stats data from our last query, it does not include snapshot data.
+ */
+ // No lock is needed.
+ private final SparseDoubleArray mLastUidBatteryUsage = new SparseDoubleArray();
+
+ // No lock is needed.
+ private final SparseDoubleArray mTmpUidBatteryUsage = new SparseDoubleArray();
+
+ // No lock is needed.
+ private final SparseDoubleArray mTmpUidBatteryUsage2 = new SparseDoubleArray();
+
+ // No lock is needed.
+ private final ArraySet<UserHandle> mTmpUserIds = new ArraySet<>();
+
+ /**
+ * The start timestamp of the battery usage stats result from our last query.
+ */
+ // No lock is needed.
+ private long mLastUidBatteryUsageStartTs;
+
+ // For debug only.
+ final SparseDoubleArray mDebugUidPercentages = new SparseDoubleArray();
+
+ AppBatteryTracker(Context context, AppRestrictionController controller) {
+ this(context, controller, null, null);
+ }
+
+ AppBatteryTracker(Context context, AppRestrictionController controller,
+ Constructor<? extends Injector<AppBatteryPolicy>> injector,
+ Object outerContext) {
+ super(context, controller, injector, outerContext);
+ if (injector == null) {
+ mBatteryUsageStatsPollingIntervalMs = DEBUG_BACKGROUND_BATTERY_TRACKER
+ ? BATTERY_USAGE_STATS_POLLING_INTERVAL_MS_DEBUG
+ : BATTERY_USAGE_STATS_POLLING_INTERVAL_MS_LONG;
+ mBatteryUsageStatsPollingMinIntervalMs = DEBUG_BACKGROUND_BATTERY_TRACKER
+ ? BATTERY_USAGE_STATS_POLLING_MIN_INTERVAL_MS_DEBUG
+ : BATTERY_USAGE_STATS_POLLING_MIN_INTERVAL_MS_LONG;
+ } else {
+ mBatteryUsageStatsPollingIntervalMs = BATTERY_USAGE_STATS_POLLING_INTERVAL_MS_DEBUG;
+ mBatteryUsageStatsPollingMinIntervalMs =
+ BATTERY_USAGE_STATS_POLLING_MIN_INTERVAL_MS_DEBUG;
+ }
+ mInjector.setPolicy(new AppBatteryPolicy(mInjector, this));
+ }
+
+ @Override
+ void onSystemReady() {
+ super.onSystemReady();
+ final UserManagerInternal um = mInjector.getUserManagerInternal();
+ final int[] userIds = um.getUserIds();
+ for (int userId : userIds) {
+ if (um.isUserRunning(userId)) {
+ synchronized (mLock) {
+ mActiveUserIdStates.put(userId, true);
+ }
+ }
+ }
+ mBootTimestamp = mInjector.currentTimeMillis();
+ scheduleBatteryUsageStatsUpdateIfNecessary(mBatteryUsageStatsPollingIntervalMs);
+ }
+
+ private void scheduleBatteryUsageStatsUpdateIfNecessary(long delay) {
+ if (mInjector.getPolicy().isEnabled()) {
+ synchronized (mLock) {
+ if (!mBgHandler.hasCallbacks(mBgBatteryUsageStatsPolling)) {
+ mBgHandler.postDelayed(mBgBatteryUsageStatsPolling, delay);
+ }
+ }
+ }
+ }
+
+ @Override
+ void onUserStarted(final @UserIdInt int userId) {
+ synchronized (mLock) {
+ mActiveUserIdStates.put(userId, true);
+ }
+ }
+
+ @Override
+ void onUserStopped(final @UserIdInt int userId) {
+ synchronized (mLock) {
+ mActiveUserIdStates.put(userId, false);
+ }
+ }
+
+ @Override
+ void onUserRemoved(final @UserIdInt int userId) {
+ synchronized (mLock) {
+ mActiveUserIdStates.delete(userId);
+ for (int i = mUidBatteryUsage.size() - 1; i >= 0; i--) {
+ if (UserHandle.getUserId(mUidBatteryUsage.keyAt(i)) == userId) {
+ mUidBatteryUsage.removeAt(i);
+ }
+ }
+ for (int i = mUidBatteryUsageInWindow.size() - 1; i >= 0; i--) {
+ if (UserHandle.getUserId(mUidBatteryUsageInWindow.keyAt(i)) == userId) {
+ mUidBatteryUsageInWindow.removeAt(i);
+ }
+ }
+ }
+ }
+
+ @Override
+ void onUidRemoved(final int uid) {
+ synchronized (mLock) {
+ mUidBatteryUsage.delete(uid);
+ mUidBatteryUsageInWindow.delete(uid);
+ }
+ }
+
+ @Override
+ void onUserInteractionStarted(String packageName, int uid) {
+ mInjector.getPolicy().onUserInteractionStarted(packageName, uid);
+ }
+
+ @Override
+ void onBackgroundRestrictionChanged(int uid, String pkgName, boolean restricted) {
+ mInjector.getPolicy().onBackgroundRestrictionChanged(uid, pkgName, restricted);
+ }
+
+ /**
+ * @return The total battery usage of the given UID since the system boots.
+ *
+ * <p>
+ * Note: as there are throttling in polling the battery usage stats by
+ * the {@link #mBatteryUsageStatsPollingMinIntervalMs}, the returned data here
+ * could be either from the most recent polling, or the very fresh one - if the most recent
+ * polling is outdated, it'll trigger an immediate update.
+ * </p>
+ */
+ @Override
+ public double getUidBatteryUsage(int uid) {
+ final long now = mInjector.currentTimeMillis();
+ final boolean updated = updateBatteryUsageStatsIfNecessary(now, false);
+ synchronized (mLock) {
+ if (updated) {
+ // We just got fresh data, schedule a check right a way.
+ mBgHandler.removeCallbacks(mBgBatteryUsageStatsPolling);
+ if (!mBgHandler.hasCallbacks(mBgBatteryUsageStatsCheck)) {
+ mBgHandler.post(mBgBatteryUsageStatsCheck);
+ }
+ }
+ return mUidBatteryUsage.get(uid, 0.0d);
+ }
+ }
+
+ private void updateBatteryUsageStatsAndCheck() {
+ final long now = mInjector.currentTimeMillis();
+ if (updateBatteryUsageStatsIfNecessary(now, false)) {
+ checkBatteryUsageStats();
+ } else {
+ // We didn't do the battery stats update above, schedule a check later.
+ scheduleBatteryUsageStatsUpdateIfNecessary(
+ mLastBatteryUsageSamplingTs + mBatteryUsageStatsPollingMinIntervalMs - now);
+ }
+ }
+
+ private void checkBatteryUsageStats() {
+ final long now = SystemClock.elapsedRealtime();
+ final AppBatteryPolicy bgPolicy = mInjector.getPolicy();
+ try {
+ final SparseDoubleArray uidConsumers = mUidBatteryUsageInWindow;
+ final long since = Math.max(0, now - bgPolicy.mBgCurrentDrainWindowMs);
+ for (int i = 0, size = uidConsumers.size(); i < size; i++) {
+ final int uid = uidConsumers.keyAt(i);
+ final double actualUsage = uidConsumers.valueAt(i);
+ final double exemptedUsage = mAppRestrictionController
+ .getUidBatteryExemptedUsageSince(uid, since, now);
+ // It's possible the exemptedUsage could be larger than actualUsage,
+ // as the former one is an approximate value.
+ final double bgUsage = Math.max(0.0d, actualUsage - exemptedUsage);
+ final double percentage = bgPolicy.getPercentage(uid, bgUsage);
+ if (DEBUG_BACKGROUND_BATTERY_TRACKER) {
+ Slog.i(TAG, String.format(
+ "UID %d: %.3f mAh (or %4.2f%%) %.3f %.3f over the past %s",
+ uid, bgUsage, percentage, exemptedUsage, actualUsage,
+ TimeUtils.formatDuration(bgPolicy.mBgCurrentDrainWindowMs)));
+ }
+ bgPolicy.handleUidBatteryUsage(uid, percentage);
+ }
+ // For debugging only.
+ for (int i = 0, size = mDebugUidPercentages.size(); i < size; i++) {
+ bgPolicy.handleUidBatteryUsage(mDebugUidPercentages.keyAt(i),
+ mDebugUidPercentages.valueAt(i));
+ }
+ } finally {
+ scheduleBatteryUsageStatsUpdateIfNecessary(mBatteryUsageStatsPollingIntervalMs);
+ }
+ }
+
+ /**
+ * Update the battery usage stats data, if it's allowed to do so.
+ *
+ * @return {@code true} if the battery stats is up to date.
+ */
+ private boolean updateBatteryUsageStatsIfNecessary(long now, boolean forceUpdate) {
+ boolean needUpdate = false;
+ boolean updated = false;
+ synchronized (mLock) {
+ if (mLastBatteryUsageSamplingTs + mBatteryUsageStatsPollingMinIntervalMs < now
+ || forceUpdate) {
+ // The data we have is outdated.
+ if (mBatteryUsageStatsUpdatePending) {
+ // An update is ongoing in parallel, just wait for it.
+ try {
+ mLock.wait();
+ } catch (InterruptedException e) {
+ }
+ } else {
+ mBatteryUsageStatsUpdatePending = true;
+ needUpdate = true;
+ }
+ updated = true;
+ } else {
+ // The data is still fresh, no need to update it.
+ return false;
+ }
+ }
+ if (needUpdate) {
+ // We don't want to query the battery usage stats with mLock held.
+ updateBatteryUsageStatsOnce(now);
+ synchronized (mLock) {
+ mLastBatteryUsageSamplingTs = now;
+ mBatteryUsageStatsUpdatePending = false;
+ mLock.notifyAll();
+ }
+ }
+ return updated;
+ }
+
+ private void updateBatteryUsageStatsOnce(long now) {
+ final AppBatteryPolicy bgPolicy = mInjector.getPolicy();
+ final ArraySet<UserHandle> userIds = mTmpUserIds;
+ final SparseDoubleArray buf = mTmpUidBatteryUsage;
+ final BatteryStatsInternal batteryStatsInternal = mInjector.getBatteryStatsInternal();
+ final long windowSize = Math.min(now - mBootTimestamp, bgPolicy.mBgCurrentDrainWindowMs);
+
+ buf.clear();
+ userIds.clear();
+ synchronized (mLock) {
+ for (int i = mActiveUserIdStates.size() - 1; i >= 0; i--) {
+ userIds.add(UserHandle.of(mActiveUserIdStates.keyAt(i)));
+ if (!mActiveUserIdStates.valueAt(i)) {
+ mActiveUserIdStates.removeAt(i);
+ }
+ }
+ }
+
+ if (DEBUG_BACKGROUND_BATTERY_TRACKER) {
+ Slog.i(TAG, "updateBatteryUsageStatsOnce");
+ }
+
+ // Query the current battery usage stats.
+ BatteryUsageStatsQuery.Builder builder = new BatteryUsageStatsQuery.Builder()
+ .includeProcessStateData()
+ .setMaxStatsAgeMs(0);
+ final BatteryUsageStats stats = updateBatteryUsageStatsOnceInternal(
+ buf, builder, userIds, batteryStatsInternal);
+ final long curStart = stats != null ? stats.getStatsStartTimestamp() : 0L;
+ long curDuration = now - curStart;
+ boolean needUpdateUidBatteryUsageInWindow = true;
+
+ if (curDuration >= windowSize) {
+ // If we do have long enough data for the window, save it.
+ copyUidBatteryUsage(buf, mUidBatteryUsageInWindow, windowSize * 1.0d / curDuration);
+ needUpdateUidBatteryUsageInWindow = false;
+ }
+
+ // Save the current data, which includes the battery usage since last snapshot.
+ mTmpUidBatteryUsage2.clear();
+ copyUidBatteryUsage(buf, mTmpUidBatteryUsage2);
+
+ final long lastUidBatteryUsageStartTs = mLastUidBatteryUsageStartTs;
+ mLastUidBatteryUsageStartTs = curStart;
+ if (curStart > lastUidBatteryUsageStartTs && lastUidBatteryUsageStartTs > 0) {
+ // The battery usage stats committed data since our last query,
+ // let's query the snapshots to get the data since last start.
+ builder = new BatteryUsageStatsQuery.Builder()
+ .includeProcessStateData()
+ .aggregateSnapshots(lastUidBatteryUsageStartTs, curStart);
+ updateBatteryUsageStatsOnceInternal(buf, builder, userIds, batteryStatsInternal);
+ curDuration += curStart - lastUidBatteryUsageStartTs;
+ }
+ if (needUpdateUidBatteryUsageInWindow && curDuration > windowSize) {
+ // If we do have long enough data for the window, save it.
+ copyUidBatteryUsage(buf, mUidBatteryUsageInWindow, windowSize * 1.0d / curDuration);
+ needUpdateUidBatteryUsageInWindow = false;
+ }
+
+ // Add the delta into the global records.
+ for (int i = 0, size = buf.size(); i < size; i++) {
+ final int uid = buf.keyAt(i);
+ final int index = mUidBatteryUsage.indexOfKey(uid);
+ final double delta = Math.max(0.0d,
+ buf.valueAt(i) - mLastUidBatteryUsage.get(uid, 0.0d));
+ final double before;
+ if (index >= 0) {
+ before = mUidBatteryUsage.valueAt(index);
+ mUidBatteryUsage.setValueAt(index, before + delta);
+ } else {
+ before = 0.0d;
+ mUidBatteryUsage.put(uid, delta);
+ }
+ if (DEBUG_BACKGROUND_BATTERY_TRACKER) {
+ final double actualDelta = buf.valueAt(i) - mLastUidBatteryUsage.get(uid, 0.0d);
+ String msg = "Updating mUidBatteryUsage uid=" + uid + ", before=" + before
+ + ", after=" + mUidBatteryUsage.get(uid, 0.0d) + ", delta=" + actualDelta
+ + ", last=" + mLastUidBatteryUsage.get(uid, 0.0d)
+ + ", curStart=" + curStart
+ + ", lastLastStart=" + lastUidBatteryUsageStartTs
+ + ", thisLastStart=" + mLastUidBatteryUsageStartTs;
+ if (actualDelta < 0.0d) {
+ // Something is wrong, the battery usage shouldn't be negative.
+ Slog.e(TAG, msg);
+ } else {
+ Slog.i(TAG, msg);
+ }
+ }
+ }
+ // Now update the mLastUidBatteryUsage with the data we just saved above.
+ copyUidBatteryUsage(mTmpUidBatteryUsage2, mLastUidBatteryUsage);
+ mTmpUidBatteryUsage2.clear();
+
+ if (needUpdateUidBatteryUsageInWindow) {
+ // No sufficient data for the full window still, query snapshots again.
+ builder = new BatteryUsageStatsQuery.Builder()
+ .includeProcessStateData()
+ .aggregateSnapshots(now - windowSize, lastUidBatteryUsageStartTs);
+ updateBatteryUsageStatsOnceInternal(buf, builder, userIds, batteryStatsInternal);
+ copyUidBatteryUsage(buf, mUidBatteryUsageInWindow);
+ }
+ }
+
+ private static BatteryUsageStats updateBatteryUsageStatsOnceInternal(
+ SparseDoubleArray buf, BatteryUsageStatsQuery.Builder builder,
+ ArraySet<UserHandle> userIds, BatteryStatsInternal batteryStatsInternal) {
+ for (int i = 0, size = userIds.size(); i < size; i++) {
+ builder.addUser(userIds.valueAt(i));
+ }
+ final List<BatteryUsageStats> statsList = batteryStatsInternal
+ .getBatteryUsageStats(Arrays.asList(builder.build()));
+ if (ArrayUtils.isEmpty(statsList)) {
+ // Shouldn't happen unless in test.
+ return null;
+ }
+ final BatteryUsageStats stats = statsList.get(0);
+ final List<UidBatteryConsumer> uidConsumers = stats.getUidBatteryConsumers();
+ if (uidConsumers != null) {
+ for (UidBatteryConsumer uidConsumer : uidConsumers) {
+ // TODO: b/200326767 - as we are not supporting per proc state attribution yet,
+ // we couldn't distinguish between a real FGS vs. a bound FGS proc state.
+ final int uid = uidConsumer.getUid();
+ final double bgUsage = getBgUsage(uidConsumer);
+ int index = buf.indexOfKey(uid);
+ if (index < 0) {
+ buf.put(uid, bgUsage);
+ } else {
+ buf.setValueAt(index, buf.valueAt(index) + bgUsage);
+ }
+ if (DEBUG_BACKGROUND_BATTERY_TRACKER) {
+ Slog.i(TAG, "updateBatteryUsageStatsOnceInternal uid=" + uid
+ + ", bgUsage=" + bgUsage
+ + ", start=" + stats.getStatsStartTimestamp()
+ + ", end=" + stats.getStatsEndTimestamp());
+ }
+ }
+ }
+ return stats;
+ }
+
+ private static void copyUidBatteryUsage(SparseDoubleArray source, SparseDoubleArray dest) {
+ dest.clear();
+ for (int i = source.size() - 1; i >= 0; i--) {
+ dest.put(source.keyAt(i), source.valueAt(i));
+ }
+ }
+
+ private static void copyUidBatteryUsage(SparseDoubleArray source, SparseDoubleArray dest,
+ double scale) {
+ dest.clear();
+ for (int i = source.size() - 1; i >= 0; i--) {
+ dest.put(source.keyAt(i), source.valueAt(i) * scale);
+ }
+ }
+
+ private static double getBgUsage(final UidBatteryConsumer uidConsumer) {
+ return getConsumedPowerNoThrow(uidConsumer, BATT_DIMEN_BG)
+ + getConsumedPowerNoThrow(uidConsumer, BATT_DIMEN_FGS);
+ }
+
+ private static double getConsumedPowerNoThrow(final UidBatteryConsumer uidConsumer,
+ final BatteryConsumer.Dimensions dimens) {
+ try {
+ return uidConsumer.getConsumedPower(dimens);
+ } catch (IllegalArgumentException e) {
+ return 0.0d;
+ }
+ }
+
+ private void onCurrentDrainMonitorEnabled(boolean enabled) {
+ if (enabled) {
+ if (!mBgHandler.hasCallbacks(mBgBatteryUsageStatsPolling)) {
+ mBgHandler.postDelayed(mBgBatteryUsageStatsPolling,
+ mBatteryUsageStatsPollingIntervalMs);
+ }
+ } else {
+ mBgHandler.removeCallbacks(mBgBatteryUsageStatsPolling);
+ synchronized (mLock) {
+ if (mBatteryUsageStatsUpdatePending) {
+ // An update is ongoing in parallel, just wait for it.
+ try {
+ mLock.wait();
+ } catch (InterruptedException e) {
+ }
+ }
+ mUidBatteryUsage.clear();
+ mUidBatteryUsageInWindow.clear();
+ mLastUidBatteryUsage.clear();
+ mLastUidBatteryUsageStartTs = mLastBatteryUsageSamplingTs = 0L;
+ }
+ }
+ }
+
+ @VisibleForTesting
+ void reset() {
+ synchronized (mLock) {
+ mUidBatteryUsage.clear();
+ mUidBatteryUsageInWindow.clear();
+ mLastUidBatteryUsage.clear();
+ mLastUidBatteryUsageStartTs = mLastBatteryUsageSamplingTs = 0L;
+ }
+ mBgHandler.removeCallbacks(mBgBatteryUsageStatsPolling);
+ updateBatteryUsageStatsAndCheck();
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ pw.print(prefix);
+ pw.println("APP BATTERY STATE TRACKER:");
+ updateBatteryUsageStatsIfNecessary(mInjector.currentTimeMillis(), true);
+ final SparseDoubleArray uidConsumers = mUidBatteryUsageInWindow;
+ pw.print(" " + prefix);
+ pw.print("Boot=");
+ TimeUtils.dumpTime(pw, mBootTimestamp);
+ pw.print(" Last battery usage start=");
+ TimeUtils.dumpTime(pw, mLastUidBatteryUsageStartTs);
+ pw.println();
+ pw.print(" " + prefix);
+ pw.print("Battery usage over last ");
+ final String newPrefix = " " + prefix;
+ final AppBatteryPolicy bgPolicy = mInjector.getPolicy();
+ final long now = SystemClock.elapsedRealtime();
+ final long since = Math.max(0, now - bgPolicy.mBgCurrentDrainWindowMs);
+ pw.println(TimeUtils.formatDuration(now - since));
+ if (uidConsumers.size() == 0) {
+ pw.print(newPrefix);
+ pw.println("(none)");
+ } else {
+ for (int i = 0, size = uidConsumers.size(); i < size; i++) {
+ final int uid = uidConsumers.keyAt(i);
+ final double bgUsage = uidConsumers.valueAt(i);
+ final double exemptedUsage = mAppRestrictionController
+ .getUidBatteryExemptedUsageSince(uid, since, now);
+ final double reportedUsage = Math.max(0.0d, bgUsage - exemptedUsage);
+ pw.format("%s%s: [%s] %.3f mAh (%4.2f%%) | %.3f mAh (%4.2f%%) | "
+ + "%.3f mAh (%4.2f%%) | %.3f mAh\n",
+ newPrefix, UserHandle.formatUid(uid),
+ PowerExemptionManager.reasonCodeToString(bgPolicy.shouldExemptUid(uid)),
+ bgUsage , bgPolicy.getPercentage(uid, bgUsage),
+ exemptedUsage, bgPolicy.getPercentage(-1, exemptedUsage),
+ reportedUsage, bgPolicy.getPercentage(-1, reportedUsage),
+ mUidBatteryUsage.get(uid, 0.0d));
+ }
+ }
+ super.dump(pw, prefix);
+ }
+
+ static final class AppBatteryPolicy extends BaseAppStatePolicy<AppBatteryTracker> {
+ /**
+ * Whether or not we should enable the monitoring on background current drains.
+ */
+ static final String KEY_BG_CURRENT_DRAIN_MONITOR_ENABLED =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "current_drain_monitor_enabled";
+
+ /**
+ * The threshold of the background current drain (in percentage) to the restricted
+ * standby bucket. In conjunction with the {@link #KEY_BG_CURRENT_DRAIN_WINDOW},
+ * the app could be moved to more restricted standby bucket when its background current
+ * drain rate is over this limit.
+ */
+ static final String KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_RESTRICTED_BUCKET =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "current_drain_threshold_to_restricted_bucket";
+
+ /**
+ * The threshold of the background current drain (in percentage) to the background
+ * restricted level. In conjunction with the {@link #KEY_BG_CURRENT_DRAIN_WINDOW},
+ * the app could be moved to more restricted level when its background current
+ * drain rate is over this limit.
+ */
+ static final String KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_BG_RESTRICTED =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "current_drain_threshold_to_bg_restricted";
+
+ /**
+ * The background current drain window size. In conjunction with the
+ * {@link #KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_RESTRICTED_BUCKET}, the app could be moved to
+ * more restrictive bucket when its background current drain rate is over this limit.
+ */
+ static final String KEY_BG_CURRENT_DRAIN_WINDOW =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "current_drain_window";
+
+ /**
+ * Similar to {@link #KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_RESTRICTED_BUCKET}, but a higher
+ * value for the legitimate cases with higher background current drain.
+ */
+ static final String KEY_BG_CURRENT_DRAIN_HIGH_THRESHOLD_TO_RESTRICTED_BUCKET =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX
+ + "current_drain_high_threshold_to_restricted_bucket";
+
+ /**
+ * Similar to {@link #KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_BG_RESTRICTED}, but a higher value
+ * for the legitimate cases with higher background current drain.
+ */
+ static final String KEY_BG_CURRENT_DRAIN_HIGH_THRESHOLD_TO_BG_RESTRICTED =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "current_drain_high_threshold_to_bg_restricted";
+
+ /**
+ * The threshold of minimal time of hosting a foreground service with type "mediaPlayback"
+ * or a media session, over the given window, so it'd subject towards the higher
+ * background current drain threshold as defined in
+ * {@link #mBgCurrentDrainBgRestrictedHighThreshold}.
+ */
+ static final String KEY_BG_CURRENT_DRAIN_MEDIA_PLAYBACK_MIN_DURATION =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "current_drain_media_playback_min_duration";
+
+ /**
+ * Similar to {@link #KEY_BG_CURRENT_DRAIN_MEDIA_PLAYBACK_MIN_DURATION} but for foreground
+ * service with type "location".
+ */
+ static final String KEY_BG_CURRENT_DRAIN_LOCATION_MIN_DURATION =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "current_drain_location_min_duration";
+
+ /**
+ * Whether or not we should enable the different threshold based on the durations of
+ * certain event type.
+ */
+ static final String KEY_BG_CURRENT_DRAIN_EVENT_DURATION_BASED_THRESHOLD_ENABLED =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX
+ + "current_drain_event_duration_based_threshold_enabled";
+
+ /**
+ * Default value to {@link #mTrackerEnabled}.
+ */
+ static final boolean DEFAULT_BG_CURRENT_DRAIN_MONITOR_ENABLED = true;
+
+ /**
+ * Default value to the {@link #INDEX_REGULAR_CURRENT_DRAIN_THRESHOLD} of
+ * the {@link #mBgCurrentDrainRestrictedBucketThreshold}.
+ */
+ static final float DEFAULT_BG_CURRENT_DRAIN_RESTRICTED_BUCKET_THRESHOLD =
+ isLowRamDeviceStatic() ? 4.0f : 2.0f;
+
+ /**
+ * Default value to the {@link #INDEX_REGULAR_CURRENT_DRAIN_THRESHOLD} of
+ * the {@link #mBgCurrentDrainBgRestrictedThreshold}.
+ */
+ static final float DEFAULT_BG_CURRENT_DRAIN_BG_RESTRICTED_THRESHOLD =
+ isLowRamDeviceStatic() ? 8.0f : 4.0f;
+
+ /**
+ * Default value to {@link #mBgCurrentDrainWindowMs}.
+ */
+ static final long DEFAULT_BG_CURRENT_DRAIN_WINDOW_MS = ONE_DAY;
+
+ /**
+ * Default value to the {@link #INDEX_HIGH_CURRENT_DRAIN_THRESHOLD} of
+ * the {@link #mBgCurrentDrainRestrictedBucketThreshold}.
+ */
+ static final float DEFAULT_BG_CURRENT_DRAIN_RESTRICTED_BUCKET_HIGH_THRESHOLD =
+ isLowRamDeviceStatic() ? 60.0f : 30.0f;
+
+ /**
+ * Default value to the {@link #INDEX_HIGH_CURRENT_DRAIN_THRESHOLD} of
+ * the {@link #mBgCurrentDrainBgRestrictedThreshold}.
+ */
+ static final float DEFAULT_BG_CURRENT_DRAIN_BG_RESTRICTED_HIGH_THRESHOLD =
+ isLowRamDeviceStatic() ? 60.0f : 30.0f;
+
+ /**
+ * Default value to {@link #mBgCurrentDrainMediaPlaybackMinDuration}.
+ */
+ static final long DEFAULT_BG_CURRENT_DRAIN_MEDIA_PLAYBACK_MIN_DURATION = 30 * ONE_MINUTE;
+
+ /**
+ * Default value to {@link #mBgCurrentDrainLocationMinDuration}.
+ */
+ static final long DEFAULT_BG_CURRENT_DRAIN_LOCATION_MIN_DURATION = 30 * ONE_MINUTE;
+
+ /**
+ * Default value to {@link #mBgCurrentDrainEventDurationBasedThresholdEnabled}.
+ */
+ static final boolean DEFAULT_BG_CURRENT_DRAIN_EVENT_DURATION_BASED_THRESHOLD_ENABLED =
+ false;
+
+ /**
+ * The index to {@link #mBgCurrentDrainRestrictedBucketThreshold}
+ * and {@link #mBgCurrentDrainBgRestrictedThreshold}.
+ */
+ static final int INDEX_REGULAR_CURRENT_DRAIN_THRESHOLD = 0;
+ static final int INDEX_HIGH_CURRENT_DRAIN_THRESHOLD = 1;
+
+ /**
+ * @see #KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_RESTRICTED_BUCKET.
+ * @see #KEY_BG_CURRENT_DRAIN_HIGH_THRESHOLD_TO_RESTRICTED_BUCKET.
+ */
+ volatile float[] mBgCurrentDrainRestrictedBucketThreshold = {
+ DEFAULT_BG_CURRENT_DRAIN_RESTRICTED_BUCKET_THRESHOLD,
+ DEFAULT_BG_CURRENT_DRAIN_BG_RESTRICTED_HIGH_THRESHOLD,
+ };
+
+ /**
+ * @see #KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_BG_RESTRICTED.
+ * @see #KEY_BG_CURRENT_DRAIN_HIGH_THRESHOLD_TO_BG_RESTRICTED.
+ */
+ volatile float[] mBgCurrentDrainBgRestrictedThreshold = {
+ DEFAULT_BG_CURRENT_DRAIN_BG_RESTRICTED_THRESHOLD,
+ DEFAULT_BG_CURRENT_DRAIN_BG_RESTRICTED_HIGH_THRESHOLD,
+ };
+
+ /**
+ * @see #KEY_BG_CURRENT_DRAIN_WINDOW.
+ */
+ volatile long mBgCurrentDrainWindowMs = DEFAULT_BG_CURRENT_DRAIN_WINDOW_MS;
+
+ /**
+ * @see #KEY_BG_CURRENT_DRAIN_MEDIA_PLAYBACK_MIN_DURATION.
+ */
+ volatile long mBgCurrentDrainMediaPlaybackMinDuration =
+ DEFAULT_BG_CURRENT_DRAIN_MEDIA_PLAYBACK_MIN_DURATION;
+
+ /**
+ * @see #KEY_BG_CURRENT_DRAIN_LOCATION_MIN_DURATION.
+ */
+ volatile long mBgCurrentDrainLocationMinDuration =
+ DEFAULT_BG_CURRENT_DRAIN_LOCATION_MIN_DURATION;
+
+ /**
+ * @see #KEY_BG_CURRENT_DRAIN_EVENT_DURATION_BASED_THRESHOLD_ENABLED.
+ */
+ volatile boolean mBgCurrentDrainEventDurationBasedThresholdEnabled;
+
+ /**
+ * The capacity of the battery when fully charged in mAh.
+ */
+ private int mBatteryFullChargeMah;
+
+ /**
+ * List of the packages with significant background battery usage, key is the UID of
+ * the package and value is an array of the timestamps when the UID is found guilty and
+ * should be moved to the next level of restriction.
+ */
+ @GuardedBy("mLock")
+ private final SparseArray<long[]> mHighBgBatteryPackages = new SparseArray<>();
+
+ @NonNull
+ private final Object mLock;
+
+ private static final int TIME_STAMP_INDEX_RESTRICTED_BUCKET = 0;
+ private static final int TIME_STAMP_INDEX_BG_RESTRICTED = 1;
+ private static final int TIME_STAMP_INDEX_LAST = 2;
+
+ AppBatteryPolicy(@NonNull Injector injector, @NonNull AppBatteryTracker tracker) {
+ super(injector, tracker, KEY_BG_CURRENT_DRAIN_MONITOR_ENABLED,
+ DEFAULT_BG_CURRENT_DRAIN_MONITOR_ENABLED);
+ mLock = tracker.mLock;
+ }
+
+ @Override
+ public void onPropertiesChanged(String name) {
+ switch (name) {
+ case KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_RESTRICTED_BUCKET:
+ case KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_BG_RESTRICTED:
+ case KEY_BG_CURRENT_DRAIN_HIGH_THRESHOLD_TO_RESTRICTED_BUCKET:
+ case KEY_BG_CURRENT_DRAIN_HIGH_THRESHOLD_TO_BG_RESTRICTED:
+ updateCurrentDrainThreshold();
+ break;
+ case KEY_BG_CURRENT_DRAIN_WINDOW:
+ updateCurrentDrainWindow();
+ break;
+ case KEY_BG_CURRENT_DRAIN_MEDIA_PLAYBACK_MIN_DURATION:
+ updateCurrentDrainMediaPlaybackMinDuration();
+ break;
+ case KEY_BG_CURRENT_DRAIN_LOCATION_MIN_DURATION:
+ updateCurrentDrainLocationMinDuration();
+ break;
+ case KEY_BG_CURRENT_DRAIN_EVENT_DURATION_BASED_THRESHOLD_ENABLED:
+ updateCurrentDrainEventDurationBasedThresholdEnabled();
+ break;
+ default:
+ super.onPropertiesChanged(name);
+ break;
+ }
+ }
+
+ void updateTrackerEnabled() {
+ if (mBatteryFullChargeMah > 0) {
+ super.updateTrackerEnabled();
+ } else {
+ mTrackerEnabled = false;
+ onTrackerEnabled(false);
+ }
+ }
+
+ public void onTrackerEnabled(boolean enabled) {
+ mTracker.onCurrentDrainMonitorEnabled(enabled);
+ }
+
+ private void updateCurrentDrainThreshold() {
+ mBgCurrentDrainRestrictedBucketThreshold[INDEX_REGULAR_CURRENT_DRAIN_THRESHOLD] =
+ DeviceConfig.getFloat(DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_RESTRICTED_BUCKET,
+ DEFAULT_BG_CURRENT_DRAIN_RESTRICTED_BUCKET_THRESHOLD);
+ mBgCurrentDrainRestrictedBucketThreshold[INDEX_HIGH_CURRENT_DRAIN_THRESHOLD] =
+ DeviceConfig.getFloat(DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_CURRENT_DRAIN_HIGH_THRESHOLD_TO_RESTRICTED_BUCKET,
+ DEFAULT_BG_CURRENT_DRAIN_RESTRICTED_BUCKET_HIGH_THRESHOLD);
+ mBgCurrentDrainBgRestrictedThreshold[INDEX_REGULAR_CURRENT_DRAIN_THRESHOLD] =
+ DeviceConfig.getFloat(DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_BG_RESTRICTED,
+ DEFAULT_BG_CURRENT_DRAIN_BG_RESTRICTED_THRESHOLD);
+ mBgCurrentDrainBgRestrictedThreshold[INDEX_HIGH_CURRENT_DRAIN_THRESHOLD] =
+ DeviceConfig.getFloat(DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_CURRENT_DRAIN_HIGH_THRESHOLD_TO_BG_RESTRICTED,
+ DEFAULT_BG_CURRENT_DRAIN_BG_RESTRICTED_HIGH_THRESHOLD);
+ }
+
+ private void updateCurrentDrainWindow() {
+ mBgCurrentDrainWindowMs = DeviceConfig.getLong(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_CURRENT_DRAIN_WINDOW,
+ mBgCurrentDrainWindowMs != DEFAULT_BG_CURRENT_DRAIN_WINDOW_MS
+ ? mBgCurrentDrainWindowMs : DEFAULT_BG_CURRENT_DRAIN_WINDOW_MS);
+ }
+
+ private void updateCurrentDrainMediaPlaybackMinDuration() {
+ mBgCurrentDrainMediaPlaybackMinDuration = DeviceConfig.getLong(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_CURRENT_DRAIN_MEDIA_PLAYBACK_MIN_DURATION,
+ DEFAULT_BG_CURRENT_DRAIN_MEDIA_PLAYBACK_MIN_DURATION);
+ }
+
+ private void updateCurrentDrainLocationMinDuration() {
+ mBgCurrentDrainLocationMinDuration = DeviceConfig.getLong(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_CURRENT_DRAIN_LOCATION_MIN_DURATION,
+ DEFAULT_BG_CURRENT_DRAIN_LOCATION_MIN_DURATION);
+ }
+
+ private void updateCurrentDrainEventDurationBasedThresholdEnabled() {
+ mBgCurrentDrainEventDurationBasedThresholdEnabled = DeviceConfig.getBoolean(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_CURRENT_DRAIN_EVENT_DURATION_BASED_THRESHOLD_ENABLED,
+ DEFAULT_BG_CURRENT_DRAIN_EVENT_DURATION_BASED_THRESHOLD_ENABLED);
+ }
+
+ @Override
+ public void onSystemReady() {
+ mBatteryFullChargeMah =
+ mInjector.getBatteryManagerInternal().getBatteryFullCharge() / 1000;
+ super.onSystemReady();
+ updateCurrentDrainThreshold();
+ updateCurrentDrainWindow();
+ updateCurrentDrainMediaPlaybackMinDuration();
+ updateCurrentDrainLocationMinDuration();
+ updateCurrentDrainEventDurationBasedThresholdEnabled();
+ }
+
+ @Override
+ public @RestrictionLevel int getProposedRestrictionLevel(String packageName, int uid) {
+ synchronized (mLock) {
+ final int index = mHighBgBatteryPackages.indexOfKey(uid);
+ if (index < 0) {
+ // Not found, return adaptive as the default one.
+ return RESTRICTION_LEVEL_ADAPTIVE_BUCKET;
+ }
+ final long[] ts = mHighBgBatteryPackages.valueAt(index);
+ return ts[TIME_STAMP_INDEX_BG_RESTRICTED] > 0
+ ? RESTRICTION_LEVEL_BACKGROUND_RESTRICTED
+ : RESTRICTION_LEVEL_RESTRICTED_BUCKET;
+ }
+ }
+
+ double getBgUsage(final UidBatteryConsumer uidConsumer) {
+ return getConsumedPowerNoThrow(uidConsumer, BATT_DIMEN_BG)
+ + getConsumedPowerNoThrow(uidConsumer, BATT_DIMEN_FGS);
+ }
+
+ double getPercentage(final int uid, final double usage) {
+ final double actualPercentage = usage / mBatteryFullChargeMah * 100;
+ return DEBUG_BACKGROUND_BATTERY_TRACKER
+ ? mTracker.mDebugUidPercentages.get(uid, actualPercentage) : actualPercentage;
+ }
+
+ void handleUidBatteryUsage(final int uid, final double percentage) {
+ final @ReasonCode int reason = shouldExemptUid(uid);
+ if (reason != REASON_DENIED) {
+ if (DEBUG_BACKGROUND_BATTERY_TRACKER) {
+ Slog.i(TAG, "Exempting battery usage in " + UserHandle.formatUid(uid)
+ + " " + PowerExemptionManager.reasonCodeToString(reason));
+ }
+ return;
+ }
+ boolean notifyController = false;
+ boolean excessive = false;
+ synchronized (mLock) {
+ final int curLevel = mTracker.mAppRestrictionController.getRestrictionLevel(uid);
+ if (curLevel >= RESTRICTION_LEVEL_BACKGROUND_RESTRICTED) {
+ // We're already in the background restricted level, nothing more we could do.
+ return;
+ }
+ final long now = SystemClock.elapsedRealtime();
+ final int thresholdIndex = getCurrentDrainThresholdIndex(uid, now,
+ mBgCurrentDrainWindowMs);
+ final int index = mHighBgBatteryPackages.indexOfKey(uid);
+ if (index < 0) {
+ if (percentage >= mBgCurrentDrainRestrictedBucketThreshold[thresholdIndex]) {
+ // New findings to us, track it and let the controller know.
+ final long[] ts = new long[TIME_STAMP_INDEX_LAST];
+ ts[TIME_STAMP_INDEX_RESTRICTED_BUCKET] = now;
+ mHighBgBatteryPackages.put(uid, ts);
+ notifyController = excessive = true;
+ }
+ } else {
+ final long[] ts = mHighBgBatteryPackages.valueAt(index);
+ if (percentage < mBgCurrentDrainRestrictedBucketThreshold[thresholdIndex]) {
+ // it's actually back to normal, but we don't untrack it until
+ // explicit user interactions.
+ notifyController = true;
+ } else {
+ excessive = true;
+ if (percentage >= mBgCurrentDrainBgRestrictedThreshold[thresholdIndex]) {
+ // If we're in the restricted standby bucket but still seeing high
+ // current drains, tell the controller again.
+ if (curLevel == RESTRICTION_LEVEL_RESTRICTED_BUCKET
+ && ts[TIME_STAMP_INDEX_BG_RESTRICTED] == 0) {
+ if (now > ts[TIME_STAMP_INDEX_RESTRICTED_BUCKET]
+ + mBgCurrentDrainWindowMs) {
+ ts[TIME_STAMP_INDEX_BG_RESTRICTED] = now;
+ notifyController = true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (excessive) {
+ if (DEBUG_BACKGROUND_BATTERY_TRACKER) {
+ Slog.i(TAG, "Excessive background current drain " + uid
+ + String.format(" %.2f%%", percentage) + " over "
+ + TimeUtils.formatDuration(mBgCurrentDrainWindowMs));
+ }
+ if (notifyController) {
+ mTracker.mAppRestrictionController.refreshAppRestrictionLevelForUid(
+ uid, REASON_MAIN_FORCED_BY_SYSTEM,
+ REASON_SUB_FORCED_SYSTEM_FLAG_ABUSE, true);
+ }
+ } else {
+ if (DEBUG_BACKGROUND_BATTERY_TRACKER) {
+ Slog.i(TAG, "Background current drain backs to normal " + uid
+ + String.format(" %.2f%%", percentage) + " over "
+ + TimeUtils.formatDuration(mBgCurrentDrainWindowMs));
+ }
+ // For now, we're not lifting the restrictions if the bg current drain backs to
+ // normal util an explicit user interaction.
+ }
+ }
+
+ private int getCurrentDrainThresholdIndex(int uid, long now, long window) {
+ return (hasMediaPlayback(uid, now, window) || hasLocation(uid, now, window))
+ ? INDEX_HIGH_CURRENT_DRAIN_THRESHOLD
+ : INDEX_REGULAR_CURRENT_DRAIN_THRESHOLD;
+ }
+
+ private boolean hasMediaPlayback(int uid, long now, long window) {
+ return mBgCurrentDrainEventDurationBasedThresholdEnabled
+ && mTracker.mAppRestrictionController.getCompositeMediaPlaybackDurations(
+ uid, now, window) >= mBgCurrentDrainMediaPlaybackMinDuration;
+ }
+
+ private boolean hasLocation(int uid, long now, long window) {
+ final AppRestrictionController controller = mTracker.mAppRestrictionController;
+ if (mInjector.getPermissionManagerServiceInternal().checkUidPermission(
+ uid, ACCESS_BACKGROUND_LOCATION) == PERMISSION_GRANTED) {
+ return true;
+ }
+ if (!mBgCurrentDrainEventDurationBasedThresholdEnabled) {
+ return false;
+ }
+ final long since = Math.max(0, now - window);
+ final long locationDuration = controller.getForegroundServiceTotalDurationsSince(
+ uid, since, now, ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION);
+ return locationDuration >= mBgCurrentDrainLocationMinDuration;
+ }
+
+ void onUserInteractionStarted(String packageName, int uid) {
+ boolean changed = false;
+ synchronized (mLock) {
+ final int curLevel = mTracker.mAppRestrictionController.getRestrictionLevel(
+ uid, packageName);
+ if (curLevel == RESTRICTION_LEVEL_BACKGROUND_RESTRICTED) {
+ // It's a sticky state, user interaction won't change it, still track it.
+ } else {
+ // Remove the given UID from our tracking list, as user interacted with it.
+ final int index = mHighBgBatteryPackages.indexOfKey(uid);
+ if (index >= 0) {
+ mHighBgBatteryPackages.removeAt(index);
+ changed = true;
+ }
+ }
+ }
+ if (changed) {
+ // Request to refresh the app restriction level.
+ mTracker.mAppRestrictionController.refreshAppRestrictionLevelForUid(uid,
+ REASON_MAIN_USAGE, REASON_SUB_USAGE_USER_INTERACTION, true);
+ }
+ }
+
+ void onBackgroundRestrictionChanged(int uid, String pkgName, boolean restricted) {
+ if (restricted) {
+ return;
+ }
+ synchronized (mLock) {
+ // User has explicitly removed it from background restricted level,
+ // clear the timestamp of the background-restricted
+ final long[] ts = mHighBgBatteryPackages.get(uid);
+ if (ts != null) {
+ ts[TIME_STAMP_INDEX_BG_RESTRICTED] = 0;
+ }
+ }
+ }
+
+ private double getConsumedPowerNoThrow(final UidBatteryConsumer uidConsumer,
+ final BatteryConsumer.Dimensions dimens) {
+ try {
+ return uidConsumer.getConsumedPower(dimens);
+ } catch (IllegalArgumentException e) {
+ return 0.0d;
+ }
+ }
+
+ @VisibleForTesting
+ void reset() {
+ mHighBgBatteryPackages.clear();
+ mTracker.reset();
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ pw.print(prefix);
+ pw.println("APP BATTERY TRACKER POLICY SETTINGS:");
+ final String indent = " ";
+ prefix = indent + prefix;
+ super.dump(pw, prefix);
+ if (isEnabled()) {
+ pw.print(prefix);
+ pw.print(KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_RESTRICTED_BUCKET);
+ pw.print('=');
+ pw.println(mBgCurrentDrainRestrictedBucketThreshold[
+ INDEX_REGULAR_CURRENT_DRAIN_THRESHOLD]);
+ pw.print(prefix);
+ pw.print(KEY_BG_CURRENT_DRAIN_HIGH_THRESHOLD_TO_RESTRICTED_BUCKET);
+ pw.print('=');
+ pw.println(mBgCurrentDrainRestrictedBucketThreshold[
+ INDEX_HIGH_CURRENT_DRAIN_THRESHOLD]);
+ pw.print(prefix);
+ pw.print(KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_BG_RESTRICTED);
+ pw.print('=');
+ pw.println(mBgCurrentDrainBgRestrictedThreshold[
+ INDEX_REGULAR_CURRENT_DRAIN_THRESHOLD]);
+ pw.print(prefix);
+ pw.print(KEY_BG_CURRENT_DRAIN_HIGH_THRESHOLD_TO_BG_RESTRICTED);
+ pw.print('=');
+ pw.println(mBgCurrentDrainBgRestrictedThreshold[
+ INDEX_HIGH_CURRENT_DRAIN_THRESHOLD]);
+ pw.print(prefix);
+ pw.print(KEY_BG_CURRENT_DRAIN_WINDOW);
+ pw.print('=');
+ pw.println(mBgCurrentDrainWindowMs);
+ pw.print(prefix);
+ pw.print(KEY_BG_CURRENT_DRAIN_MEDIA_PLAYBACK_MIN_DURATION);
+ pw.print('=');
+ pw.println(mBgCurrentDrainMediaPlaybackMinDuration);
+ pw.print(prefix);
+ pw.print(KEY_BG_CURRENT_DRAIN_LOCATION_MIN_DURATION);
+ pw.print('=');
+ pw.println(mBgCurrentDrainLocationMinDuration);
+ pw.print(prefix);
+ pw.print(KEY_BG_CURRENT_DRAIN_EVENT_DURATION_BASED_THRESHOLD_ENABLED);
+ pw.print('=');
+ pw.println(mBgCurrentDrainEventDurationBasedThresholdEnabled);
+
+ pw.print(prefix);
+ pw.println("Excessive current drain detected:");
+ synchronized (mLock) {
+ final int size = mHighBgBatteryPackages.size();
+ prefix = indent + prefix;
+ if (size > 0) {
+ final long now = SystemClock.elapsedRealtime();
+ for (int i = 0; i < size; i++) {
+ final int uid = mHighBgBatteryPackages.keyAt(i);
+ final long[] ts = mHighBgBatteryPackages.valueAt(i);
+ final int thresholdIndex = getCurrentDrainThresholdIndex(uid, now,
+ mBgCurrentDrainWindowMs);
+ pw.format("%s%s: (threshold=%4.2f%%/%4.2f%%) %s/%s\n",
+ prefix,
+ UserHandle.formatUid(uid),
+ mBgCurrentDrainRestrictedBucketThreshold[thresholdIndex],
+ mBgCurrentDrainBgRestrictedThreshold[thresholdIndex],
+ ts[TIME_STAMP_INDEX_RESTRICTED_BUCKET] == 0 ? "0"
+ : formatTime(ts[TIME_STAMP_INDEX_RESTRICTED_BUCKET], now),
+ ts[TIME_STAMP_INDEX_BG_RESTRICTED] == 0 ? "0"
+ : formatTime(ts[TIME_STAMP_INDEX_BG_RESTRICTED], now));
+ }
+ } else {
+ pw.print(prefix);
+ pw.println("(none)");
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/AppBindServiceEventsTracker.java b/services/core/java/com/android/server/am/AppBindServiceEventsTracker.java
new file mode 100644
index 0000000..9e3cae6
--- /dev/null
+++ b/services/core/java/com/android/server/am/AppBindServiceEventsTracker.java
@@ -0,0 +1,142 @@
+/*
+ * 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.server.am;
+
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
+import static com.android.server.am.AppRestrictionController.DEVICE_CONFIG_SUBNAMESPACE_PREFIX;
+import static com.android.server.am.BaseAppStateTracker.ONE_DAY;
+
+import android.annotation.NonNull;
+import android.app.ActivityManagerInternal.BindServiceEventListener;
+import android.content.Context;
+
+import com.android.server.am.AppBindServiceEventsTracker.AppBindServiceEventsPolicy;
+import com.android.server.am.BaseAppStateTimeSlotEventsTracker.SimpleAppStateTimeslotEvents;
+import com.android.server.am.BaseAppStateTracker.Injector;
+
+import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+
+final class AppBindServiceEventsTracker extends BaseAppStateTimeSlotEventsTracker
+ <AppBindServiceEventsPolicy, SimpleAppStateTimeslotEvents>
+ implements BindServiceEventListener {
+
+ static final String TAG = TAG_WITH_CLASS_NAME ? "AppBindServiceEventsTracker" : TAG_AM;
+
+ static final boolean DEBUG_APP_STATE_BIND_SERVICE_EVENT_TRACKER = false;
+
+ AppBindServiceEventsTracker(Context context, AppRestrictionController controller) {
+ this(context, controller, null, null);
+ }
+
+ AppBindServiceEventsTracker(Context context, AppRestrictionController controller,
+ Constructor<? extends Injector<AppBindServiceEventsPolicy>> injector,
+ Object outerContext) {
+ super(context, controller, injector, outerContext);
+ mInjector.setPolicy(new AppBindServiceEventsPolicy(mInjector, this));
+ }
+
+ @Override
+ public void onBindingService(String packageName, int uid) {
+ if (mInjector.getPolicy().isEnabled()) {
+ onNewEvent(packageName, uid);
+ }
+ }
+
+ @Override
+ void onSystemReady() {
+ super.onSystemReady();
+ mInjector.getActivityManagerInternal().addBindServiceEventListener(this);
+ }
+
+ @Override
+ public SimpleAppStateTimeslotEvents createAppStateEvents(int uid, String packageName) {
+ return new SimpleAppStateTimeslotEvents(uid, packageName,
+ mInjector.getPolicy().getTimeSlotSize(), TAG, mInjector.getPolicy());
+ }
+
+ @Override
+ public SimpleAppStateTimeslotEvents createAppStateEvents(SimpleAppStateTimeslotEvents other) {
+ return new SimpleAppStateTimeslotEvents(other);
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ pw.print(prefix);
+ pw.println("APP BIND SERVICE EVENT TRACKER:");
+ super.dump(pw, " " + prefix);
+ }
+
+ static final class AppBindServiceEventsPolicy
+ extends BaseAppStateTimeSlotEventsPolicy<AppBindServiceEventsTracker> {
+ /**
+ * Whether or not we should enable the monitoring on abusive service bindings requests.
+ */
+ static final String KEY_BG_BIND_SVC_MONITOR_ENABLED =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "bind_svc_monitor_enabled";
+
+ /**
+ * The size of the sliding window in which the number of service binding requests is checked
+ * against the threshold.
+ */
+ static final String KEY_BG_BIND_SVC_WINDOW =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "bind_svc_window";
+
+ /**
+ * The threshold at where the number of service binding requests are considered as
+ * "excessive" within the given window.
+ */
+ static final String KEY_BG_EX_BIND_SVC_THRESHOLD =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "ex_bind_svc_threshold";
+
+ /**
+ * Default value to {@link #mTrackerEnabled}.
+ */
+ static final boolean DEFAULT_BG_BIND_SVC_MONITOR_ENABLED = true;
+
+ /**
+ * Default value to {@link #mMaxTrackingDuration}.
+ */
+ static final long DEFAULT_BG_BIND_SVC_WINDOW = ONE_DAY;
+
+ /**
+ * Default value to {@link #mNumOfEventsThreshold}.
+ */
+ static final int DEFAULT_BG_EX_BIND_SVC_THRESHOLD = 10_000;
+
+ AppBindServiceEventsPolicy(@NonNull Injector injector,
+ @NonNull AppBindServiceEventsTracker tracker) {
+ super(injector, tracker,
+ KEY_BG_BIND_SVC_MONITOR_ENABLED, DEFAULT_BG_BIND_SVC_MONITOR_ENABLED,
+ KEY_BG_BIND_SVC_WINDOW, DEFAULT_BG_BIND_SVC_WINDOW,
+ KEY_BG_EX_BIND_SVC_THRESHOLD, DEFAULT_BG_EX_BIND_SVC_THRESHOLD);
+ }
+
+ @Override
+ String getEventName() {
+ return "bindservice";
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ pw.print(prefix);
+ pw.println("APP BIND SERVICE EVENT TRACKER POLICY SETTINGS:");
+ super.dump(pw, " " + prefix);
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/AppBroadcastEventsTracker.java b/services/core/java/com/android/server/am/AppBroadcastEventsTracker.java
new file mode 100644
index 0000000..cafae40
--- /dev/null
+++ b/services/core/java/com/android/server/am/AppBroadcastEventsTracker.java
@@ -0,0 +1,141 @@
+/*
+ * 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.server.am;
+
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
+import static com.android.server.am.AppRestrictionController.DEVICE_CONFIG_SUBNAMESPACE_PREFIX;
+import static com.android.server.am.BaseAppStateTracker.ONE_DAY;
+
+import android.annotation.NonNull;
+import android.app.ActivityManagerInternal.BroadcastEventListener;
+import android.content.Context;
+
+import com.android.server.am.AppBroadcastEventsTracker.AppBroadcastEventsPolicy;
+import com.android.server.am.BaseAppStateTimeSlotEventsTracker.SimpleAppStateTimeslotEvents;
+import com.android.server.am.BaseAppStateTracker.Injector;
+
+import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+
+final class AppBroadcastEventsTracker extends BaseAppStateTimeSlotEventsTracker
+ <AppBroadcastEventsPolicy, SimpleAppStateTimeslotEvents> implements BroadcastEventListener {
+
+ static final String TAG = TAG_WITH_CLASS_NAME ? "AppBroadcastEventsTracker" : TAG_AM;
+
+ static final boolean DEBUG_APP_STATE_BROADCAST_EVENT_TRACKER = false;
+
+ AppBroadcastEventsTracker(Context context, AppRestrictionController controller) {
+ this(context, controller, null, null);
+ }
+
+ AppBroadcastEventsTracker(Context context, AppRestrictionController controller,
+ Constructor<? extends Injector<AppBroadcastEventsPolicy>> injector,
+ Object outerContext) {
+ super(context, controller, injector, outerContext);
+ mInjector.setPolicy(new AppBroadcastEventsPolicy(mInjector, this));
+ }
+
+ @Override
+ public void onSendingBroadcast(String packageName, int uid) {
+ if (mInjector.getPolicy().isEnabled()) {
+ onNewEvent(packageName, uid);
+ }
+ }
+
+ @Override
+ void onSystemReady() {
+ super.onSystemReady();
+ mInjector.getActivityManagerInternal().addBroadcastEventListener(this);
+ }
+
+ @Override
+ public SimpleAppStateTimeslotEvents createAppStateEvents(int uid, String packageName) {
+ return new SimpleAppStateTimeslotEvents(uid, packageName,
+ mInjector.getPolicy().getTimeSlotSize(), TAG, mInjector.getPolicy());
+ }
+
+ @Override
+ public SimpleAppStateTimeslotEvents createAppStateEvents(SimpleAppStateTimeslotEvents other) {
+ return new SimpleAppStateTimeslotEvents(other);
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ pw.print(prefix);
+ pw.println("APP BROADCAST EVENT TRACKER:");
+ super.dump(pw, " " + prefix);
+ }
+
+ static final class AppBroadcastEventsPolicy
+ extends BaseAppStateTimeSlotEventsPolicy<AppBroadcastEventsTracker> {
+ /**
+ * Whether or not we should enable the monitoring on abusive broadcasts.
+ */
+ static final String KEY_BG_BROADCAST_MONITOR_ENABLED =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "broadcast_monitor_enabled";
+
+ /**
+ * The size of the sliding window in which the number of broadcasts is checked
+ * against the threshold.
+ */
+ static final String KEY_BG_BROADCAST_WINDOW =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "broadcast_window";
+
+ /**
+ * The threshold at where the number of broadcasts are considered as "excessive"
+ * within the given window.
+ */
+ static final String KEY_BG_EX_BROADCAST_THRESHOLD =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "ex_broadcast_threshold";
+
+ /**
+ * Default value to {@link #mTrackerEnabled}.
+ */
+ static final boolean DEFAULT_BG_BROADCAST_MONITOR_ENABLED = true;
+
+ /**
+ * Default value to {@link #mMaxTrackingDuration}.
+ */
+ static final long DEFAULT_BG_BROADCAST_WINDOW = ONE_DAY;
+
+ /**
+ * Default value to {@link #mNumOfEventsThreshold}.
+ */
+ static final int DEFAULT_BG_EX_BROADCAST_THRESHOLD = 10_000;
+
+ AppBroadcastEventsPolicy(@NonNull Injector injector,
+ @NonNull AppBroadcastEventsTracker tracker) {
+ super(injector, tracker,
+ KEY_BG_BROADCAST_MONITOR_ENABLED, DEFAULT_BG_BROADCAST_MONITOR_ENABLED,
+ KEY_BG_BROADCAST_WINDOW, DEFAULT_BG_BROADCAST_WINDOW,
+ KEY_BG_EX_BROADCAST_THRESHOLD, DEFAULT_BG_EX_BROADCAST_THRESHOLD);
+ }
+
+ @Override
+ String getEventName() {
+ return "broadcast";
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ pw.print(prefix);
+ pw.println("APP BROADCAST EVENT TRACKER POLICY SETTINGS:");
+ super.dump(pw, " " + prefix);
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/AppFGSTracker.java b/services/core/java/com/android/server/am/AppFGSTracker.java
new file mode 100644
index 0000000..9c775b3
--- /dev/null
+++ b/services/core/java/com/android/server/am/AppFGSTracker.java
@@ -0,0 +1,780 @@
+/*
+ * 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.server.am;
+
+import static android.Manifest.permission.ACCESS_BACKGROUND_LOCATION;
+import static android.content.pm.PackageManager.PERMISSION_GRANTED;
+import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION;
+import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK;
+import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_NONE;
+import static android.content.pm.ServiceInfo.NUM_OF_FOREGROUND_SERVICE_TYPES;
+import static android.content.pm.ServiceInfo.foregroundServiceTypeToLabel;
+import static android.os.PowerExemptionManager.REASON_DENIED;
+
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
+import static com.android.server.am.AppRestrictionController.DEVICE_CONFIG_SUBNAMESPACE_PREFIX;
+import static com.android.server.am.BaseAppStateTracker.ONE_DAY;
+import static com.android.server.am.BaseAppStateTracker.ONE_HOUR;
+
+import android.annotation.NonNull;
+import android.app.ActivityManagerInternal.ForegroundServiceStateListener;
+import android.app.IProcessObserver;
+import android.content.Context;
+import android.content.pm.ServiceInfo.ForegroundServiceType;
+import android.os.Handler;
+import android.os.Message;
+import android.os.PowerExemptionManager.ReasonCode;
+import android.os.SystemClock;
+import android.os.UserHandle;
+import android.provider.DeviceConfig;
+import android.util.ArrayMap;
+import android.util.Slog;
+import android.util.SparseArray;
+import android.util.TimeUtils;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.am.AppFGSTracker.AppFGSPolicy;
+import com.android.server.am.AppFGSTracker.PackageDurations;
+import com.android.server.am.BaseAppStateEventsTracker.BaseAppStateEventsPolicy;
+import com.android.server.am.BaseAppStateTimeEvents.BaseTimeEvent;
+import com.android.server.am.BaseAppStateTracker.Injector;
+
+import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+import java.util.Arrays;
+import java.util.LinkedList;
+
+/**
+ * The tracker for monitoring abusive (long-running) FGS.
+ */
+final class AppFGSTracker extends BaseAppStateDurationsTracker<AppFGSPolicy, PackageDurations>
+ implements ForegroundServiceStateListener {
+ static final String TAG = TAG_WITH_CLASS_NAME ? "AppFGSTracker" : TAG_AM;
+
+ static final boolean DEBUG_BACKGROUND_FGS_TRACKER = false;
+
+ private final MyHandler mHandler;
+
+ // Unlocked since it's only accessed in single thread.
+ private final ArrayMap<PackageDurations, Long> mTmpPkgDurations = new ArrayMap<>();
+
+ final IProcessObserver.Stub mProcessObserver = new IProcessObserver.Stub() {
+ @Override
+ public void onForegroundActivitiesChanged(int pid, int uid, boolean fg) {
+ }
+
+ @Override
+ public void onForegroundServicesChanged(int pid, int uid, int serviceTypes) {
+ final String packageName = mAppRestrictionController.getPackageName(pid);
+ if (packageName != null) {
+ mHandler.obtainMessage(MyHandler.MSG_FOREGROUND_SERVICES_CHANGED,
+ uid, serviceTypes, packageName).sendToTarget();
+ }
+ }
+
+ @Override
+ public void onProcessDied(int pid, int uid) {
+ }
+ };
+
+ @Override
+ public void onForegroundServiceStateChanged(String packageName,
+ int uid, int pid, boolean started) {
+ mHandler.obtainMessage(started ? MyHandler.MSG_FOREGROUND_SERVICES_STARTED
+ : MyHandler.MSG_FOREGROUND_SERVICES_STOPPED, pid, uid, packageName).sendToTarget();
+ }
+
+ private static class MyHandler extends Handler {
+ static final int MSG_FOREGROUND_SERVICES_STARTED = 0;
+ static final int MSG_FOREGROUND_SERVICES_STOPPED = 1;
+ static final int MSG_FOREGROUND_SERVICES_CHANGED = 2;
+ static final int MSG_CHECK_LONG_RUNNING_FGS = 3;
+
+ private final AppFGSTracker mTracker;
+
+ MyHandler(AppFGSTracker tracker) {
+ super(tracker.mBgHandler.getLooper());
+ mTracker = tracker;
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_FOREGROUND_SERVICES_STARTED:
+ mTracker.handleForegroundServicesChanged(
+ (String) msg.obj, msg.arg1, msg.arg2, true);
+ break;
+ case MSG_FOREGROUND_SERVICES_STOPPED:
+ mTracker.handleForegroundServicesChanged(
+ (String) msg.obj, msg.arg1, msg.arg2, false);
+ break;
+ case MSG_FOREGROUND_SERVICES_CHANGED:
+ mTracker.handleForegroundServicesChanged(
+ (String) msg.obj, msg.arg1, msg.arg2);
+ break;
+ case MSG_CHECK_LONG_RUNNING_FGS:
+ mTracker.checkLongRunningFgs();
+ break;
+ }
+ }
+ }
+
+ AppFGSTracker(Context context, AppRestrictionController controller) {
+ this(context, controller, null, null);
+ }
+
+ AppFGSTracker(Context context, AppRestrictionController controller,
+ Constructor<? extends Injector<AppFGSPolicy>> injector, Object outerContext) {
+ super(context, controller, injector, outerContext);
+ mHandler = new MyHandler(this);
+ mInjector.setPolicy(new AppFGSPolicy(mInjector, this));
+ }
+
+ @Override
+ void onSystemReady() {
+ super.onSystemReady();
+ mInjector.getActivityManagerInternal().addForegroundServiceStateListener(this);
+ mInjector.getActivityManagerInternal().registerProcessObserver(mProcessObserver);
+ }
+
+ @VisibleForTesting
+ @Override
+ void reset() {
+ mHandler.removeMessages(MyHandler.MSG_CHECK_LONG_RUNNING_FGS);
+ super.reset();
+ }
+
+ @Override
+ public PackageDurations createAppStateEvents(int uid, String packageName) {
+ return new PackageDurations(uid, packageName, mInjector.getPolicy(), this);
+ }
+
+ @Override
+ public PackageDurations createAppStateEvents(PackageDurations other) {
+ return new PackageDurations(other);
+ }
+
+ private void handleForegroundServicesChanged(String packageName, int pid, int uid,
+ boolean started) {
+ if (!mInjector.getPolicy().isEnabled()) {
+ return;
+ }
+ final long now = SystemClock.elapsedRealtime();
+ boolean longRunningFGSGone = false;
+ final int exemptReason = mInjector.getPolicy().shouldExemptUid(uid);
+ if (DEBUG_BACKGROUND_FGS_TRACKER) {
+ Slog.i(TAG, (started ? "Starting" : "Stopping") + " fgs in "
+ + packageName + "/" + UserHandle.formatUid(uid)
+ + " exemptReason=" + exemptReason);
+ }
+ synchronized (mLock) {
+ PackageDurations pkg = mPkgEvents.get(uid, packageName);
+ if (pkg == null) {
+ pkg = createAppStateEvents(uid, packageName);
+ mPkgEvents.put(uid, packageName, pkg);
+ }
+ final boolean wasLongRunning = pkg.isLongRunning();
+ pkg.addEvent(started, now);
+ longRunningFGSGone = wasLongRunning && !pkg.hasForegroundServices();
+ if (longRunningFGSGone) {
+ pkg.setIsLongRunning(false);
+ }
+ pkg.mExemptReason = exemptReason;
+ // Reschedule the checks.
+ scheduleDurationCheckLocked(now);
+ }
+ if (longRunningFGSGone) {
+ // The long-running FGS is gone, cancel the notification.
+ mInjector.getPolicy().onLongRunningFgsGone(packageName, uid);
+ }
+ }
+
+ @GuardedBy("mLock")
+ private void scheduleDurationCheckLocked(long now) {
+ // Look for the active FGS with longest running time till now.
+ final SparseArray<ArrayMap<String, PackageDurations>> map = mPkgEvents.getMap();
+ long longest = -1;
+ for (int i = map.size() - 1; i >= 0; i--) {
+ final ArrayMap<String, PackageDurations> val = map.valueAt(i);
+ for (int j = val.size() - 1; j >= 0; j--) {
+ final PackageDurations pkg = val.valueAt(j);
+ if (!pkg.hasForegroundServices() || pkg.isLongRunning()) {
+ // No FGS or it's a known long-running FGS, ignore it.
+ continue;
+ }
+ longest = Math.max(getTotalDurations(pkg, now), longest);
+ }
+ }
+ // Schedule a check in the future.
+ mHandler.removeMessages(MyHandler.MSG_CHECK_LONG_RUNNING_FGS);
+ if (longest >= 0) {
+ // We'd add the "service start foreground timeout", as the apps are allowed
+ // to call startForeground() within that timeout after the FGS being started.
+ final long future = mInjector.getServiceStartForegroundTimeout()
+ + Math.max(0, mInjector.getPolicy().getFgsLongRunningThreshold() - longest);
+ if (DEBUG_BACKGROUND_FGS_TRACKER) {
+ Slog.i(TAG, "Scheduling a FGS duration check at "
+ + TimeUtils.formatDuration(future));
+ }
+ mHandler.sendEmptyMessageDelayed(MyHandler.MSG_CHECK_LONG_RUNNING_FGS, future);
+ } else if (DEBUG_BACKGROUND_FGS_TRACKER) {
+ Slog.i(TAG, "Not scheduling FGS duration check");
+ }
+ }
+
+ private void checkLongRunningFgs() {
+ final AppFGSPolicy policy = mInjector.getPolicy();
+ final ArrayMap<PackageDurations, Long> pkgWithLongFgs = mTmpPkgDurations;
+ final long now = SystemClock.elapsedRealtime();
+ final long threshold = policy.getFgsLongRunningThreshold();
+ final long windowSize = policy.getFgsLongRunningWindowSize();
+ final long trimTo = Math.max(0, now - windowSize);
+
+ synchronized (mLock) {
+ final SparseArray<ArrayMap<String, PackageDurations>> map = mPkgEvents.getMap();
+ for (int i = map.size() - 1; i >= 0; i--) {
+ final ArrayMap<String, PackageDurations> val = map.valueAt(i);
+ for (int j = val.size() - 1; j >= 0; j--) {
+ final PackageDurations pkg = val.valueAt(j);
+ if (pkg.hasForegroundServices() && !pkg.isLongRunning()) {
+ final long totalDuration = getTotalDurations(pkg, now);
+ if (totalDuration >= threshold) {
+ pkgWithLongFgs.put(pkg, totalDuration);
+ pkg.setIsLongRunning(true);
+ if (DEBUG_BACKGROUND_FGS_TRACKER) {
+ Slog.i(TAG, pkg.mPackageName
+ + "/" + UserHandle.formatUid(pkg.mUid)
+ + " has FGS running for "
+ + TimeUtils.formatDuration(totalDuration)
+ + " over " + TimeUtils.formatDuration(windowSize));
+ }
+ }
+ }
+ }
+ }
+ // Trim the duration list, we don't need to keep track of all old records.
+ trim(trimTo);
+ }
+
+ final int size = pkgWithLongFgs.size();
+ if (size > 0) {
+ // Sort it by the durations.
+ final Integer[] indices = new Integer[size];
+ for (int i = 0; i < size; i++) {
+ indices[i] = i;
+ }
+ Arrays.sort(indices, (a, b) -> Long.compare(
+ pkgWithLongFgs.valueAt(a), pkgWithLongFgs.valueAt(b)));
+ // Notify it in the order of from longest to shortest durations.
+ for (int i = size - 1; i >= 0; i--) {
+ final PackageDurations pkg = pkgWithLongFgs.keyAt(indices[i]);
+ policy.onLongRunningFgs(pkg.mPackageName, pkg.mUid, pkg.mExemptReason);
+ }
+ pkgWithLongFgs.clear();
+ }
+
+ synchronized (mLock) {
+ scheduleDurationCheckLocked(now);
+ }
+ }
+
+ private void handleForegroundServicesChanged(String packageName, int uid, int serviceTypes) {
+ if (!mInjector.getPolicy().isEnabled()) {
+ return;
+ }
+ final int exemptReason = mInjector.getPolicy().shouldExemptUid(uid);
+ final long now = SystemClock.elapsedRealtime();
+ if (DEBUG_BACKGROUND_FGS_TRACKER) {
+ Slog.i(TAG, "Updating fgs type for " + packageName + "/" + UserHandle.formatUid(uid)
+ + " to " + Integer.toHexString(serviceTypes)
+ + " exemptReason=" + exemptReason);
+ }
+ synchronized (mLock) {
+ PackageDurations pkg = mPkgEvents.get(uid, packageName);
+ if (pkg == null) {
+ pkg = new PackageDurations(uid, packageName, mInjector.getPolicy(), this);
+ mPkgEvents.put(uid, packageName, pkg);
+ }
+ pkg.setForegroundServiceType(serviceTypes, now);
+ pkg.mExemptReason = exemptReason;
+ }
+ }
+
+ private void onBgFgsMonitorEnabled(boolean enabled) {
+ if (enabled) {
+ synchronized (mLock) {
+ scheduleDurationCheckLocked(SystemClock.elapsedRealtime());
+ }
+ } else {
+ mHandler.removeMessages(MyHandler.MSG_CHECK_LONG_RUNNING_FGS);
+ synchronized (mLock) {
+ mPkgEvents.clear();
+ }
+ }
+ }
+
+ private void onBgFgsLongRunningThresholdChanged() {
+ synchronized (mLock) {
+ if (mInjector.getPolicy().isEnabled()) {
+ scheduleDurationCheckLocked(SystemClock.elapsedRealtime());
+ }
+ }
+ }
+
+ static int foregroundServiceTypeToIndex(@ForegroundServiceType int serviceType) {
+ return serviceType == FOREGROUND_SERVICE_TYPE_NONE ? 0
+ : Integer.numberOfTrailingZeros(serviceType) + 1;
+ }
+
+ static @ForegroundServiceType int indexToForegroundServiceType(int index) {
+ return index == PackageDurations.DEFAULT_INDEX
+ ? FOREGROUND_SERVICE_TYPE_NONE : (1 << (index - 1));
+ }
+
+ long getTotalDurations(PackageDurations pkg, long now) {
+ return getTotalDurations(pkg.mPackageName, pkg.mUid, now,
+ foregroundServiceTypeToIndex(FOREGROUND_SERVICE_TYPE_NONE));
+ }
+
+ boolean hasForegroundServices(String packageName, int uid) {
+ synchronized (mLock) {
+ final PackageDurations pkg = mPkgEvents.get(uid, packageName);
+ return pkg != null && pkg.hasForegroundServices();
+ }
+ }
+
+ boolean hasForegroundServices(int uid) {
+ synchronized (mLock) {
+ final SparseArray<ArrayMap<String, PackageDurations>> map = mPkgEvents.getMap();
+ final ArrayMap<String, PackageDurations> pkgs = map.get(uid);
+ if (pkgs != null) {
+ for (int i = pkgs.size() - 1; i >= 0; i--) {
+ final PackageDurations pkg = pkgs.valueAt(i);
+ if (pkg.hasForegroundServices()) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ pw.print(prefix);
+ pw.println("APP FOREGROUND SERVICE TRACKER:");
+ super.dump(pw, " " + prefix);
+ }
+
+ /**
+ * Tracks the durations with active FGS for a given package.
+ */
+ static class PackageDurations extends BaseAppStateDurations<BaseTimeEvent> {
+ private final AppFGSTracker mTracker;
+
+ /**
+ * Whether or not this package is considered as having long-running FGS.
+ */
+ private boolean mIsLongRunning;
+
+ /**
+ * The current foreground service types, should be a combination of the values in
+ * {@link android.content.pm.ServiceInfo.ForegroundServiceType}.
+ */
+ private int mForegroundServiceTypes;
+
+ /**
+ * The index to the duration list array, where it holds the overall FGS stats of this
+ * package.
+ */
+ static final int DEFAULT_INDEX = foregroundServiceTypeToIndex(FOREGROUND_SERVICE_TYPE_NONE);
+
+ PackageDurations(int uid, String packageName,
+ MaxTrackingDurationConfig maxTrackingDurationConfig, AppFGSTracker tracker) {
+ super(uid, packageName, NUM_OF_FOREGROUND_SERVICE_TYPES + 1, TAG,
+ maxTrackingDurationConfig);
+ mEvents[DEFAULT_INDEX] = new LinkedList<>();
+ mTracker = tracker;
+ }
+
+ PackageDurations(@NonNull PackageDurations other) {
+ super(other);
+ mIsLongRunning = other.mIsLongRunning;
+ mForegroundServiceTypes = other.mForegroundServiceTypes;
+ mTracker = other.mTracker;
+ }
+
+ /**
+ * Add a foreground service start/stop event.
+ */
+ void addEvent(boolean startFgs, long now) {
+ addEvent(startFgs, new BaseTimeEvent(now), DEFAULT_INDEX);
+ if (!startFgs && !hasForegroundServices()) {
+ mIsLongRunning = false;
+ }
+
+ if (!startFgs && mForegroundServiceTypes != FOREGROUND_SERVICE_TYPE_NONE) {
+ // Save the stop time per service type.
+ for (int i = 1; i < mEvents.length; i++) {
+ if (mEvents[i] == null) {
+ continue;
+ }
+ if (isActive(i)) {
+ mEvents[i].add(new BaseTimeEvent(now));
+ notifyListenersOnEventIfNecessary(false, now,
+ indexToForegroundServiceType(i));
+ }
+ }
+ mForegroundServiceTypes = FOREGROUND_SERVICE_TYPE_NONE;
+ }
+ }
+
+ /**
+ * Called on the service type changes via the {@link android.app.Service#startForeground}.
+ */
+ void setForegroundServiceType(int serviceTypes, long now) {
+ if (serviceTypes == mForegroundServiceTypes || !hasForegroundServices()) {
+ // Nothing to do.
+ return;
+ }
+ int changes = serviceTypes ^ mForegroundServiceTypes;
+ for (int serviceType = Integer.highestOneBit(changes); serviceType != 0;) {
+ final int i = foregroundServiceTypeToIndex(serviceType);
+ if ((serviceTypes & serviceType) != 0) {
+ // Start this type.
+ if (mEvents[i] == null) {
+ mEvents[i] = new LinkedList<>();
+ }
+ if (!isActive(i)) {
+ mEvents[i].add(new BaseTimeEvent(now));
+ notifyListenersOnEventIfNecessary(true, now, serviceType);
+ }
+ } else {
+ // Stop this type.
+ if (mEvents[i] != null && isActive(i)) {
+ mEvents[i].add(new BaseTimeEvent(now));
+ notifyListenersOnEventIfNecessary(false, now, serviceType);
+ }
+ }
+ changes &= ~serviceType;
+ serviceType = Integer.highestOneBit(changes);
+ }
+ mForegroundServiceTypes = serviceTypes;
+ }
+
+ private void notifyListenersOnEventIfNecessary(boolean start, long now,
+ @ForegroundServiceType int serviceType) {
+ int eventType;
+ switch (serviceType) {
+ case FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK:
+ eventType = BaseAppStateDurationsTracker.EVENT_TYPE_FGS_MEDIA_PLAYBACK;
+ break;
+ case FOREGROUND_SERVICE_TYPE_LOCATION:
+ eventType = BaseAppStateDurationsTracker.EVENT_TYPE_FGS_LOCATION;
+ break;
+ default:
+ return;
+ }
+ mTracker.notifyListenersOnEvent(mUid, mPackageName, start, now, eventType);
+ }
+
+ void setIsLongRunning(boolean isLongRunning) {
+ mIsLongRunning = isLongRunning;
+ }
+
+ boolean isLongRunning() {
+ return mIsLongRunning;
+ }
+
+ boolean hasForegroundServices() {
+ return isActive(DEFAULT_INDEX);
+ }
+
+ @Override
+ String formatEventTypeLabel(int index) {
+ if (index == DEFAULT_INDEX) {
+ return "Overall foreground services: ";
+ } else {
+ return foregroundServiceTypeToLabel(indexToForegroundServiceType(index)) + ": ";
+ }
+ }
+ }
+
+ static final class AppFGSPolicy extends BaseAppStateEventsPolicy<AppFGSTracker> {
+ /**
+ * Whether or not we should enable the monitoring on abusive FGS.
+ */
+ static final String KEY_BG_FGS_MONITOR_ENABLED =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "fgs_monitor_enabled";
+
+ /**
+ * The size of the sliding window in which the accumulated FGS durations are checked
+ * against the threshold.
+ */
+ static final String KEY_BG_FGS_LONG_RUNNING_WINDOW =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "fgs_long_running_window";
+
+ /**
+ * The threshold at where the accumulated FGS durations are considered as "long-running"
+ * within the given window.
+ */
+ static final String KEY_BG_FGS_LONG_RUNNING_THRESHOLD =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "fgs_long_running_threshold";
+
+ /**
+ * If a package has run FGS with "mediaPlayback" over this threshold, it won't be considered
+ * as a long-running FGS.
+ */
+ static final String KEY_BG_FGS_MEDIA_PLAYBACK_THRESHOLD =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "fgs_media_playback_threshold";
+
+ /**
+ * If a package has run FGS with "location" over this threshold, it won't be considered
+ * as a long-running FGS.
+ */
+ static final String KEY_BG_FGS_LOCATION_THRESHOLD =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "fgs_location_threshold";
+
+ /**
+ * Default value to {@link #mTrackerEnabled}.
+ */
+ static final boolean DEFAULT_BG_FGS_MONITOR_ENABLED = true;
+
+ /**
+ * Default value to {@link #mMaxTrackingDuration}.
+ */
+ static final long DEFAULT_BG_FGS_LONG_RUNNING_WINDOW = ONE_DAY;
+
+ /**
+ * Default value to {@link #mBgFgsLongRunningThresholdMs}.
+ */
+ static final long DEFAULT_BG_FGS_LONG_RUNNING_THRESHOLD = 20 * ONE_HOUR;
+
+ /**
+ * Default value to {@link #mBgFgsMediaPlaybackThresholdMs}.
+ */
+ static final long DEFAULT_BG_FGS_MEDIA_PLAYBACK_THRESHOLD = 4 * ONE_HOUR;
+
+ /**
+ * Default value to {@link #mBgFgsLocationThresholdMs}.
+ */
+ static final long DEFAULT_BG_FGS_LOCATION_THRESHOLD = 4 * ONE_HOUR;
+
+ /**
+ * @see #KEY_BG_FGS_LONG_RUNNING_THRESHOLD.
+ */
+ private volatile long mBgFgsLongRunningThresholdMs = DEFAULT_BG_FGS_LONG_RUNNING_THRESHOLD;
+
+ /**
+ * @see #KEY_BG_FGS_MEDIA_PLAYBACK_THRESHOLD.
+ */
+ private volatile long mBgFgsMediaPlaybackThresholdMs =
+ DEFAULT_BG_FGS_MEDIA_PLAYBACK_THRESHOLD;
+
+ /**
+ * @see #KEY_BG_FGS_LOCATION_THRESHOLD.
+ */
+ private volatile long mBgFgsLocationThresholdMs = DEFAULT_BG_FGS_LOCATION_THRESHOLD;
+
+ AppFGSPolicy(@NonNull Injector injector, @NonNull AppFGSTracker tracker) {
+ super(injector, tracker, KEY_BG_FGS_MONITOR_ENABLED, DEFAULT_BG_FGS_MONITOR_ENABLED,
+ KEY_BG_FGS_LONG_RUNNING_WINDOW, DEFAULT_BG_FGS_LONG_RUNNING_WINDOW);
+ }
+
+ @Override
+ public void onSystemReady() {
+ super.onSystemReady();
+ updateBgFgsLongRunningThreshold();
+ updateBgFgsMediaPlaybackThreshold();
+ updateBgFgsLocationThreshold();
+ }
+
+ @Override
+ public void onPropertiesChanged(String name) {
+ switch (name) {
+ case KEY_BG_FGS_LONG_RUNNING_THRESHOLD:
+ updateBgFgsLongRunningThreshold();
+ break;
+ case KEY_BG_FGS_MEDIA_PLAYBACK_THRESHOLD:
+ updateBgFgsMediaPlaybackThreshold();
+ break;
+ case KEY_BG_FGS_LOCATION_THRESHOLD:
+ updateBgFgsLocationThreshold();
+ break;
+ default:
+ super.onPropertiesChanged(name);
+ break;
+ }
+ }
+
+ @Override
+ public void onTrackerEnabled(boolean enabled) {
+ mTracker.onBgFgsMonitorEnabled(enabled);
+ }
+
+ @Override
+ public void onMaxTrackingDurationChanged(long maxDuration) {
+ mTracker.onBgFgsLongRunningThresholdChanged();
+ }
+
+ private void updateBgFgsLongRunningThreshold() {
+ final long threshold = DeviceConfig.getLong(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_FGS_LONG_RUNNING_THRESHOLD,
+ DEFAULT_BG_FGS_LONG_RUNNING_THRESHOLD);
+ if (threshold != mBgFgsLongRunningThresholdMs) {
+ mBgFgsLongRunningThresholdMs = threshold;
+ mTracker.onBgFgsLongRunningThresholdChanged();
+ }
+ }
+
+ private void updateBgFgsMediaPlaybackThreshold() {
+ mBgFgsMediaPlaybackThresholdMs = DeviceConfig.getLong(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_FGS_MEDIA_PLAYBACK_THRESHOLD,
+ DEFAULT_BG_FGS_MEDIA_PLAYBACK_THRESHOLD);
+ }
+
+ private void updateBgFgsLocationThreshold() {
+ mBgFgsLocationThresholdMs = DeviceConfig.getLong(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_FGS_LOCATION_THRESHOLD,
+ DEFAULT_BG_FGS_LOCATION_THRESHOLD);
+ }
+
+ long getFgsLongRunningThreshold() {
+ return mBgFgsLongRunningThresholdMs;
+ }
+
+ long getFgsLongRunningWindowSize() {
+ return getMaxTrackingDuration();
+ }
+
+ long getFGSMediaPlaybackThreshold() {
+ return mBgFgsMediaPlaybackThresholdMs;
+ }
+
+ long getLocationFGSThreshold() {
+ return mBgFgsLocationThresholdMs;
+ }
+
+ void onLongRunningFgs(String packageName, int uid, @ReasonCode int exemptReason) {
+ if (exemptReason != REASON_DENIED) {
+ return;
+ }
+ final long now = SystemClock.elapsedRealtime();
+ final long window = getFgsLongRunningWindowSize();
+ final long since = Math.max(0, now - window);
+ if (shouldExemptMediaPlaybackFGS(packageName, uid, now, window)) {
+ return;
+ }
+ if (shouldExemptLocationFGS(packageName, uid, now, since)) {
+ return;
+ }
+ if (hasBackgroundLocationPermission(packageName, uid)) {
+ // This package has background location permission, ignore it.
+ return;
+ }
+ mTracker.mAppRestrictionController.postLongRunningFgsIfNecessary(packageName, uid);
+ }
+
+ boolean shouldExemptMediaPlaybackFGS(String packageName, int uid, long now, long window) {
+ final long mediaPlaybackMs = mTracker.mAppRestrictionController
+ .getCompositeMediaPlaybackDurations(packageName, uid, now, window);
+ if (mediaPlaybackMs > 0 && mediaPlaybackMs >= getFGSMediaPlaybackThreshold()) {
+ if (DEBUG_BACKGROUND_FGS_TRACKER) {
+ Slog.i(TAG, "Ignoring long-running FGS in " + packageName + "/"
+ + UserHandle.formatUid(uid) + " media playback for "
+ + TimeUtils.formatDuration(mediaPlaybackMs));
+ }
+ return true;
+ }
+ return false;
+ }
+
+ boolean shouldExemptLocationFGS(String packageName, int uid, long now, long since) {
+ final long locationMs = mTracker.mAppRestrictionController
+ .getForegroundServiceTotalDurationsSince(packageName, uid, since, now,
+ FOREGROUND_SERVICE_TYPE_LOCATION);
+ if (locationMs > 0 && locationMs >= getLocationFGSThreshold()) {
+ if (DEBUG_BACKGROUND_FGS_TRACKER) {
+ Slog.i(TAG, "Ignoring long-running FGS in " + packageName + "/"
+ + UserHandle.formatUid(uid) + " location for "
+ + TimeUtils.formatDuration(locationMs));
+ }
+ return true;
+ }
+ return false;
+ }
+
+ boolean hasBackgroundLocationPermission(String packageName, int uid) {
+ if (mInjector.getPermissionManagerServiceInternal().checkPermission(
+ packageName, ACCESS_BACKGROUND_LOCATION, UserHandle.getUserId(uid))
+ == PERMISSION_GRANTED) {
+ if (DEBUG_BACKGROUND_FGS_TRACKER) {
+ Slog.i(TAG, "Ignoring bg-location FGS in " + packageName + "/"
+ + UserHandle.formatUid(uid));
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ String getExemptionReasonString(String packageName, int uid, @ReasonCode int reason) {
+ if (reason != REASON_DENIED) {
+ return super.getExemptionReasonString(packageName, uid, reason);
+ }
+ final long now = SystemClock.elapsedRealtime();
+ final long window = getFgsLongRunningWindowSize();
+ final long since = Math.max(0, now - getFgsLongRunningWindowSize());
+ return "{mediaPlayback=" + shouldExemptMediaPlaybackFGS(packageName, uid, now, window)
+ + ", location=" + shouldExemptLocationFGS(packageName, uid, now, since)
+ + ", bgLocationPerm=" + hasBackgroundLocationPermission(packageName, uid) + "}";
+ }
+
+ void onLongRunningFgsGone(String packageName, int uid) {
+ mTracker.mAppRestrictionController
+ .cancelLongRunningFGSNotificationIfNecessary(packageName, uid);
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ pw.print(prefix);
+ pw.println("APP FOREGROUND SERVICE TRACKER POLICY SETTINGS:");
+ final String indent = " ";
+ prefix = indent + prefix;
+ super.dump(pw, prefix);
+ if (isEnabled()) {
+ pw.print(prefix);
+ pw.print(KEY_BG_FGS_LONG_RUNNING_THRESHOLD);
+ pw.print('=');
+ pw.println(mBgFgsLongRunningThresholdMs);
+ pw.print(prefix);
+ pw.print(KEY_BG_FGS_MEDIA_PLAYBACK_THRESHOLD);
+ pw.print('=');
+ pw.println(mBgFgsMediaPlaybackThresholdMs);
+ pw.print(prefix);
+ pw.print(KEY_BG_FGS_LOCATION_THRESHOLD);
+ pw.print('=');
+ pw.println(mBgFgsLocationThresholdMs);
+ }
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/AppMediaSessionTracker.java b/services/core/java/com/android/server/am/AppMediaSessionTracker.java
new file mode 100644
index 0000000..3914f6f
--- /dev/null
+++ b/services/core/java/com/android/server/am/AppMediaSessionTracker.java
@@ -0,0 +1,226 @@
+/*
+ * 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.server.am;
+
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
+import static com.android.server.am.AppRestrictionController.DEVICE_CONFIG_SUBNAMESPACE_PREFIX;
+import static com.android.server.am.BaseAppStateDurationsTracker.EVENT_TYPE_MEDIA_SESSION;
+import static com.android.server.am.BaseAppStateTracker.ONE_DAY;
+
+import android.annotation.NonNull;
+import android.content.Context;
+import android.media.session.MediaController;
+import android.media.session.MediaSessionManager.OnActiveSessionsChangedListener;
+import android.os.HandlerExecutor;
+import android.os.PowerExemptionManager.ReasonCode;
+import android.os.SystemClock;
+import android.os.UserHandle;
+import android.util.ArrayMap;
+import android.util.Slog;
+import android.util.SparseArray;
+
+import com.android.internal.app.ProcessMap;
+import com.android.server.am.AppMediaSessionTracker.AppMediaSessionPolicy;
+import com.android.server.am.BaseAppStateDurationsTracker.SimplePackageDurations;
+import com.android.server.am.BaseAppStateEventsTracker.BaseAppStateEventsPolicy;
+
+import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+import java.util.List;
+
+/**
+ * The tracker for monitoring the active media sessions of apps.
+ */
+final class AppMediaSessionTracker
+ extends BaseAppStateDurationsTracker<AppMediaSessionPolicy, SimplePackageDurations> {
+ static final String TAG = TAG_WITH_CLASS_NAME ? "AppMediaSessionTracker" : TAG_AM;
+
+ static final boolean DEBUG_MEDIA_SESSION_TRACKER = false;
+
+ private final HandlerExecutor mHandlerExecutor;
+ private final OnActiveSessionsChangedListener mSessionsChangedListener =
+ this::handleMediaSessionChanged;
+
+ // Unlocked since it's only accessed in single thread.
+ private final ProcessMap<Boolean> mTmpMediaControllers = new ProcessMap<>();
+
+ AppMediaSessionTracker(Context context, AppRestrictionController controller) {
+ this(context, controller, null, null);
+ }
+
+ AppMediaSessionTracker(Context context, AppRestrictionController controller,
+ Constructor<? extends Injector<AppMediaSessionPolicy>> injector, Object outerContext) {
+ super(context, controller, injector, outerContext);
+ mHandlerExecutor = new HandlerExecutor(mBgHandler);
+ mInjector.setPolicy(new AppMediaSessionPolicy(mInjector, this));
+ }
+
+ @Override
+ public SimplePackageDurations createAppStateEvents(int uid, String packageName) {
+ return new SimplePackageDurations(uid, packageName, mInjector.getPolicy());
+ }
+
+ @Override
+ public SimplePackageDurations createAppStateEvents(SimplePackageDurations other) {
+ return new SimplePackageDurations(other);
+ }
+
+ private void onBgMediaSessionMonitorEnabled(boolean enabled) {
+ if (enabled) {
+ mInjector.getMediaSessionManager().addOnActiveSessionsChangedListener(
+ null, UserHandle.ALL, mHandlerExecutor, mSessionsChangedListener);
+ } else {
+ mInjector.getMediaSessionManager().removeOnActiveSessionsChangedListener(
+ mSessionsChangedListener);
+ }
+ }
+
+ private void handleMediaSessionChanged(List<MediaController> controllers) {
+ if (controllers != null) {
+ synchronized (mLock) {
+ final long now = SystemClock.elapsedRealtime();
+ for (MediaController controller : controllers) {
+ final String packageName = controller.getPackageName();
+ final int uid = controller.getSessionToken().getUid();
+ SimplePackageDurations pkg = mPkgEvents.get(uid, packageName);
+ if (pkg == null) {
+ pkg = createAppStateEvents(uid, packageName);
+ mPkgEvents.put(uid, packageName, pkg);
+ }
+ if (!pkg.isActive()) {
+ pkg.addEvent(true, now);
+ notifyListenersOnEvent(pkg.mUid, pkg.mPackageName, true, now,
+ EVENT_TYPE_MEDIA_SESSION);
+ }
+ // Mark it as active, so we could filter out inactive ones below.
+ mTmpMediaControllers.put(packageName, uid, Boolean.TRUE);
+
+ if (DEBUG_MEDIA_SESSION_TRACKER) {
+ Slog.i(TAG, "Active media session from " + packageName + "/"
+ + UserHandle.formatUid(uid));
+ }
+ }
+
+ // Iterate the duration list and stop those inactive ones.
+ final SparseArray<ArrayMap<String, SimplePackageDurations>> map =
+ mPkgEvents.getMap();
+ for (int i = map.size() - 1; i >= 0; i--) {
+ final ArrayMap<String, SimplePackageDurations> val = map.valueAt(i);
+ for (int j = val.size() - 1; j >= 0; j--) {
+ final SimplePackageDurations pkg = val.valueAt(j);
+ if (pkg.isActive()
+ && mTmpMediaControllers.get(pkg.mPackageName, pkg.mUid) == null) {
+ // This package has removed its controller, issue a stop event.
+ pkg.addEvent(false, now);
+ notifyListenersOnEvent(pkg.mUid, pkg.mPackageName, false, now,
+ EVENT_TYPE_MEDIA_SESSION);
+ }
+ }
+ }
+ }
+ mTmpMediaControllers.clear();
+ } else {
+ synchronized (mLock) {
+ // Issue stop event to all active trackers.
+ final SparseArray<ArrayMap<String, SimplePackageDurations>> map =
+ mPkgEvents.getMap();
+ final long now = SystemClock.elapsedRealtime();
+ for (int i = map.size() - 1; i >= 0; i--) {
+ final ArrayMap<String, SimplePackageDurations> val = map.valueAt(i);
+ for (int j = val.size() - 1; j >= 0; j--) {
+ final SimplePackageDurations pkg = val.valueAt(j);
+ if (pkg.isActive()) {
+ pkg.addEvent(false, now);
+ notifyListenersOnEvent(pkg.mUid, pkg.mPackageName, false, now,
+ EVENT_TYPE_MEDIA_SESSION);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void trimDurations() {
+ final long now = SystemClock.elapsedRealtime();
+ trim(Math.max(0, now - mInjector.getPolicy().getMaxTrackingDuration()));
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ pw.print(prefix);
+ pw.println("APP MEDIA SESSION TRACKER:");
+ super.dump(pw, " " + prefix);
+ }
+
+ static final class AppMediaSessionPolicy
+ extends BaseAppStateEventsPolicy<AppMediaSessionTracker> {
+ /**
+ * Whether or not we should enable the monitoring on media sessions.
+ */
+ static final String KEY_BG_MEADIA_SESSION_MONITOR_ENABLED =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "media_session_monitor_enabled";
+
+ /**
+ * The maximum duration we'd keep tracking, events earlier than that will be discarded.
+ */
+ static final String KEY_BG_MEDIA_SESSION_MONITOR_MAX_TRACKING_DURATION =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "media_session_monitor_max_tracking_duration";
+
+ /**
+ * Default value to {@link #mTrackerEnabled}.
+ */
+ static final boolean DEFAULT_BG_MEDIA_SESSION_MONITOR_ENABLED = true;
+
+ /**
+ * Default value to {@link #mBgMediaSessionMonitorMaxTrackingDurationMs}.
+ */
+ static final long DEFAULT_BG_MEDIA_SESSION_MONITOR_MAX_TRACKING_DURATION =
+ 4 * ONE_DAY;
+
+ AppMediaSessionPolicy(@NonNull Injector injector, @NonNull AppMediaSessionTracker tracker) {
+ super(injector, tracker,
+ KEY_BG_MEADIA_SESSION_MONITOR_ENABLED,
+ DEFAULT_BG_MEDIA_SESSION_MONITOR_ENABLED,
+ KEY_BG_MEDIA_SESSION_MONITOR_MAX_TRACKING_DURATION,
+ DEFAULT_BG_MEDIA_SESSION_MONITOR_MAX_TRACKING_DURATION);
+ }
+
+ @Override
+ public void onTrackerEnabled(boolean enabled) {
+ mTracker.onBgMediaSessionMonitorEnabled(enabled);
+ }
+
+ @Override
+ public void onMaxTrackingDurationChanged(long maxDuration) {
+ mTracker.mBgHandler.post(mTracker::trimDurations);
+ }
+
+ @Override
+ String getExemptionReasonString(String packageName, int uid, @ReasonCode int reason) {
+ // This tracker is a helper class for other trackers, we don't track exemptions here.
+ return "n/a";
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ pw.print(prefix);
+ pw.println("APP MEDIA SESSION TRACKER POLICY SETTINGS:");
+ super.dump(pw, " " + prefix);
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/AppRestrictionController.java b/services/core/java/com/android/server/am/AppRestrictionController.java
new file mode 100644
index 0000000..bd63a24
--- /dev/null
+++ b/services/core/java/com/android/server/am/AppRestrictionController.java
@@ -0,0 +1,2068 @@
+/*
+ * 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.server.am;
+
+import static android.Manifest.permission.MANAGE_ACTIVITY_TASKS;
+import static android.app.ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE;
+import static android.app.ActivityManager.PROCESS_STATE_PERSISTENT;
+import static android.app.ActivityManager.PROCESS_STATE_PERSISTENT_UI;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_ADAPTIVE_BUCKET;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_BACKGROUND_RESTRICTED;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_EXEMPTED;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_HIBERNATION;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_RESTRICTED_BUCKET;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_UNKNOWN;
+import static android.app.ActivityManager.UID_OBSERVER_ACTIVE;
+import static android.app.ActivityManager.UID_OBSERVER_GONE;
+import static android.app.ActivityManager.UID_OBSERVER_IDLE;
+import static android.app.ActivityManager.UID_OBSERVER_PROCSTATE;
+import static android.app.usage.UsageStatsManager.REASON_MAIN_DEFAULT;
+import static android.app.usage.UsageStatsManager.REASON_MAIN_FORCED_BY_SYSTEM;
+import static android.app.usage.UsageStatsManager.REASON_MAIN_FORCED_BY_USER;
+import static android.app.usage.UsageStatsManager.REASON_MAIN_MASK;
+import static android.app.usage.UsageStatsManager.REASON_MAIN_USAGE;
+import static android.app.usage.UsageStatsManager.REASON_SUB_DEFAULT_UNDEFINED;
+import static android.app.usage.UsageStatsManager.REASON_SUB_FORCED_SYSTEM_FLAG_UNDEFINED;
+import static android.app.usage.UsageStatsManager.REASON_SUB_FORCED_USER_FLAG_INTERACTION;
+import static android.app.usage.UsageStatsManager.REASON_SUB_MASK;
+import static android.app.usage.UsageStatsManager.REASON_SUB_USAGE_SYSTEM_UPDATE;
+import static android.app.usage.UsageStatsManager.REASON_SUB_USAGE_USER_INTERACTION;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_ACTIVE;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_EXEMPTED;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_FREQUENT;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_NEVER;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_RARE;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_RESTRICTED;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_WORKING_SET;
+import static android.app.usage.UsageStatsManager.reasonToString;
+import static android.content.Intent.ACTION_SHOW_FOREGROUND_SERVICE_MANAGER;
+import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_AWARE;
+import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE;
+import static android.content.pm.PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS;
+import static android.os.PowerExemptionManager.REASON_ALLOWLISTED_PACKAGE;
+import static android.os.PowerExemptionManager.REASON_COMPANION_DEVICE_MANAGER;
+import static android.os.PowerExemptionManager.REASON_DENIED;
+import static android.os.PowerExemptionManager.REASON_DEVICE_DEMO_MODE;
+import static android.os.PowerExemptionManager.REASON_DEVICE_OWNER;
+import static android.os.PowerExemptionManager.REASON_OP_ACTIVATE_PLATFORM_VPN;
+import static android.os.PowerExemptionManager.REASON_OP_ACTIVATE_VPN;
+import static android.os.PowerExemptionManager.REASON_PROC_STATE_PERSISTENT;
+import static android.os.PowerExemptionManager.REASON_PROC_STATE_PERSISTENT_UI;
+import static android.os.PowerExemptionManager.REASON_PROFILE_OWNER;
+import static android.os.PowerExemptionManager.REASON_ROLE_DIALER;
+import static android.os.PowerExemptionManager.REASON_ROLE_EMERGENCY;
+import static android.os.PowerExemptionManager.REASON_SYSTEM_MODULE;
+import static android.os.PowerExemptionManager.REASON_SYSTEM_UID;
+import static android.os.Process.SYSTEM_UID;
+
+import static com.android.internal.notification.SystemNotificationChannels.ABUSIVE_BACKGROUND_APPS;
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
+import static com.android.server.am.AppFGSTracker.foregroundServiceTypeToIndex;
+
+import android.annotation.ElapsedRealtimeLong;
+import android.annotation.IntDef;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.annotation.UserIdInt;
+import android.app.ActivityManager;
+import android.app.ActivityManager.RestrictionLevel;
+import android.app.ActivityManagerInternal;
+import android.app.ActivityManagerInternal.AppBackgroundRestrictionListener;
+import android.app.ActivityThread;
+import android.app.AppOpsManager;
+import android.app.IActivityManager;
+import android.app.IUidObserver;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.app.role.OnRoleHoldersChangedListener;
+import android.app.role.RoleManager;
+import android.app.usage.AppStandbyInfo;
+import android.app.usage.UsageStatsManager;
+import android.content.BroadcastReceiver;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.ModuleInfo;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManagerInternal;
+import android.content.pm.ServiceInfo;
+import android.content.pm.ServiceInfo.ForegroundServiceType;
+import android.database.ContentObserver;
+import android.graphics.drawable.Icon;
+import android.net.Uri;
+import android.os.Environment;
+import android.os.Handler;
+import android.os.HandlerExecutor;
+import android.os.HandlerThread;
+import android.os.Looper;
+import android.os.Message;
+import android.os.PowerExemptionManager.ReasonCode;
+import android.os.RemoteException;
+import android.os.SystemClock;
+import android.os.UserHandle;
+import android.os.UserManager;
+import android.provider.DeviceConfig;
+import android.provider.DeviceConfig.OnPropertiesChangedListener;
+import android.provider.DeviceConfig.Properties;
+import android.provider.Settings;
+import android.provider.Settings.Global;
+import android.util.ArraySet;
+import android.util.Slog;
+import android.util.SparseArray;
+import android.util.SparseArrayMap;
+import android.util.TimeUtils;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
+import com.android.internal.util.ArrayUtils;
+import com.android.internal.util.function.TriConsumer;
+import com.android.server.AppStateTracker;
+import com.android.server.LocalServices;
+import com.android.server.apphibernation.AppHibernationManagerInternal;
+import com.android.server.pm.UserManagerInternal;
+import com.android.server.usage.AppStandbyInternal;
+import com.android.server.usage.AppStandbyInternal.AppIdleStateChangeListener;
+
+import java.io.PrintWriter;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.function.Consumer;
+
+/**
+ * This class tracks various state of the apps and mutates their restriction levels accordingly.
+ */
+public final class AppRestrictionController {
+ static final String TAG = TAG_WITH_CLASS_NAME ? "AppRestrictionController" : TAG_AM;
+ static final boolean DEBUG_BG_RESTRICTION_CONTROLLER = false;
+
+ /**
+ * The prefix for the sub-namespace of our device configs under
+ * the {@link android.provider.DeviceConfig#NAMESPACE_ACTIVITY_MANAGER}.
+ */
+ static final String DEVICE_CONFIG_SUBNAMESPACE_PREFIX = "bg_";
+
+ static final int STOCK_PM_FLAGS = MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE
+ | MATCH_DISABLED_UNTIL_USED_COMPONENTS;
+
+ /**
+ * Whether or not to show the foreground service manager on tapping notifications.
+ */
+ private static final boolean ENABLE_SHOW_FOREGROUND_SERVICE_MANAGER = false;
+
+ private final Context mContext;
+ private final HandlerThread mBgHandlerThread;
+ private final BgHandler mBgHandler;
+ private final HandlerExecutor mBgExecutor;
+
+ // No lock is needed, as it's immutable after initialization in constructor.
+ private final ArrayList<BaseAppStateTracker> mAppStateTrackers = new ArrayList<>();
+
+ @GuardedBy("mLock")
+ private final RestrictionSettings mRestrictionSettings = new RestrictionSettings();
+
+ private final CopyOnWriteArraySet<AppBackgroundRestrictionListener> mRestrictionListeners =
+ new CopyOnWriteArraySet<>();
+
+ /**
+ * A mapping between the UID/Pkg and its pending work which should be triggered on inactive;
+ * an active UID/pkg pair should have an entry here, although its pending work could be null.
+ */
+ @GuardedBy("mLock")
+ private final SparseArrayMap<String, Runnable> mActiveUids = new SparseArrayMap<>();
+
+ // No lock is needed as it's accessed in bg handler thread only.
+ private final ArrayList<Runnable> mTmpRunnables = new ArrayList<>();
+
+ /**
+ * Power-save allowlisted app-ids (not including except-idle-allowlisted ones).
+ */
+ private int[] mDeviceIdleAllowlist = new int[0]; // No lock is needed.
+
+ /**
+ * Power-save allowlisted app-ids (including except-idle-allowlisted ones).
+ */
+ private int[] mDeviceIdleExceptIdleAllowlist = new int[0]; // No lock is needed.
+
+ private final Object mLock = new Object();
+ private final Injector mInjector;
+ private final NotificationHelper mNotificationHelper;
+
+ private final OnRoleHoldersChangedListener mRoleHolderChangedListener =
+ this::onRoleHoldersChanged;
+
+ /**
+ * The key is the UID, the value is the list of the roles it holds.
+ */
+ @GuardedBy("mLock")
+ private final SparseArray<ArrayList<String>> mUidRolesMapping = new SparseArray<>();
+
+ /**
+ * Cache the package name and information about if it's a system module.
+ */
+ @GuardedBy("mLock")
+ private final HashMap<String, Boolean> mSystemModulesCache = new HashMap<>();
+
+ final ActivityManagerService mActivityManagerService;
+
+ /**
+ * The restriction levels that each package is on, the levels here are defined in
+ * {@link android.app.ActivityManager.RESTRICTION_LEVEL_*}.
+ */
+ final class RestrictionSettings {
+ @GuardedBy("mLock")
+ final SparseArrayMap<String, PkgSettings> mRestrictionLevels = new SparseArrayMap();
+
+ final class PkgSettings {
+ private final String mPackageName;
+ private final int mUid;
+
+ private @RestrictionLevel int mCurrentRestrictionLevel;
+ private @RestrictionLevel int mLastRestrictionLevel;
+ private @ElapsedRealtimeLong long mLevelChangeTimeElapsed;
+ private int mReason;
+
+ private @ElapsedRealtimeLong long[] mLastNotificationShownTimeElapsed;
+ private int[] mNotificationId;
+
+ PkgSettings(String packageName, int uid) {
+ mPackageName = packageName;
+ mUid = uid;
+ mCurrentRestrictionLevel = mLastRestrictionLevel = RESTRICTION_LEVEL_UNKNOWN;
+ }
+
+ @RestrictionLevel int update(@RestrictionLevel int level, int reason, int subReason) {
+ if (level != mCurrentRestrictionLevel) {
+ mLastRestrictionLevel = mCurrentRestrictionLevel;
+ mCurrentRestrictionLevel = level;
+ mLevelChangeTimeElapsed = SystemClock.elapsedRealtime();
+ mReason = (REASON_MAIN_MASK & reason) | (REASON_SUB_MASK & subReason);
+ mBgHandler.obtainMessage(BgHandler.MSG_APP_RESTRICTION_LEVEL_CHANGED,
+ mUid, level, mPackageName).sendToTarget();
+ }
+ return mLastRestrictionLevel;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder sb = new StringBuilder(128);
+ sb.append("RestrictionLevel{");
+ sb.append(Integer.toHexString(System.identityHashCode(this)));
+ sb.append(':');
+ sb.append(mPackageName);
+ sb.append('/');
+ sb.append(UserHandle.formatUid(mUid));
+ sb.append('}');
+ sb.append(' ');
+ sb.append(ActivityManager.restrictionLevelToName(mCurrentRestrictionLevel));
+ sb.append('(');
+ sb.append(reasonToString(mReason));
+ sb.append(')');
+ return sb.toString();
+ }
+
+ void dump(PrintWriter pw, @ElapsedRealtimeLong long nowElapsed) {
+ pw.print(toString());
+ if (mLastRestrictionLevel != RESTRICTION_LEVEL_UNKNOWN) {
+ pw.print('/');
+ pw.print(ActivityManager.restrictionLevelToName(mLastRestrictionLevel));
+ }
+ pw.print(" levelChange=");
+ TimeUtils.formatDuration(mLevelChangeTimeElapsed - nowElapsed, pw);
+ if (mLastNotificationShownTimeElapsed != null) {
+ for (int i = 0; i < mLastNotificationShownTimeElapsed.length; i++) {
+ if (mLastNotificationShownTimeElapsed[i] > 0) {
+ pw.print(" lastNoti(");
+ pw.print(mNotificationHelper.notificationTypeToString(i));
+ pw.print(")=");
+ TimeUtils.formatDuration(
+ mLastNotificationShownTimeElapsed[i] - nowElapsed, pw);
+ }
+ }
+ }
+ }
+
+ String getPackageName() {
+ return mPackageName;
+ }
+
+ int getUid() {
+ return mUid;
+ }
+
+ @RestrictionLevel int getCurrentRestrictionLevel() {
+ return mCurrentRestrictionLevel;
+ }
+
+ @RestrictionLevel int getLastRestrictionLevel() {
+ return mLastRestrictionLevel;
+ }
+
+ int getReason() {
+ return mReason;
+ }
+
+ @ElapsedRealtimeLong long getLastNotificationTime(
+ @NotificationHelper.NotificationType int notificationType) {
+ if (mLastNotificationShownTimeElapsed == null) {
+ return 0;
+ }
+ return mLastNotificationShownTimeElapsed[notificationType];
+ }
+
+ void setLastNotificationTime(@NotificationHelper.NotificationType int notificationType,
+ @ElapsedRealtimeLong long timestamp) {
+ if (mLastNotificationShownTimeElapsed == null) {
+ mLastNotificationShownTimeElapsed =
+ new long[NotificationHelper.NOTIFICATION_TYPE_LAST];
+ }
+ mLastNotificationShownTimeElapsed[notificationType] = timestamp;
+ }
+
+ int getNotificationId(@NotificationHelper.NotificationType int notificationType) {
+ if (mNotificationId == null) {
+ return 0;
+ }
+ return mNotificationId[notificationType];
+ }
+
+ void setNotificationId(@NotificationHelper.NotificationType int notificationType,
+ int notificationId) {
+ if (mNotificationId == null) {
+ mNotificationId = new int[NotificationHelper.NOTIFICATION_TYPE_LAST];
+ }
+ mNotificationId[notificationType] = notificationId;
+ }
+ }
+
+ /**
+ * Update the restriction level.
+ *
+ * @return The previous restriction level.
+ */
+ @RestrictionLevel int update(String packageName, int uid, @RestrictionLevel int level,
+ int reason, int subReason) {
+ synchronized (mLock) {
+ PkgSettings settings = getRestrictionSettingsLocked(uid, packageName);
+ if (settings == null) {
+ settings = new PkgSettings(packageName, uid);
+ mRestrictionLevels.add(uid, packageName, settings);
+ }
+ return settings.update(level, reason, subReason);
+ }
+ }
+
+ /**
+ * @return The reason of why it's in this level.
+ */
+ int getReason(String packageName, int uid) {
+ synchronized (mLock) {
+ final PkgSettings settings = mRestrictionLevels.get(uid, packageName);
+ return settings != null ? settings.getReason()
+ : (REASON_MAIN_DEFAULT | REASON_SUB_DEFAULT_UNDEFINED);
+ }
+ }
+
+ @RestrictionLevel int getRestrictionLevel(int uid) {
+ synchronized (mLock) {
+ final int uidKeyIndex = mRestrictionLevels.indexOfKey(uid);
+ if (uidKeyIndex < 0) {
+ return RESTRICTION_LEVEL_UNKNOWN;
+ }
+ final int numPackages = mRestrictionLevels.numElementsForKeyAt(uidKeyIndex);
+ if (numPackages == 0) {
+ return RESTRICTION_LEVEL_UNKNOWN;
+ }
+ @RestrictionLevel int level = RESTRICTION_LEVEL_UNKNOWN;
+ for (int i = 0; i < numPackages; i++) {
+ final PkgSettings setting = mRestrictionLevels.valueAt(uidKeyIndex, i);
+ if (setting != null) {
+ final @RestrictionLevel int l = setting.getCurrentRestrictionLevel();
+ level = (level == RESTRICTION_LEVEL_UNKNOWN) ? l : Math.min(level, l);
+ }
+ }
+ return level;
+ }
+ }
+
+ @RestrictionLevel int getRestrictionLevel(int uid, String packageName) {
+ synchronized (mLock) {
+ final PkgSettings settings = getRestrictionSettingsLocked(uid, packageName);
+ return settings == null
+ ? getRestrictionLevel(uid) : settings.getCurrentRestrictionLevel();
+ }
+ }
+
+ @RestrictionLevel int getRestrictionLevel(String packageName, @UserIdInt int userId) {
+ final PackageManagerInternal pm = mInjector.getPackageManagerInternal();
+ final int uid = pm.getPackageUid(packageName, STOCK_PM_FLAGS, userId);
+ return getRestrictionLevel(uid, packageName);
+ }
+
+ private @RestrictionLevel int getLastRestrictionLevel(int uid, String packageName) {
+ synchronized (mLock) {
+ final PkgSettings settings = mRestrictionLevels.get(uid, packageName);
+ return settings == null
+ ? RESTRICTION_LEVEL_UNKNOWN : settings.mLastRestrictionLevel;
+ }
+ }
+
+ @GuardedBy("mLock")
+ void forEachPackageInUidLocked(int uid,
+ @NonNull TriConsumer<String, Integer, Integer> consumer) {
+ final int uidKeyIndex = mRestrictionLevels.indexOfKey(uid);
+ if (uidKeyIndex < 0) {
+ return;
+ }
+ final int numPackages = mRestrictionLevels.numElementsForKeyAt(uidKeyIndex);
+ for (int i = 0; i < numPackages; i++) {
+ final PkgSettings settings = mRestrictionLevels.valueAt(uidKeyIndex, i);
+ consumer.accept(mRestrictionLevels.keyAt(uidKeyIndex, i),
+ settings.getCurrentRestrictionLevel(), settings.getReason());
+ }
+ }
+
+ @GuardedBy("mLock")
+ void forEachUidLocked(@NonNull Consumer<Integer> consumer) {
+ for (int i = mRestrictionLevels.numMaps() - 1; i >= 0; i--) {
+ consumer.accept(mRestrictionLevels.keyAt(i));
+ }
+ }
+
+ @GuardedBy("mLock")
+ PkgSettings getRestrictionSettingsLocked(int uid, String packageName) {
+ return mRestrictionLevels.get(uid, packageName);
+ }
+
+ void removeUser(@UserIdInt int userId) {
+ synchronized (mLock) {
+ for (int i = mRestrictionLevels.numMaps() - 1; i >= 0; i--) {
+ final int uid = mRestrictionLevels.keyAt(i);
+ if (UserHandle.getUserId(uid) != userId) {
+ continue;
+ }
+ mRestrictionLevels.deleteAt(i);
+ }
+ }
+ }
+
+ void removePackage(String pkgName, int uid) {
+ synchronized (mLock) {
+ mRestrictionLevels.delete(uid, pkgName);
+ }
+ }
+
+ void removeUid(int uid) {
+ synchronized (mLock) {
+ mRestrictionLevels.delete(uid);
+ }
+ }
+
+ @VisibleForTesting
+ void reset() {
+ synchronized (mLock) {
+ mRestrictionLevels.clear();
+ }
+ }
+
+ @GuardedBy("mLock")
+ void dumpLocked(PrintWriter pw, String prefix) {
+ final ArrayList<PkgSettings> settings = new ArrayList<>();
+ mRestrictionLevels.forEach(setting -> settings.add(setting));
+ Collections.sort(settings, Comparator.comparingInt(PkgSettings::getUid));
+ final long nowElapsed = SystemClock.elapsedRealtime();
+ for (int i = 0, size = settings.size(); i < size; i++) {
+ pw.print(prefix);
+ pw.print('#');
+ pw.print(i);
+ pw.print(' ');
+ settings.get(i).dump(pw, nowElapsed);
+ pw.println();
+ }
+ }
+ }
+
+ final class ConstantsObserver extends ContentObserver implements
+ OnPropertiesChangedListener {
+ /**
+ * Whether or not to set the app to restricted standby bucket automatically
+ * when it's background-restricted.
+ */
+ static final String KEY_BG_AUTO_RESTRICTED_BUCKET_ON_BG_RESTRICTION =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "auto_restricted_bucket_on_bg_restricted";
+
+ /**
+ * The minimal interval in ms before posting a notification again on abusive behaviors
+ * of a certain package.
+ */
+ static final String KEY_BG_ABUSIVE_NOTIFICATION_MINIMAL_INTERVAL =
+ DEVICE_CONFIG_SUBNAMESPACE_PREFIX + "abusive_notification_minimal_interval";
+
+ static final boolean DEFAULT_BG_AUTO_RESTRICTED_BUCKET_ON_BG_RESTRICTION = true;
+ static final long DEFAULT_BG_ABUSIVE_NOTIFICATION_MINIMAL_INTERVAL_MS = 24 * 60 * 60 * 1000;
+
+ volatile boolean mBgAutoRestrictedBucket;
+
+ volatile boolean mRestrictedBucketEnabled;
+
+ volatile long mBgNotificationMinIntervalMs;
+
+ ConstantsObserver(Handler handler) {
+ super(handler);
+ }
+
+ @Override
+ public void onPropertiesChanged(Properties properties) {
+ for (String name : properties.getKeyset()) {
+ if (name == null || !name.startsWith(DEVICE_CONFIG_SUBNAMESPACE_PREFIX)) {
+ return;
+ }
+ switch (name) {
+ case KEY_BG_AUTO_RESTRICTED_BUCKET_ON_BG_RESTRICTION:
+ updateBgAutoRestrictedBucketChanged();
+ break;
+ case KEY_BG_ABUSIVE_NOTIFICATION_MINIMAL_INTERVAL:
+ updateBgAbusiveNotificationMinimalInterval();
+ break;
+ }
+ AppRestrictionController.this.onPropertiesChanged(name);
+ }
+ }
+
+ @Override
+ public void onChange(boolean selfChange) {
+ updateSettings();
+ }
+
+ public void start() {
+ final ContentResolver cr = mContext.getContentResolver();
+ cr.registerContentObserver(Global.getUriFor(Global.ENABLE_RESTRICTED_BUCKET),
+ false, this);
+ updateSettings();
+ updateDeviceConfig();
+ }
+
+ void updateSettings() {
+ mRestrictedBucketEnabled = isRestrictedBucketEnabled();
+ }
+
+ private boolean isRestrictedBucketEnabled() {
+ return Global.getInt(mContext.getContentResolver(),
+ Global.ENABLE_RESTRICTED_BUCKET,
+ Global.DEFAULT_ENABLE_RESTRICTED_BUCKET) == 1;
+ }
+
+ void updateDeviceConfig() {
+ updateBgAutoRestrictedBucketChanged();
+ updateBgAbusiveNotificationMinimalInterval();
+ }
+
+ private void updateBgAutoRestrictedBucketChanged() {
+ boolean oldValue = mBgAutoRestrictedBucket;
+ mBgAutoRestrictedBucket = DeviceConfig.getBoolean(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_AUTO_RESTRICTED_BUCKET_ON_BG_RESTRICTION,
+ DEFAULT_BG_AUTO_RESTRICTED_BUCKET_ON_BG_RESTRICTION);
+ if (oldValue != mBgAutoRestrictedBucket) {
+ dispatchAutoRestrictedBucketFeatureFlagChanged(mBgAutoRestrictedBucket);
+ }
+ }
+
+ private void updateBgAbusiveNotificationMinimalInterval() {
+ mBgNotificationMinIntervalMs = DeviceConfig.getLong(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ KEY_BG_ABUSIVE_NOTIFICATION_MINIMAL_INTERVAL,
+ DEFAULT_BG_ABUSIVE_NOTIFICATION_MINIMAL_INTERVAL_MS);
+ }
+ }
+
+ private final ConstantsObserver mConstantsObserver;
+
+ private final AppStateTracker.BackgroundRestrictedAppListener mBackgroundRestrictionListener =
+ new AppStateTracker.BackgroundRestrictedAppListener() {
+ @Override
+ public void updateBackgroundRestrictedForUidPackage(int uid, String packageName,
+ boolean restricted) {
+ mBgHandler.obtainMessage(BgHandler.MSG_BACKGROUND_RESTRICTION_CHANGED,
+ uid, restricted ? 1 : 0, packageName).sendToTarget();
+ }
+ };
+
+ private final AppIdleStateChangeListener mAppIdleStateChangeListener =
+ new AppIdleStateChangeListener() {
+ @Override
+ public void onAppIdleStateChanged(String packageName, @UserIdInt int userId,
+ boolean idle, int bucket, int reason) {
+ mBgHandler.obtainMessage(BgHandler.MSG_APP_STANDBY_BUCKET_CHANGED,
+ userId, bucket, packageName).sendToTarget();
+ }
+
+ @Override
+ public void onUserInteractionStarted(String packageName, @UserIdInt int userId) {
+ mBgHandler.obtainMessage(BgHandler.MSG_USER_INTERACTION_STARTED,
+ userId, 0, packageName).sendToTarget();
+ }
+ };
+
+ private final IUidObserver mUidObserver =
+ new IUidObserver.Stub() {
+ @Override
+ public void onUidStateChanged(int uid, int procState, long procStateSeq,
+ int capability) {
+ mBgHandler.obtainMessage(BgHandler.MSG_UID_PROC_STATE_CHANGED, uid, procState)
+ .sendToTarget();
+ }
+
+ @Override
+ public void onUidIdle(int uid, boolean disabled) {
+ mBgHandler.obtainMessage(BgHandler.MSG_UID_IDLE, uid, disabled ? 1 : 0)
+ .sendToTarget();
+ }
+
+ @Override
+ public void onUidGone(int uid, boolean disabled) {
+ mBgHandler.obtainMessage(BgHandler.MSG_UID_GONE, uid, disabled ? 1 : 0)
+ .sendToTarget();
+ }
+
+ @Override
+ public void onUidActive(int uid) {
+ mBgHandler.obtainMessage(BgHandler.MSG_UID_ACTIVE, uid, 0).sendToTarget();
+ }
+
+ @Override
+ public void onUidCachedChanged(int uid, boolean cached) {
+ }
+ };
+
+ /**
+ * Register the background restriction listener callback.
+ */
+ public void addAppBackgroundRestrictionListener(
+ @NonNull AppBackgroundRestrictionListener listener) {
+ mRestrictionListeners.add(listener);
+ }
+
+ AppRestrictionController(final Context context, final ActivityManagerService service) {
+ this(new Injector(context), service);
+ }
+
+ AppRestrictionController(final Injector injector, final ActivityManagerService service) {
+ mInjector = injector;
+ mContext = injector.getContext();
+ mActivityManagerService = service;
+ mBgHandlerThread = new HandlerThread("bgres-controller");
+ mBgHandlerThread.start();
+ mBgHandler = new BgHandler(mBgHandlerThread.getLooper(), injector);
+ mBgExecutor = new HandlerExecutor(mBgHandler);
+ mConstantsObserver = new ConstantsObserver(mBgHandler);
+ mNotificationHelper = new NotificationHelper(this);
+ injector.initAppStateTrackers(this);
+ }
+
+ void onSystemReady() {
+ DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ ActivityThread.currentApplication().getMainExecutor(), mConstantsObserver);
+ mConstantsObserver.start();
+ initRestrictionStates();
+ initSystemModuleNames();
+ registerForUidObservers();
+ registerForSystemBroadcasts();
+ mNotificationHelper.onSystemReady();
+ mInjector.getAppStateTracker().addBackgroundRestrictedAppListener(
+ mBackgroundRestrictionListener);
+ mInjector.getAppStandbyInternal().addListener(mAppIdleStateChangeListener);
+ mInjector.getRoleManager().addOnRoleHoldersChangedListenerAsUser(mBgExecutor,
+ mRoleHolderChangedListener, UserHandle.ALL);
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ mAppStateTrackers.get(i).onSystemReady();
+ }
+ }
+
+ @VisibleForTesting
+ void resetRestrictionSettings() {
+ mRestrictionSettings.reset();
+ initRestrictionStates();
+ }
+
+ private void initRestrictionStates() {
+ final int[] allUsers = mInjector.getUserManagerInternal().getUserIds();
+ for (int userId : allUsers) {
+ refreshAppRestrictionLevelForUser(userId, REASON_MAIN_FORCED_BY_USER,
+ REASON_SUB_FORCED_USER_FLAG_INTERACTION);
+ }
+ }
+
+ private void initSystemModuleNames() {
+ final PackageManager pm = mInjector.getPackageManager();
+ final List<ModuleInfo> moduleInfos = pm.getInstalledModules(0 /* flags */);
+ if (moduleInfos == null) {
+ return;
+ }
+ synchronized (mLock) {
+ for (ModuleInfo info : moduleInfos) {
+ mSystemModulesCache.put(info.getPackageName(), Boolean.TRUE);
+ }
+ }
+ }
+
+ private boolean isSystemModule(String packageName) {
+ synchronized (mLock) {
+ final Boolean val = mSystemModulesCache.get(packageName);
+ if (val != null) {
+ return val.booleanValue();
+ }
+ }
+
+ // Slow path: check if the package is listed among the system modules.
+ final PackageManager pm = mInjector.getPackageManager();
+ boolean isSystemModule = false;
+ try {
+ isSystemModule = pm.getModuleInfo(packageName, 0 /* flags */) != null;
+ } catch (PackageManager.NameNotFoundException e) {
+ }
+
+ if (!isSystemModule) {
+ try {
+ final PackageInfo pkg = pm.getPackageInfo(packageName, 0 /* flags */);
+ // Check if the package is contained in an APEX. There is no public API to properly
+ // check whether a given APK package comes from an APEX registered as module.
+ // Therefore we conservatively assume that any package scanned from an /apex path is
+ // a system package.
+ isSystemModule = pkg != null && pkg.applicationInfo.sourceDir.startsWith(
+ Environment.getApexDirectory().getAbsolutePath());
+ } catch (PackageManager.NameNotFoundException e) {
+ }
+ }
+ // Update the cache.
+ synchronized (mLock) {
+ mSystemModulesCache.put(packageName, isSystemModule);
+ }
+ return isSystemModule;
+ }
+
+ private void registerForUidObservers() {
+ try {
+ mInjector.getIActivityManager().registerUidObserver(mUidObserver,
+ UID_OBSERVER_ACTIVE | UID_OBSERVER_GONE | UID_OBSERVER_IDLE
+ | UID_OBSERVER_PROCSTATE, PROCESS_STATE_FOREGROUND_SERVICE, "android");
+ } catch (RemoteException e) {
+ // Intra-process call, it won't happen.
+ }
+ }
+
+ /**
+ * Called when initializing a user.
+ */
+ private void refreshAppRestrictionLevelForUser(@UserIdInt int userId, int reason,
+ int subReason) {
+ final List<AppStandbyInfo> appStandbyInfos = mInjector.getAppStandbyInternal()
+ .getAppStandbyBuckets(userId);
+ if (ArrayUtils.isEmpty(appStandbyInfos)) {
+ return;
+ }
+
+ if (DEBUG_BG_RESTRICTION_CONTROLLER) {
+ Slog.i(TAG, "Refreshing restriction levels of user " + userId);
+ }
+ final PackageManagerInternal pm = mInjector.getPackageManagerInternal();
+ for (AppStandbyInfo info: appStandbyInfos) {
+ final int uid = pm.getPackageUid(info.mPackageName, STOCK_PM_FLAGS, userId);
+ if (uid < 0) {
+ // Shouldn't happen.
+ Slog.e(TAG, "Unable to find " + info.mPackageName + "/u" + userId);
+ continue;
+ }
+ final @RestrictionLevel int level = calcAppRestrictionLevel(
+ userId, uid, info.mPackageName, info.mStandbyBucket, false, false);
+ applyRestrictionLevel(info.mPackageName, uid, level,
+ info.mStandbyBucket, true, reason, subReason);
+ }
+ }
+
+ void refreshAppRestrictionLevelForUid(int uid, int reason, int subReason,
+ boolean allowRequestBgRestricted) {
+ final String[] packages = mInjector.getPackageManager().getPackagesForUid(uid);
+ if (ArrayUtils.isEmpty(packages)) {
+ return;
+ }
+ final AppStandbyInternal appStandbyInternal = mInjector.getAppStandbyInternal();
+ final int userId = UserHandle.getUserId(uid);
+ final long now = SystemClock.elapsedRealtime();
+ for (String pkg: packages) {
+ final int curBucket = appStandbyInternal.getAppStandbyBucket(pkg, userId, now, false);
+ final @RestrictionLevel int level = calcAppRestrictionLevel(userId, uid, pkg,
+ curBucket, allowRequestBgRestricted, true);
+ if (DEBUG_BG_RESTRICTION_CONTROLLER) {
+ Slog.i(TAG, "Proposed restriction level of " + pkg + "/"
+ + UserHandle.formatUid(uid) + ": "
+ + ActivityManager.restrictionLevelToName(level));
+ }
+ applyRestrictionLevel(pkg, uid, level, curBucket, true, reason, subReason);
+ }
+ }
+
+ private @RestrictionLevel int calcAppRestrictionLevel(@UserIdInt int userId, int uid,
+ String packageName, @UsageStatsManager.StandbyBuckets int standbyBucket,
+ boolean allowRequestBgRestricted, boolean calcTrackers) {
+ if (mInjector.getAppHibernationInternal().isHibernatingForUser(packageName, userId)) {
+ return RESTRICTION_LEVEL_HIBERNATION;
+ }
+ @RestrictionLevel int level;
+ switch (standbyBucket) {
+ case STANDBY_BUCKET_EXEMPTED:
+ level = RESTRICTION_LEVEL_EXEMPTED;
+ break;
+ case STANDBY_BUCKET_NEVER:
+ level = RESTRICTION_LEVEL_BACKGROUND_RESTRICTED;
+ break;
+ case STANDBY_BUCKET_ACTIVE:
+ case STANDBY_BUCKET_WORKING_SET:
+ case STANDBY_BUCKET_FREQUENT:
+ case STANDBY_BUCKET_RARE:
+ case STANDBY_BUCKET_RESTRICTED:
+ default:
+ if (mInjector.getAppStateTracker()
+ .isAppBackgroundRestricted(uid, packageName)) {
+ return RESTRICTION_LEVEL_BACKGROUND_RESTRICTED;
+ }
+ level = mConstantsObserver.mRestrictedBucketEnabled
+ && standbyBucket == STANDBY_BUCKET_RESTRICTED
+ ? RESTRICTION_LEVEL_RESTRICTED_BUCKET
+ : RESTRICTION_LEVEL_ADAPTIVE_BUCKET;
+ if (calcTrackers) {
+ @RestrictionLevel int l = calcAppRestrictionLevelFromTackers(uid, packageName);
+ if (l == RESTRICTION_LEVEL_EXEMPTED) {
+ return RESTRICTION_LEVEL_EXEMPTED;
+ }
+ level = Math.max(l, level);
+ if (level == RESTRICTION_LEVEL_BACKGROUND_RESTRICTED) {
+ // This level can't be entered without user consent
+ if (allowRequestBgRestricted) {
+ mBgHandler.obtainMessage(BgHandler.MSG_REQUEST_BG_RESTRICTED,
+ uid, 0, packageName).sendToTarget();
+ }
+ // Lower the level.
+ level = RESTRICTION_LEVEL_RESTRICTED_BUCKET;
+ }
+ }
+ break;
+ }
+ return level;
+ }
+
+ /**
+ * Ask each of the trackers for their proposed restriction levels for the given uid/package,
+ * and return the most restrictive level.
+ *
+ * <p>Note, it's different from the {@link #getRestrictionLevel} where it returns the least
+ * restrictive level. We're returning the most restrictive level here because each tracker
+ * monitors certain dimensions of the app, the abusive behaviors could be detected in one or
+ * more of these dimensions, but not necessarily all of them. </p>
+ */
+ private @RestrictionLevel int calcAppRestrictionLevelFromTackers(int uid, String packageName) {
+ @RestrictionLevel int level = RESTRICTION_LEVEL_UNKNOWN;
+ final boolean isRestrictedBucketEnabled = mConstantsObserver.mRestrictedBucketEnabled;
+ for (int i = mAppStateTrackers.size() - 1; i >= 0; i--) {
+ @RestrictionLevel int l = mAppStateTrackers.get(i).getPolicy()
+ .getProposedRestrictionLevel(packageName, uid);
+ if (!isRestrictedBucketEnabled && l == RESTRICTION_LEVEL_RESTRICTED_BUCKET) {
+ l = RESTRICTION_LEVEL_ADAPTIVE_BUCKET;
+ }
+ level = Math.max(level, l);
+ }
+ return level;
+ }
+
+ /**
+ * Get the restriction level of the given UID, if it hosts multiple packages,
+ * return least restricted one (or if any of them is exempted).
+ */
+ @RestrictionLevel int getRestrictionLevel(int uid) {
+ return mRestrictionSettings.getRestrictionLevel(uid);
+ }
+
+ /**
+ * Get the restriction level of the given UID and package.
+ */
+ @RestrictionLevel int getRestrictionLevel(int uid, String packageName) {
+ return mRestrictionSettings.getRestrictionLevel(uid, packageName);
+ }
+
+ /**
+ * Get the restriction level of the given package in given user id.
+ */
+ @RestrictionLevel int getRestrictionLevel(String packageName, @UserIdInt int userId) {
+ return mRestrictionSettings.getRestrictionLevel(packageName, userId);
+ }
+
+ /**
+ * @return The total foreground service durations for the given package/uid with given
+ * foreground service type, or the total durations regardless the type if the given type is 0.
+ */
+ long getForegroundServiceTotalDurations(String packageName, int uid, long now,
+ @ForegroundServiceType int serviceType) {
+ return mInjector.getAppFGSTracker().getTotalDurations(packageName, uid, now,
+ foregroundServiceTypeToIndex(serviceType));
+ }
+
+ /**
+ * @return The total foreground service durations for the given uid with given
+ * foreground service type, or the total durations regardless the type if the given type is 0.
+ */
+ long getForegroundServiceTotalDurations(int uid, long now,
+ @ForegroundServiceType int serviceType) {
+ return mInjector.getAppFGSTracker().getTotalDurations(uid, now,
+ foregroundServiceTypeToIndex(serviceType));
+ }
+
+ /**
+ * @return The foreground service durations since given timestamp for the given package/uid
+ * with given foreground service type, or the total durations regardless the type if the given
+ * type is 0.
+ */
+ long getForegroundServiceTotalDurationsSince(String packageName, int uid, long since, long now,
+ @ForegroundServiceType int serviceType) {
+ return mInjector.getAppFGSTracker().getTotalDurationsSince(packageName, uid, since, now,
+ foregroundServiceTypeToIndex(serviceType));
+ }
+
+ /**
+ * @return The foreground service durations since given timestamp for the given uid with given
+ * foreground service type, or the total durations regardless the type if the given type is 0.
+ */
+ long getForegroundServiceTotalDurationsSince(int uid, long since, long now,
+ @ForegroundServiceType int serviceType) {
+ return mInjector.getAppFGSTracker().getTotalDurationsSince(uid, since, now,
+ foregroundServiceTypeToIndex(serviceType));
+ }
+
+ /**
+ * @return The total durations for the given package/uid with active media session.
+ */
+ long getMediaSessionTotalDurations(String packageName, int uid, long now) {
+ return mInjector.getAppMediaSessionTracker().getTotalDurations(packageName, uid, now);
+ }
+
+ /**
+ * @return The total durations for the given uid with active media session.
+ */
+ long getMediaSessionTotalDurations(int uid, long now) {
+ return mInjector.getAppMediaSessionTracker().getTotalDurations(uid, now);
+ }
+
+ /**
+ * @return The durations since given timestamp for the given package/uid with
+ * active media session.
+ */
+ long getMediaSessionTotalDurationsSince(String packageName, int uid, long since, long now) {
+ return mInjector.getAppMediaSessionTracker().getTotalDurationsSince(packageName, uid, since,
+ now);
+ }
+
+ /**
+ * @return The durations since given timestamp for the given uid with active media session.
+ */
+ long getMediaSessionTotalDurationsSince(int uid, long since, long now) {
+ return mInjector.getAppMediaSessionTracker().getTotalDurationsSince(uid, since, now);
+ }
+
+ /**
+ * @return The durations over the given window, where the given package/uid has either
+ * foreground services with type "mediaPlayback" running, or active media session running.
+ */
+ long getCompositeMediaPlaybackDurations(String packageName, int uid, long now, long window) {
+ final long since = Math.max(0, now - window);
+ final long mediaPlaybackDuration = Math.max(
+ getMediaSessionTotalDurationsSince(packageName, uid, since, now),
+ getForegroundServiceTotalDurationsSince(packageName, uid, since, now,
+ ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK));
+ return mediaPlaybackDuration;
+ }
+
+ /**
+ * @return The durations over the given window, where the given uid has either foreground
+ * services with type "mediaPlayback" running, or active media session running.
+ */
+ long getCompositeMediaPlaybackDurations(int uid, long now, long window) {
+ final long since = Math.max(0, now - window);
+ final long mediaPlaybackDuration = Math.max(
+ getMediaSessionTotalDurationsSince(uid, since, now),
+ getForegroundServiceTotalDurationsSince(uid, since, now,
+ ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK));
+ return mediaPlaybackDuration;
+ }
+
+ /**
+ * @return If the given package/uid has an active foreground service running.
+ */
+ boolean hasForegroundServices(String packageName, int uid) {
+ return mInjector.getAppFGSTracker().hasForegroundServices(packageName, uid);
+ }
+
+ /**
+ * @return If the given uid has an active foreground service running.
+ */
+ boolean hasForegroundServices(int uid) {
+ return mInjector.getAppFGSTracker().hasForegroundServices(uid);
+ }
+
+ /**
+ * @return The to-be-exempted battery usage of the given UID in the given duration; it could
+ * be considered as "exempted" due to various use cases, i.e. media playback.
+ */
+ double getUidBatteryExemptedUsageSince(int uid, long since, long now) {
+ return mInjector.getAppBatteryExemptionTracker()
+ .getUidBatteryExemptedUsageSince(uid, since, now);
+ }
+
+ /**
+ * @return The total battery usage of the given UID since the system boots.
+ */
+ double getUidBatteryUsage(int uid) {
+ return mInjector.getUidBatteryUsageProvider().getUidBatteryUsage(uid);
+ }
+
+ interface UidBatteryUsageProvider {
+ /**
+ * @return The total battery usage of the given UID since the system boots.
+ */
+ double getUidBatteryUsage(int uid);
+ }
+
+ void dump(PrintWriter pw, String prefix) {
+ pw.print(prefix);
+ pw.println("BACKGROUND RESTRICTION LEVEL SETTINGS");
+ prefix = " " + prefix;
+ synchronized (mLock) {
+ mRestrictionSettings.dumpLocked(pw, prefix);
+ }
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ pw.println();
+ mAppStateTrackers.get(i).dump(pw, prefix);
+ }
+ }
+
+ private void applyRestrictionLevel(String pkgName, int uid, @RestrictionLevel int level,
+ int curBucket, boolean allowUpdateBucket, int reason, int subReason) {
+ int curLevel;
+ int prevReason;
+ synchronized (mLock) {
+ curLevel = getRestrictionLevel(uid, pkgName);
+ if (curLevel == level) {
+ // Nothing to do.
+ return;
+ }
+ if (DEBUG_BG_RESTRICTION_CONTROLLER) {
+ Slog.i(TAG, "Updating the restriction level of " + pkgName + "/"
+ + UserHandle.formatUid(uid) + " from "
+ + ActivityManager.restrictionLevelToName(curLevel) + " to "
+ + ActivityManager.restrictionLevelToName(level)
+ + " reason=" + reason + ", subReason=" + subReason);
+ }
+
+ prevReason = mRestrictionSettings.getReason(pkgName, uid);
+ mRestrictionSettings.update(pkgName, uid, level, reason, subReason);
+ }
+
+ if (!allowUpdateBucket || curBucket == STANDBY_BUCKET_EXEMPTED) {
+ return;
+ }
+ final AppStandbyInternal appStandbyInternal = mInjector.getAppStandbyInternal();
+ if (level >= RESTRICTION_LEVEL_RESTRICTED_BUCKET
+ && curLevel < RESTRICTION_LEVEL_RESTRICTED_BUCKET) {
+ if (!mConstantsObserver.mRestrictedBucketEnabled
+ || !mConstantsObserver.mBgAutoRestrictedBucket) {
+ return;
+ }
+ // Moving the app standby bucket to restricted in the meanwhile.
+ if (DEBUG_BG_RESTRICTION_CONTROLLER
+ && level == RESTRICTION_LEVEL_BACKGROUND_RESTRICTED) {
+ Slog.i(TAG, pkgName + "/" + UserHandle.formatUid(uid)
+ + " is bg-restricted, moving to restricted standby bucket");
+ }
+ if (curBucket != STANDBY_BUCKET_RESTRICTED) {
+ // restrict the app if it hasn't done so.
+ boolean doIt = true;
+ synchronized (mLock) {
+ final int index = mActiveUids.indexOfKey(uid, pkgName);
+ if (index >= 0) {
+ // It's currently active, enqueue it.
+ mActiveUids.add(uid, pkgName, () -> appStandbyInternal.restrictApp(
+ pkgName, UserHandle.getUserId(uid), reason, subReason));
+ doIt = false;
+ }
+ }
+ if (doIt) {
+ appStandbyInternal.restrictApp(pkgName, UserHandle.getUserId(uid),
+ reason, subReason);
+ }
+ }
+ } else if (curLevel >= RESTRICTION_LEVEL_RESTRICTED_BUCKET
+ && level < RESTRICTION_LEVEL_RESTRICTED_BUCKET) {
+ // Moved out of the background-restricted state.
+ if (curBucket != STANDBY_BUCKET_RARE) {
+ synchronized (mLock) {
+ final int index = mActiveUids.indexOfKey(uid, pkgName);
+ if (index >= 0) {
+ mActiveUids.add(uid, pkgName, null);
+ }
+ }
+ appStandbyInternal.maybeUnrestrictApp(pkgName, UserHandle.getUserId(uid),
+ prevReason & REASON_MAIN_MASK, prevReason & REASON_SUB_MASK,
+ reason, subReason);
+ }
+ }
+ }
+
+ private void handleBackgroundRestrictionChanged(int uid, String pkgName, boolean restricted) {
+ // Firstly, notify the trackers.
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ mAppStateTrackers.get(i)
+ .onBackgroundRestrictionChanged(uid, pkgName, restricted);
+ }
+
+ final AppStandbyInternal appStandbyInternal = mInjector.getAppStandbyInternal();
+ final int userId = UserHandle.getUserId(uid);
+ final long now = SystemClock.elapsedRealtime();
+ final int curBucket = appStandbyInternal.getAppStandbyBucket(pkgName, userId, now, false);
+ if (restricted) {
+ // The app could fall into the background restricted with user consent only,
+ // so set the reason to it.
+ applyRestrictionLevel(pkgName, uid, RESTRICTION_LEVEL_BACKGROUND_RESTRICTED,
+ curBucket, true, REASON_MAIN_FORCED_BY_USER,
+ REASON_SUB_FORCED_USER_FLAG_INTERACTION);
+ mBgHandler.obtainMessage(BgHandler.MSG_CANCEL_REQUEST_BG_RESTRICTED, uid, 0, pkgName)
+ .sendToTarget();
+ } else {
+ // Moved out of the background-restricted state, we'd need to check if it should
+ // stay in the restricted standby bucket.
+ final @RestrictionLevel int lastLevel =
+ mRestrictionSettings.getLastRestrictionLevel(uid, pkgName);
+ final int tentativeBucket = curBucket == STANDBY_BUCKET_EXEMPTED
+ ? STANDBY_BUCKET_EXEMPTED
+ : (lastLevel == RESTRICTION_LEVEL_RESTRICTED_BUCKET
+ ? STANDBY_BUCKET_RESTRICTED : STANDBY_BUCKET_RARE);
+ final @RestrictionLevel int level = calcAppRestrictionLevel(
+ UserHandle.getUserId(uid), uid, pkgName, tentativeBucket, false, true);
+
+ applyRestrictionLevel(pkgName, uid, level, curBucket, true,
+ REASON_MAIN_USAGE, REASON_SUB_USAGE_USER_INTERACTION);
+ }
+ }
+
+ private void dispatchAppRestrictionLevelChanges(int uid, String pkgName,
+ @RestrictionLevel int newLevel) {
+ mRestrictionListeners.forEach(
+ l -> l.onRestrictionLevelChanged(uid, pkgName, newLevel));
+ }
+
+ private void dispatchAutoRestrictedBucketFeatureFlagChanged(boolean newValue) {
+ final AppStandbyInternal appStandbyInternal = mInjector.getAppStandbyInternal();
+ final ArrayList<Runnable> pendingTasks = new ArrayList<>();
+ synchronized (mLock) {
+ mRestrictionSettings.forEachUidLocked(uid -> {
+ mRestrictionSettings.forEachPackageInUidLocked(uid, (pkgName, level, reason) -> {
+ if (level == RESTRICTION_LEVEL_BACKGROUND_RESTRICTED) {
+ pendingTasks.add(newValue
+ ? () -> appStandbyInternal.restrictApp(pkgName,
+ UserHandle.getUserId(uid), reason & REASON_MAIN_MASK,
+ reason & REASON_SUB_MASK)
+ : () -> appStandbyInternal.maybeUnrestrictApp(pkgName,
+ UserHandle.getUserId(uid), reason & REASON_MAIN_MASK,
+ reason & REASON_SUB_MASK, REASON_MAIN_USAGE,
+ REASON_SUB_USAGE_SYSTEM_UPDATE));
+ }
+ });
+ });
+ }
+ for (int i = 0; i < pendingTasks.size(); i++) {
+ pendingTasks.get(i).run();
+ }
+ mRestrictionListeners.forEach(
+ l -> l.onAutoRestrictedBucketFeatureFlagChanged(newValue));
+ }
+
+ private void handleAppStandbyBucketChanged(int bucket, String packageName,
+ @UserIdInt int userId) {
+ final int uid = mInjector.getPackageManagerInternal().getPackageUid(
+ packageName, STOCK_PM_FLAGS, userId);
+ final @RestrictionLevel int level = calcAppRestrictionLevel(
+ userId, uid, packageName, bucket, false, false);
+ applyRestrictionLevel(packageName, uid, level, bucket, false,
+ REASON_MAIN_DEFAULT, REASON_SUB_DEFAULT_UNDEFINED);
+ }
+
+ void handleRequestBgRestricted(String packageName, int uid) {
+ if (DEBUG_BG_RESTRICTION_CONTROLLER) {
+ Slog.i(TAG, "Requesting background restricted " + packageName + " "
+ + UserHandle.formatUid(uid));
+ }
+ mNotificationHelper.postRequestBgRestrictedIfNecessary(packageName, uid);
+ }
+
+ void handleCancelRequestBgRestricted(String packageName, int uid) {
+ if (DEBUG_BG_RESTRICTION_CONTROLLER) {
+ Slog.i(TAG, "Cancelling requesting background restricted " + packageName + " "
+ + UserHandle.formatUid(uid));
+ }
+ mNotificationHelper.cancelRequestBgRestrictedIfNecessary(packageName, uid);
+ }
+
+ void handleUidProcStateChanged(int uid, int procState) {
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ mAppStateTrackers.get(i).onUidProcStateChanged(uid, procState);
+ }
+ }
+
+ void handleUidGone(int uid) {
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ mAppStateTrackers.get(i).onUidGone(uid);
+ }
+ }
+
+ static class NotificationHelper {
+ static final String PACKAGE_SCHEME = "package";
+ static final String GROUP_KEY = "com.android.app.abusive_bg_apps";
+
+ static final int SUMMARY_NOTIFICATION_ID = SystemMessage.NOTE_ABUSIVE_BG_APPS_BASE;
+
+ static final int NOTIFICATION_TYPE_ABUSIVE_CURRENT_DRAIN = 0;
+ static final int NOTIFICATION_TYPE_LONG_RUNNING_FGS = 1;
+ static final int NOTIFICATION_TYPE_LAST = 2;
+
+ @IntDef(prefix = { "NOTIFICATION_TYPE_"}, value = {
+ NOTIFICATION_TYPE_ABUSIVE_CURRENT_DRAIN,
+ NOTIFICATION_TYPE_LONG_RUNNING_FGS,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ static @interface NotificationType{}
+
+ static final String[] NOTIFICATION_TYPE_STRINGS = {
+ "Abusive current drain",
+ "Long-running FGS",
+ };
+
+ static final String ACTION_FGS_MANAGER_TRAMPOLINE =
+ "com.android.server.am.ACTION_FGS_MANAGER_TRAMPOLINE";
+
+ static String notificationTypeToString(@NotificationType int notificationType) {
+ return NOTIFICATION_TYPE_STRINGS[notificationType];
+ }
+
+ private final AppRestrictionController mBgController;
+ private final NotificationManager mNotificationManager;
+ private final Injector mInjector;
+ private final Object mLock;
+ private final Context mContext;
+
+ private final BroadcastReceiver mActionButtonReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ final String action = intent.getAction();
+ switch (intent.getAction()) {
+ case ACTION_FGS_MANAGER_TRAMPOLINE:
+ final String packageName = intent.getStringExtra(Intent.EXTRA_PACKAGE_NAME);
+ final int uid = intent.getIntExtra(Intent.EXTRA_UID, 0);
+ cancelRequestBgRestrictedIfNecessary(packageName, uid);
+ final Intent newIntent = new Intent(ACTION_SHOW_FOREGROUND_SERVICE_MANAGER);
+ newIntent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
+ mContext.sendBroadcastAsUser(newIntent,
+ UserHandle.of(UserHandle.getUserId(uid)));
+ break;
+ }
+ }
+ };
+
+ @GuardedBy("mLock")
+ private int mNotificationIDStepper = SUMMARY_NOTIFICATION_ID + 1;
+
+ NotificationHelper(AppRestrictionController controller) {
+ mBgController = controller;
+ mInjector = controller.mInjector;
+ mNotificationManager = mInjector.getNotificationManager();
+ mLock = controller.mLock;
+ mContext = mInjector.getContext();
+ }
+
+ void onSystemReady() {
+ mContext.registerReceiverForAllUsers(mActionButtonReceiver,
+ new IntentFilter(ACTION_FGS_MANAGER_TRAMPOLINE),
+ MANAGE_ACTIVITY_TASKS, mBgController.mBgHandler);
+ }
+
+ void postRequestBgRestrictedIfNecessary(String packageName, int uid) {
+ final Intent intent = new Intent(Settings.ACTION_VIEW_ADVANCED_POWER_USAGE_DETAIL);
+ intent.setData(Uri.fromParts(PACKAGE_SCHEME, packageName, null));
+
+ final PendingIntent pendingIntent = PendingIntent.getActivityAsUser(mContext, 0,
+ intent, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE, null,
+ UserHandle.of(UserHandle.getUserId(uid)));
+ Notification.Action[] actions = null;
+ if (ENABLE_SHOW_FOREGROUND_SERVICE_MANAGER
+ && mBgController.hasForegroundServices(packageName, uid)) {
+ final Intent trampoline = new Intent(ACTION_FGS_MANAGER_TRAMPOLINE);
+ trampoline.setPackage("android");
+ trampoline.putExtra(Intent.EXTRA_PACKAGE_NAME, packageName);
+ trampoline.putExtra(Intent.EXTRA_UID, uid);
+ final PendingIntent fgsMgrTrampoline = PendingIntent.getBroadcastAsUser(
+ mContext, 0, trampoline,
+ PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE,
+ UserHandle.CURRENT);
+ actions = new Notification.Action[] {
+ new Notification.Action.Builder(null,
+ mContext.getString(
+ com.android.internal.R.string.notification_action_check_bg_apps),
+ fgsMgrTrampoline)
+ .build()
+ };
+ }
+ postNotificationIfNecessary(NOTIFICATION_TYPE_ABUSIVE_CURRENT_DRAIN,
+ com.android.internal.R.string.notification_title_abusive_bg_apps,
+ com.android.internal.R.string.notification_content_abusive_bg_apps,
+ pendingIntent, packageName, uid, actions);
+ }
+
+ void postLongRunningFgsIfNecessary(String packageName, int uid) {
+ PendingIntent pendingIntent;
+ if (ENABLE_SHOW_FOREGROUND_SERVICE_MANAGER) {
+ final Intent intent = new Intent(ACTION_SHOW_FOREGROUND_SERVICE_MANAGER);
+ intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
+ pendingIntent = PendingIntent.getBroadcastAsUser(mContext, 0,
+ intent, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
+ UserHandle.of(UserHandle.getUserId(uid)));
+ } else {
+ final Intent intent = new Intent(Settings.ACTION_VIEW_ADVANCED_POWER_USAGE_DETAIL);
+ intent.setData(Uri.fromParts(PACKAGE_SCHEME, packageName, null));
+ pendingIntent = PendingIntent.getActivityAsUser(mContext, 0,
+ intent, PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
+ null, UserHandle.of(UserHandle.getUserId(uid)));
+ }
+
+ postNotificationIfNecessary(NOTIFICATION_TYPE_LONG_RUNNING_FGS,
+ com.android.internal.R.string.notification_title_abusive_bg_apps,
+ com.android.internal.R.string.notification_content_long_running_fgs,
+ pendingIntent, packageName, uid, null);
+ }
+
+ int getNotificationIdIfNecessary(@NotificationType int notificationType,
+ String packageName, int uid) {
+ synchronized (mLock) {
+ final RestrictionSettings.PkgSettings settings = mBgController.mRestrictionSettings
+ .getRestrictionSettingsLocked(uid, packageName);
+ if (settings == null) {
+ return 0;
+ }
+
+ final long now = SystemClock.elapsedRealtime();
+ final long lastNotificationShownTimeElapsed =
+ settings.getLastNotificationTime(notificationType);
+ if (lastNotificationShownTimeElapsed != 0 && (lastNotificationShownTimeElapsed
+ + mBgController.mConstantsObserver.mBgNotificationMinIntervalMs > now)) {
+ if (DEBUG_BG_RESTRICTION_CONTROLLER) {
+ Slog.i(TAG, "Not showing notification as last notification was shown "
+ + TimeUtils.formatDuration(now - lastNotificationShownTimeElapsed)
+ + " ago");
+ }
+ return 0;
+ }
+ settings.setLastNotificationTime(notificationType, now);
+ int notificationId = settings.getNotificationId(notificationType);
+ if (notificationId <= 0) {
+ notificationId = mNotificationIDStepper++;
+ settings.setNotificationId(notificationType, notificationId);
+ }
+ if (DEBUG_BG_RESTRICTION_CONTROLLER) {
+ Slog.i(TAG, "Showing notification for " + packageName
+ + "/" + UserHandle.formatUid(uid)
+ + ", id=" + notificationId
+ + ", now=" + now
+ + ", lastShown=" + lastNotificationShownTimeElapsed);
+ }
+ return notificationId;
+ }
+ }
+
+ void postNotificationIfNecessary(@NotificationType int notificationType, int titleRes,
+ int messageRes, PendingIntent pendingIntent, String packageName, int uid,
+ @Nullable Notification.Action[] actions) {
+ int notificationId = getNotificationIdIfNecessary(notificationType, packageName, uid);
+ if (notificationId <= 0) {
+ return;
+ }
+
+ final PackageManagerInternal pmi = mInjector.getPackageManagerInternal();
+ final PackageManager pm = mInjector.getPackageManager();
+ final ApplicationInfo ai = pmi.getApplicationInfo(packageName, STOCK_PM_FLAGS,
+ SYSTEM_UID, UserHandle.getUserId(uid));
+ final String title = mContext.getString(titleRes);
+ final String message = mContext.getString(messageRes,
+ ai != null ? pm.getText(packageName, ai.labelRes, ai) : packageName);
+ final Icon icon = ai != null ? Icon.createWithResource(packageName, ai.icon) : null;
+
+ postNotification(notificationId, packageName, uid, title, message, icon, pendingIntent,
+ actions);
+ }
+
+ void postNotification(int notificationId, String packageName, int uid, String title,
+ String message, Icon icon, PendingIntent pendingIntent,
+ @Nullable Notification.Action[] actions) {
+ final UserHandle targetUser = UserHandle.of(UserHandle.getUserId(uid));
+ postSummaryNotification(targetUser);
+
+ final Notification.Builder notificationBuilder = new Notification.Builder(mContext,
+ ABUSIVE_BACKGROUND_APPS)
+ .setAutoCancel(true)
+ .setGroup(GROUP_KEY)
+ .setWhen(System.currentTimeMillis())
+ .setSmallIcon(com.android.internal.R.drawable.stat_sys_warning)
+ .setColor(mContext.getColor(
+ com.android.internal.R.color.system_notification_accent_color))
+ .setContentTitle(title)
+ .setContentText(message)
+ .setContentIntent(pendingIntent);
+ if (icon != null) {
+ notificationBuilder.setLargeIcon(icon);
+ }
+ if (actions != null) {
+ for (Notification.Action action : actions) {
+ notificationBuilder.addAction(action);
+ }
+ }
+
+ final Notification notification = notificationBuilder.build();
+ // Remember the package name for testing.
+ notification.extras.putString(Intent.EXTRA_PACKAGE_NAME, packageName);
+
+ mNotificationManager.notifyAsUser(null, notificationId, notification, targetUser);
+ }
+
+ private void postSummaryNotification(@NonNull UserHandle targetUser) {
+ final Notification summary = new Notification.Builder(mContext,
+ ABUSIVE_BACKGROUND_APPS)
+ .setGroup(GROUP_KEY)
+ .setGroupSummary(true)
+ .setStyle(new Notification.BigTextStyle())
+ .setSmallIcon(com.android.internal.R.drawable.stat_sys_warning)
+ .setColor(mContext.getColor(
+ com.android.internal.R.color.system_notification_accent_color))
+ .build();
+ mNotificationManager.notifyAsUser(null, SUMMARY_NOTIFICATION_ID, summary, targetUser);
+ }
+
+ void cancelRequestBgRestrictedIfNecessary(String packageName, int uid) {
+ synchronized (mLock) {
+ final RestrictionSettings.PkgSettings settings = mBgController.mRestrictionSettings
+ .getRestrictionSettingsLocked(uid, packageName);
+ if (settings != null) {
+ final int notificationId =
+ settings.getNotificationId(NOTIFICATION_TYPE_ABUSIVE_CURRENT_DRAIN);
+ if (notificationId > 0) {
+ mNotificationManager.cancel(notificationId);
+ }
+ }
+ }
+ }
+
+ void cancelLongRunningFGSNotificationIfNecessary(String packageName, int uid) {
+ synchronized (mLock) {
+ final RestrictionSettings.PkgSettings settings = mBgController.mRestrictionSettings
+ .getRestrictionSettingsLocked(uid, packageName);
+ if (settings != null) {
+ final int notificationId =
+ settings.getNotificationId(NOTIFICATION_TYPE_LONG_RUNNING_FGS);
+ if (notificationId > 0) {
+ mNotificationManager.cancel(notificationId);
+ }
+ }
+ }
+ }
+ }
+
+ void handleUidInactive(int uid, boolean disabled) {
+ final ArrayList<Runnable> pendingTasks = mTmpRunnables;
+ synchronized (mLock) {
+ final int index = mActiveUids.indexOfKey(uid);
+ if (index < 0) {
+ return;
+ }
+ final int numPackages = mActiveUids.numElementsForKeyAt(index);
+ for (int i = 0; i < numPackages; i++) {
+ final Runnable pendingTask = mActiveUids.valueAt(index, i);
+ if (pendingTask != null) {
+ pendingTasks.add(pendingTask);
+ }
+ }
+ mActiveUids.deleteAt(index);
+ }
+ for (int i = 0, size = pendingTasks.size(); i < size; i++) {
+ pendingTasks.get(i).run();
+ }
+ pendingTasks.clear();
+ }
+
+ void handleUidActive(int uid) {
+ synchronized (mLock) {
+ final AppStandbyInternal appStandbyInternal = mInjector.getAppStandbyInternal();
+ final int userId = UserHandle.getUserId(uid);
+ mRestrictionSettings.forEachPackageInUidLocked(uid, (pkgName, level, reason) -> {
+ if (level == RESTRICTION_LEVEL_BACKGROUND_RESTRICTED) {
+ mActiveUids.add(uid, pkgName, () -> appStandbyInternal.restrictApp(pkgName,
+ userId, reason & REASON_MAIN_MASK, reason & REASON_SUB_MASK));
+ } else {
+ mActiveUids.add(uid, pkgName, null);
+ }
+ });
+ }
+ }
+
+ boolean isOnDeviceIdleAllowlist(int uid, boolean allowExceptIdle) {
+ final int appId = UserHandle.getAppId(uid);
+
+ final int[] allowlist = allowExceptIdle
+ ? mDeviceIdleExceptIdleAllowlist
+ : mDeviceIdleAllowlist;
+
+ return Arrays.binarySearch(allowlist, appId) >= 0;
+ }
+
+ void setDeviceIdleAllowlist(int[] allAppids, int[] exceptIdleAppids) {
+ mDeviceIdleAllowlist = allAppids;
+ mDeviceIdleExceptIdleAllowlist = exceptIdleAppids;
+ }
+
+ /**
+ * @return The reason code of whether or not the given UID should be exempted from background
+ * restrictions here.
+ *
+ * <p>
+ * Note: Call it with caution as it'll try to acquire locks in other services.
+ * </p>
+ */
+ @ReasonCode
+ int getBackgroundRestrictionExemptionReason(int uid) {
+ if (UserHandle.isCore(uid)) {
+ return REASON_SYSTEM_UID;
+ }
+ if (isOnDeviceIdleAllowlist(uid, false)) {
+ return REASON_ALLOWLISTED_PACKAGE;
+ }
+ final ActivityManagerInternal am = mInjector.getActivityManagerInternal();
+ if (am.isAssociatedCompanionApp(UserHandle.getUserId(uid), uid)) {
+ return REASON_COMPANION_DEVICE_MANAGER;
+ }
+ if (UserManager.isDeviceInDemoMode(mContext)) {
+ return REASON_DEVICE_DEMO_MODE;
+ }
+ if (am.isDeviceOwner(uid)) {
+ return REASON_DEVICE_OWNER;
+ }
+ if (am.isProfileOwner(uid)) {
+ return REASON_PROFILE_OWNER;
+ }
+ final int uidProcState = am.getUidProcessState(uid);
+ if (uidProcState <= PROCESS_STATE_PERSISTENT) {
+ return REASON_PROC_STATE_PERSISTENT;
+ } else if (uidProcState <= PROCESS_STATE_PERSISTENT_UI) {
+ return REASON_PROC_STATE_PERSISTENT_UI;
+ }
+ final String[] packages = mInjector.getPackageManager().getPackagesForUid(uid);
+ if (packages != null) {
+ final AppOpsManager appOpsManager = mInjector.getAppOpsManager();
+ for (String pkg : packages) {
+ if (appOpsManager.checkOpNoThrow(AppOpsManager.OP_ACTIVATE_VPN,
+ uid, pkg) == AppOpsManager.MODE_ALLOWED) {
+ return REASON_OP_ACTIVATE_VPN;
+ } else if (appOpsManager.checkOpNoThrow(AppOpsManager.OP_ACTIVATE_PLATFORM_VPN,
+ uid, pkg) == AppOpsManager.MODE_ALLOWED) {
+ return REASON_OP_ACTIVATE_PLATFORM_VPN;
+ } else if (isSystemModule(pkg)) {
+ return REASON_SYSTEM_MODULE;
+ }
+ }
+ }
+ if (isRoleHeldByUid(RoleManager.ROLE_DIALER, uid)) {
+ return REASON_ROLE_DIALER;
+ }
+ if (isRoleHeldByUid(RoleManager.ROLE_EMERGENCY, uid)) {
+ return REASON_ROLE_EMERGENCY;
+ }
+ return REASON_DENIED;
+ }
+
+ private boolean isRoleHeldByUid(@NonNull String roleName, int uid) {
+ synchronized (mLock) {
+ final ArrayList<String> roles = mUidRolesMapping.get(uid);
+ return roles != null && roles.indexOf(roleName) >= 0;
+ }
+ }
+
+ private void onRoleHoldersChanged(@NonNull String roleName, @NonNull UserHandle user) {
+ final List<String> rolePkgs = mInjector.getRoleManager().getRoleHoldersAsUser(
+ roleName, user);
+ final ArraySet<Integer> roleUids = new ArraySet<>();
+ final int userId = user.getIdentifier();
+ if (rolePkgs != null) {
+ final PackageManagerInternal pm = mInjector.getPackageManagerInternal();
+ for (String pkg: rolePkgs) {
+ roleUids.add(pm.getPackageUid(pkg, STOCK_PM_FLAGS, userId));
+ }
+ }
+ synchronized (mLock) {
+ for (int i = mUidRolesMapping.size() - 1; i >= 0; i--) {
+ final int uid = mUidRolesMapping.keyAt(i);
+ if (UserHandle.getUserId(uid) != userId) {
+ continue;
+ }
+ final ArrayList<String> roles = mUidRolesMapping.valueAt(i);
+ final int index = roles.indexOf(roleName);
+ final boolean isRole = roleUids.contains(uid);
+ if (index >= 0) {
+ if (!isRole) { // Not holding this role anymore, remove it.
+ roles.remove(index);
+ if (roles.isEmpty()) {
+ mUidRolesMapping.removeAt(i);
+ }
+ }
+ } else if (isRole) { // Got this new role, add it.
+ roles.add(roleName);
+ roleUids.remove(uid);
+ }
+ }
+ for (int i = roleUids.size() - 1; i >= 0; i--) { // Take care of the leftovers.
+ final ArrayList<String> roles = new ArrayList<>();
+ roles.add(roleName);
+ mUidRolesMapping.put(roleUids.valueAt(i), roles);
+ }
+ }
+ }
+
+ /**
+ * @return The background handler of this controller.
+ */
+ Handler getBackgroundHandler() {
+ return mBgHandler;
+ }
+
+ /**
+ * @return The background handler thread of this controller.
+ */
+ @VisibleForTesting
+ HandlerThread getBackgroundHandlerThread() {
+ return mBgHandlerThread;
+ }
+
+ /**
+ * @return The global lock of this controller.
+ */
+ Object getLock() {
+ return mLock;
+ }
+
+ @VisibleForTesting
+ void addAppStateTracker(@NonNull BaseAppStateTracker tracker) {
+ mAppStateTrackers.add(tracker);
+ }
+
+ /**
+ * @return The tracker instance of the given class.
+ */
+ <T extends BaseAppStateTracker> T getAppStateTracker(Class<T> trackerClass) {
+ for (BaseAppStateTracker tracker : mAppStateTrackers) {
+ if (trackerClass.isAssignableFrom(tracker.getClass())) {
+ return (T) tracker;
+ }
+ }
+ return null;
+ }
+
+ void postLongRunningFgsIfNecessary(String packageName, int uid) {
+ mNotificationHelper.postLongRunningFgsIfNecessary(packageName, uid);
+ }
+
+ void cancelLongRunningFGSNotificationIfNecessary(String packageName, int uid) {
+ mNotificationHelper.cancelLongRunningFGSNotificationIfNecessary(packageName, uid);
+ }
+
+ String getPackageName(int pid) {
+ return mInjector.getPackageName(pid);
+ }
+
+ static class BgHandler extends Handler {
+ static final int MSG_BACKGROUND_RESTRICTION_CHANGED = 0;
+ static final int MSG_APP_RESTRICTION_LEVEL_CHANGED = 1;
+ static final int MSG_APP_STANDBY_BUCKET_CHANGED = 2;
+ static final int MSG_USER_INTERACTION_STARTED = 3;
+ static final int MSG_REQUEST_BG_RESTRICTED = 4;
+ static final int MSG_UID_IDLE = 5;
+ static final int MSG_UID_ACTIVE = 6;
+ static final int MSG_UID_GONE = 7;
+ static final int MSG_UID_PROC_STATE_CHANGED = 8;
+ static final int MSG_CANCEL_REQUEST_BG_RESTRICTED = 9;
+
+ private final Injector mInjector;
+
+ BgHandler(Looper looper, Injector injector) {
+ super(looper);
+ mInjector = injector;
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ final AppRestrictionController c = mInjector
+ .getAppRestrictionController();
+ switch (msg.what) {
+ case MSG_BACKGROUND_RESTRICTION_CHANGED: {
+ c.handleBackgroundRestrictionChanged(msg.arg1, (String) msg.obj, msg.arg2 == 1);
+ } break;
+ case MSG_APP_RESTRICTION_LEVEL_CHANGED: {
+ c.dispatchAppRestrictionLevelChanges(msg.arg1, (String) msg.obj, msg.arg2);
+ } break;
+ case MSG_APP_STANDBY_BUCKET_CHANGED: {
+ c.handleAppStandbyBucketChanged(msg.arg2, (String) msg.obj, msg.arg1);
+ } break;
+ case MSG_USER_INTERACTION_STARTED: {
+ c.onUserInteractionStarted((String) msg.obj, msg.arg1);
+ } break;
+ case MSG_REQUEST_BG_RESTRICTED: {
+ c.handleRequestBgRestricted((String) msg.obj, msg.arg1);
+ } break;
+ case MSG_UID_IDLE: {
+ c.handleUidInactive(msg.arg1, msg.arg2 == 1);
+ } break;
+ case MSG_UID_ACTIVE: {
+ c.handleUidActive(msg.arg1);
+ } break;
+ case MSG_CANCEL_REQUEST_BG_RESTRICTED: {
+ c.handleCancelRequestBgRestricted((String) msg.obj, msg.arg1);
+ } break;
+ case MSG_UID_PROC_STATE_CHANGED: {
+ c.handleUidProcStateChanged(msg.arg1, msg.arg2);
+ } break;
+ case MSG_UID_GONE: {
+ // It also means this UID is inactive now.
+ c.handleUidInactive(msg.arg1, msg.arg2 == 1);
+ c.handleUidGone(msg.arg1);
+ } break;
+ }
+ }
+ }
+
+ static class Injector {
+ private final Context mContext;
+ private ActivityManagerInternal mActivityManagerInternal;
+ private AppRestrictionController mAppRestrictionController;
+ private AppOpsManager mAppOpsManager;
+ private AppStandbyInternal mAppStandbyInternal;
+ private AppStateTracker mAppStateTracker;
+ private AppHibernationManagerInternal mAppHibernationInternal;
+ private IActivityManager mIActivityManager;
+ private UserManagerInternal mUserManagerInternal;
+ private PackageManagerInternal mPackageManagerInternal;
+ private NotificationManager mNotificationManager;
+ private RoleManager mRoleManager;
+ private AppBatteryTracker mAppBatteryTracker;
+ private AppBatteryExemptionTracker mAppBatteryExemptionTracker;
+ private AppFGSTracker mAppFGSTracker;
+ private AppMediaSessionTracker mAppMediaSessionTracker;
+
+ Injector(Context context) {
+ mContext = context;
+ }
+
+ Context getContext() {
+ return mContext;
+ }
+
+ void initAppStateTrackers(AppRestrictionController controller) {
+ mAppRestrictionController = controller;
+ mAppBatteryTracker = new AppBatteryTracker(mContext, controller);
+ mAppBatteryExemptionTracker = new AppBatteryExemptionTracker(mContext, controller);
+ mAppFGSTracker = new AppFGSTracker(mContext, controller);
+ mAppMediaSessionTracker = new AppMediaSessionTracker(mContext, controller);
+ controller.mAppStateTrackers.add(mAppBatteryTracker);
+ controller.mAppStateTrackers.add(mAppBatteryExemptionTracker);
+ controller.mAppStateTrackers.add(mAppFGSTracker);
+ controller.mAppStateTrackers.add(mAppMediaSessionTracker);
+ controller.mAppStateTrackers.add(new AppBroadcastEventsTracker(mContext, controller));
+ controller.mAppStateTrackers.add(new AppBindServiceEventsTracker(mContext, controller));
+ }
+
+ ActivityManagerInternal getActivityManagerInternal() {
+ if (mActivityManagerInternal == null) {
+ mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class);
+ }
+ return mActivityManagerInternal;
+ }
+
+ AppRestrictionController getAppRestrictionController() {
+ return mAppRestrictionController;
+ }
+
+ AppOpsManager getAppOpsManager() {
+ if (mAppOpsManager == null) {
+ mAppOpsManager = getContext().getSystemService(AppOpsManager.class);
+ }
+ return mAppOpsManager;
+ }
+
+ AppStandbyInternal getAppStandbyInternal() {
+ if (mAppStandbyInternal == null) {
+ mAppStandbyInternal = LocalServices.getService(AppStandbyInternal.class);
+ }
+ return mAppStandbyInternal;
+ }
+
+ AppHibernationManagerInternal getAppHibernationInternal() {
+ if (mAppHibernationInternal == null) {
+ mAppHibernationInternal = LocalServices.getService(
+ AppHibernationManagerInternal.class);
+ }
+ return mAppHibernationInternal;
+ }
+
+ AppStateTracker getAppStateTracker() {
+ if (mAppStateTracker == null) {
+ mAppStateTracker = LocalServices.getService(AppStateTracker.class);
+ }
+ return mAppStateTracker;
+ }
+
+ IActivityManager getIActivityManager() {
+ return ActivityManager.getService();
+ }
+
+ UserManagerInternal getUserManagerInternal() {
+ if (mUserManagerInternal == null) {
+ mUserManagerInternal = LocalServices.getService(UserManagerInternal.class);
+ }
+ return mUserManagerInternal;
+ }
+
+ PackageManagerInternal getPackageManagerInternal() {
+ if (mPackageManagerInternal == null) {
+ mPackageManagerInternal = LocalServices.getService(PackageManagerInternal.class);
+ }
+ return mPackageManagerInternal;
+ }
+
+ PackageManager getPackageManager() {
+ return getContext().getPackageManager();
+ }
+
+ NotificationManager getNotificationManager() {
+ if (mNotificationManager == null) {
+ mNotificationManager = getContext().getSystemService(NotificationManager.class);
+ }
+ return mNotificationManager;
+ }
+
+ RoleManager getRoleManager() {
+ if (mRoleManager == null) {
+ mRoleManager = getContext().getSystemService(RoleManager.class);
+ }
+ return mRoleManager;
+ }
+
+ AppFGSTracker getAppFGSTracker() {
+ return mAppFGSTracker;
+ }
+
+ AppMediaSessionTracker getAppMediaSessionTracker() {
+ return mAppMediaSessionTracker;
+ }
+
+ ActivityManagerService getActivityManagerService() {
+ return mAppRestrictionController.mActivityManagerService;
+ }
+
+ UidBatteryUsageProvider getUidBatteryUsageProvider() {
+ return mAppBatteryTracker;
+ }
+
+ AppBatteryExemptionTracker getAppBatteryExemptionTracker() {
+ return mAppBatteryExemptionTracker;
+ }
+
+ String getPackageName(int pid) {
+ final ActivityManagerService am = getActivityManagerService();
+ final ProcessRecord app;
+ synchronized (am.mPidsSelfLocked) {
+ app = am.mPidsSelfLocked.get(pid);
+ if (app != null) {
+ final ApplicationInfo ai = app.info;
+ if (ai != null) {
+ return ai.packageName;
+ }
+ }
+ }
+ return null;
+ }
+ }
+
+ private void registerForSystemBroadcasts() {
+ final BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ final String action = intent.getAction();
+ switch (intent.getAction()) {
+ case Intent.ACTION_PACKAGE_ADDED: {
+ if (!intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {
+ final int uid = intent.getIntExtra(Intent.EXTRA_UID, -1);
+ if (uid >= 0) {
+ onUidAdded(uid);
+ }
+ }
+ } break;
+ case Intent.ACTION_PACKAGE_FULLY_REMOVED: {
+ final int uid = intent.getIntExtra(Intent.EXTRA_UID, -1);
+ final Uri data = intent.getData();
+ String ssp;
+ if (uid >= 0 && data != null
+ && (ssp = data.getSchemeSpecificPart()) != null) {
+ onPackageRemoved(ssp, uid);
+ }
+ } break;
+ case Intent.ACTION_UID_REMOVED: {
+ if (!intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {
+ final int uid = intent.getIntExtra(Intent.EXTRA_UID, -1);
+ if (uid >= 0) {
+ onUidRemoved(uid);
+ }
+ }
+ } break;
+ case Intent.ACTION_USER_ADDED: {
+ final int userId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, -1);
+ if (userId >= 0) {
+ onUserAdded(userId);
+ }
+ } break;
+ case Intent.ACTION_USER_STARTED: {
+ final int userId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, -1);
+ if (userId >= 0) {
+ onUserStarted(userId);
+ }
+ } break;
+ case Intent.ACTION_USER_STOPPED: {
+ final int userId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, -1);
+ if (userId >= 0) {
+ onUserStopped(userId);
+ }
+ } break;
+ case Intent.ACTION_USER_REMOVED: {
+ final int userId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, -1);
+ if (userId >= 0) {
+ onUserRemoved(userId);
+ }
+ } break;
+ }
+ }
+ };
+ final IntentFilter packageFilter = new IntentFilter();
+ packageFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
+ packageFilter.addAction(Intent.ACTION_PACKAGE_FULLY_REMOVED);
+ packageFilter.addDataScheme("package");
+ mContext.registerReceiverForAllUsers(broadcastReceiver, packageFilter, null, mBgHandler);
+ final IntentFilter userFilter = new IntentFilter();
+ userFilter.addAction(Intent.ACTION_USER_ADDED);
+ userFilter.addAction(Intent.ACTION_USER_REMOVED);
+ userFilter.addAction(Intent.ACTION_UID_REMOVED);
+ mContext.registerReceiverForAllUsers(broadcastReceiver, userFilter, null, mBgHandler);
+ }
+
+ void forEachTracker(Consumer<BaseAppStateTracker> sink) {
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ sink.accept(mAppStateTrackers.get(i));
+ }
+ }
+
+ private void onUserAdded(@UserIdInt int userId) {
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ mAppStateTrackers.get(i).onUserAdded(userId);
+ }
+ }
+
+ private void onUserStarted(@UserIdInt int userId) {
+ refreshAppRestrictionLevelForUser(userId, REASON_MAIN_FORCED_BY_USER,
+ REASON_SUB_FORCED_USER_FLAG_INTERACTION);
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ mAppStateTrackers.get(i).onUserStarted(userId);
+ }
+ }
+
+ private void onUserStopped(@UserIdInt int userId) {
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ mAppStateTrackers.get(i).onUserStopped(userId);
+ }
+ }
+
+ private void onUserRemoved(@UserIdInt int userId) {
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ mAppStateTrackers.get(i).onUserRemoved(userId);
+ }
+ mRestrictionSettings.removeUser(userId);
+ }
+
+ private void onUidAdded(int uid) {
+ refreshAppRestrictionLevelForUid(uid, REASON_MAIN_FORCED_BY_SYSTEM,
+ REASON_SUB_FORCED_SYSTEM_FLAG_UNDEFINED, false);
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ mAppStateTrackers.get(i).onUidAdded(uid);
+ }
+ }
+
+ private void onPackageRemoved(String pkgName, int uid) {
+ mRestrictionSettings.removePackage(pkgName, uid);
+ }
+
+ private void onUidRemoved(int uid) {
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ mAppStateTrackers.get(i).onUidRemoved(uid);
+ }
+ mRestrictionSettings.removeUid(uid);
+ }
+
+ boolean isBgAutoRestrictedBucketFeatureFlagEnabled() {
+ return mConstantsObserver.mBgAutoRestrictedBucket;
+ }
+
+ private void onPropertiesChanged(String name) {
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ mAppStateTrackers.get(i).onPropertiesChanged(name);
+ }
+ }
+
+ private void onUserInteractionStarted(String packageName, @UserIdInt int userId) {
+ final int uid = mInjector.getPackageManagerInternal()
+ .getPackageUid(packageName, STOCK_PM_FLAGS, userId);
+ for (int i = 0, size = mAppStateTrackers.size(); i < size; i++) {
+ mAppStateTrackers.get(i).onUserInteractionStarted(packageName, uid);
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/BaseAppStateDurations.java b/services/core/java/com/android/server/am/BaseAppStateDurations.java
new file mode 100644
index 0000000..4d3b4dd
--- /dev/null
+++ b/services/core/java/com/android/server/am/BaseAppStateDurations.java
@@ -0,0 +1,255 @@
+/*
+ * 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.server.am;
+
+import android.annotation.NonNull;
+import android.os.SystemClock;
+import android.os.UserHandle;
+import android.util.Slog;
+import android.util.TimeUtils;
+
+import com.android.server.am.BaseAppStateTimeEvents.BaseTimeEvent;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+
+/**
+ * A helper class to track the accumulated durations of certain events; supports tracking event
+ * start/stop, trim.
+ */
+abstract class BaseAppStateDurations<T extends BaseTimeEvent> extends BaseAppStateTimeEvents<T> {
+ static final boolean DEBUG_BASE_APP_STATE_DURATIONS = false;
+
+ BaseAppStateDurations(int uid, @NonNull String packageName, int numOfEventTypes,
+ @NonNull String tag, @NonNull MaxTrackingDurationConfig maxTrackingDurationConfig) {
+ super(uid, packageName, numOfEventTypes, tag, maxTrackingDurationConfig);
+ }
+
+ BaseAppStateDurations(@NonNull BaseAppStateDurations other) {
+ super(other);
+ }
+
+ /**
+ * Add a start/stop event.
+ */
+ void addEvent(boolean start, @NonNull T event, int index) {
+ if (mEvents[index] == null) {
+ mEvents[index] = new LinkedList<>();
+ }
+ final LinkedList<T> events = mEvents[index];
+ final int size = events.size();
+ final boolean active = isActive(index);
+
+ if (DEBUG_BASE_APP_STATE_DURATIONS && !start && !active) {
+ Slog.wtf(mTag, "Under-counted start event");
+ return;
+ }
+ if (start != active) {
+ // Only record the event time if it's not the same state as now
+ events.add(event);
+ }
+ trimEvents(getEarliest(event.getTimestamp()), index);
+ }
+
+ @Override
+ void trimEvents(long earliest, int index) {
+ trimEvents(earliest, mEvents[index]);
+ }
+
+ void trimEvents(long earliest, LinkedList<T> events) {
+ if (events == null) {
+ return;
+ }
+ while (events.size() > 1) {
+ final T current = events.peek();
+ if (current.getTimestamp() >= earliest) {
+ return; // All we have are newer than the given timestamp.
+ }
+ // Check the timestamp of stop event.
+ if (events.get(1).getTimestamp() > earliest) {
+ // Trim the duration by moving the start time.
+ events.get(0).trimTo(earliest);
+ return;
+ }
+ // Discard the 1st duration as it's older than the given timestamp.
+ events.pop();
+ events.pop();
+ }
+ if (events.size() == 1) {
+ // Trim the duration by moving the start time.
+ events.get(0).trimTo(Math.max(earliest, events.peek().getTimestamp()));
+ }
+ }
+
+ /**
+ * Merge the two given duration table and return the result.
+ */
+ @Override
+ LinkedList<T> add(LinkedList<T> durations, LinkedList<T> otherDurations) {
+ if (otherDurations == null || otherDurations.size() == 0) {
+ return durations;
+ }
+ if (durations == null || durations.size() == 0) {
+ return (LinkedList<T>) otherDurations.clone();
+ }
+ final Iterator<T> itl = durations.iterator();
+ final Iterator<T> itr = otherDurations.iterator();
+ T l = itl.next(), r = itr.next();
+ LinkedList<T> dest = new LinkedList<>();
+ boolean actl = false, actr = false;
+ for (long lts = l.getTimestamp(), rts = r.getTimestamp();
+ lts != Long.MAX_VALUE || rts != Long.MAX_VALUE;) {
+ final boolean actCur = actl || actr;
+ final T earliest;
+ if (lts == rts) {
+ earliest = l;
+ actl = !actl;
+ actr = !actr;
+ lts = itl.hasNext() ? (l = itl.next()).getTimestamp() : Long.MAX_VALUE;
+ rts = itr.hasNext() ? (r = itr.next()).getTimestamp() : Long.MAX_VALUE;
+ } else if (lts < rts) {
+ earliest = l;
+ actl = !actl;
+ lts = itl.hasNext() ? (l = itl.next()).getTimestamp() : Long.MAX_VALUE;
+ } else {
+ earliest = r;
+ actr = !actr;
+ rts = itr.hasNext() ? (r = itr.next()).getTimestamp() : Long.MAX_VALUE;
+ }
+ if (actCur != (actl || actr)) {
+ dest.add((T) earliest.clone());
+ }
+ }
+ return dest;
+ }
+
+ /**
+ * Subtract the other durations from the this duration table at given index
+ */
+ void subtract(BaseAppStateDurations otherDurations, int thisIndex, int otherIndex) {
+ if (mEvents.length <= thisIndex || mEvents[thisIndex] == null
+ || otherDurations.mEvents.length <= otherIndex
+ || otherDurations.mEvents[otherIndex] == null) {
+ if (DEBUG_BASE_APP_STATE_DURATIONS) {
+ Slog.wtf(mTag, "Incompatible event table this=" + this + ", other=" + otherDurations
+ + ", thisIndex=" + thisIndex + ", otherIndex=" + otherIndex);
+ }
+ return;
+ }
+ mEvents[thisIndex] = subtract(mEvents[thisIndex], otherDurations.mEvents[otherIndex]);
+ }
+
+ /**
+ * Subtract the other durations at given index from the this duration table at all indexes.
+ */
+ void subtract(BaseAppStateDurations otherDurations, int otherIndex) {
+ if (otherDurations.mEvents.length <= otherIndex
+ || otherDurations.mEvents[otherIndex] == null) {
+ if (DEBUG_BASE_APP_STATE_DURATIONS) {
+ Slog.wtf(mTag, "Incompatible event table this=" + this + ", other=" + otherDurations
+ + ", otherIndex=" + otherIndex);
+ }
+ return;
+ }
+ for (int i = 0; i < mEvents.length; i++) {
+ if (mEvents[i] != null) {
+ mEvents[i] = subtract(mEvents[i], otherDurations.mEvents[otherIndex]);
+ }
+ }
+ }
+
+ /**
+ * Subtract the other durations from the given duration table and return the new one.
+ */
+ LinkedList<T> subtract(LinkedList<T> durations, LinkedList<T> otherDurations) {
+ if (otherDurations == null || otherDurations.size() == 0
+ || durations == null || durations.size() == 0) {
+ return durations;
+ }
+ final Iterator<T> itl = durations.iterator();
+ final Iterator<T> itr = otherDurations.iterator();
+ T l = itl.next(), r = itr.next();
+ LinkedList<T> dest = new LinkedList<>();
+ boolean actl = false, actr = false;
+ for (long lts = l.getTimestamp(), rts = r.getTimestamp();
+ lts != Long.MAX_VALUE || rts != Long.MAX_VALUE;) {
+ final boolean actCur = actl && !actr;
+ final T earliest;
+ if (lts == rts) {
+ earliest = l;
+ actl = !actl;
+ actr = !actr;
+ lts = itl.hasNext() ? (l = itl.next()).getTimestamp() : Long.MAX_VALUE;
+ rts = itr.hasNext() ? (r = itr.next()).getTimestamp() : Long.MAX_VALUE;
+ } else if (lts < rts) {
+ earliest = l;
+ actl = !actl;
+ lts = itl.hasNext() ? (l = itl.next()).getTimestamp() : Long.MAX_VALUE;
+ } else {
+ earliest = r;
+ actr = !actr;
+ rts = itr.hasNext() ? (r = itr.next()).getTimestamp() : Long.MAX_VALUE;
+ }
+ if (actCur != (actl && !actr)) {
+ dest.add((T) earliest.clone());
+ }
+ }
+ return dest;
+ }
+
+ long getTotalDurations(long now, int index) {
+ return getTotalDurationsSince(getEarliest(0), now, index);
+ }
+
+ long getTotalDurationsSince(long since, long now, int index) {
+ final LinkedList<T> events = mEvents[index];
+ if (events == null || events.size() == 0) {
+ return 0L;
+ }
+ boolean active = true;
+ long last = 0;
+ long duration = 0;
+ for (T event : events) {
+ if (event.getTimestamp() < since || active) {
+ last = event.getTimestamp();
+ } else {
+ duration += Math.max(0, event.getTimestamp() - Math.max(last, since));
+ }
+ active = !active;
+ }
+ if ((events.size() & 1) == 1) {
+ duration += Math.max(0, now - Math.max(last, since));
+ }
+ return duration;
+ }
+
+ boolean isActive(int index) {
+ return mEvents[index] != null && (mEvents[index].size() & 1) == 1;
+ }
+
+ @Override
+ String formatEventSummary(long now, int index) {
+ return TimeUtils.formatDuration(getTotalDurations(now, index));
+ }
+
+ @Override
+ public String toString() {
+ return mPackageName + "/" + UserHandle.formatUid(mUid)
+ + " isActive[0]=" + isActive(0)
+ + " totalDurations[0]=" + getTotalDurations(SystemClock.elapsedRealtime(), 0);
+ }
+}
diff --git a/services/core/java/com/android/server/am/BaseAppStateDurationsTracker.java b/services/core/java/com/android/server/am/BaseAppStateDurationsTracker.java
new file mode 100644
index 0000000..cc89e84
--- /dev/null
+++ b/services/core/java/com/android/server/am/BaseAppStateDurationsTracker.java
@@ -0,0 +1,298 @@
+/*
+ * 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.server.am;
+
+import static android.app.ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE;
+import static android.app.ActivityManager.PROCESS_STATE_NONEXISTENT;
+
+import android.annotation.NonNull;
+import android.content.Context;
+import android.os.SystemClock;
+import android.util.SparseArray;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.am.BaseAppStateEvents.MaxTrackingDurationConfig;
+import com.android.server.am.BaseAppStateEventsTracker.BaseAppStateEventsPolicy;
+import com.android.server.am.BaseAppStateTimeEvents.BaseTimeEvent;
+
+import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
+import java.util.LinkedList;
+
+/**
+ * Base class to track certain binary state event of apps.
+ */
+abstract class BaseAppStateDurationsTracker
+ <T extends BaseAppStateEventsPolicy, U extends BaseAppStateDurations>
+ extends BaseAppStateEventsTracker<T, U> {
+ static final boolean DEBUG_BASE_APP_STATE_DURATION_TRACKER = false;
+
+ static final int EVENT_TYPE_MEDIA_SESSION = 0;
+ static final int EVENT_TYPE_FGS_MEDIA_PLAYBACK = 1;
+ static final int EVENT_TYPE_FGS_LOCATION = 2;
+ static final int EVENT_NUM = 3;
+
+ final ArrayList<EventListener> mEventListeners = new ArrayList<>();
+
+ @GuardedBy("mLock")
+ final SparseArray<UidStateDurations> mUidStateDurations = new SparseArray<>();
+
+ interface EventListener {
+ void onNewEvent(int uid, String packageName, boolean start, long now, int eventType);
+ }
+
+ BaseAppStateDurationsTracker(Context context, AppRestrictionController controller,
+ Constructor<? extends Injector<T>> injector, Object outerContext) {
+ super(context, controller, injector, outerContext);
+ }
+
+ @Override
+ void onUidProcStateChanged(final int uid, final int procState) {
+ synchronized (mLock) {
+ if (mPkgEvents.getMap().indexOfKey(uid) < 0) {
+ // If we're not tracking its events, ignore its UID state changes.
+ return;
+ }
+ onUidProcStateChangedUncheckedLocked(uid, procState);
+ UidStateDurations uidStateDurations = mUidStateDurations.get(uid);
+ if (uidStateDurations == null) {
+ uidStateDurations = new UidStateDurations(uid, mInjector.getPolicy());
+ mUidStateDurations.put(uid, uidStateDurations);
+ }
+ uidStateDurations.addEvent(procState < PROCESS_STATE_FOREGROUND_SERVICE,
+ SystemClock.elapsedRealtime());
+ }
+ }
+
+ @Override
+ void onUidGone(final int uid) {
+ onUidProcStateChanged(uid, PROCESS_STATE_NONEXISTENT);
+ }
+
+ @Override
+ @GuardedBy("mLock")
+ void trimLocked(long earliest) {
+ super.trimLocked(earliest);
+ for (int i = mUidStateDurations.size() - 1; i >= 0; i--) {
+ final UidStateDurations u = mUidStateDurations.valueAt(i);
+ u.trim(earliest);
+ if (u.isEmpty()) {
+ mUidStateDurations.removeAt(i);
+ }
+ }
+ }
+
+ @Override
+ @GuardedBy("mLock")
+ void onUntrackingUidLocked(int uid) {
+ mUidStateDurations.remove(uid);
+ }
+
+ void registerEventListener(@NonNull EventListener listener) {
+ synchronized (mLock) {
+ mEventListeners.add(listener);
+ }
+ }
+
+ void notifyListenersOnEvent(int uid, String packageName,
+ boolean start, long now, int eventType) {
+ synchronized (mLock) {
+ for (int i = 0, size = mEventListeners.size(); i < size; i++) {
+ mEventListeners.get(i).onNewEvent(uid, packageName, start, now, eventType);
+ }
+ }
+ }
+
+ long getTotalDurations(String packageName, int uid, long now, int index, boolean bgOnly) {
+ synchronized (mLock) {
+ final U durations = mPkgEvents.get(uid, packageName);
+ if (durations == null) {
+ return 0;
+ }
+ if (bgOnly) {
+ final UidStateDurations uidDurations = mUidStateDurations.get(uid);
+ if (uidDurations != null && !uidDurations.isEmpty()) {
+ final U res = createAppStateEvents(durations);
+ res.subtract(uidDurations, index, UidStateDurations.DEFAULT_INDEX);
+ return res.getTotalDurations(now, index);
+ }
+ }
+ return durations.getTotalDurations(now, index);
+ }
+ }
+
+ long getTotalDurations(String packageName, int uid, long now, int index) {
+ return getTotalDurations(packageName, uid, now, index, true /* bgOnly */);
+ }
+
+ long getTotalDurations(String packageName, int uid, long now) {
+ return getTotalDurations(packageName, uid, now, SimplePackageDurations.DEFAULT_INDEX);
+ }
+
+ long getTotalDurations(int uid, long now, int index, boolean bgOnly) {
+ synchronized (mLock) {
+ final U durations = getUidEventsLocked(uid);
+ if (durations == null) {
+ return 0;
+ }
+ if (bgOnly) {
+ final UidStateDurations uidDurations = mUidStateDurations.get(uid);
+ if (uidDurations != null && !uidDurations.isEmpty()) {
+ durations.subtract(uidDurations, index, UidStateDurations.DEFAULT_INDEX);
+ }
+ }
+ return durations.getTotalDurations(now, index);
+ }
+ }
+
+ long getTotalDurations(int uid, long now, int index) {
+ return getTotalDurations(uid, now, index, true /* bgOnly */);
+ }
+
+ long getTotalDurations(int uid, long now) {
+ return getTotalDurations(uid, now, SimplePackageDurations.DEFAULT_INDEX);
+ }
+
+ long getTotalDurationsSince(String packageName, int uid, long since, long now, int index,
+ boolean bgOnly) {
+ synchronized (mLock) {
+ final U durations = mPkgEvents.get(uid, packageName);
+ if (durations == null) {
+ return 0;
+ }
+ if (bgOnly) {
+ final UidStateDurations uidDurations = mUidStateDurations.get(uid);
+ if (uidDurations != null && !uidDurations.isEmpty()) {
+ final U res = createAppStateEvents(durations);
+ res.subtract(uidDurations, index, UidStateDurations.DEFAULT_INDEX);
+ return res.getTotalDurationsSince(since, now, index);
+ }
+ }
+ return durations.getTotalDurationsSince(since, now, index);
+ }
+ }
+
+ long getTotalDurationsSince(String packageName, int uid, long since, long now, int index) {
+ return getTotalDurationsSince(packageName, uid, since, now, index, true /* bgOnly */);
+ }
+
+ long getTotalDurationsSince(String packageName, int uid, long since, long now) {
+ return getTotalDurationsSince(packageName, uid, since, now,
+ SimplePackageDurations.DEFAULT_INDEX);
+ }
+
+ long getTotalDurationsSince(int uid, long since, long now, int index, boolean bgOnly) {
+ synchronized (mLock) {
+ final U durations = getUidEventsLocked(uid);
+ if (durations == null) {
+ return 0;
+ }
+ if (bgOnly) {
+ final UidStateDurations uidDurations = mUidStateDurations.get(uid);
+ if (uidDurations != null && !uidDurations.isEmpty()) {
+ durations.subtract(uidDurations, index, UidStateDurations.DEFAULT_INDEX);
+ }
+ }
+ return durations.getTotalDurationsSince(since, now, index);
+ }
+ }
+
+ long getTotalDurationsSince(int uid, long since, long now, int index) {
+ return getTotalDurationsSince(uid, since, now, index, true /* bgOnly */);
+ }
+
+ long getTotalDurationsSince(int uid, long since, long now) {
+ return getTotalDurationsSince(uid, since, now, SimplePackageDurations.DEFAULT_INDEX);
+ }
+
+ @VisibleForTesting
+ @Override
+ void reset() {
+ super.reset();
+ synchronized (mLock) {
+ mUidStateDurations.clear();
+ }
+ }
+
+ @Override
+ @GuardedBy("mLock")
+ void dumpEventLocked(PrintWriter pw, String prefix, U events, long now) {
+ final UidStateDurations uidDurations = mUidStateDurations.get(events.mUid);
+ pw.print(" " + prefix);
+ pw.println("(bg only)");
+ if (uidDurations == null || uidDurations.isEmpty()) {
+ events.dump(pw, " " + prefix, now);
+ return;
+ }
+ final U bgEvents = createAppStateEvents(events);
+ bgEvents.subtract(uidDurations, SimplePackageDurations.DEFAULT_INDEX);
+ bgEvents.dump(pw, " " + prefix, now);
+ pw.print(" " + prefix);
+ pw.println("(fg + bg)");
+ events.dump(pw, " " + prefix, now);
+ }
+
+ /**
+ * Simple duration table, with only one track of durations.
+ */
+ static class SimplePackageDurations extends BaseAppStateDurations<BaseTimeEvent> {
+ static final int DEFAULT_INDEX = 0;
+
+ SimplePackageDurations(int uid, String packageName,
+ MaxTrackingDurationConfig maxTrackingDurationConfig) {
+ super(uid, packageName, 1, TAG, maxTrackingDurationConfig);
+ mEvents[DEFAULT_INDEX] = new LinkedList<BaseTimeEvent>();
+ }
+
+ SimplePackageDurations(SimplePackageDurations other) {
+ super(other);
+ }
+
+ void addEvent(boolean active, long now) {
+ addEvent(active, new BaseTimeEvent(now), DEFAULT_INDEX);
+ }
+
+ long getTotalDurations(long now) {
+ return getTotalDurations(now, DEFAULT_INDEX);
+ }
+
+ long getTotalDurationsSince(long since, long now) {
+ return getTotalDurationsSince(since, now, DEFAULT_INDEX);
+ }
+
+ boolean isActive() {
+ return isActive(DEFAULT_INDEX);
+ }
+
+ @Override
+ String formatEventTypeLabel(int index) {
+ return "";
+ }
+ }
+
+ static class UidStateDurations extends SimplePackageDurations {
+ UidStateDurations(int uid, MaxTrackingDurationConfig maxTrackingDurationConfig) {
+ super(uid, "", maxTrackingDurationConfig);
+ }
+
+ UidStateDurations(UidStateDurations other) {
+ super(other);
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/BaseAppStateEvents.java b/services/core/java/com/android/server/am/BaseAppStateEvents.java
new file mode 100644
index 0000000..a754059
--- /dev/null
+++ b/services/core/java/com/android/server/am/BaseAppStateEvents.java
@@ -0,0 +1,206 @@
+/*
+ * 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.server.am;
+
+import static android.os.PowerExemptionManager.REASON_DENIED;
+
+import android.annotation.ElapsedRealtimeLong;
+import android.annotation.NonNull;
+import android.os.PowerExemptionManager.ReasonCode;
+import android.os.SystemClock;
+import android.os.UserHandle;
+import android.util.Slog;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+import java.io.PrintWriter;
+import java.util.LinkedList;
+
+/**
+ * A helper class to track the occurrences of certain events.
+ */
+abstract class BaseAppStateEvents<E> {
+ static final boolean DEBUG_BASE_APP_STATE_EVENTS = false;
+ final int mUid;
+ final @NonNull String mPackageName;
+ final @NonNull String mTag;
+ final @NonNull MaxTrackingDurationConfig mMaxTrackingDurationConfig;
+
+ /**
+ * The events we're tracking.
+ *
+ * <p>
+ * The meaning of the events is up to the derived classes, i.e., it could be a series of
+ * individual events, or a series of event pairs (i.e., start/stop event). The implementations
+ * of {@link #add}, {@link #trim} etc. in this class are based on the individual events.
+ * </p>
+ */
+ final LinkedList<E>[] mEvents;
+
+ /**
+ * In case the data we're tracking here is ignored, here is why.
+ */
+ @ReasonCode int mExemptReason = REASON_DENIED;
+
+ BaseAppStateEvents(int uid, @NonNull String packageName, int numOfEventTypes,
+ @NonNull String tag, @NonNull MaxTrackingDurationConfig maxTrackingDurationConfig) {
+ mUid = uid;
+ mPackageName = packageName;
+ mTag = tag;
+ mMaxTrackingDurationConfig = maxTrackingDurationConfig;
+ mEvents = new LinkedList[numOfEventTypes];
+ }
+
+ BaseAppStateEvents(@NonNull BaseAppStateEvents other) {
+ mUid = other.mUid;
+ mPackageName = other.mPackageName;
+ mTag = other.mTag;
+ mMaxTrackingDurationConfig = other.mMaxTrackingDurationConfig;
+ mEvents = new LinkedList[other.mEvents.length];
+ for (int i = 0; i < mEvents.length; i++) {
+ if (other.mEvents[i] != null) {
+ mEvents[i] = new LinkedList<E>(other.mEvents[i]);
+ }
+ }
+ }
+
+ /**
+ * Add an individual event.
+ */
+ void addEvent(E event, long now, int index) {
+ if (mEvents[index] == null) {
+ mEvents[index] = new LinkedList<E>();
+ }
+ final LinkedList<E> events = mEvents[index];
+ events.add(event);
+ trimEvents(getEarliest(now), index);
+ }
+
+ /**
+ * Remove/trim earlier events with start time older than the given timestamp.
+ */
+ void trim(long earliest) {
+ for (int i = 0; i < mEvents.length; i++) {
+ trimEvents(earliest, i);
+ }
+ }
+
+ /**
+ * Remove/trim earlier events with start time older than the given timestamp.
+ */
+ abstract void trimEvents(long earliest, int index);
+
+ /**
+ * @return {@code true} if there is no events being tracked.
+ */
+ boolean isEmpty() {
+ for (int i = 0; i < mEvents.length; i++) {
+ if (mEvents[i] != null && !mEvents[i].isEmpty()) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * @return {@code true} if there is no events being tracked.
+ */
+ boolean isEmpty(int index) {
+ return mEvents[index] == null || mEvents[index].isEmpty();
+ }
+
+ /**
+ * Merge the events table from another instance.
+ */
+ void add(BaseAppStateEvents other) {
+ if (mEvents.length != other.mEvents.length) {
+ if (DEBUG_BASE_APP_STATE_EVENTS) {
+ Slog.wtf(mTag, "Incompatible event table this=" + this + ", other=" + other);
+ }
+ return;
+ }
+ for (int i = 0; i < mEvents.length; i++) {
+ mEvents[i] = add(mEvents[i], other.mEvents[i]);
+ }
+ }
+
+ @VisibleForTesting
+ LinkedList<E> getRawEvents(int index) {
+ return mEvents[index];
+ }
+
+ /**
+ * Merge the two given events table and return the result.
+ */
+ abstract LinkedList<E> add(LinkedList<E> events, LinkedList<E> otherEvents);
+
+ /**
+ * The number of events since the given time.
+ */
+ abstract int getTotalEventsSince(long since, long now, int index);
+
+ /**
+ * The total number of events we are tracking.
+ */
+ int getTotalEvents(long now, int index) {
+ return getTotalEventsSince(getEarliest(0), now, index);
+ }
+
+ /**
+ * @return The earliest possible time we're tracking with given timestamp.
+ */
+ long getEarliest(long now) {
+ return Math.max(0, now - mMaxTrackingDurationConfig.getMaxTrackingDuration());
+ }
+
+ void dump(PrintWriter pw, String prefix, @ElapsedRealtimeLong long nowElapsed) {
+ for (int i = 0; i < mEvents.length; i++) {
+ if (mEvents[i] == null) {
+ continue;
+ }
+ pw.print(prefix);
+ pw.print(formatEventTypeLabel(i));
+ pw.println(formatEventSummary(nowElapsed, i));
+ }
+ }
+
+ String formatEventSummary(long now, int index) {
+ return Integer.toString(getTotalEvents(now, index));
+ }
+
+ String formatEventTypeLabel(int index) {
+ return Integer.toString(index) + ":";
+ }
+
+ @Override
+ public String toString() {
+ return mPackageName + "/" + UserHandle.formatUid(mUid)
+ + " totalEvents[0]=" + formatEventSummary(SystemClock.elapsedRealtime(), 0);
+ }
+
+ interface Factory<T extends BaseAppStateEvents> {
+ T createAppStateEvents(int uid, String packageName);
+ T createAppStateEvents(T other);
+ }
+
+ interface MaxTrackingDurationConfig {
+ /**
+ * @return The mximum duration we'd keep tracking.
+ */
+ long getMaxTrackingDuration();
+ }
+}
diff --git a/services/core/java/com/android/server/am/BaseAppStateEventsTracker.java b/services/core/java/com/android/server/am/BaseAppStateEventsTracker.java
new file mode 100644
index 0000000..3e1bcae
--- /dev/null
+++ b/services/core/java/com/android/server/am/BaseAppStateEventsTracker.java
@@ -0,0 +1,309 @@
+/*
+ * 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.server.am;
+
+import android.annotation.NonNull;
+import android.annotation.UserIdInt;
+import android.app.ActivityManager;
+import android.content.Context;
+import android.os.PowerExemptionManager;
+import android.os.PowerExemptionManager.ReasonCode;
+import android.os.SystemClock;
+import android.os.UserHandle;
+import android.provider.DeviceConfig;
+import android.util.ArrayMap;
+import android.util.ArraySet;
+import android.util.SparseArray;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.am.BaseAppStateEvents.MaxTrackingDurationConfig;
+import com.android.server.am.BaseAppStateEventsTracker.BaseAppStateEventsPolicy;
+
+import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+import java.util.LinkedList;
+
+/**
+ * Base class to track certain state event of apps.
+ */
+abstract class BaseAppStateEventsTracker
+ <T extends BaseAppStateEventsPolicy, U extends BaseAppStateEvents>
+ extends BaseAppStateTracker<T> implements BaseAppStateEvents.Factory<U> {
+ static final boolean DEBUG_BASE_APP_STATE_EVENTS_TRACKER = false;
+
+ @GuardedBy("mLock")
+ final UidProcessMap<U> mPkgEvents = new UidProcessMap<>();
+
+ @GuardedBy("mLock")
+ final ArraySet<Integer> mTopUids = new ArraySet<>();
+
+ BaseAppStateEventsTracker(Context context, AppRestrictionController controller,
+ Constructor<? extends Injector<T>> injector, Object outerContext) {
+ super(context, controller, injector, outerContext);
+ }
+
+ @VisibleForTesting
+ void reset() {
+ synchronized (mLock) {
+ mPkgEvents.clear();
+ mTopUids.clear();
+ }
+ }
+
+ @GuardedBy("mLock")
+ U getUidEventsLocked(int uid) {
+ U events = null;
+ final ArrayMap<String, U> map = mPkgEvents.getMap().get(uid);
+ if (map == null) {
+ return null;
+ }
+ for (int i = map.size() - 1; i >= 0; i--) {
+ final U event = map.valueAt(i);
+ if (event != null) {
+ if (events == null) {
+ events = createAppStateEvents(uid, event.mPackageName);
+ }
+ events.add(event);
+ }
+ }
+ return events;
+ }
+
+ void trim(long earliest) {
+ synchronized (mLock) {
+ trimLocked(earliest);
+ }
+ }
+
+ @GuardedBy("mLock")
+ void trimLocked(long earliest) {
+ final SparseArray<ArrayMap<String, U>> map = mPkgEvents.getMap();
+ for (int i = map.size() - 1; i >= 0; i--) {
+ final ArrayMap<String, U> val = map.valueAt(i);
+ for (int j = val.size() - 1; j >= 0; j--) {
+ final U v = val.valueAt(j);
+ v.trim(earliest);
+ if (v.isEmpty()) {
+ val.removeAt(j);
+ }
+ }
+ if (val.size() == 0) {
+ map.removeAt(i);
+ }
+ }
+ }
+
+ boolean isUidOnTop(int uid) {
+ synchronized (mLock) {
+ return mTopUids.contains(uid);
+ }
+ }
+
+ @GuardedBy("mLock")
+ void onUntrackingUidLocked(int uid) {
+ }
+
+ @Override
+ void onUidProcStateChanged(final int uid, final int procState) {
+ synchronized (mLock) {
+ if (mPkgEvents.getMap().indexOfKey(uid) < 0) {
+ // If we're not tracking its events, ignore its UID state changes.
+ return;
+ }
+ onUidProcStateChangedUncheckedLocked(uid, procState);
+ }
+ }
+
+ @GuardedBy("mLock")
+ void onUidProcStateChangedUncheckedLocked(final int uid, final int procState) {
+ if (procState < ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE) {
+ mTopUids.add(uid);
+ } else {
+ mTopUids.remove(uid);
+ }
+ }
+
+ @Override
+ void onUidGone(final int uid) {
+ synchronized (mLock) {
+ mTopUids.remove(uid);
+ }
+ }
+
+ @Override
+ void onUidRemoved(final int uid) {
+ synchronized (mLock) {
+ mPkgEvents.getMap().remove(uid);
+ onUntrackingUidLocked(uid);
+ }
+ }
+
+ @Override
+ void onUserRemoved(final @UserIdInt int userId) {
+ synchronized (mLock) {
+ final SparseArray<ArrayMap<String, U>> map = mPkgEvents.getMap();
+ for (int i = map.size() - 1; i >= 0; i--) {
+ final int uid = map.keyAt(i);
+ if (UserHandle.getUserId(uid) == userId) {
+ map.removeAt(i);
+ onUntrackingUidLocked(uid);
+ }
+ }
+ }
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ final T policy = mInjector.getPolicy();
+ synchronized (mLock) {
+ final long now = SystemClock.elapsedRealtime();
+ final SparseArray<ArrayMap<String, U>> map = mPkgEvents.getMap();
+ for (int i = map.size() - 1; i >= 0; i--) {
+ final int uid = map.keyAt(i);
+ final ArrayMap<String, U> val = map.valueAt(i);
+ for (int j = val.size() - 1; j >= 0; j--) {
+ final String packageName = val.keyAt(j);
+ final U events = val.valueAt(j);
+ dumpEventHeaderLocked(pw, prefix, packageName, uid, events, policy);
+ dumpEventLocked(pw, prefix, events, now);
+ }
+ }
+ }
+ policy.dump(pw, prefix);
+ }
+
+ @GuardedBy("mLock")
+ void dumpEventHeaderLocked(PrintWriter pw, String prefix, String packageName, int uid, U events,
+ T policy) {
+ pw.print(prefix);
+ pw.print("* ");
+ pw.print(packageName);
+ pw.print('/');
+ pw.print(UserHandle.formatUid(uid));
+ pw.print(" exemption=");
+ pw.println(policy.getExemptionReasonString(packageName, uid, events.mExemptReason));
+ }
+
+ @GuardedBy("mLock")
+ void dumpEventLocked(PrintWriter pw, String prefix, U events, long now) {
+ events.dump(pw, " " + prefix, now);
+ }
+
+ abstract static class BaseAppStateEventsPolicy<V extends BaseAppStateEventsTracker>
+ extends BaseAppStatePolicy<V> implements MaxTrackingDurationConfig {
+ /**
+ * The key to the maximum duration we'd keep tracking, events earlier than that
+ * will be discarded.
+ */
+ final @NonNull String mKeyMaxTrackingDuration;
+
+ /**
+ * The default to the {@link #mMaxTrackingDuration}.
+ */
+ final long mDefaultMaxTrackingDuration;
+
+ /**
+ * The maximum duration we'd keep tracking, events earlier than that will be discarded.
+ */
+ volatile long mMaxTrackingDuration;
+
+ BaseAppStateEventsPolicy(@NonNull Injector<?> injector, @NonNull V tracker,
+ @NonNull String keyTrackerEnabled, boolean defaultTrackerEnabled,
+ @NonNull String keyMaxTrackingDuration, long defaultMaxTrackingDuration) {
+ super(injector, tracker, keyTrackerEnabled, defaultTrackerEnabled);
+ mKeyMaxTrackingDuration = keyMaxTrackingDuration;
+ mDefaultMaxTrackingDuration = defaultMaxTrackingDuration;
+ }
+
+ @Override
+ public void onPropertiesChanged(String name) {
+ if (mKeyMaxTrackingDuration.equals(name)) {
+ updateMaxTrackingDuration();
+ } else {
+ super.onPropertiesChanged(name);
+ }
+ }
+
+ @Override
+ public void onSystemReady() {
+ super.onSystemReady();
+ updateMaxTrackingDuration();
+ }
+
+ /**
+ * Called when the maximum duration we'd keep tracking has been changed.
+ */
+ public abstract void onMaxTrackingDurationChanged(long maxDuration);
+
+ void updateMaxTrackingDuration() {
+ long max = DeviceConfig.getLong(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ mKeyMaxTrackingDuration, mDefaultMaxTrackingDuration);
+ if (max != mMaxTrackingDuration) {
+ mMaxTrackingDuration = max;
+ onMaxTrackingDurationChanged(max);
+ }
+ }
+
+ @Override
+ public long getMaxTrackingDuration() {
+ return mMaxTrackingDuration;
+ }
+
+ String getExemptionReasonString(String packageName, int uid, @ReasonCode int reason) {
+ return PowerExemptionManager.reasonCodeToString(reason);
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ super.dump(pw, prefix);
+ if (isEnabled()) {
+ pw.print(prefix);
+ pw.print(mKeyMaxTrackingDuration);
+ pw.print('=');
+ pw.println(mMaxTrackingDuration);
+ }
+ }
+ }
+
+ /**
+ * Simple event table, with only one track of events.
+ */
+ static class SimplePackageEvents extends BaseAppStateTimeEvents {
+ static final int DEFAULT_INDEX = 0;
+
+ SimplePackageEvents(int uid, String packageName,
+ MaxTrackingDurationConfig maxTrackingDurationConfig) {
+ super(uid, packageName, 1, TAG, maxTrackingDurationConfig);
+ mEvents[DEFAULT_INDEX] = new LinkedList<Long>();
+ }
+
+ long getTotalEvents(long now) {
+ return getTotalEvents(now, DEFAULT_INDEX);
+ }
+
+ long getTotalEventsSince(long since, long now) {
+ return getTotalEventsSince(since, now, DEFAULT_INDEX);
+ }
+
+ @Override
+ String formatEventTypeLabel(int index) {
+ return "";
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/BaseAppStatePolicy.java b/services/core/java/com/android/server/am/BaseAppStatePolicy.java
new file mode 100644
index 0000000..67318a7
--- /dev/null
+++ b/services/core/java/com/android/server/am/BaseAppStatePolicy.java
@@ -0,0 +1,132 @@
+/*
+ * 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.server.am;
+
+import static android.app.ActivityManager.RESTRICTION_LEVEL_UNKNOWN;
+
+import android.annotation.CallSuper;
+import android.annotation.NonNull;
+import android.app.ActivityManager.RestrictionLevel;
+import android.os.PowerExemptionManager.ReasonCode;
+import android.provider.DeviceConfig;
+
+import com.android.server.am.BaseAppStateTracker.Injector;
+
+import java.io.PrintWriter;
+
+/**
+ * Base class to track the policy for certain state of the app.
+ *
+ * @param <T> A class derived from BaseAppStateTracker.
+ */
+public abstract class BaseAppStatePolicy<T extends BaseAppStateTracker> {
+
+ protected final Injector<?> mInjector;
+ protected final T mTracker;
+
+ /**
+ * The key to the device config, on whether or not we should enable the tracker.
+ */
+ protected final @NonNull String mKeyTrackerEnabled;
+
+ /**
+ * The default settings on whether or not we should enable the tracker.
+ */
+ protected final boolean mDefaultTrackerEnabled;
+
+ /**
+ * Whether or not we should enable the tracker.
+ */
+ volatile boolean mTrackerEnabled;
+
+ BaseAppStatePolicy(@NonNull Injector<?> injector, @NonNull T tracker,
+ @NonNull String keyTrackerEnabled, boolean defaultTrackerEnabled) {
+ mInjector = injector;
+ mTracker = tracker;
+ mKeyTrackerEnabled = keyTrackerEnabled;
+ mDefaultTrackerEnabled = defaultTrackerEnabled;
+ }
+
+ void updateTrackerEnabled() {
+ final boolean enabled = DeviceConfig.getBoolean(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ mKeyTrackerEnabled, mDefaultTrackerEnabled);
+ if (enabled != mTrackerEnabled) {
+ mTrackerEnabled = enabled;
+ onTrackerEnabled(enabled);
+ }
+ }
+
+ /**
+ * Called when the tracker enable flag flips.
+ */
+ public abstract void onTrackerEnabled(boolean enabled);
+
+ /**
+ * Called when a device config property in the activity manager namespace
+ * has changed.
+ */
+ public void onPropertiesChanged(@NonNull String name) {
+ if (mKeyTrackerEnabled.equals(name)) {
+ updateTrackerEnabled();
+ }
+ }
+
+ /**
+ * @return The proposed background restriction policy for the given package/uid.
+ */
+ public @RestrictionLevel int getProposedRestrictionLevel(String packageName, int uid) {
+ return RESTRICTION_LEVEL_UNKNOWN;
+ }
+
+ /**
+ * Called when the system is ready to rock.
+ */
+ public void onSystemReady() {
+ updateTrackerEnabled();
+ }
+
+ /**
+ * @return If this tracker is enabled or not.
+ */
+ public boolean isEnabled() {
+ return mTrackerEnabled;
+ }
+
+ /**
+ * @return If the given UID should be exempted.
+ *
+ * <p>
+ * Note: Call it with caution as it'll try to acquire locks in other services.
+ * </p>
+ */
+ @CallSuper
+ @ReasonCode
+ public int shouldExemptUid(int uid) {
+ return mTracker.mAppRestrictionController.getBackgroundRestrictionExemptionReason(uid);
+ }
+
+ /**
+ * Dump to the given printer writer.
+ */
+ void dump(PrintWriter pw, String prefix) {
+ pw.print(prefix);
+ pw.print(mKeyTrackerEnabled);
+ pw.print('=');
+ pw.println(mTrackerEnabled);
+ }
+}
diff --git a/services/core/java/com/android/server/am/BaseAppStateTimeEvents.java b/services/core/java/com/android/server/am/BaseAppStateTimeEvents.java
new file mode 100644
index 0000000..1eccdf2
--- /dev/null
+++ b/services/core/java/com/android/server/am/BaseAppStateTimeEvents.java
@@ -0,0 +1,145 @@
+/*
+ * 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.server.am;
+
+import android.annotation.NonNull;
+
+import com.android.server.am.BaseAppStateTimeEvents.BaseTimeEvent;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+
+/**
+ * A helper class to track the timestamps of individual events.
+ */
+class BaseAppStateTimeEvents<T extends BaseTimeEvent> extends BaseAppStateEvents<T> {
+
+ BaseAppStateTimeEvents(int uid, @NonNull String packageName, int numOfEventTypes,
+ @NonNull String tag, @NonNull MaxTrackingDurationConfig maxTrackingDurationConfig) {
+ super(uid, packageName, numOfEventTypes, tag, maxTrackingDurationConfig);
+ }
+
+ BaseAppStateTimeEvents(@NonNull BaseAppStateTimeEvents other) {
+ super(other);
+ }
+
+ @Override
+ LinkedList<T> add(LinkedList<T> durations, LinkedList<T> otherDurations) {
+ if (otherDurations == null || otherDurations.size() == 0) {
+ return durations;
+ }
+ if (durations == null || durations.size() == 0) {
+ return (LinkedList<T>) otherDurations.clone();
+ }
+ final Iterator<T> itl = durations.iterator();
+ final Iterator<T> itr = otherDurations.iterator();
+ T l = itl.next(), r = itr.next();
+ LinkedList<T> dest = new LinkedList<>();
+ for (long lts = l.getTimestamp(), rts = r.getTimestamp();
+ lts != Long.MAX_VALUE || rts != Long.MAX_VALUE;) {
+ if (lts == rts) {
+ dest.add((T) l.clone());
+ lts = itl.hasNext() ? (l = itl.next()).getTimestamp() : Long.MAX_VALUE;
+ rts = itr.hasNext() ? (r = itr.next()).getTimestamp() : Long.MAX_VALUE;
+ } else if (lts < rts) {
+ dest.add((T) l.clone());
+ lts = itl.hasNext() ? (l = itl.next()).getTimestamp() : Long.MAX_VALUE;
+ } else {
+ dest.add((T) r.clone());
+ rts = itr.hasNext() ? (r = itr.next()).getTimestamp() : Long.MAX_VALUE;
+ }
+ }
+ return dest;
+ }
+
+ @Override
+ int getTotalEventsSince(long since, long now, int index) {
+ final LinkedList<T> events = mEvents[index];
+ if (events == null || events.size() == 0) {
+ return 0;
+ }
+ int count = 0;
+ for (T event : events) {
+ if (event.getTimestamp() >= since) {
+ count++;
+ }
+ }
+ return count;
+ }
+
+ @Override
+ void trimEvents(long earliest, int index) {
+ final LinkedList<T> events = mEvents[index];
+ if (events == null) {
+ return;
+ }
+ while (events.size() > 0) {
+ final T current = events.peek();
+ if (current.getTimestamp() >= earliest) {
+ return; // All we have are newer than the given timestamp.
+ }
+ events.pop();
+ }
+ }
+
+ /**
+ * A data class encapsulate the individual event data.
+ */
+ static class BaseTimeEvent implements Cloneable {
+ /**
+ * The timestamp this event occurred at.
+ */
+ long mTimestamp;
+
+ BaseTimeEvent(long timestamp) {
+ mTimestamp = timestamp;
+ }
+
+ BaseTimeEvent(BaseTimeEvent other) {
+ mTimestamp = other.mTimestamp;
+ }
+
+ void trimTo(long timestamp) {
+ mTimestamp = timestamp;
+ }
+
+ long getTimestamp() {
+ return mTimestamp;
+ }
+
+ @Override
+ public Object clone() {
+ return new BaseTimeEvent(this);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other == null) {
+ return false;
+ }
+ if (other.getClass() != BaseTimeEvent.class) {
+ return false;
+ }
+ return ((BaseTimeEvent) other).mTimestamp == mTimestamp;
+ }
+
+ @Override
+ public int hashCode() {
+ return Long.hashCode(mTimestamp);
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/BaseAppStateTimeSlotEvents.java b/services/core/java/com/android/server/am/BaseAppStateTimeSlotEvents.java
new file mode 100644
index 0000000..0c43a33
--- /dev/null
+++ b/services/core/java/com/android/server/am/BaseAppStateTimeSlotEvents.java
@@ -0,0 +1,184 @@
+/*
+ * 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.server.am;
+
+import android.annotation.NonNull;
+import android.util.Slog;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+
+/**
+ * Base class to track certain individual event of app states, it groups the events into time-based
+ * slots, thus we could only track the total number of events in a slot, eliminating
+ * the needs to track the timestamps for each individual event. This will be much more memory
+ * efficient for the case of massive amount of events.
+ */
+class BaseAppStateTimeSlotEvents extends BaseAppStateEvents<Integer> {
+
+ static final boolean DEBUG_BASE_APP_TIME_SLOT_EVENTS = false;
+
+ /**
+ * The size (in ms) of the timeslot, should be greater than 0 always.
+ */
+ final long mTimeSlotSize;
+
+ /**
+ * The start timestamp of current timeslot.
+ */
+ long[] mCurSlotStartTime;
+
+ BaseAppStateTimeSlotEvents(int uid, @NonNull String packageName, int numOfEventTypes,
+ long timeslotSize, @NonNull String tag,
+ @NonNull MaxTrackingDurationConfig maxTrackingDurationConfig) {
+ super(uid, packageName, numOfEventTypes, tag, maxTrackingDurationConfig);
+ mTimeSlotSize = timeslotSize;
+ mCurSlotStartTime = new long[numOfEventTypes];
+ }
+
+ BaseAppStateTimeSlotEvents(@NonNull BaseAppStateTimeSlotEvents other) {
+ super(other);
+ mTimeSlotSize = other.mTimeSlotSize;
+ mCurSlotStartTime = new long[other.mCurSlotStartTime.length];
+ for (int i = 0; i < mCurSlotStartTime.length; i++) {
+ mCurSlotStartTime[i] = other.mCurSlotStartTime[i];
+ }
+ }
+
+ @Override
+ LinkedList<Integer> add(LinkedList<Integer> events, LinkedList<Integer> otherEvents) {
+ if (DEBUG_BASE_APP_TIME_SLOT_EVENTS) {
+ Slog.wtf(mTag, "Called into BaseAppStateTimeSlotEvents#add unexpected.");
+ }
+ // This function is invalid semantically here without the information of time-bases.
+ return null;
+ }
+
+ @Override
+ void add(BaseAppStateEvents otherObj) {
+ if (otherObj == null || !(otherObj instanceof BaseAppStateTimeSlotEvents)) {
+ return;
+ }
+ final BaseAppStateTimeSlotEvents other = (BaseAppStateTimeSlotEvents) otherObj;
+ if (mEvents.length != other.mEvents.length) {
+ if (DEBUG_BASE_APP_TIME_SLOT_EVENTS) {
+ Slog.wtf(mTag, "Incompatible event table this=" + this + ", other=" + other);
+ }
+ return;
+ }
+ for (int i = 0; i < mEvents.length; i++) {
+ final LinkedList<Integer> otherEvents = other.mEvents[i];
+ if (otherEvents == null || otherEvents.size() == 0) {
+ continue;
+ }
+ LinkedList<Integer> events = mEvents[i];
+ if (events == null || events.size() == 0) {
+ mEvents[i] = new LinkedList<Integer>(otherEvents);
+ mCurSlotStartTime[i] = other.mCurSlotStartTime[i];
+ continue;
+ }
+
+ final LinkedList<Integer> dest = new LinkedList<>();
+ final Iterator<Integer> itl = events.iterator();
+ final Iterator<Integer> itr = otherEvents.iterator();
+ final long maxl = mCurSlotStartTime[i];
+ final long maxr = other.mCurSlotStartTime[i];
+ final long minl = maxl - mTimeSlotSize * (events.size() - 1);
+ final long minr = maxr - mTimeSlotSize * (otherEvents.size() - 1);
+ final long latest = Math.max(maxl, maxr);
+ final long earliest = Math.min(minl, minr);
+ for (long start = earliest; start <= latest; start += mTimeSlotSize) {
+ dest.add((start >= minl && start <= maxl ? itl.next() : 0)
+ + (start >= minr && start <= maxr ? itr.next() : 0));
+ }
+ mEvents[i] = dest;
+ if (maxl < maxr) {
+ mCurSlotStartTime[i] = other.mCurSlotStartTime[i];
+ }
+ trimEvents(getEarliest(mCurSlotStartTime[i]), i);
+ }
+ }
+
+ @Override
+ int getTotalEventsSince(long since, long now, int index) {
+ final LinkedList<Integer> events = mEvents[index];
+ if (events == null || events.size() == 0) {
+ return 0;
+ }
+ final long start = getSlotStartTime(since);
+ if (start > mCurSlotStartTime[index]) {
+ return 0;
+ }
+ final long end = Math.min(getSlotStartTime(now), mCurSlotStartTime[index]);
+ final Iterator<Integer> it = events.descendingIterator();
+ int count = 0;
+ for (long time = mCurSlotStartTime[index]; time >= start && it.hasNext();
+ time -= mTimeSlotSize) {
+ final int val = it.next();
+ if (time <= end) {
+ count += val;
+ }
+ }
+ return count;
+ }
+
+ void addEvent(long now, int index) {
+ final long slot = getSlotStartTime(now);
+ if (DEBUG_BASE_APP_TIME_SLOT_EVENTS) {
+ Slog.i(mTag, "Adding event to slot " + slot);
+ }
+ LinkedList<Integer> events = mEvents[index];
+ if (events == null) {
+ events = new LinkedList<Integer>();
+ mEvents[index] = events;
+ }
+ if (events.size() == 0) {
+ events.add(1);
+ } else {
+ for (long start = mCurSlotStartTime[index]; start < slot; start += mTimeSlotSize) {
+ events.add(0);
+ }
+ events.offerLast(events.pollLast() + 1);
+ }
+ mCurSlotStartTime[index] = slot;
+ trimEvents(getEarliest(now), index);
+ }
+
+ @Override
+ void trimEvents(long earliest, int index) {
+ final LinkedList<Integer> events = mEvents[index];
+ if (events == null || events.size() == 0) {
+ return;
+ }
+ final long slot = getSlotStartTime(earliest);
+ for (long time = mCurSlotStartTime[index] - mTimeSlotSize * (events.size() - 1);
+ time < slot && events.size() > 0; time += mTimeSlotSize) {
+ events.pop();
+ }
+ }
+
+ long getSlotStartTime(long timestamp) {
+ return timestamp - timestamp % mTimeSlotSize;
+ }
+
+ @VisibleForTesting
+ long getCurrentSlotStartTime(int index) {
+ return mCurSlotStartTime[index];
+ }
+}
diff --git a/services/core/java/com/android/server/am/BaseAppStateTimeSlotEventsTracker.java b/services/core/java/com/android/server/am/BaseAppStateTimeSlotEventsTracker.java
new file mode 100644
index 0000000..2fbca1f
--- /dev/null
+++ b/services/core/java/com/android/server/am/BaseAppStateTimeSlotEventsTracker.java
@@ -0,0 +1,364 @@
+/*
+ * 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.server.am;
+
+import static android.app.ActivityManager.RESTRICTION_LEVEL_ADAPTIVE_BUCKET;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_RESTRICTED_BUCKET;
+import static android.app.usage.UsageStatsManager.REASON_MAIN_FORCED_BY_SYSTEM;
+import static android.app.usage.UsageStatsManager.REASON_MAIN_USAGE;
+import static android.app.usage.UsageStatsManager.REASON_SUB_FORCED_SYSTEM_FLAG_ABUSE;
+import static android.app.usage.UsageStatsManager.REASON_SUB_USAGE_USER_INTERACTION;
+import static android.os.PowerExemptionManager.REASON_DENIED;
+import static android.os.PowerExemptionManager.REASON_PROC_STATE_FGS;
+import static android.os.PowerExemptionManager.REASON_PROC_STATE_TOP;
+import static android.os.PowerExemptionManager.reasonCodeToString;
+
+import static com.android.server.am.BaseAppStateTracker.ONE_MINUTE;
+
+import android.annotation.NonNull;
+import android.app.ActivityManager.RestrictionLevel;
+import android.content.Context;
+import android.os.Handler;
+import android.os.Message;
+import android.os.PowerExemptionManager.ReasonCode;
+import android.os.SystemClock;
+import android.os.UserHandle;
+import android.provider.DeviceConfig;
+import android.util.ArrayMap;
+import android.util.Slog;
+import android.util.SparseArray;
+import android.util.TimeUtils;
+
+import com.android.internal.annotations.GuardedBy;
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.app.ProcessMap;
+import com.android.server.am.BaseAppStateTimeSlotEventsTracker.BaseAppStateTimeSlotEventsPolicy;
+import com.android.server.am.BaseAppStateTimeSlotEventsTracker.SimpleAppStateTimeslotEvents;
+
+import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+
+/**
+ * Base class to track {@link #BaseAppStateTimeSlotEvents}.
+ */
+abstract class BaseAppStateTimeSlotEventsTracker
+ <T extends BaseAppStateTimeSlotEventsPolicy, U extends SimpleAppStateTimeslotEvents>
+ extends BaseAppStateEventsTracker<T, U> {
+ static final String TAG = "BaseAppStateTimeSlotEventsTracker";
+
+ static final boolean DEBUG_APP_STATE_TIME_SLOT_EVENT_TRACKER = false;
+
+ // Unlocked since it's only accessed in single thread.
+ private final ArrayMap<U, Integer> mTmpPkgs = new ArrayMap<>();
+
+ private H mHandler;
+
+ BaseAppStateTimeSlotEventsTracker(Context context, AppRestrictionController controller,
+ Constructor<? extends Injector<T>> injector, Object outerContext) {
+ super(context, controller, injector, outerContext);
+ mHandler = new H(this);
+ }
+
+ void onNewEvent(String packageName, int uid) {
+ mHandler.obtainMessage(H.MSG_NEW_EVENT, uid, 0, packageName).sendToTarget();
+ }
+
+ void handleNewEvent(String packageName, int uid) {
+ if (mInjector.getPolicy().shouldExempt(packageName, uid) != REASON_DENIED) {
+ return;
+ }
+ final long now = SystemClock.elapsedRealtime();
+ boolean notify = false;
+ int totalEvents;
+ synchronized (mLock) {
+ U pkgEvents = mPkgEvents.get(uid, packageName);
+ if (pkgEvents == null) {
+ pkgEvents = createAppStateEvents(uid, packageName);
+ mPkgEvents.put(uid, packageName, pkgEvents);
+ }
+ pkgEvents.addEvent(now, SimpleAppStateTimeslotEvents.DEFAULT_INDEX);
+ totalEvents = pkgEvents.getTotalEvents(now, SimpleAppStateTimeslotEvents.DEFAULT_INDEX);
+ notify = totalEvents >= mInjector.getPolicy().getNumOfEventsThreshold();
+ }
+ if (notify) {
+ mInjector.getPolicy().onExcessiveEvents(
+ packageName, uid, totalEvents, now);
+ }
+ }
+
+ void onMonitorEnabled(boolean enabled) {
+ if (!enabled) {
+ synchronized (mLock) {
+ mPkgEvents.clear();
+ }
+ }
+ }
+
+ void onNumOfEventsThresholdChanged(int threshold) {
+ final long now = SystemClock.elapsedRealtime();
+ synchronized (mLock) {
+ SparseArray<ArrayMap<String, U>> pkgEvents = mPkgEvents.getMap();
+ for (int i = pkgEvents.size() - 1; i >= 0; i--) {
+ final ArrayMap<String, U> pkgs = pkgEvents.valueAt(i);
+ for (int j = pkgs.size() - 1; j >= 0; j--) {
+ final U pkg = pkgs.valueAt(j);
+ int totalEvents = pkg.getTotalEvents(now,
+ SimpleAppStateTimeslotEvents.DEFAULT_INDEX);
+ if (totalEvents >= threshold) {
+ mTmpPkgs.put(pkg, totalEvents);
+ }
+ }
+ }
+ }
+ for (int i = mTmpPkgs.size() - 1; i >= 0; i--) {
+ final U pkg = mTmpPkgs.keyAt(i);
+ mInjector.getPolicy().onExcessiveEvents(
+ pkg.mPackageName, pkg.mUid, mTmpPkgs.valueAt(i), now);
+ }
+ mTmpPkgs.clear();
+ }
+
+ private void trimEvents() {
+ final long now = SystemClock.elapsedRealtime();
+ trim(Math.max(0, now - mInjector.getPolicy().getMaxTrackingDuration()));
+ }
+
+ @Override
+ void onUserInteractionStarted(String packageName, int uid) {
+ mInjector.getPolicy().onUserInteractionStarted(packageName, uid);
+ }
+
+ static class H extends Handler {
+ static final int MSG_NEW_EVENT = 0;
+
+ final BaseAppStateTimeSlotEventsTracker mTracker;
+
+ H(BaseAppStateTimeSlotEventsTracker tracker) {
+ super(tracker.mBgHandler.getLooper());
+ mTracker = tracker;
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_NEW_EVENT:
+ mTracker.handleNewEvent((String) msg.obj, msg.arg1);
+ break;
+ }
+ }
+ }
+
+ static class BaseAppStateTimeSlotEventsPolicy<E extends BaseAppStateTimeSlotEventsTracker>
+ extends BaseAppStateEventsPolicy<E> {
+
+ final String mKeyNumOfEventsThreshold;
+ final int mDefaultNumOfEventsThreshold;
+
+ @NonNull
+ private final Object mLock;
+
+ @GuardedBy("mLock")
+ private final ProcessMap<Long> mExcessiveEventPkgs = new ProcessMap<>();
+
+ long mTimeSlotSize = DEBUG_APP_STATE_TIME_SLOT_EVENT_TRACKER
+ ? SimpleAppStateTimeslotEvents.DEFAULT_TIME_SLOT_SIZE_DEBUG
+ : SimpleAppStateTimeslotEvents.DEFAULT_TIME_SLOT_SIZE;
+
+ volatile int mNumOfEventsThreshold;
+
+ BaseAppStateTimeSlotEventsPolicy(@NonNull Injector injector, @NonNull E tracker,
+ @NonNull String keyTrackerEnabled, boolean defaultTrackerEnabled,
+ @NonNull String keyMaxTrackingDuration, long defaultMaxTrackingDuration,
+ @NonNull String keyNumOfEventsThreshold, int defaultNumOfEventsThreshold) {
+ super(injector, tracker, keyTrackerEnabled, defaultTrackerEnabled,
+ keyMaxTrackingDuration, defaultMaxTrackingDuration);
+ mKeyNumOfEventsThreshold = keyNumOfEventsThreshold;
+ mDefaultNumOfEventsThreshold = defaultNumOfEventsThreshold;
+ mLock = tracker.mLock;
+ }
+
+ @Override
+ public void onSystemReady() {
+ super.onSystemReady();
+ updateNumOfEventsThreshold();
+ }
+
+ @Override
+ public void onPropertiesChanged(String name) {
+ if (mKeyNumOfEventsThreshold.equals(name)) {
+ updateNumOfEventsThreshold();
+ } else {
+ super.onPropertiesChanged(name);
+ }
+ }
+
+ @Override
+ public void onTrackerEnabled(boolean enabled) {
+ mTracker.onMonitorEnabled(enabled);
+ }
+
+ @Override
+ public void onMaxTrackingDurationChanged(long maxDuration) {
+ mTracker.mBgHandler.post(mTracker::trimEvents);
+ }
+
+ private void updateNumOfEventsThreshold() {
+ final int threshold = DeviceConfig.getInt(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ mKeyNumOfEventsThreshold,
+ mDefaultNumOfEventsThreshold);
+ if (threshold != mNumOfEventsThreshold) {
+ mNumOfEventsThreshold = threshold;
+ mTracker.onNumOfEventsThresholdChanged(threshold);
+ }
+ }
+
+ int getNumOfEventsThreshold() {
+ return mNumOfEventsThreshold;
+ }
+
+ long getTimeSlotSize() {
+ return mTimeSlotSize;
+ }
+
+ @VisibleForTesting
+ void setTimeSlotSize(long size) {
+ mTimeSlotSize = size;
+ }
+
+ String getEventName() {
+ return "event";
+ }
+
+ void onExcessiveEvents(String packageName, int uid, int numOfEvents, long now) {
+ boolean notifyController = false;
+ synchronized (mLock) {
+ Long ts = mExcessiveEventPkgs.get(packageName, uid);
+ if (ts == null) {
+ if (DEBUG_APP_STATE_TIME_SLOT_EVENT_TRACKER) {
+ Slog.i(TAG, "Excessive amount of " + getEventName() + " from "
+ + packageName + "/" + UserHandle.formatUid(uid) + ": " + numOfEvents
+ + " over " + TimeUtils.formatDuration(getMaxTrackingDuration()));
+ }
+ mExcessiveEventPkgs.put(packageName, uid, now);
+ notifyController = true;
+ }
+ }
+ if (notifyController) {
+ mTracker.mAppRestrictionController.refreshAppRestrictionLevelForUid(
+ uid, REASON_MAIN_FORCED_BY_SYSTEM,
+ REASON_SUB_FORCED_SYSTEM_FLAG_ABUSE, true);
+ }
+ }
+
+ /**
+ * Whether or not we should ignore the incoming event.
+ */
+ @ReasonCode int shouldExempt(String packageName, int uid) {
+ if (mTracker.isUidOnTop(uid)) {
+ if (DEBUG_APP_STATE_TIME_SLOT_EVENT_TRACKER) {
+ Slog.i(TAG, "Ignoring event from " + packageName + "/"
+ + UserHandle.formatUid(uid) + ": top");
+ }
+ return REASON_PROC_STATE_TOP;
+ }
+ if (mTracker.mAppRestrictionController.hasForegroundServices(packageName, uid)) {
+ if (DEBUG_APP_STATE_TIME_SLOT_EVENT_TRACKER) {
+ Slog.i(TAG, "Ignoring event " + packageName + "/"
+ + UserHandle.formatUid(uid) + ": has active FGS");
+ }
+ return REASON_PROC_STATE_FGS;
+ }
+ final @ReasonCode int reason = shouldExemptUid(uid);
+ if (reason != REASON_DENIED) {
+ if (DEBUG_APP_STATE_TIME_SLOT_EVENT_TRACKER) {
+ Slog.i(TAG, "Ignoring event " + packageName + "/" + UserHandle.formatUid(uid)
+ + ": " + reasonCodeToString(reason));
+ }
+ return reason;
+ }
+ return REASON_DENIED;
+ }
+
+ @Override
+ public @RestrictionLevel int getProposedRestrictionLevel(String packageName, int uid) {
+ synchronized (mLock) {
+ return mExcessiveEventPkgs.get(packageName, uid) == null
+ ? RESTRICTION_LEVEL_ADAPTIVE_BUCKET
+ : RESTRICTION_LEVEL_RESTRICTED_BUCKET;
+ }
+ }
+
+ void onUserInteractionStarted(String packageName, int uid) {
+ boolean notifyController = false;
+ synchronized (mLock) {
+ notifyController = mExcessiveEventPkgs.remove(packageName, uid) != null;
+ }
+ mTracker.mAppRestrictionController.refreshAppRestrictionLevelForUid(uid,
+ REASON_MAIN_USAGE, REASON_SUB_USAGE_USER_INTERACTION, true);
+ }
+
+ @Override
+ void dump(PrintWriter pw, String prefix) {
+ super.dump(pw, prefix);
+ if (isEnabled()) {
+ pw.print(prefix);
+ pw.print(mKeyNumOfEventsThreshold);
+ pw.print('=');
+ pw.println(mDefaultNumOfEventsThreshold);
+ }
+ pw.print(prefix);
+ pw.print("event_time_slot_size=");
+ pw.println(getTimeSlotSize());
+ }
+ }
+
+ /**
+ * A simple time-slot based event table, with only one track of events.
+ */
+ static class SimpleAppStateTimeslotEvents extends BaseAppStateTimeSlotEvents {
+ static final int DEFAULT_INDEX = 0;
+ static final long DEFAULT_TIME_SLOT_SIZE = 15 * ONE_MINUTE;
+ static final long DEFAULT_TIME_SLOT_SIZE_DEBUG = ONE_MINUTE;
+
+ SimpleAppStateTimeslotEvents(int uid, @NonNull String packageName,
+ long timeslotSize, @NonNull String tag,
+ @NonNull MaxTrackingDurationConfig maxTrackingDurationConfig) {
+ super(uid, packageName, 1, timeslotSize, tag, maxTrackingDurationConfig);
+ }
+
+ SimpleAppStateTimeslotEvents(SimpleAppStateTimeslotEvents other) {
+ super(other);
+ }
+
+ @Override
+ String formatEventTypeLabel(int index) {
+ return "";
+ }
+
+ @Override
+ String formatEventSummary(long now, int index) {
+ if (mEvents[DEFAULT_INDEX] == null || mEvents[DEFAULT_INDEX].size() == 0) {
+ return "(none)";
+ }
+ final int total = getTotalEvents(now, DEFAULT_INDEX);
+ return "total=" + total + ", latest="
+ + getTotalEventsSince(mCurSlotStartTime[DEFAULT_INDEX], now, DEFAULT_INDEX)
+ + "(slot=" + TimeUtils.formatTime(mCurSlotStartTime[DEFAULT_INDEX], now) + ")";
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/BaseAppStateTracker.java b/services/core/java/com/android/server/am/BaseAppStateTracker.java
new file mode 100644
index 0000000..2846f6c
--- /dev/null
+++ b/services/core/java/com/android/server/am/BaseAppStateTracker.java
@@ -0,0 +1,263 @@
+/*
+ * 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.server.am;
+
+import static com.android.server.am.ActiveServices.SERVICE_START_FOREGROUND_TIMEOUT;
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM;
+import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.annotation.UserIdInt;
+import android.app.ActivityManagerInternal;
+import android.app.AppOpsManager;
+import android.app.role.RoleManager;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.media.session.MediaSessionManager;
+import android.os.BatteryManagerInternal;
+import android.os.BatteryStatsInternal;
+import android.os.Handler;
+import android.util.Slog;
+
+import com.android.server.DeviceIdleInternal;
+import com.android.server.LocalServices;
+import com.android.server.pm.UserManagerInternal;
+import com.android.server.pm.permission.PermissionManagerServiceInternal;
+
+import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+
+/**
+ * Base class to track certain state of the app, could be used to determine the restriction level.
+ *
+ * @param <T> A class derived from BaseAppStatePolicy.
+ */
+public abstract class BaseAppStateTracker<T extends BaseAppStatePolicy> {
+ protected static final String TAG = TAG_WITH_CLASS_NAME ? "BaseAppStatePolicy" : TAG_AM;
+
+ static final long ONE_MINUTE = 60 * 1_000L;
+ static final long ONE_HOUR = 60 * ONE_MINUTE;
+ static final long ONE_DAY = 24 * ONE_HOUR;
+
+ protected final AppRestrictionController mAppRestrictionController;
+ protected final Injector<T> mInjector;
+ protected final Context mContext;
+ protected final Handler mBgHandler;
+ protected final Object mLock;
+
+ BaseAppStateTracker(Context context, AppRestrictionController controller,
+ @Nullable Constructor<? extends Injector<T>> injector, Object outerContext) {
+ mContext = context;
+ mAppRestrictionController = controller;
+ mBgHandler = controller.getBackgroundHandler();
+ mLock = controller.getLock();
+ if (injector == null) {
+ mInjector = new Injector<>();
+ } else {
+ Injector<T> localInjector = null;
+ try {
+ localInjector = injector.newInstance(outerContext);
+ } catch (Exception e) {
+ Slog.w(TAG, "Unable to instantiate " + injector, e);
+ }
+ mInjector = (localInjector == null) ? new Injector<>() : localInjector;
+ }
+ }
+
+ /**
+ * Return the policy holder of this tracker.
+ */
+ T getPolicy() {
+ return mInjector.getPolicy();
+ }
+
+ /**
+ * Called when the system is ready to rock.
+ */
+ void onSystemReady() {
+ mInjector.onSystemReady();
+ }
+
+ /**
+ * Called when a user with the given uid is added.
+ */
+ void onUidAdded(final int uid) {
+ }
+
+ /**
+ * Called when a user with the given uid is removed.
+ */
+ void onUidRemoved(final int uid) {
+ }
+
+ /**
+ * Called when a user with the given userId is added.
+ */
+ void onUserAdded(final @UserIdInt int userId) {
+ }
+
+ /**
+ * Called when a user with the given userId is started.
+ */
+ void onUserStarted(final @UserIdInt int userId) {
+ }
+
+ /**
+ * Called when a user with the given userId is stopped.
+ */
+ void onUserStopped(final @UserIdInt int userId) {
+ }
+
+ /**
+ * Called when a user with the given userId is removed.
+ */
+ void onUserRemoved(final @UserIdInt int userId) {
+ }
+
+ /**
+ * Called when a device config property in the activity manager namespace
+ * has changed.
+ */
+ void onPropertiesChanged(@NonNull String name) {
+ getPolicy().onPropertiesChanged(name);
+ }
+
+ /**
+ * Called when an app has transitioned into an active state due to user interaction.
+ */
+ void onUserInteractionStarted(String packageName, int uid) {
+ }
+
+ /**
+ * Called when the background restriction settings of the given app is changed.
+ */
+ void onBackgroundRestrictionChanged(int uid, String pkgName, boolean restricted) {
+ }
+
+ /**
+ * Called when the process state of the given UID has been changed.
+ *
+ * <p>Note: as of now, for simplification, we're tracking the TOP state changes only.</p>
+ */
+ void onUidProcStateChanged(int uid, int procState) {
+ }
+
+ /**
+ * Called when all the processes in the given UID have died.
+ */
+ void onUidGone(int uid) {
+ }
+
+ /**
+ * Dump to the given printer writer.
+ */
+ void dump(PrintWriter pw, String prefix) {
+ mInjector.getPolicy().dump(pw, " " + prefix);
+ }
+
+ static class Injector<T extends BaseAppStatePolicy> {
+ T mAppStatePolicy;
+
+ ActivityManagerInternal mActivityManagerInternal;
+ BatteryManagerInternal mBatteryManagerInternal;
+ BatteryStatsInternal mBatteryStatsInternal;
+ DeviceIdleInternal mDeviceIdleInternal;
+ UserManagerInternal mUserManagerInternal;
+ PackageManager mPackageManager;
+ PermissionManagerServiceInternal mPermissionManagerServiceInternal;
+ AppOpsManager mAppOpsManager;
+ MediaSessionManager mMediaSessionManager;
+ RoleManager mRoleManager;
+
+ void setPolicy(T policy) {
+ mAppStatePolicy = policy;
+ }
+
+ void onSystemReady() {
+ mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class);
+ mBatteryManagerInternal = LocalServices.getService(BatteryManagerInternal.class);
+ mBatteryStatsInternal = LocalServices.getService(BatteryStatsInternal.class);
+ mDeviceIdleInternal = LocalServices.getService(DeviceIdleInternal.class);
+ mUserManagerInternal = LocalServices.getService(UserManagerInternal.class);
+ mPermissionManagerServiceInternal = LocalServices.getService(
+ PermissionManagerServiceInternal.class);
+ final Context context = mAppStatePolicy.mTracker.mContext;
+ mPackageManager = context.getPackageManager();
+ mAppOpsManager = context.getSystemService(AppOpsManager.class);
+ mMediaSessionManager = context.getSystemService(MediaSessionManager.class);
+ mRoleManager = context.getSystemService(RoleManager.class);
+
+ getPolicy().onSystemReady();
+ }
+
+ ActivityManagerInternal getActivityManagerInternal() {
+ return mActivityManagerInternal;
+ }
+
+ BatteryManagerInternal getBatteryManagerInternal() {
+ return mBatteryManagerInternal;
+ }
+
+ BatteryStatsInternal getBatteryStatsInternal() {
+ return mBatteryStatsInternal;
+ }
+
+ T getPolicy() {
+ return mAppStatePolicy;
+ }
+
+ DeviceIdleInternal getDeviceIdleInternal() {
+ return mDeviceIdleInternal;
+ }
+
+ UserManagerInternal getUserManagerInternal() {
+ return mUserManagerInternal;
+ }
+
+ /**
+ * Equivalent to {@link java.lang.System#currentTimeMillis}.
+ */
+ long currentTimeMillis() {
+ return System.currentTimeMillis();
+ }
+
+ PackageManager getPackageManager() {
+ return mPackageManager;
+ }
+
+ PermissionManagerServiceInternal getPermissionManagerServiceInternal() {
+ return mPermissionManagerServiceInternal;
+ }
+
+ AppOpsManager getAppOpsManager() {
+ return mAppOpsManager;
+ }
+
+ MediaSessionManager getMediaSessionManager() {
+ return mMediaSessionManager;
+ }
+
+ long getServiceStartForegroundTimeout() {
+ return SERVICE_START_FOREGROUND_TIMEOUT;
+ }
+
+ RoleManager getRoleManager() {
+ return mRoleManager;
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/BatteryStatsService.java b/services/core/java/com/android/server/am/BatteryStatsService.java
index 0b92954..c8ad0e8 100644
--- a/services/core/java/com/android/server/am/BatteryStatsService.java
+++ b/services/core/java/com/android/server/am/BatteryStatsService.java
@@ -431,6 +431,11 @@
}
@Override
+ public List<BatteryUsageStats> getBatteryUsageStats(List<BatteryUsageStatsQuery> queries) {
+ return BatteryStatsService.this.getBatteryUsageStats(queries);
+ }
+
+ @Override
public void noteJobsDeferred(int uid, int numDeferred, long sinceLast) {
if (DBG) Slog.d(TAG, "Jobs deferred " + uid + ": " + numDeferred + " " + sinceLast);
BatteryStatsService.this.noteJobsDeferred(uid, numDeferred, sinceLast);
diff --git a/services/core/java/com/android/server/am/BroadcastQueue.java b/services/core/java/com/android/server/am/BroadcastQueue.java
index bb939b7..0c383eb 100644
--- a/services/core/java/com/android/server/am/BroadcastQueue.java
+++ b/services/core/java/com/android/server/am/BroadcastQueue.java
@@ -16,6 +16,7 @@
package com.android.server.am;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_RESTRICTED_BUCKET;
import static android.os.Process.ZYGOTE_POLICY_FLAG_EMPTY;
import static android.os.Process.ZYGOTE_POLICY_FLAG_LATENCY_SENSITIVE;
import static android.text.TextUtils.formatSimple;
@@ -28,6 +29,7 @@
import static com.android.server.am.ActivityManagerDebugConfig.POSTFIX_BROADCAST;
import static com.android.server.am.ActivityManagerDebugConfig.POSTFIX_MU;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.ActivityManager;
import android.app.AppGlobals;
@@ -37,6 +39,7 @@
import android.app.PendingIntent;
import android.app.RemoteServiceException.CannotDeliverBroadcastException;
import android.app.usage.UsageEvents.Event;
+import android.app.usage.UsageStatsManagerInternal;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.IIntentReceiver;
@@ -44,6 +47,7 @@
import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.ActivityInfo;
+import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PermissionInfo;
import android.content.pm.ResolveInfo;
@@ -69,6 +73,7 @@
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.FrameworkStatsLog;
+import com.android.server.LocalServices;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -317,7 +322,11 @@
final ProcessReceiverRecord prr = app.mReceivers;
prr.addCurReceiver(r);
app.mState.forceProcessStateUpTo(ActivityManager.PROCESS_STATE_RECEIVER);
- mService.updateLruProcessLocked(app, false, null);
+ // Don't bump its LRU position if it's in the background restricted.
+ if (mService.mInternal.getRestrictionLevel(app.info.packageName, app.userId)
+ < RESTRICTION_LEVEL_RESTRICTED_BUCKET) {
+ mService.updateLruProcessLocked(app, false, null);
+ }
// Make sure the oom adj score is updated before delivering the broadcast.
// Force an update, even if there are other pending requests, overall it still saves time,
// because time(updateOomAdj(N apps)) <= N * time(updateOomAdj(1 app)).
@@ -325,6 +334,7 @@
mService.updateOomAdjPendingTargetsLocked(OomAdjuster.OOM_ADJ_REASON_START_RECEIVER);
// Tell the application to launch this receiver.
+ maybeReportBroadcastDispatchedEventLocked(r);
r.intent.setComponent(r.curComponent);
boolean started = false;
@@ -917,6 +927,7 @@
r.receiverTime = SystemClock.uptimeMillis();
maybeAddAllowBackgroundActivityStartsToken(filter.receiverList.app, r);
maybeScheduleTempAllowlistLocked(filter.owningUid, r, r.options);
+ maybeReportBroadcastDispatchedEventLocked(r);
performReceiveLocked(filter.receiverList.app, filter.receiverList.receiver,
new Intent(r.intent), r.resultCode, r.resultData,
r.resultExtras, r.ordered, r.initialSticky, r.userId);
@@ -1831,6 +1842,45 @@
mPendingBroadcastRecvIndex = recIdx;
}
+
+ @Nullable
+ private String getTargetPackage(BroadcastRecord r) {
+ if (r.intent == null) {
+ return null;
+ }
+ if (r.intent.getPackage() != null) {
+ return r.intent.getPackage();
+ } else if (r.intent.getComponent() != null) {
+ return r.intent.getComponent().getPackageName();
+ }
+ return null;
+ }
+
+ private void maybeReportBroadcastDispatchedEventLocked(BroadcastRecord r) {
+ final String targetPackage = getTargetPackage(r);
+ // Ignore non-explicit broadcasts
+ if (targetPackage == null) {
+ return;
+ }
+ // TODO (206518114): Only allow apps with ACCESS_PACKAGE_USAGE_STATS to set
+ // getIdForResponseEvent.
+ if (r.options == null || r.options.getIdForResponseEvent() <= 0) {
+ return;
+ }
+ // TODO (206518114): Only report this event when the broadcast is dispatched while the app
+ // is in the background state.
+ getUsageStatsManagerInternal().reportBroadcastDispatched(
+ r.callingUid, targetPackage, UserHandle.of(r.userId),
+ r.options.getIdForResponseEvent(), SystemClock.elapsedRealtime());
+ }
+
+ @NonNull
+ private UsageStatsManagerInternal getUsageStatsManagerInternal() {
+ final UsageStatsManagerInternal usageStatsManagerInternal =
+ LocalServices.getService(UsageStatsManagerInternal.class);
+ return usageStatsManagerInternal;
+ }
+
private boolean noteOpForManifestReceiver(int appOp, BroadcastRecord r, ResolveInfo info,
ComponentName component) {
if (ArrayUtils.isEmpty(info.activityInfo.attributionTags)) {
@@ -2022,6 +2072,13 @@
System.identityHashCode(original));
}
+ final ApplicationInfo info = original.callerApp != null ? original.callerApp.info : null;
+ final String callerPackage = info != null ? info.packageName : original.callerPackage;
+ if (callerPackage != null) {
+ mService.mHandler.obtainMessage(ActivityManagerService.DISPATCH_SENDING_BROADCAST_EVENT,
+ original.callingUid, 0, callerPackage).sendToTarget();
+ }
+
// Note sometimes (only for sticky broadcasts?) we reuse BroadcastRecords,
// So don't change the incoming record directly.
final BroadcastRecord historyRecord = original.maybeStripForHistory();
diff --git a/services/core/java/com/android/server/am/EventLogTags.logtags b/services/core/java/com/android/server/am/EventLogTags.logtags
index 68f2e35..b250a0c 100644
--- a/services/core/java/com/android/server/am/EventLogTags.logtags
+++ b/services/core/java/com/android/server/am/EventLogTags.logtags
@@ -115,3 +115,4 @@
30085 ssm_user_unlocked (userId|1|5)
30086 ssm_user_stopping (userId|1|5)
30087 ssm_user_stopped (userId|1|5)
+30088 ssm_user_completed_event (userId|1|5),(eventFlag|1|5)
diff --git a/services/core/java/com/android/server/am/UidProcessMap.java b/services/core/java/com/android/server/am/UidProcessMap.java
new file mode 100644
index 0000000..f708d37
--- /dev/null
+++ b/services/core/java/com/android/server/am/UidProcessMap.java
@@ -0,0 +1,108 @@
+/*
+ * 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.server.am;
+
+import android.util.ArrayMap;
+import android.util.SparseArray;
+
+/**
+ * Utility class to track mappings between (UID, name) and E.
+ *
+ * @param <E> The type of the values in this map.
+ */
+public class UidProcessMap<E> {
+ final SparseArray<ArrayMap<String, E>> mMap = new SparseArray<>();
+
+ /**
+ * Retrieve a value from the map.
+ */
+ public E get(int uid, String name) {
+ final ArrayMap<String, E> names = mMap.get(uid);
+ if (names == null) {
+ return null;
+ }
+ return names.get(name);
+ }
+
+ /**
+ * Add a new value to the array map.
+ */
+ public E put(int uid, String name, E value) {
+ ArrayMap<String, E> names = mMap.get(uid);
+ if (names == null) {
+ names = new ArrayMap<String, E>(2);
+ mMap.put(uid, names);
+ }
+ names.put(name, value);
+ return value;
+ }
+
+ /**
+ * Remove an existing key (uid, name) from the array map.
+ */
+ public E remove(int uid, String name) {
+ final int index = mMap.indexOfKey(uid);
+ if (index < 0) {
+ return null;
+ }
+ final ArrayMap<String, E> names = mMap.valueAt(index);
+ if (names != null) {
+ final E old = names.remove(name);
+ if (names.isEmpty()) {
+ mMap.removeAt(index);
+ }
+ return old;
+ }
+ return null;
+ }
+
+ /**
+ * Return the underneath map.
+ */
+ public SparseArray<ArrayMap<String, E>> getMap() {
+ return mMap;
+ }
+
+ /**
+ * Return the number of items in this map.
+ */
+ public int size() {
+ return mMap.size();
+ }
+
+ /**
+ * Make the map empty. All storage is released.
+ */
+ public void clear() {
+ mMap.clear();
+ }
+
+ /**
+ * Perform a {@link #put} of all key/value pairs in other.
+ */
+ public void putAll(UidProcessMap<E> other) {
+ for (int i = other.mMap.size() - 1; i >= 0; i--) {
+ final int uid = other.mMap.keyAt(i);
+ final ArrayMap<String, E> names = mMap.get(uid);
+ if (names != null) {
+ names.putAll(other.mMap.valueAt(i));
+ } else {
+ mMap.put(uid, new ArrayMap<String, E>(other.mMap.valueAt(i)));
+ }
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java
index 252584c..e4c0846 100644
--- a/services/core/java/com/android/server/am/UserController.java
+++ b/services/core/java/com/android/server/am/UserController.java
@@ -109,6 +109,7 @@
import com.android.internal.widget.LockPatternUtils;
import com.android.server.FgThread;
import com.android.server.LocalServices;
+import com.android.server.SystemService.UserCompletedEventType;
import com.android.server.SystemServiceManager;
import com.android.server.am.UserState.KeyEvictedCallback;
import com.android.server.pm.UserManagerInternal;
@@ -166,6 +167,7 @@
static final int REPORT_LOCKED_BOOT_COMPLETE_MSG = 110;
static final int START_USER_SWITCH_FG_MSG = 120;
static final int COMPLETE_USER_SWITCH_MSG = 130;
+ static final int USER_COMPLETED_EVENT_MSG = 140;
// Message constant to clear {@link UserJourneySession} from {@link mUserIdToUserJourneyMap} if
// the user journey, defined in the UserLifecycleJourneyReported atom for statsd, is not
@@ -184,6 +186,14 @@
// when it never calls back.
private static final int USER_SWITCH_CALLBACKS_TIMEOUT_MS = 5 * 1000;
+ /**
+ * Time after last scheduleOnUserCompletedEvent() call at which USER_COMPLETED_EVENT_MSG will be
+ * scheduled (although it may fire sooner instead).
+ * When it fires, {@link #reportOnUserCompletedEvent} will be processed.
+ */
+ // TODO(b/197344658): Increase to 10s or 15s once we have a switch-UX-is-done invocation too.
+ private static final int USER_COMPLETED_EVENT_DELAY_MS = 5 * 1000;
+
// Used for statsd logging with UserLifecycleJourneyReported + UserLifecycleEventOccurred atoms
private static final long INVALID_SESSION_ID = 0;
@@ -365,6 +375,13 @@
private final SparseArray<UserJourneySession> mUserIdToUserJourneyMap = new SparseArray<>();
/**
+ * Map of userId to {@link UserCompletedEventType} event flags, indicating which as-yet-
+ * unreported user-starting events have transpired for the given user.
+ */
+ @GuardedBy("mCompletedEventTypes")
+ private final SparseIntArray mCompletedEventTypes = new SparseIntArray();
+
+ /**
* Sets on {@link #setInitialConfig(boolean, int, boolean)}, which is called by
* {@code ActivityManager} when the system is started.
*
@@ -2778,6 +2795,9 @@
mInjector.getSystemServiceManager().onUserStarting(
TimingsTraceAndSlog.newAsyncLog(), msg.arg1);
+ scheduleOnUserCompletedEvent(msg.arg1,
+ UserCompletedEventType.EVENT_TYPE_USER_STARTING,
+ USER_COMPLETED_EVENT_DELAY_MS);
logUserLifecycleEvent(msg.arg1, USER_LIFECYCLE_EVENT_START_USER,
USER_LIFECYCLE_EVENT_STATE_FINISH);
@@ -2802,6 +2822,13 @@
break;
case USER_UNLOCKED_MSG:
mInjector.getSystemServiceManager().onUserUnlocked(msg.arg1);
+ scheduleOnUserCompletedEvent(msg.arg1,
+ UserCompletedEventType.EVENT_TYPE_USER_UNLOCKED,
+ // If it's the foreground user, we wait longer to let it fully load.
+ // Else, there's nothing specific to wait for, so we basically just proceed.
+ // (No need to acquire lock to read mCurrentUserId since it is volatile.)
+ // TODO: Find something to wait for in the case of a profile.
+ mCurrentUserId == msg.arg1 ? USER_COMPLETED_EVENT_DELAY_MS : 1000);
logUserLifecycleEvent(msg.arg1, USER_LIFECYCLE_EVENT_UNLOCKED_USER,
USER_LIFECYCLE_EVENT_STATE_FINISH);
clearSessionId(msg.arg1);
@@ -2815,6 +2842,12 @@
Integer.toString(msg.arg1), msg.arg1);
mInjector.getSystemServiceManager().onUserSwitching(msg.arg2, msg.arg1);
+ scheduleOnUserCompletedEvent(msg.arg1,
+ UserCompletedEventType.EVENT_TYPE_USER_SWITCHING,
+ USER_COMPLETED_EVENT_DELAY_MS);
+ break;
+ case USER_COMPLETED_EVENT_MSG:
+ reportOnUserCompletedEvent((Integer) msg.obj);
break;
case FOREGROUND_PROFILE_CHANGED_MSG:
dispatchForegroundProfileChanged(msg.arg1);
@@ -2847,6 +2880,71 @@
}
/**
+ * Schedules {@link SystemServiceManager#onUserCompletedEvent()} with the given
+ * {@link UserCompletedEventType} event, which will be combined with any other events for that
+ * user already scheduled.
+ * If it isn't rescheduled first, it will fire after a delayMs delay.
+ *
+ * @param eventType event type flags from {@link UserCompletedEventType} to append to the
+ * schedule. Use 0 to schedule the ssm call without modifying the event types.
+ */
+ // TODO(b/197344658): Also call scheduleOnUserCompletedEvent(userId, 0, 0) after switch UX done.
+ @VisibleForTesting
+ void scheduleOnUserCompletedEvent(
+ int userId, @UserCompletedEventType.EventTypesFlag int eventType, int delayMs) {
+
+ if (eventType != 0) {
+ synchronized (mCompletedEventTypes) {
+ mCompletedEventTypes.put(userId, mCompletedEventTypes.get(userId, 0) | eventType);
+ }
+ }
+
+ final Object msgObj = userId;
+ mHandler.removeEqualMessages(USER_COMPLETED_EVENT_MSG, msgObj);
+ mHandler.sendMessageDelayed(
+ mHandler.obtainMessage(USER_COMPLETED_EVENT_MSG, msgObj),
+ delayMs);
+ }
+
+ /**
+ * Calls {@link SystemServiceManager#onUserCompletedEvent()} for the given user, sending all the
+ * {@link UserCompletedEventType} events that have been scheduled for it if they are still
+ * applicable.
+ *
+ * Called on the mHandler thread.
+ */
+ @VisibleForTesting
+ void reportOnUserCompletedEvent(Integer userId) {
+ mHandler.removeEqualMessages(USER_COMPLETED_EVENT_MSG, userId);
+
+ int eventTypes;
+ synchronized (mCompletedEventTypes) {
+ eventTypes = mCompletedEventTypes.get(userId, 0);
+ mCompletedEventTypes.delete(userId);
+ }
+
+ // Now, remove any eventTypes that are no longer true.
+ int eligibleEventTypes = 0;
+ synchronized (mLock) {
+ final UserState uss = mStartedUsers.get(userId);
+ if (uss != null && uss.state != UserState.STATE_SHUTDOWN) {
+ eligibleEventTypes |= UserCompletedEventType.EVENT_TYPE_USER_STARTING;
+ }
+ if (uss != null && uss.state == STATE_RUNNING_UNLOCKED) {
+ eligibleEventTypes |= UserCompletedEventType.EVENT_TYPE_USER_UNLOCKED;
+ }
+ if (userId == mCurrentUserId) {
+ eligibleEventTypes |= UserCompletedEventType.EVENT_TYPE_USER_SWITCHING;
+ }
+ }
+ Slogf.i(TAG, "reportOnUserCompletedEvent(%d): stored=%s, eligible=%s", userId,
+ Integer.toBinaryString(eventTypes), Integer.toBinaryString(eligibleEventTypes));
+ eventTypes &= eligibleEventTypes;
+
+ mInjector.systemServiceManagerOnUserCompletedEvent(userId, eventTypes);
+ }
+
+ /**
* statsd helper method for logging the start of a user journey via a UserLifecycleEventOccurred
* atom given the originating and targeting users for the journey.
*/
@@ -3086,7 +3184,11 @@
}
void systemServiceManagerOnUserStopped(@UserIdInt int userId) {
- mService.mSystemServiceManager.onUserStopped(userId);
+ getSystemServiceManager().onUserStopped(userId);
+ }
+
+ void systemServiceManagerOnUserCompletedEvent(@UserIdInt int userId, int eventTypes) {
+ getSystemServiceManager().onUserCompletedEvent(userId, eventTypes);
}
protected UserManagerService getUserManager() {
@@ -3113,7 +3215,7 @@
}
boolean isRuntimeRestarted() {
- return mService.mSystemServiceManager.isRuntimeRestarted();
+ return getSystemServiceManager().isRuntimeRestarted();
}
SystemServiceManager getSystemServiceManager() {
diff --git a/services/core/java/com/android/server/app/GameServiceProviderInstanceFactoryImpl.java b/services/core/java/com/android/server/app/GameServiceProviderInstanceFactoryImpl.java
index b4c43f6..73278e4 100644
--- a/services/core/java/com/android/server/app/GameServiceProviderInstanceFactoryImpl.java
+++ b/services/core/java/com/android/server/app/GameServiceProviderInstanceFactoryImpl.java
@@ -17,6 +17,7 @@
package com.android.server.app;
import android.annotation.NonNull;
+import android.app.ActivityManager;
import android.app.ActivityTaskManager;
import android.content.Context;
import android.content.Intent;
@@ -36,17 +37,19 @@
private final Context mContext;
GameServiceProviderInstanceFactoryImpl(@NonNull Context context) {
- this.mContext = context;
+ mContext = context;
}
@NonNull
@Override
- public GameServiceProviderInstance create(@NonNull
- GameServiceProviderConfiguration gameServiceProviderConfiguration) {
+ public GameServiceProviderInstance create(
+ @NonNull GameServiceProviderConfiguration gameServiceProviderConfiguration) {
return new GameServiceProviderInstanceImpl(
gameServiceProviderConfiguration.getUserHandle(),
BackgroundThread.getExecutor(),
+ mContext,
new GameClassifierImpl(mContext.getPackageManager()),
+ ActivityManager.getService(),
ActivityTaskManager.getService(),
(WindowManagerService) ServiceManager.getService(Context.WINDOW_SERVICE),
LocalServices.getService(WindowManagerInternal.class),
diff --git a/services/core/java/com/android/server/app/GameServiceProviderInstanceImpl.java b/services/core/java/com/android/server/app/GameServiceProviderInstanceImpl.java
index 43c9839..8578de7 100644
--- a/services/core/java/com/android/server/app/GameServiceProviderInstanceImpl.java
+++ b/services/core/java/com/android/server/app/GameServiceProviderInstanceImpl.java
@@ -16,13 +16,18 @@
package com.android.server.app;
+import android.Manifest;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.RequiresPermission;
import android.app.ActivityManager.RunningTaskInfo;
import android.app.ActivityTaskManager;
+import android.app.IActivityManager;
import android.app.IActivityTaskManager;
import android.app.TaskStackListener;
import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.os.RemoteException;
@@ -110,12 +115,23 @@
gameScreenshotResultFuture);
});
}
+
+ @RequiresPermission(android.Manifest.permission.FORCE_STOP_PACKAGES)
+ public void restartGame(int taskId) {
+ mContext.enforceCallingPermission(Manifest.permission.FORCE_STOP_PACKAGES,
+ "restartGame()");
+ mBackgroundExecutor.execute(() -> {
+ GameServiceProviderInstanceImpl.this.restartGame(taskId);
+ });
+ }
};
private final Object mLock = new Object();
private final UserHandle mUserHandle;
private final Executor mBackgroundExecutor;
+ private final Context mContext;
private final GameClassifier mGameClassifier;
+ private final IActivityManager mActivityManager;
private final IActivityTaskManager mActivityTaskManager;
private final WindowManagerService mWindowManagerService;
private final WindowManagerInternal mWindowManagerInternal;
@@ -131,7 +147,9 @@
GameServiceProviderInstanceImpl(
@NonNull UserHandle userHandle,
@NonNull Executor backgroundExecutor,
+ @NonNull Context context,
@NonNull GameClassifier gameClassifier,
+ @NonNull IActivityManager activityManager,
@NonNull IActivityTaskManager activityTaskManager,
@NonNull WindowManagerService windowManagerService,
@NonNull WindowManagerInternal windowManagerInternal,
@@ -139,7 +157,9 @@
@NonNull ServiceConnector<IGameSessionService> gameSessionServiceConnector) {
mUserHandle = userHandle;
mBackgroundExecutor = backgroundExecutor;
+ mContext = context;
mGameClassifier = gameClassifier;
+ mActivityManager = activityManager;
mActivityTaskManager = activityTaskManager;
mWindowManagerService = windowManagerService;
mWindowManagerInternal = windowManagerInternal;
@@ -310,6 +330,7 @@
+ ") is not awaiting game session request. Ignoring.");
return;
}
+ mGameSessions.put(taskId, existingGameSessionRecord.withGameSessionRequested());
GameSessionViewHostConfiguration gameSessionViewHostConfiguration =
createViewHostConfigurationForTask(taskId);
@@ -532,4 +553,27 @@
}
});
}
+
+ private void restartGame(int taskId) {
+ String packageName;
+
+ synchronized (mLock) {
+ boolean isTaskAssociatedWithGameSession = mGameSessions.containsKey(taskId);
+ if (!isTaskAssociatedWithGameSession) {
+ return;
+ }
+
+ packageName = mGameSessions.get(taskId).getComponentName().getPackageName();
+ }
+
+ try {
+ mActivityManager.forceStopPackage(packageName, UserHandle.USER_CURRENT);
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+
+ Intent launchIntent =
+ mContext.getPackageManager().getLaunchIntentForPackage(packageName);
+ mContext.startActivity(launchIntent);
+ }
}
diff --git a/services/core/java/com/android/server/audio/BtHelper.java b/services/core/java/com/android/server/audio/BtHelper.java
index 6ec9836..42fca9b 100644
--- a/services/core/java/com/android/server/audio/BtHelper.java
+++ b/services/core/java/com/android/server/audio/BtHelper.java
@@ -371,7 +371,7 @@
* @return false if SCO isn't connected
*/
/*package*/ synchronized boolean isBluetoothScoOn() {
- if (mBluetoothHeadset == null) {
+ if (mBluetoothHeadset == null || mBluetoothHeadsetDevice == null) {
return false;
}
return mBluetoothHeadset.getAudioState(mBluetoothHeadsetDevice)
@@ -505,7 +505,7 @@
// Discard timeout message
mDeviceBroker.handleCancelFailureToConnectToBtHeadsetService();
mBluetoothHeadset = headset;
- setBtScoActiveDevice(mBluetoothHeadset.getActiveDevice());
+ setBtScoActiveDevice(headset != null ? headset.getActiveDevice() : null);
// Refresh SCO audio state
checkScoAudioState();
if (mScoAudioState != SCO_STATE_ACTIVATE_REQ
@@ -513,7 +513,7 @@
return;
}
boolean status = false;
- if (mBluetoothHeadsetDevice != null) {
+ if (mBluetoothHeadset != null && mBluetoothHeadsetDevice != null) {
switch (mScoAudioState) {
case SCO_STATE_ACTIVATE_REQ:
status = connectBluetoothScoAudioHelper(
@@ -552,6 +552,9 @@
}
private AudioDeviceAttributes btHeadsetDeviceToAudioDevice(BluetoothDevice btDevice) {
+ if (btDevice == null) {
+ return new AudioDeviceAttributes(AudioSystem.DEVICE_OUT_BLUETOOTH_SCO, "");
+ }
String address = btDevice.getAddress();
if (!BluetoothAdapter.checkBluetoothAddress(address)) {
address = "";
diff --git a/services/core/java/com/android/server/biometrics/sensors/AcquisitionClient.java b/services/core/java/com/android/server/biometrics/sensors/AcquisitionClient.java
index 86d72ba..8b8103e 100644
--- a/services/core/java/com/android/server/biometrics/sensors/AcquisitionClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/AcquisitionClient.java
@@ -29,6 +29,8 @@
import android.os.Vibrator;
import android.util.Slog;
+import java.util.function.Supplier;
+
/**
* Abstract {@link HalClientMonitor} subclass that operations eligible/interested in acquisition
* messages should extend.
@@ -52,12 +54,7 @@
private boolean mShouldSendErrorToClient = true;
private boolean mAlreadyCancelled;
- /**
- * Stops the HAL operation specific to the ClientMonitor subclass.
- */
- protected abstract void stopHalOperation();
-
- public AcquisitionClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
+ public AcquisitionClient(@NonNull Context context, @NonNull Supplier<T> lazyDaemon,
@NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener, int userId,
@NonNull String owner, int cookie, int sensorId, boolean shouldVibrate,
int statsModality, int statsAction, int statsClient) {
@@ -67,6 +64,11 @@
mShouldVibrate = shouldVibrate;
}
+ /**
+ * Stops the HAL operation specific to the ClientMonitor subclass.
+ */
+ protected abstract void stopHalOperation();
+
@Override
public void unableToStart() {
try {
diff --git a/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java b/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java
index 35a0f57..b715faf 100644
--- a/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java
@@ -42,6 +42,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.function.Supplier;
/**
* A class to keep track of the authentication state for a given client.
@@ -89,23 +90,7 @@
// the state. We should think of a way to improve this in the future.
protected @State int mState = STATE_NEW;
- /**
- * Handles lifecycle, e.g. {@link BiometricScheduler},
- * {@link ClientMonitorCallback} after authentication
- * results are known. Note that this happens asynchronously from (but shortly after)
- * {@link #onAuthenticated(BiometricAuthenticator.Identifier, boolean, ArrayList)} and allows
- * {@link CoexCoordinator} a chance to invoke/delay this event.
- * @param authenticated
- */
- protected abstract void handleLifecycleAfterAuth(boolean authenticated);
-
- /**
- * @return true if a user was detected (i.e. face was found, fingerprint sensor was touched.
- * etc)
- */
- public abstract boolean wasUserDetected();
-
- public AuthenticationClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
+ public AuthenticationClient(@NonNull Context context, @NonNull Supplier<T> lazyDaemon,
@NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener,
int targetUserId, long operationId, boolean restricted, @NonNull String owner,
int cookie, boolean requireConfirmation, int sensorId, boolean isStrongBiometric,
@@ -474,6 +459,22 @@
}
}
+ /**
+ * Handles lifecycle, e.g. {@link BiometricScheduler},
+ * {@link com.android.server.biometrics.sensors.BaseClientMonitor.Callback} after authentication
+ * results are known. Note that this happens asynchronously from (but shortly after)
+ * {@link #onAuthenticated(BiometricAuthenticator.Identifier, boolean, ArrayList)} and allows
+ * {@link CoexCoordinator} a chance to invoke/delay this event.
+ * @param authenticated
+ */
+ protected abstract void handleLifecycleAfterAuth(boolean authenticated);
+
+ /**
+ * @return true if a user was detected (i.e. face was found, fingerprint sensor was touched.
+ * etc)
+ */
+ public abstract boolean wasUserDetected();
+
public @State int getState() {
return mState;
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/EnrollClient.java b/services/core/java/com/android/server/biometrics/sensors/EnrollClient.java
index 3b7adc1..74f4931 100644
--- a/services/core/java/com/android/server/biometrics/sensors/EnrollClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/EnrollClient.java
@@ -29,6 +29,7 @@
import com.android.server.biometrics.BiometricsProto;
import java.util.Arrays;
+import java.util.function.Supplier;
/**
* A class to keep track of the enrollment state for a given client.
@@ -49,7 +50,7 @@
*/
protected abstract boolean hasReachedEnrollmentLimit();
- public EnrollClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
+ public EnrollClient(@NonNull Context context, @NonNull Supplier<T> lazyDaemon,
@NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener, int userId,
@NonNull byte[] hardwareAuthToken, @NonNull String owner, @NonNull BiometricUtils utils,
int timeoutSec, int statsModality, int sensorId, boolean shouldVibrate) {
diff --git a/services/core/java/com/android/server/biometrics/sensors/GenerateChallengeClient.java b/services/core/java/com/android/server/biometrics/sensors/GenerateChallengeClient.java
index 6fb6d08..9689418 100644
--- a/services/core/java/com/android/server/biometrics/sensors/GenerateChallengeClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/GenerateChallengeClient.java
@@ -25,11 +25,13 @@
import com.android.server.biometrics.BiometricsProto;
+import java.util.function.Supplier;
+
public abstract class GenerateChallengeClient<T> extends HalClientMonitor<T> {
private static final String TAG = "GenerateChallengeClient";
- public GenerateChallengeClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
+ public GenerateChallengeClient(@NonNull Context context, @NonNull Supplier<T> lazyDaemon,
@NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener,
int userId, @NonNull String owner, int sensorId) {
super(context, lazyDaemon, token, listener, userId, owner, 0 /* cookie */, sensorId,
diff --git a/services/core/java/com/android/server/biometrics/sensors/HalClientMonitor.java b/services/core/java/com/android/server/biometrics/sensors/HalClientMonitor.java
index c8830f8..66a1c6e 100644
--- a/services/core/java/com/android/server/biometrics/sensors/HalClientMonitor.java
+++ b/services/core/java/com/android/server/biometrics/sensors/HalClientMonitor.java
@@ -22,35 +22,16 @@
import android.hardware.biometrics.BiometricsProtoEnums;
import android.os.IBinder;
+import java.util.function.Supplier;
+
/**
* Abstract {@link BaseClientMonitor} implementation that supports HAL operations.
* @param <T> HAL template
*/
public abstract class HalClientMonitor<T> extends BaseClientMonitor {
- /**
- * Interface that allows ClientMonitor subclasses to retrieve a fresh instance to the HAL.
- */
- public interface LazyDaemon<T> {
- /**
- * @return A fresh instance to the biometric HAL
- */
- T getDaemon();
- }
-
- /**
- * Starts the HAL operation specific to the ClientMonitor subclass.
- */
- protected abstract void startHalOperation();
-
- /**
- * Invoked if the scheduler is unable to start the ClientMonitor (for example the HAL is null).
- * If such a problem is detected, the scheduler will not invoke
- * {@link #start(ClientMonitorCallback)}.
- */
- public abstract void unableToStart();
-
+
@NonNull
- protected final LazyDaemon<T> mLazyDaemon;
+ protected final Supplier<T> mLazyDaemon;
/**
* @param context system_server context
@@ -65,7 +46,7 @@
* @param statsAction One of {@link BiometricsProtoEnums} ACTION_* constants
* @param statsClient One of {@link BiometricsProtoEnums} CLIENT_* constants
*/
- public HalClientMonitor(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
+ public HalClientMonitor(@NonNull Context context, @NonNull Supplier<T> lazyDaemon,
@Nullable IBinder token, @Nullable ClientMonitorCallbackConverter listener, int userId,
@NonNull String owner, int cookie, int sensorId, int statsModality, int statsAction,
int statsClient) {
@@ -76,6 +57,18 @@
@Nullable
public T getFreshDaemon() {
- return mLazyDaemon.getDaemon();
+ return mLazyDaemon.get();
}
+
+ /**
+ * Starts the HAL operation specific to the ClientMonitor subclass.
+ */
+ protected abstract void startHalOperation();
+
+ /**
+ * Invoked if the scheduler is unable to start the ClientMonitor (for example the HAL is null).
+ * If such a problem is detected, the scheduler will not invoke
+ * {@link #start(ClientMonitorCallback)}.
+ */
+ public abstract void unableToStart();
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/InternalCleanupClient.java b/services/core/java/com/android/server/biometrics/sensors/InternalCleanupClient.java
index 0636893..0e6d11e 100644
--- a/services/core/java/com/android/server/biometrics/sensors/InternalCleanupClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/InternalCleanupClient.java
@@ -28,6 +28,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.function.Supplier;
/**
* Wraps {@link InternalEnumerateClient} and {@link RemovalClient}. Keeps track of all the
@@ -99,14 +100,14 @@
};
protected abstract InternalEnumerateClient<T> getEnumerateClient(Context context,
- LazyDaemon<T> lazyDaemon, IBinder token, int userId, String owner,
+ Supplier<T> lazyDaemon, IBinder token, int userId, String owner,
List<S> enrolledList, BiometricUtils<S> utils, int sensorId);
protected abstract RemovalClient<S, T> getRemovalClient(Context context,
- LazyDaemon<T> lazyDaemon, IBinder token, int biometricId, int userId, String owner,
+ Supplier<T> lazyDaemon, IBinder token, int biometricId, int userId, String owner,
BiometricUtils<S> utils, int sensorId, Map<Integer, Long> authenticatorIds);
- protected InternalCleanupClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
+ protected InternalCleanupClient(@NonNull Context context, @NonNull Supplier<T> lazyDaemon,
int userId, @NonNull String owner, int sensorId, int statsModality,
@NonNull List<S> enrolledList, @NonNull BiometricUtils<S> utils,
@NonNull Map<Integer, Long> authenticatorIds) {
diff --git a/services/core/java/com/android/server/biometrics/sensors/InternalEnumerateClient.java b/services/core/java/com/android/server/biometrics/sensors/InternalEnumerateClient.java
index 05ea19a..5f97f37 100644
--- a/services/core/java/com/android/server/biometrics/sensors/InternalEnumerateClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/InternalEnumerateClient.java
@@ -27,6 +27,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.function.Supplier;
/**
* Internal class to help clean up unknown templates in the HAL and Framework
@@ -43,7 +44,7 @@
// List of templates to remove from the HAL
private List<BiometricAuthenticator.Identifier> mUnknownHALTemplates = new ArrayList<>();
- protected InternalEnumerateClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
+ protected InternalEnumerateClient(@NonNull Context context, @NonNull Supplier<T> lazyDaemon,
@NonNull IBinder token, int userId, @NonNull String owner,
@NonNull List<? extends BiometricAuthenticator.Identifier> enrolledList,
@NonNull BiometricUtils utils, int sensorId, int statsModality) {
diff --git a/services/core/java/com/android/server/biometrics/sensors/InvalidationClient.java b/services/core/java/com/android/server/biometrics/sensors/InvalidationClient.java
index ee6bb0f..697d77c 100644
--- a/services/core/java/com/android/server/biometrics/sensors/InvalidationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/InvalidationClient.java
@@ -27,6 +27,7 @@
import com.android.server.biometrics.BiometricsProto;
import java.util.Map;
+import java.util.function.Supplier;
/**
* ClientMonitor subclass for requesting authenticatorId invalidation. See
@@ -40,7 +41,7 @@
@NonNull private final Map<Integer, Long> mAuthenticatorIds;
@NonNull private final IInvalidationCallback mInvalidationCallback;
- public InvalidationClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
+ public InvalidationClient(@NonNull Context context, @NonNull Supplier<T> lazyDaemon,
int userId, int sensorId, @NonNull Map<Integer, Long> authenticatorIds,
@NonNull IInvalidationCallback callback) {
super(context, lazyDaemon, null /* token */, null /* listener */, userId,
diff --git a/services/core/java/com/android/server/biometrics/sensors/RemovalClient.java b/services/core/java/com/android/server/biometrics/sensors/RemovalClient.java
index e79819b..a0cef94 100644
--- a/services/core/java/com/android/server/biometrics/sensors/RemovalClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/RemovalClient.java
@@ -27,6 +27,7 @@
import com.android.server.biometrics.BiometricsProto;
import java.util.Map;
+import java.util.function.Supplier;
/**
* A class to keep track of the remove state for a given client.
@@ -40,7 +41,7 @@
private final Map<Integer, Long> mAuthenticatorIds;
private final boolean mHasEnrollmentsBeforeStarting;
- public RemovalClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
+ public RemovalClient(@NonNull Context context, @NonNull Supplier<T> lazyDaemon,
@NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener,
int userId, @NonNull String owner, @NonNull BiometricUtils<S> utils, int sensorId,
@NonNull Map<Integer, Long> authenticatorIds, int statsModality) {
diff --git a/services/core/java/com/android/server/biometrics/sensors/RevokeChallengeClient.java b/services/core/java/com/android/server/biometrics/sensors/RevokeChallengeClient.java
index 21a6ddf..7d83863 100644
--- a/services/core/java/com/android/server/biometrics/sensors/RevokeChallengeClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/RevokeChallengeClient.java
@@ -23,9 +23,11 @@
import com.android.server.biometrics.BiometricsProto;
+import java.util.function.Supplier;
+
public abstract class RevokeChallengeClient<T> extends HalClientMonitor<T> {
- public RevokeChallengeClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
+ public RevokeChallengeClient(@NonNull Context context, @NonNull Supplier<T> lazyDaemon,
@NonNull IBinder token, int userId, @NonNull String owner, int sensorId) {
super(context, lazyDaemon, token, null /* listener */, userId, owner,
0 /* cookie */, sensorId, BiometricsProtoEnums.MODALITY_UNKNOWN,
diff --git a/services/core/java/com/android/server/biometrics/sensors/StartUserClient.java b/services/core/java/com/android/server/biometrics/sensors/StartUserClient.java
index 3d69326..1bc3248 100644
--- a/services/core/java/com/android/server/biometrics/sensors/StartUserClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/StartUserClient.java
@@ -25,6 +25,8 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.server.biometrics.BiometricsProto;
+import java.util.function.Supplier;
+
/**
* Abstract class for starting a new user.
* @param <T> Interface to request a new user.
@@ -37,13 +39,13 @@
* @param <U> New user object.
*/
public interface UserStartedCallback<U> {
- void onUserStarted(int newUserId, U newUser);
+ void onUserStarted(int newUserId, U newUser, int halInterfaceVersion);
}
@NonNull @VisibleForTesting
protected final UserStartedCallback<U> mUserStartedCallback;
- public StartUserClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
+ public StartUserClient(@NonNull Context context, @NonNull Supplier<T> lazyDaemon,
@Nullable IBinder token, int userId, int sensorId,
@NonNull UserStartedCallback<U> callback) {
super(context, lazyDaemon, token, null /* listener */, userId, context.getOpPackageName(),
diff --git a/services/core/java/com/android/server/biometrics/sensors/StopUserClient.java b/services/core/java/com/android/server/biometrics/sensors/StopUserClient.java
index 1f6e1e9..3eafbb8 100644
--- a/services/core/java/com/android/server/biometrics/sensors/StopUserClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/StopUserClient.java
@@ -25,6 +25,8 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.server.biometrics.BiometricsProto;
+import java.util.function.Supplier;
+
/**
* Abstract class for stopping a user.
* @param <T> Interface for stopping the user.
@@ -43,7 +45,7 @@
getCallback().onClientFinished(this, true /* success */);
}
- public StopUserClient(@NonNull Context context, @NonNull LazyDaemon<T> lazyDaemon,
+ public StopUserClient(@NonNull Context context, @NonNull Supplier<T> lazyDaemon,
@Nullable IBinder token, int userId, int sensorId,
@NonNull UserStoppedCallback callback) {
super(context, lazyDaemon, token, null /* listener */, userId, context.getOpPackageName(),
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/AidlSession.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/AidlSession.java
new file mode 100644
index 0000000..006667a
--- /dev/null
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/AidlSession.java
@@ -0,0 +1,66 @@
+/*
+ * 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.server.biometrics.sensors.face.aidl;
+
+import android.annotation.NonNull;
+import android.hardware.biometrics.face.ISession;
+
+import static com.android.server.biometrics.sensors.face.aidl.Sensor.HalSessionCallback;
+
+/**
+ * A holder for an AIDL {@link ISession} with additional metadata about the current user
+ * and the backend.
+ */
+public class AidlSession {
+
+ private final int mHalInterfaceVersion;
+ @NonNull
+ private final ISession mSession;
+ private final int mUserId;
+ @NonNull private final HalSessionCallback mHalSessionCallback;
+
+ public AidlSession(int halInterfaceVersion, @NonNull ISession session, int userId,
+ HalSessionCallback halSessionCallback) {
+ mHalInterfaceVersion = halInterfaceVersion;
+ mSession = session;
+ mUserId = userId;
+ mHalSessionCallback = halSessionCallback;
+ }
+
+ /** The underlying {@link ISession}. */
+ @NonNull public ISession getSession() {
+ return mSession;
+ }
+
+ /** The user id associated with the session. */
+ public int getUserId() {
+ return mUserId;
+ }
+
+ /** The HAL callback, which should only be used in tests {@See BiometricTestSessionImpl}. */
+ HalSessionCallback getHalSessionCallback() {
+ return mHalSessionCallback;
+ }
+
+ /**
+ * If this backend implements the *WithContext methods for enroll, authenticate, and
+ * detectInteraction. These variants should always be called if they are available.
+ */
+ public boolean hasContextMethods() {
+ return mHalInterfaceVersion >= 2;
+ }
+}
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/BiometricTestSessionImpl.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/BiometricTestSessionImpl.java
index 8998269..9bd7476 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/BiometricTestSessionImpl.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/BiometricTestSessionImpl.java
@@ -165,7 +165,7 @@
}
mEnrollmentIds.add(nextRandomId);
- mSensor.getSessionForUser(userId).mHalSessionCallback
+ mSensor.getSessionForUser(userId).getHalSessionCallback()
.onEnrollmentProgress(nextRandomId, 0 /* remaining */);
}
@@ -181,7 +181,7 @@
return;
}
final int fid = faces.get(0).getBiometricId();
- mSensor.getSessionForUser(userId).mHalSessionCallback.onAuthenticationSucceeded(fid,
+ mSensor.getSessionForUser(userId).getHalSessionCallback().onAuthenticationSucceeded(fid,
HardwareAuthTokenUtils.toHardwareAuthToken(new byte[69]));
}
@@ -189,7 +189,7 @@
public void rejectAuthentication(int userId) {
Utils.checkPermission(mContext, TEST_BIOMETRIC);
- mSensor.getSessionForUser(userId).mHalSessionCallback.onAuthenticationFailed();
+ mSensor.getSessionForUser(userId).getHalSessionCallback().onAuthenticationFailed();
}
// TODO(b/178414967): replace with notifyAuthenticationFrame and notifyEnrollmentFrame.
@@ -205,7 +205,7 @@
// TODO(b/178414967): Currently onAuthenticationFrame and onEnrollmentFrame are the same.
// This will need to call the correct callback once the onAcquired callback is removed.
- mSensor.getSessionForUser(userId).mHalSessionCallback.onAuthenticationFrame(
+ mSensor.getSessionForUser(userId).getHalSessionCallback().onAuthenticationFrame(
authenticationFrame);
}
@@ -213,7 +213,7 @@
public void notifyError(int userId, int errorCode) {
Utils.checkPermission(mContext, TEST_BIOMETRIC);
- mSensor.getSessionForUser(userId).mHalSessionCallback.onError((byte) errorCode,
+ mSensor.getSessionForUser(userId).getHalSessionCallback().onError((byte) errorCode,
0 /* vendorCode */);
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java
index dc21a04f..c4e0502 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java
@@ -27,8 +27,9 @@
import android.hardware.biometrics.BiometricFaceConstants;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.common.ICancellationSignal;
+import android.hardware.biometrics.common.OperationContext;
+import android.hardware.biometrics.common.OperationReason;
import android.hardware.biometrics.face.IFace;
-import android.hardware.biometrics.face.ISession;
import android.hardware.face.FaceAuthenticationFrame;
import android.hardware.face.FaceManager;
import android.os.IBinder;
@@ -48,11 +49,13 @@
import com.android.server.biometrics.sensors.face.UsageStats;
import java.util.ArrayList;
+import java.util.function.Supplier;
/**
* Face-specific authentication client for the {@link IFace} AIDL HAL interface.
*/
-class FaceAuthenticationClient extends AuthenticationClient<ISession> implements LockoutConsumer {
+class FaceAuthenticationClient extends AuthenticationClient<AidlSession>
+ implements LockoutConsumer {
private static final String TAG = "FaceAuthenticationClient";
@NonNull private final UsageStats mUsageStats;
@@ -69,7 +72,7 @@
@FaceManager.FaceAcquired private int mLastAcquire = FaceManager.FACE_ACQUIRED_UNKNOWN;
FaceAuthenticationClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon,
+ @NonNull Supplier<AidlSession> lazyDaemon,
@NonNull IBinder token, long requestId,
@NonNull ClientMonitorCallbackConverter listener, int targetUserId, long operationId,
boolean restricted, String owner, int cookie, boolean requireConfirmation, int sensorId,
@@ -122,7 +125,7 @@
0 /* vendorCode */);
mCallback.onClientFinished(this, false /* success */);
} else {
- mCancellationSignal = getFreshDaemon().authenticate(mOperationId);
+ mCancellationSignal = doAuthenticate();
}
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception when requesting auth", e);
@@ -131,6 +134,22 @@
}
}
+ private ICancellationSignal doAuthenticate() throws RemoteException {
+ final AidlSession session = getFreshDaemon();
+
+ if (session.hasContextMethods()) {
+ final OperationContext context = new OperationContext();
+ // TODO: add reason, id, and isAoD
+ context.id = 0;
+ context.reason = OperationReason.UNKNOWN;
+ context.isAoD = false;
+ context.isCrypto = isCryptoOperation();
+ return session.getSession().authenticateWithContext(mOperationId, context);
+ } else {
+ return session.getSession().authenticate(mOperationId);
+ }
+ }
+
@Override
protected void stopHalOperation() {
if (mCancellationSignal != null) {
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceDetectClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceDetectClient.java
index 72a20db07..3f3db43 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceDetectClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceDetectClient.java
@@ -23,7 +23,8 @@
import android.hardware.biometrics.BiometricConstants;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.common.ICancellationSignal;
-import android.hardware.biometrics.face.ISession;
+import android.hardware.biometrics.common.OperationContext;
+import android.hardware.biometrics.common.OperationReason;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
@@ -34,11 +35,13 @@
import com.android.server.biometrics.sensors.ClientMonitorCallbackConverter;
import com.android.server.biometrics.sensors.DetectionConsumer;
+import java.util.function.Supplier;
+
/**
* Performs face detection without exposing any matching information (e.g. accept/reject have the
* same haptic, lockout counter is not increased).
*/
-public class FaceDetectClient extends AcquisitionClient<ISession> implements DetectionConsumer {
+public class FaceDetectClient extends AcquisitionClient<AidlSession> implements DetectionConsumer {
private static final String TAG = "FaceDetectClient";
@@ -46,7 +49,7 @@
@Nullable private ICancellationSignal mCancellationSignal;
@Nullable private SensorPrivacyManager mSensorPrivacyManager;
- public FaceDetectClient(@NonNull Context context, @NonNull LazyDaemon<ISession> lazyDaemon,
+ FaceDetectClient(@NonNull Context context, @NonNull Supplier<AidlSession> lazyDaemon,
@NonNull IBinder token, long requestId,
@NonNull ClientMonitorCallbackConverter listener, int userId,
@NonNull String owner, int sensorId, boolean isStrongBiometric, int statsClient) {
@@ -87,13 +90,29 @@
}
try {
- mCancellationSignal = getFreshDaemon().detectInteraction();
+ mCancellationSignal = doDetectInteraction();
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception when requesting face detect", e);
mCallback.onClientFinished(this, false /* success */);
}
}
+ private ICancellationSignal doDetectInteraction() throws RemoteException {
+ final AidlSession session = getFreshDaemon();
+
+ if (session.hasContextMethods()) {
+ final OperationContext context = new OperationContext();
+ // TODO: add reason, id, and isAoD
+ context.id = 0;
+ context.reason = OperationReason.UNKNOWN;
+ context.isAoD = false;
+ context.isCrypto = isCryptoOperation();
+ return session.getSession().detectInteractionWithContext(context);
+ } else {
+ return session.getSession().detectInteraction();
+ }
+ }
+
@Override
public void onInteractionDetected() {
vibrateSuccess();
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 5c57dbb..8dc53b6 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
@@ -22,14 +22,16 @@
import android.hardware.biometrics.BiometricFaceConstants;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.common.ICancellationSignal;
+import android.hardware.biometrics.common.OperationContext;
+import android.hardware.biometrics.common.OperationReason;
import android.hardware.biometrics.face.EnrollmentType;
import android.hardware.biometrics.face.Feature;
import android.hardware.biometrics.face.IFace;
-import android.hardware.biometrics.face.ISession;
import android.hardware.common.NativeHandle;
import android.hardware.face.Face;
import android.hardware.face.FaceEnrollFrame;
import android.hardware.face.FaceManager;
+import android.hardware.keymaster.HardwareAuthToken;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
@@ -51,11 +53,12 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import java.util.function.Supplier;
/**
* Face-specific enroll client for the {@link IFace} AIDL HAL interface.
*/
-public class FaceEnrollClient extends EnrollClient<ISession> {
+public class FaceEnrollClient extends EnrollClient<AidlSession> {
private static final String TAG = "FaceEnrollClient";
@@ -82,7 +85,7 @@
}
};
- FaceEnrollClient(@NonNull Context context, @NonNull LazyDaemon<ISession> lazyDaemon,
+ FaceEnrollClient(@NonNull Context context, @NonNull Supplier<AidlSession> lazyDaemon,
@NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener, int userId,
@NonNull byte[] hardwareAuthToken, @NonNull String opPackageName, long requestId,
@NonNull BiometricUtils<Face> utils, @NonNull int[] disabledFeatures, int timeoutSec,
@@ -177,14 +180,12 @@
featureList.add(Feature.REQUIRE_DIVERSE_POSES);
}
- byte[] features = new byte[featureList.size()];
+ final byte[] features = new byte[featureList.size()];
for (int i = 0; i < featureList.size(); i++) {
features[i] = featureList.get(i);
}
- mCancellationSignal = getFreshDaemon().enroll(
- HardwareAuthTokenUtils.toHardwareAuthToken(mHardwareAuthToken),
- EnrollmentType.DEFAULT, features, mHwPreviewHandle);
+ mCancellationSignal = doEnroll(features);
} catch (RemoteException | IllegalArgumentException e) {
Slog.e(TAG, "Exception when requesting enroll", e);
onError(BiometricFaceConstants.FACE_ERROR_UNABLE_TO_PROCESS, 0 /* vendorCode */);
@@ -192,6 +193,26 @@
}
}
+ private ICancellationSignal doEnroll(byte[] features) throws RemoteException {
+ final AidlSession session = getFreshDaemon();
+ final HardwareAuthToken hat =
+ HardwareAuthTokenUtils.toHardwareAuthToken(mHardwareAuthToken);
+
+ if (session.hasContextMethods()) {
+ final OperationContext context = new OperationContext();
+ // TODO: add reason, id, and isAoD
+ context.id = 0;
+ context.reason = OperationReason.UNKNOWN;
+ context.isAoD = false;
+ context.isCrypto = isCryptoOperation();
+ return session.getSession().enrollWithContext(
+ hat, EnrollmentType.DEFAULT, features, mHwPreviewHandle, context);
+ } else {
+ return session.getSession().enroll(hat, EnrollmentType.DEFAULT, features,
+ mHwPreviewHandle);
+ }
+ }
+
@Override
protected void stopHalOperation() {
if (mCancellationSignal != null) {
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceGenerateChallengeClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceGenerateChallengeClient.java
index 7cdeebb..bdad268 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceGenerateChallengeClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceGenerateChallengeClient.java
@@ -19,7 +19,6 @@
import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.face.IFace;
-import android.hardware.biometrics.face.ISession;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
@@ -27,14 +26,16 @@
import com.android.server.biometrics.sensors.ClientMonitorCallbackConverter;
import com.android.server.biometrics.sensors.GenerateChallengeClient;
+import java.util.function.Supplier;
+
/**
* Face-specific generateChallenge client for the {@link IFace} AIDL HAL interface.
*/
-public class FaceGenerateChallengeClient extends GenerateChallengeClient<ISession> {
+public class FaceGenerateChallengeClient extends GenerateChallengeClient<AidlSession> {
private static final String TAG = "FaceGenerateChallengeClient";
FaceGenerateChallengeClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<AidlSession> lazyDaemon, @NonNull IBinder token,
@NonNull ClientMonitorCallbackConverter listener, int userId, @NonNull String owner,
int sensorId) {
super(context, lazyDaemon, token, listener, userId, owner, sensorId);
@@ -43,7 +44,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().generateChallenge();
+ getFreshDaemon().getSession().generateChallenge();
} catch (RemoteException e) {
Slog.e(TAG, "Unable to generateChallenge", e);
mCallback.onClientFinished(this, false /* success */);
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceGetAuthenticatorIdClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceGetAuthenticatorIdClient.java
index 584b58c..2f3187b 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceGetAuthenticatorIdClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceGetAuthenticatorIdClient.java
@@ -19,7 +19,6 @@
import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.BiometricsProtoEnums;
-import android.hardware.biometrics.face.ISession;
import android.os.RemoteException;
import android.util.Slog;
@@ -28,14 +27,16 @@
import com.android.server.biometrics.sensors.HalClientMonitor;
import java.util.Map;
+import java.util.function.Supplier;
-class FaceGetAuthenticatorIdClient extends HalClientMonitor<ISession> {
+class FaceGetAuthenticatorIdClient extends HalClientMonitor<AidlSession> {
private static final String TAG = "FaceGetAuthenticatorIdClient";
private final Map<Integer, Long> mAuthenticatorIds;
- FaceGetAuthenticatorIdClient(@NonNull Context context, @NonNull LazyDaemon<ISession> lazyDaemon,
+ FaceGetAuthenticatorIdClient(@NonNull Context context,
+ @NonNull Supplier<AidlSession> lazyDaemon,
int userId, @NonNull String opPackageName, int sensorId,
Map<Integer, Long> authenticatorIds) {
super(context, lazyDaemon, null /* token */, null /* listener */, userId, opPackageName,
@@ -57,7 +58,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().getAuthenticatorId();
+ getFreshDaemon().getSession().getAuthenticatorId();
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception", e);
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceGetFeatureClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceGetFeatureClient.java
index acf5720..79479be 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceGetFeatureClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceGetFeatureClient.java
@@ -22,7 +22,6 @@
import android.hardware.biometrics.BiometricFaceConstants;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.face.IFace;
-import android.hardware.biometrics.face.ISession;
import android.os.IBinder;
import android.os.RemoteException;
import android.provider.Settings;
@@ -36,17 +35,18 @@
import java.util.HashMap;
import java.util.Map;
+import java.util.function.Supplier;
/**
* Face-specific get feature client for the {@link IFace} AIDL HAL interface.
*/
-public class FaceGetFeatureClient extends HalClientMonitor<ISession> implements ErrorConsumer {
+public class FaceGetFeatureClient extends HalClientMonitor<AidlSession> implements ErrorConsumer {
private static final String TAG = "FaceGetFeatureClient";
private final int mUserId;
- FaceGetFeatureClient(@NonNull Context context, @NonNull LazyDaemon<ISession> lazyDaemon,
+ FaceGetFeatureClient(@NonNull Context context, @NonNull Supplier<AidlSession> lazyDaemon,
@NonNull IBinder token, @Nullable ClientMonitorCallbackConverter listener, int userId,
@NonNull String owner, int sensorId) {
super(context, lazyDaemon, token, listener, userId, owner, 0 /* cookie */, sensorId,
@@ -69,7 +69,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().getFeatures();
+ getFreshDaemon().getSession().getFeatures();
} catch (RemoteException e) {
Slog.e(TAG, "Unable to getFeature", e);
mCallback.onClientFinished(this, false /* success */);
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInternalCleanupClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInternalCleanupClient.java
index c6696aed..a2b0339 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInternalCleanupClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInternalCleanupClient.java
@@ -20,7 +20,6 @@
import android.content.Context;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.face.IFace;
-import android.hardware.biometrics.face.ISession;
import android.hardware.face.Face;
import android.os.IBinder;
@@ -31,14 +30,15 @@
import java.util.List;
import java.util.Map;
+import java.util.function.Supplier;
/**
* Face-specific internal cleanup client for the {@link IFace} AIDL HAL interface.
*/
-class FaceInternalCleanupClient extends InternalCleanupClient<Face, ISession> {
+class FaceInternalCleanupClient extends InternalCleanupClient<Face, AidlSession> {
FaceInternalCleanupClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, int userId, @NonNull String owner,
+ @NonNull Supplier<AidlSession> lazyDaemon, int userId, @NonNull String owner,
int sensorId, @NonNull List<Face> enrolledList, @NonNull BiometricUtils<Face> utils,
@NonNull Map<Integer, Long> authenticatorIds) {
super(context, lazyDaemon, userId, owner, sensorId, BiometricsProtoEnums.MODALITY_FACE,
@@ -46,16 +46,16 @@
}
@Override
- protected InternalEnumerateClient<ISession> getEnumerateClient(Context context,
- LazyDaemon<ISession> lazyDaemon, IBinder token, int userId, String owner,
+ protected InternalEnumerateClient<AidlSession> getEnumerateClient(Context context,
+ Supplier<AidlSession> lazyDaemon, IBinder token, int userId, String owner,
List<Face> enrolledList, BiometricUtils<Face> utils, int sensorId) {
return new FaceInternalEnumerateClient(context, lazyDaemon, token, userId, owner,
enrolledList, utils, sensorId);
}
@Override
- protected RemovalClient<Face, ISession> getRemovalClient(Context context,
- LazyDaemon<ISession> lazyDaemon, IBinder token,
+ protected RemovalClient<Face, AidlSession> getRemovalClient(Context context,
+ Supplier<AidlSession> lazyDaemon, IBinder token,
int biometricId, int userId, String owner, BiometricUtils<Face> utils, int sensorId,
Map<Integer, Long> authenticatorIds) {
// Internal remove does not need to send results to anyone. Cleanup (enumerate + remove)
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInternalEnumerateClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInternalEnumerateClient.java
index 0ece884..88c9d3b 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInternalEnumerateClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInternalEnumerateClient.java
@@ -20,7 +20,6 @@
import android.content.Context;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.face.IFace;
-import android.hardware.biometrics.face.ISession;
import android.hardware.face.Face;
import android.os.IBinder;
import android.os.RemoteException;
@@ -30,15 +29,16 @@
import com.android.server.biometrics.sensors.InternalEnumerateClient;
import java.util.List;
+import java.util.function.Supplier;
/**
* Face-specific internal enumerate client for the {@link IFace} AIDL HAL interface.
*/
-class FaceInternalEnumerateClient extends InternalEnumerateClient<ISession> {
+class FaceInternalEnumerateClient extends InternalEnumerateClient<AidlSession> {
private static final String TAG = "FaceInternalEnumerateClient";
FaceInternalEnumerateClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, @NonNull IBinder token, int userId,
+ @NonNull Supplier<AidlSession> lazyDaemon, @NonNull IBinder token, int userId,
@NonNull String owner, @NonNull List<Face> enrolledList,
@NonNull BiometricUtils<Face> utils, int sensorId) {
super(context, lazyDaemon, token, userId, owner, enrolledList, utils, sensorId,
@@ -48,7 +48,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().enumerateEnrollments();
+ getFreshDaemon().getSession().enumerateEnrollments();
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception when requesting enumerate", e);
mCallback.onClientFinished(this, false /* success */);
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInvalidationClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInvalidationClient.java
index 405e2b2..04ea2cfc 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInvalidationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInvalidationClient.java
@@ -19,7 +19,6 @@
import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.IInvalidationCallback;
-import android.hardware.biometrics.face.ISession;
import android.hardware.face.Face;
import android.os.RemoteException;
import android.util.Slog;
@@ -27,12 +26,13 @@
import com.android.server.biometrics.sensors.InvalidationClient;
import java.util.Map;
+import java.util.function.Supplier;
-public class FaceInvalidationClient extends InvalidationClient<Face, ISession> {
+public class FaceInvalidationClient extends InvalidationClient<Face, AidlSession> {
private static final String TAG = "FaceInvalidationClient";
public FaceInvalidationClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, int userId, int sensorId,
+ @NonNull Supplier<AidlSession> lazyDaemon, int userId, int sensorId,
@NonNull Map<Integer, Long> authenticatorIds, @NonNull IInvalidationCallback callback) {
super(context, lazyDaemon, userId, sensorId, authenticatorIds, callback);
}
@@ -40,7 +40,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().invalidateAuthenticatorId();
+ getFreshDaemon().getSession().invalidateAuthenticatorId();
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception", e);
mCallback.onClientFinished(this, false /* success */);
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceRemovalClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceRemovalClient.java
index ba678f3..130a05a 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceRemovalClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceRemovalClient.java
@@ -20,7 +20,6 @@
import android.content.Context;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.face.IFace;
-import android.hardware.biometrics.face.ISession;
import android.hardware.face.Face;
import android.os.IBinder;
import android.os.RemoteException;
@@ -31,16 +30,17 @@
import com.android.server.biometrics.sensors.RemovalClient;
import java.util.Map;
+import java.util.function.Supplier;
/**
* Face-specific removal client for the {@link IFace} AIDL HAL interface.
*/
-class FaceRemovalClient extends RemovalClient<Face, ISession> {
+class FaceRemovalClient extends RemovalClient<Face, AidlSession> {
private static final String TAG = "FaceRemovalClient";
final int[] mBiometricIds;
- FaceRemovalClient(@NonNull Context context, @NonNull LazyDaemon<ISession> lazyDaemon,
+ FaceRemovalClient(@NonNull Context context, @NonNull Supplier<AidlSession> lazyDaemon,
@NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener,
int[] biometricIds, int userId, @NonNull String owner,
@NonNull BiometricUtils<Face> utils, int sensorId,
@@ -53,7 +53,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().removeEnrollments(mBiometricIds);
+ getFreshDaemon().getSession().removeEnrollments(mBiometricIds);
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception when requesting remove", e);
mCallback.onClientFinished(this, false /* success */);
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceResetLockoutClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceResetLockoutClient.java
index fd44c5c..67bf3f5 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceResetLockoutClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceResetLockoutClient.java
@@ -20,7 +20,6 @@
import android.content.Context;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.face.IFace;
-import android.hardware.biometrics.face.ISession;
import android.hardware.keymaster.HardwareAuthToken;
import android.os.RemoteException;
import android.util.Slog;
@@ -34,12 +33,14 @@
import com.android.server.biometrics.sensors.LockoutResetDispatcher;
import com.android.server.biometrics.sensors.LockoutTracker;
+import java.util.function.Supplier;
+
/**
* Face-specific resetLockout client for the {@link IFace} AIDL HAL interface.
* Updates the framework's lockout cache and notifies clients such as Keyguard when lockout is
* cleared.
*/
-public class FaceResetLockoutClient extends HalClientMonitor<ISession> implements ErrorConsumer {
+public class FaceResetLockoutClient extends HalClientMonitor<AidlSession> implements ErrorConsumer {
private static final String TAG = "FaceResetLockoutClient";
@@ -48,7 +49,7 @@
private final LockoutResetDispatcher mLockoutResetDispatcher;
FaceResetLockoutClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, int userId, String owner, int sensorId,
+ @NonNull Supplier<AidlSession> lazyDaemon, int userId, String owner, int sensorId,
@NonNull byte[] hardwareAuthToken, @NonNull LockoutCache lockoutTracker,
@NonNull LockoutResetDispatcher lockoutResetDispatcher) {
super(context, lazyDaemon, null /* token */, null /* listener */, userId, owner,
@@ -73,7 +74,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().resetLockout(mHardwareAuthToken);
+ getFreshDaemon().getSession().resetLockout(mHardwareAuthToken);
} catch (RemoteException e) {
Slog.e(TAG, "Unable to reset lockout", e);
mCallback.onClientFinished(this, false /* success */);
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceRevokeChallengeClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceRevokeChallengeClient.java
index 7a69c44..acd2e05 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceRevokeChallengeClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceRevokeChallengeClient.java
@@ -19,24 +19,25 @@
import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.face.IFace;
-import android.hardware.biometrics.face.ISession;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
import com.android.server.biometrics.sensors.RevokeChallengeClient;
+import java.util.function.Supplier;
+
/**
* Face-specific revokeChallenge client for the {@link IFace} AIDL HAL interface.
*/
-public class FaceRevokeChallengeClient extends RevokeChallengeClient<ISession> {
+public class FaceRevokeChallengeClient extends RevokeChallengeClient<AidlSession> {
private static final String TAG = "FaceRevokeChallengeClient";
private final long mChallenge;
FaceRevokeChallengeClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<AidlSession> lazyDaemon, @NonNull IBinder token,
int userId, @NonNull String owner, int sensorId, long challenge) {
super(context, lazyDaemon, token, userId, owner, sensorId);
mChallenge = challenge;
@@ -45,7 +46,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().revokeChallenge(mChallenge);
+ getFreshDaemon().getSession().revokeChallenge(mChallenge);
} catch (RemoteException e) {
Slog.e(TAG, "Unable to revokeChallenge", e);
mCallback.onClientFinished(this, false /* success */);
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceSetFeatureClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceSetFeatureClient.java
index ee6982a..9d535a2 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceSetFeatureClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceSetFeatureClient.java
@@ -20,7 +20,6 @@
import android.content.Context;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.face.IFace;
-import android.hardware.biometrics.face.ISession;
import android.hardware.keymaster.HardwareAuthToken;
import android.os.IBinder;
import android.os.RemoteException;
@@ -33,10 +32,12 @@
import com.android.server.biometrics.sensors.ErrorConsumer;
import com.android.server.biometrics.sensors.HalClientMonitor;
+import java.util.function.Supplier;
+
/**
* Face-specific get feature client for the {@link IFace} AIDL HAL interface.
*/
-public class FaceSetFeatureClient extends HalClientMonitor<ISession> implements ErrorConsumer {
+public class FaceSetFeatureClient extends HalClientMonitor<AidlSession> implements ErrorConsumer {
private static final String TAG = "FaceSetFeatureClient";
@@ -44,7 +45,7 @@
private final boolean mEnabled;
private final HardwareAuthToken mHardwareAuthToken;
- FaceSetFeatureClient(@NonNull Context context, @NonNull LazyDaemon<ISession> lazyDaemon,
+ FaceSetFeatureClient(@NonNull Context context, @NonNull Supplier<AidlSession> lazyDaemon,
@NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener, int userId,
@NonNull String owner, int sensorId, int feature, boolean enabled,
byte[] hardwareAuthToken) {
@@ -74,8 +75,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon()
- .setFeature(mHardwareAuthToken,
+ getFreshDaemon().getSession().setFeature(mHardwareAuthToken,
AidlConversionUtils.convertFrameworkToAidlFeature(mFeature), mEnabled);
} catch (RemoteException | IllegalArgumentException e) {
Slog.e(TAG, "Unable to set feature: " + mFeature + " to enabled: " + mEnabled, e);
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceStartUserClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceStartUserClient.java
index 4a3da0d..f5a98ff 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceStartUserClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceStartUserClient.java
@@ -30,12 +30,15 @@
import com.android.server.biometrics.sensors.ClientMonitorCallback;
import com.android.server.biometrics.sensors.StartUserClient;
+import java.util.function.Supplier;
+
public class FaceStartUserClient extends StartUserClient<IFace, ISession> {
private static final String TAG = "FaceStartUserClient";
@NonNull private final ISessionCallback mSessionCallback;
- public FaceStartUserClient(@NonNull Context context, @NonNull LazyDaemon<IFace> lazyDaemon,
+ public FaceStartUserClient(@NonNull Context context,
+ @NonNull Supplier<IFace> lazyDaemon,
@Nullable IBinder token, int userId, int sensorId,
@NonNull ISessionCallback sessionCallback,
@NonNull UserStartedCallback<ISession> callback) {
@@ -52,10 +55,12 @@
@Override
protected void startHalOperation() {
try {
- final ISession newSession = getFreshDaemon().createSession(getSensorId(),
+ final IFace hal = getFreshDaemon();
+ final int version = hal.getInterfaceVersion();
+ final ISession newSession = hal.createSession(getSensorId(),
getTargetUserId(), mSessionCallback);
Binder.allowBlocking(newSession.asBinder());
- mUserStartedCallback.onUserStarted(getTargetUserId(), newSession);
+ mUserStartedCallback.onUserStarted(getTargetUserId(), newSession, version);
getCallback().onClientFinished(this, true /* success */);
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception", e);
@@ -65,6 +70,5 @@
@Override
public void unableToStart() {
-
}
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceStopUserClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceStopUserClient.java
index 88b9235..48b4856 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceStopUserClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceStopUserClient.java
@@ -19,7 +19,6 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
-import android.hardware.biometrics.face.ISession;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
@@ -27,10 +26,12 @@
import com.android.server.biometrics.sensors.ClientMonitorCallback;
import com.android.server.biometrics.sensors.StopUserClient;
-public class FaceStopUserClient extends StopUserClient<ISession> {
+import java.util.function.Supplier;
+
+public class FaceStopUserClient extends StopUserClient<AidlSession> {
private static final String TAG = "FaceStopUserClient";
- public FaceStopUserClient(@NonNull Context context, @NonNull LazyDaemon<ISession> lazyDaemon,
+ public FaceStopUserClient(@NonNull Context context, @NonNull Supplier<AidlSession> lazyDaemon,
@Nullable IBinder token, int userId, int sensorId,
@NonNull UserStoppedCallback callback) {
super(context, lazyDaemon, token, userId, sensorId, callback);
@@ -45,7 +46,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().close();
+ getFreshDaemon().getSession().close();
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception", e);
getCallback().onClientFinished(this, false /* success */);
@@ -54,6 +55,5 @@
@Override
public void unableToStart() {
-
}
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/Sensor.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/Sensor.java
index 206b8f0..33e6fa4 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/Sensor.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/Sensor.java
@@ -53,7 +53,6 @@
import com.android.server.biometrics.sensors.BiometricScheduler;
import com.android.server.biometrics.sensors.EnumerateConsumer;
import com.android.server.biometrics.sensors.ErrorConsumer;
-import com.android.server.biometrics.sensors.HalClientMonitor;
import com.android.server.biometrics.sensors.Interruptable;
import com.android.server.biometrics.sensors.LockoutCache;
import com.android.server.biometrics.sensors.LockoutConsumer;
@@ -67,6 +66,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
+import java.util.function.Supplier;
/**
* Maintains the state of a single sensor within an instance of the {@link IFace} HAL.
@@ -84,24 +84,9 @@
@NonNull private final UserAwareBiometricScheduler mScheduler;
@NonNull private final LockoutCache mLockoutCache;
@NonNull private final Map<Integer, Long> mAuthenticatorIds;
- @NonNull private final HalClientMonitor.LazyDaemon<ISession> mLazySession;
- @Nullable private Session mCurrentSession;
- static class Session {
- @NonNull final HalSessionCallback mHalSessionCallback;
- @NonNull private final String mTag;
- @NonNull private final ISession mSession;
- private final int mUserId;
-
- Session(@NonNull String tag, @NonNull ISession session, int userId,
- @NonNull HalSessionCallback halSessionCallback) {
- mTag = tag;
- mSession = session;
- mUserId = userId;
- mHalSessionCallback = halSessionCallback;
- Slog.d(mTag, "New session created for user: " + userId);
- }
- }
+ @NonNull private final Supplier<AidlSession> mLazySession;
+ @Nullable private AidlSession mCurrentSession;
static class HalSessionCallback extends ISessionCallback.Stub {
/**
@@ -496,7 +481,7 @@
mSensorProperties = sensorProperties;
mScheduler = new UserAwareBiometricScheduler(tag,
BiometricScheduler.SENSOR_TYPE_FACE, null /* gestureAvailabilityDispatcher */,
- () -> mCurrentSession != null ? mCurrentSession.mUserId : UserHandle.USER_NULL,
+ () -> mCurrentSession != null ? mCurrentSession.getUserId() : UserHandle.USER_NULL,
new UserAwareBiometricScheduler.UserSwitchCallback() {
@NonNull
@Override
@@ -508,21 +493,22 @@
@NonNull
@Override
public StartUserClient<?, ?> getStartUserClient(int newUserId) {
- final HalSessionCallback.Callback callback = () -> {
- Slog.e(mTag, "Got ERROR_HW_UNAVAILABLE");
- mCurrentSession = null;
- };
-
final int sensorId = mSensorProperties.sensorId;
final HalSessionCallback resultController = new HalSessionCallback(mContext,
mHandler, mTag, mScheduler, sensorId, newUserId, mLockoutCache,
- lockoutResetDispatcher, callback);
+ lockoutResetDispatcher, () -> {
+ Slog.e(mTag, "Got ERROR_HW_UNAVAILABLE");
+ mCurrentSession = null;
+ });
final StartUserClient.UserStartedCallback<ISession> userStartedCallback =
- (userIdStarted, newSession) -> {
- mCurrentSession = new Session(mTag, newSession, userIdStarted,
- resultController);
+ (userIdStarted, newSession, halInterfaceVersion) -> {
+ Slog.d(mTag, "New session created for user: "
+ + userIdStarted + " with hal version: "
+ + halInterfaceVersion);
+ mCurrentSession = new AidlSession(halInterfaceVersion,
+ newSession, userIdStarted, resultController);
if (FaceUtils.getLegacyInstance(sensorId)
.isInvalidationInProgress(mContext, userIdStarted)) {
Slog.w(mTag,
@@ -542,10 +528,10 @@
});
mLockoutCache = new LockoutCache();
mAuthenticatorIds = new HashMap<>();
- mLazySession = () -> mCurrentSession != null ? mCurrentSession.mSession : null;
+ mLazySession = () -> mCurrentSession != null ? mCurrentSession : null;
}
- @NonNull HalClientMonitor.LazyDaemon<ISession> getLazySession() {
+ @NonNull Supplier<AidlSession> getLazySession() {
return mLazySession;
}
@@ -553,8 +539,8 @@
return mSensorProperties;
}
- @Nullable Session getSessionForUser(int userId) {
- if (mCurrentSession != null && mCurrentSession.mUserId == userId) {
+ @Nullable AidlSession getSessionForUser(int userId) {
+ if (mCurrentSession != null && mCurrentSession.getUserId() == userId) {
return mCurrentSession;
} else {
return null;
@@ -583,10 +569,10 @@
if (enabled != mTestHalEnabled) {
// The framework should retrieve a new session from the HAL.
try {
- if (mCurrentSession != null && mCurrentSession.mSession != null) {
+ if (mCurrentSession != null) {
// TODO(181984005): This should be scheduled instead of directly invoked
Slog.d(mTag, "Closing old session");
- mCurrentSession.mSession.close();
+ mCurrentSession.getSession().close();
}
} catch (RemoteException e) {
Slog.e(mTag, "RemoteException", e);
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/TestHal.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/TestHal.java
index 15d6a89..4fc2e22 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/TestHal.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/TestHal.java
@@ -207,6 +207,11 @@
public ICancellationSignal detectInteractionWithContext(OperationContext context) {
return detectInteraction();
}
+
+ @Override
+ public void onContextChanged(OperationContext context) {
+ Slog.w(TAG, "onContextChanged");
+ }
};
}
}
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 9a52db1..586abe2 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
@@ -64,7 +64,6 @@
import com.android.server.biometrics.sensors.ClientMonitorCallbackConverter;
import com.android.server.biometrics.sensors.EnumerateConsumer;
import com.android.server.biometrics.sensors.ErrorConsumer;
-import com.android.server.biometrics.sensors.HalClientMonitor;
import com.android.server.biometrics.sensors.LockoutResetDispatcher;
import com.android.server.biometrics.sensors.LockoutTracker;
import com.android.server.biometrics.sensors.PerformanceTracker;
@@ -89,6 +88,7 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
+import java.util.function.Supplier;
/**
* Supports a single instance of the {@link android.hardware.biometrics.face.V1_0} or its extended
@@ -111,7 +111,7 @@
@NonNull private final Context mContext;
@NonNull private final BiometricScheduler mScheduler;
@NonNull private final Handler mHandler;
- @NonNull private final HalClientMonitor.LazyDaemon<IBiometricsFace> mLazyDaemon;
+ @NonNull private final Supplier<IBiometricsFace> mLazyDaemon;
@NonNull private final LockoutHalImpl mLockoutTracker;
@NonNull private final UsageStats mUsageStats;
@NonNull private final Map<Integer, Long> mAuthenticatorIds;
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceAuthenticationClient.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceAuthenticationClient.java
index 1e0e799..9038435 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceAuthenticationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceAuthenticationClient.java
@@ -41,6 +41,7 @@
import com.android.server.biometrics.sensors.face.UsageStats;
import java.util.ArrayList;
+import java.util.function.Supplier;
/**
* Face-specific authentication client supporting the {@link android.hardware.biometrics.face.V1_0}
@@ -61,7 +62,7 @@
private SensorPrivacyManager mSensorPrivacyManager;
FaceAuthenticationClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFace> lazyDaemon,
+ @NonNull Supplier<IBiometricsFace> lazyDaemon,
@NonNull IBinder token, long requestId,
@NonNull ClientMonitorCallbackConverter listener, int targetUserId, long operationId,
boolean restricted, String owner, int cookie, boolean requireConfirmation, int sensorId,
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 8068e14..92f7253 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
@@ -40,6 +40,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.function.Supplier;
/**
* Face-specific enroll client supporting the {@link android.hardware.biometrics.face.V1_0} HIDL
@@ -53,7 +54,7 @@
@NonNull private final int[] mEnrollIgnoreList;
@NonNull private final int[] mEnrollIgnoreListVendor;
- FaceEnrollClient(@NonNull Context context, @NonNull LazyDaemon<IBiometricsFace> lazyDaemon,
+ FaceEnrollClient(@NonNull Context context, @NonNull Supplier<IBiometricsFace> lazyDaemon,
@NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener, int userId,
@NonNull byte[] hardwareAuthToken, @NonNull String owner, long requestId,
@NonNull BiometricUtils<Face> utils, @NonNull int[] disabledFeatures, int timeoutSec,
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceGenerateChallengeClient.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceGenerateChallengeClient.java
index e29a192..b66ad60 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceGenerateChallengeClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceGenerateChallengeClient.java
@@ -31,6 +31,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.function.Supplier;
/**
* Face-specific generateChallenge client supporting the
@@ -48,7 +49,7 @@
private Long mChallengeResult;
FaceGenerateChallengeClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFace> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<IBiometricsFace> lazyDaemon, @NonNull IBinder token,
@NonNull ClientMonitorCallbackConverter listener, int userId, @NonNull String owner,
int sensorId, long now) {
super(context, lazyDaemon, token, listener, userId, owner, sensorId);
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceGetFeatureClient.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceGetFeatureClient.java
index 0a9d96d..1b387bf 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceGetFeatureClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceGetFeatureClient.java
@@ -32,6 +32,8 @@
import com.android.server.biometrics.sensors.ClientMonitorCallbackConverter;
import com.android.server.biometrics.sensors.HalClientMonitor;
+import java.util.function.Supplier;
+
/**
* Face-specific getFeature client supporting the {@link android.hardware.biometrics.face.V1_0}
* HIDL interface.
@@ -44,7 +46,7 @@
private final int mFaceId;
private boolean mValue;
- FaceGetFeatureClient(@NonNull Context context, @NonNull LazyDaemon<IBiometricsFace> lazyDaemon,
+ FaceGetFeatureClient(@NonNull Context context, @NonNull Supplier<IBiometricsFace> lazyDaemon,
@NonNull IBinder token, @Nullable ClientMonitorCallbackConverter listener, int userId,
@NonNull String owner, int sensorId, int feature, int faceId) {
super(context, lazyDaemon, token, listener, userId, owner, 0 /* cookie */, sensorId,
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceInternalCleanupClient.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceInternalCleanupClient.java
index 1e3b92d..93a2913 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceInternalCleanupClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceInternalCleanupClient.java
@@ -30,6 +30,7 @@
import java.util.List;
import java.util.Map;
+import java.util.function.Supplier;
/**
* Face-specific internal cleanup client supporting the
@@ -38,7 +39,7 @@
class FaceInternalCleanupClient extends InternalCleanupClient<Face, IBiometricsFace> {
FaceInternalCleanupClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFace> lazyDaemon, int userId, @NonNull String owner,
+ @NonNull Supplier<IBiometricsFace> lazyDaemon, int userId, @NonNull String owner,
int sensorId, @NonNull List<Face> enrolledList, @NonNull BiometricUtils<Face> utils,
@NonNull Map<Integer, Long> authenticatorIds) {
super(context, lazyDaemon, userId, owner, sensorId, BiometricsProtoEnums.MODALITY_FACE,
@@ -47,7 +48,7 @@
@Override
protected InternalEnumerateClient<IBiometricsFace> getEnumerateClient(Context context,
- LazyDaemon<IBiometricsFace> lazyDaemon, IBinder token, int userId, String owner,
+ Supplier<IBiometricsFace> lazyDaemon, IBinder token, int userId, String owner,
List<Face> enrolledList, BiometricUtils<Face> utils, int sensorId) {
return new FaceInternalEnumerateClient(context, lazyDaemon, token, userId, owner,
enrolledList, utils, sensorId);
@@ -55,7 +56,7 @@
@Override
protected RemovalClient<Face, IBiometricsFace> getRemovalClient(Context context,
- LazyDaemon<IBiometricsFace> lazyDaemon, IBinder token,
+ Supplier<IBiometricsFace> lazyDaemon, IBinder token,
int biometricId, int userId, String owner, BiometricUtils<Face> utils, int sensorId,
Map<Integer, Long> authenticatorIds) {
// Internal remove does not need to send results to anyone. Cleanup (enumerate + remove)
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceInternalEnumerateClient.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceInternalEnumerateClient.java
index f2a9afc..f1788de 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceInternalEnumerateClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceInternalEnumerateClient.java
@@ -29,6 +29,7 @@
import com.android.server.biometrics.sensors.InternalEnumerateClient;
import java.util.List;
+import java.util.function.Supplier;
/**
* Face-specific internal enumerate client supporting the
@@ -38,7 +39,7 @@
private static final String TAG = "FaceInternalEnumerateClient";
FaceInternalEnumerateClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFace> lazyDaemon, @NonNull IBinder token, int userId,
+ @NonNull Supplier<IBiometricsFace> lazyDaemon, @NonNull IBinder token, int userId,
@NonNull String owner, @NonNull List<Face> enrolledList,
@NonNull BiometricUtils<Face> utils, int sensorId) {
super(context, lazyDaemon, token, userId, owner, enrolledList, utils, sensorId,
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceRemovalClient.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceRemovalClient.java
index 3ae2011..cbc23e4 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceRemovalClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceRemovalClient.java
@@ -30,6 +30,7 @@
import com.android.server.biometrics.sensors.RemovalClient;
import java.util.Map;
+import java.util.function.Supplier;
/**
* Face-specific removal client supporting the {@link android.hardware.biometrics.face.V1_0}
@@ -40,7 +41,7 @@
private final int mBiometricId;
- FaceRemovalClient(@NonNull Context context, @NonNull LazyDaemon<IBiometricsFace> lazyDaemon,
+ FaceRemovalClient(@NonNull Context context, @NonNull Supplier<IBiometricsFace> lazyDaemon,
@NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener,
int biometricId, int userId, @NonNull String owner, @NonNull BiometricUtils<Face> utils,
int sensorId, @NonNull Map<Integer, Long> authenticatorIds) {
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceResetLockoutClient.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceResetLockoutClient.java
index ee01c43..88e2318 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceResetLockoutClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceResetLockoutClient.java
@@ -28,6 +28,7 @@
import com.android.server.biometrics.sensors.HalClientMonitor;
import java.util.ArrayList;
+import java.util.function.Supplier;
/**
* Face-specific resetLockout client supporting the {@link android.hardware.biometrics.face.V1_0}
@@ -40,7 +41,7 @@
private final ArrayList<Byte> mHardwareAuthToken;
FaceResetLockoutClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFace> lazyDaemon, int userId, String owner, int sensorId,
+ @NonNull Supplier<IBiometricsFace> lazyDaemon, int userId, String owner, int sensorId,
@NonNull byte[] hardwareAuthToken) {
super(context, lazyDaemon, null /* token */, null /* listener */, userId, owner,
0 /* cookie */, sensorId, BiometricsProtoEnums.MODALITY_UNKNOWN,
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceRevokeChallengeClient.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceRevokeChallengeClient.java
index 5ec7a98..ab8d161 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceRevokeChallengeClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceRevokeChallengeClient.java
@@ -25,6 +25,8 @@
import com.android.server.biometrics.sensors.RevokeChallengeClient;
+import java.util.function.Supplier;
+
/**
* Face-specific revokeChallenge client supporting the {@link android.hardware.biometrics.face.V1_0}
* HIDL interface.
@@ -34,7 +36,7 @@
private static final String TAG = "FaceRevokeChallengeClient";
FaceRevokeChallengeClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFace> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<IBiometricsFace> lazyDaemon, @NonNull IBinder token,
int userId, @NonNull String owner, int sensorId) {
super(context, lazyDaemon, token, userId, owner, sensorId);
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceSetFeatureClient.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceSetFeatureClient.java
index ee28f7b..b2b52e7 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceSetFeatureClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceSetFeatureClient.java
@@ -31,6 +31,7 @@
import com.android.server.biometrics.sensors.HalClientMonitor;
import java.util.ArrayList;
+import java.util.function.Supplier;
/**
* Face-specific setFeature client supporting the {@link android.hardware.biometrics.face.V1_0}
@@ -45,7 +46,7 @@
private final ArrayList<Byte> mHardwareAuthToken;
private final int mFaceId;
- FaceSetFeatureClient(@NonNull Context context, @NonNull LazyDaemon<IBiometricsFace> lazyDaemon,
+ FaceSetFeatureClient(@NonNull Context context, @NonNull Supplier<IBiometricsFace> lazyDaemon,
@NonNull IBinder token, @NonNull ClientMonitorCallbackConverter listener, int userId,
@NonNull String owner, int sensorId, int feature, boolean enabled,
byte[] hardwareAuthToken, int faceId) {
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceUpdateActiveUserClient.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceUpdateActiveUserClient.java
index 8ee8ce5..04b9327 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceUpdateActiveUserClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceUpdateActiveUserClient.java
@@ -30,6 +30,7 @@
import java.io.File;
import java.util.Map;
+import java.util.function.Supplier;
public class FaceUpdateActiveUserClient extends HalClientMonitor<IBiometricsFace> {
private static final String TAG = "FaceUpdateActiveUserClient";
@@ -39,7 +40,7 @@
@NonNull private final Map<Integer, Long> mAuthenticatorIds;
FaceUpdateActiveUserClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFace> lazyDaemon, int userId, @NonNull String owner,
+ @NonNull Supplier<IBiometricsFace> lazyDaemon, int userId, @NonNull String owner,
int sensorId, boolean hasEnrolledBiometrics,
@NonNull Map<Integer, Long> authenticatorIds) {
super(context, lazyDaemon, null /* token */, null /* listener */, userId, owner,
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/AidlSession.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/AidlSession.java
new file mode 100644
index 0000000..727101a
--- /dev/null
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/AidlSession.java
@@ -0,0 +1,65 @@
+/*
+ * 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.server.biometrics.sensors.fingerprint.aidl;
+
+import android.annotation.NonNull;
+import android.hardware.biometrics.fingerprint.ISession;
+
+import static com.android.server.biometrics.sensors.fingerprint.aidl.Sensor.HalSessionCallback;
+
+/**
+ * A holder for an AIDL {@link ISession} with additional metadata about the current user
+ * and the backend.
+ */
+public class AidlSession {
+
+ private final int mHalInterfaceVersion;
+ @NonNull private final ISession mSession;
+ private final int mUserId;
+ @NonNull private final HalSessionCallback mHalSessionCallback;
+
+ public AidlSession(int halInterfaceVersion, @NonNull ISession session, int userId,
+ HalSessionCallback halSessionCallback) {
+ mHalInterfaceVersion = halInterfaceVersion;
+ mSession = session;
+ mUserId = userId;
+ mHalSessionCallback = halSessionCallback;
+ }
+
+ /** The underlying {@link ISession}. */
+ @NonNull public ISession getSession() {
+ return mSession;
+ }
+
+ /** The user id associated with the session. */
+ public int getUserId() {
+ return mUserId;
+ }
+
+ /** The HAL callback, which should only be used in tests {@See BiometricTestSessionImpl}. */
+ HalSessionCallback getHalSessionCallback() {
+ return mHalSessionCallback;
+ }
+
+ /**
+ * If this backend implements the *WithContext methods for enroll, authenticate, and
+ * detectInteraction. These variants should always be called if they are available.
+ */
+ public boolean hasContextMethods() {
+ return mHalInterfaceVersion >= 2;
+ }
+}
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/BiometricTestSessionImpl.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/BiometricTestSessionImpl.java
index b29fbb6..0528cd4 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/BiometricTestSessionImpl.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/BiometricTestSessionImpl.java
@@ -157,7 +157,7 @@
}
mEnrollmentIds.add(nextRandomId);
- mSensor.getSessionForUser(userId).mHalSessionCallback
+ mSensor.getSessionForUser(userId).getHalSessionCallback()
.onEnrollmentProgress(nextRandomId, 0 /* remaining */);
}
@@ -173,7 +173,7 @@
return;
}
final int fid = fingerprints.get(0).getBiometricId();
- mSensor.getSessionForUser(userId).mHalSessionCallback.onAuthenticationSucceeded(fid,
+ mSensor.getSessionForUser(userId).getHalSessionCallback().onAuthenticationSucceeded(fid,
HardwareAuthTokenUtils.toHardwareAuthToken(new byte[69]));
}
@@ -181,14 +181,14 @@
public void rejectAuthentication(int userId) {
Utils.checkPermission(mContext, TEST_BIOMETRIC);
- mSensor.getSessionForUser(userId).mHalSessionCallback.onAuthenticationFailed();
+ mSensor.getSessionForUser(userId).getHalSessionCallback().onAuthenticationFailed();
}
@Override
public void notifyAcquired(int userId, int acquireInfo) {
Utils.checkPermission(mContext, TEST_BIOMETRIC);
- mSensor.getSessionForUser(userId).mHalSessionCallback
+ mSensor.getSessionForUser(userId).getHalSessionCallback()
.onAcquired((byte) acquireInfo, 0 /* vendorCode */);
}
@@ -196,7 +196,7 @@
public void notifyError(int userId, int errorCode) {
Utils.checkPermission(mContext, TEST_BIOMETRIC);
- mSensor.getSessionForUser(userId).mHalSessionCallback.onError((byte) errorCode,
+ mSensor.getSessionForUser(userId).getHalSessionCallback().onError((byte) errorCode,
0 /* vendorCode */);
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClient.java
index f3d0121..2c1c80c 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClient.java
@@ -25,7 +25,9 @@
import android.hardware.biometrics.BiometricFingerprintConstants.FingerprintAcquired;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.common.ICancellationSignal;
-import android.hardware.biometrics.fingerprint.ISession;
+import android.hardware.biometrics.common.OperationContext;
+import android.hardware.biometrics.common.OperationReason;
+import android.hardware.biometrics.fingerprint.PointerContext;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.hardware.fingerprint.ISidefpsController;
import android.hardware.fingerprint.IUdfpsOverlayController;
@@ -47,12 +49,13 @@
import com.android.server.biometrics.sensors.fingerprint.Udfps;
import java.util.ArrayList;
+import java.util.function.Supplier;
/**
* Fingerprint-specific authentication client supporting the
* {@link android.hardware.biometrics.fingerprint.IFingerprint} AIDL interface.
*/
-class FingerprintAuthenticationClient extends AuthenticationClient<ISession> implements
+class FingerprintAuthenticationClient extends AuthenticationClient<AidlSession> implements
Udfps, LockoutConsumer {
private static final String TAG = "FingerprintAuthenticationClient";
@@ -65,7 +68,7 @@
private boolean mIsPointerDown;
FingerprintAuthenticationClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon,
+ @NonNull Supplier<AidlSession> lazyDaemon,
@NonNull IBinder token, long requestId,
@NonNull ClientMonitorCallbackConverter listener, int targetUserId, long operationId,
boolean restricted, @NonNull String owner, int cookie, boolean requireConfirmation,
@@ -158,7 +161,7 @@
mSensorOverlays.show(getSensorId(), getShowOverlayReason(), this);
try {
- mCancellationSignal = getFreshDaemon().authenticate(mOperationId);
+ mCancellationSignal = doAuthenticate();
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception", e);
onError(BiometricFingerprintConstants.FINGERPRINT_ERROR_HW_UNAVAILABLE,
@@ -168,6 +171,22 @@
}
}
+ private ICancellationSignal doAuthenticate() throws RemoteException {
+ final AidlSession session = getFreshDaemon();
+
+ if (session.hasContextMethods()) {
+ final OperationContext context = new OperationContext();
+ // TODO: add reason, id, and isAoD
+ context.id = 0;
+ context.reason = OperationReason.UNKNOWN;
+ context.isAoD = false;
+ context.isCrypto = isCryptoOperation();
+ return session.getSession().authenticateWithContext(mOperationId, context);
+ } else {
+ return session.getSession().authenticate(mOperationId);
+ }
+ }
+
@Override
protected void stopHalOperation() {
mSensorOverlays.hide(getSensorId());
@@ -191,7 +210,20 @@
mIsPointerDown = true;
mState = STATE_STARTED;
mALSProbeCallback.getProbe().enable();
- getFreshDaemon().onPointerDown(0 /* pointerId */, x, y, minor, major);
+
+ final AidlSession session = getFreshDaemon();
+ if (session.hasContextMethods()) {
+ final PointerContext context = new PointerContext();
+ context.pointerId = 0;
+ context.x = x;
+ context.y = y;
+ context.minor = minor;
+ context.major = major;
+ context.isAoD = false; // TODO; get value
+ session.getSession().onPointerDownWithContext(context);
+ } else {
+ session.getSession().onPointerDown(0 /* pointerId */, x, y, minor, major);
+ }
if (getListener() != null) {
getListener().onUdfpsPointerDown(getSensorId());
@@ -207,7 +239,15 @@
mIsPointerDown = false;
mState = STATE_STARTED_PAUSED_ATTEMPTED;
mALSProbeCallback.getProbe().disable();
- getFreshDaemon().onPointerUp(0 /* pointerId */);
+
+ final AidlSession session = getFreshDaemon();
+ if (session.hasContextMethods()) {
+ final PointerContext context = new PointerContext();
+ context.pointerId = 0;
+ session.getSession().onPointerUpWithContext(context);
+ } else {
+ session.getSession().onPointerUp(0 /* pointerId */);
+ }
if (getListener() != null) {
getListener().onUdfpsPointerUp(getSensorId());
@@ -225,7 +265,7 @@
@Override
public void onUiReady() {
try {
- getFreshDaemon().onUiReady();
+ getFreshDaemon().getSession().onUiReady();
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception", e);
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintDetectClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintDetectClient.java
index 1f0482d..6645332 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintDetectClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintDetectClient.java
@@ -22,7 +22,8 @@
import android.hardware.biometrics.BiometricOverlayConstants;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.common.ICancellationSignal;
-import android.hardware.biometrics.fingerprint.ISession;
+import android.hardware.biometrics.common.OperationContext;
+import android.hardware.biometrics.common.OperationReason;
import android.hardware.fingerprint.IUdfpsOverlayController;
import android.os.IBinder;
import android.os.RemoteException;
@@ -35,11 +36,13 @@
import com.android.server.biometrics.sensors.DetectionConsumer;
import com.android.server.biometrics.sensors.SensorOverlays;
+import java.util.function.Supplier;
+
/**
* Performs fingerprint detection without exposing any matching information (e.g. accept/reject
* have the same haptic, lockout counter is not increased).
*/
-class FingerprintDetectClient extends AcquisitionClient<ISession> implements DetectionConsumer {
+class FingerprintDetectClient extends AcquisitionClient<AidlSession> implements DetectionConsumer {
private static final String TAG = "FingerprintDetectClient";
@@ -47,7 +50,7 @@
@NonNull private final SensorOverlays mSensorOverlays;
@Nullable private ICancellationSignal mCancellationSignal;
- FingerprintDetectClient(@NonNull Context context, @NonNull LazyDaemon<ISession> lazyDaemon,
+ FingerprintDetectClient(@NonNull Context context, @NonNull Supplier<AidlSession> lazyDaemon,
@NonNull IBinder token, long requestId,
@NonNull ClientMonitorCallbackConverter listener, int userId,
@NonNull String owner, int sensorId,
@@ -84,7 +87,7 @@
mSensorOverlays.show(getSensorId(), BiometricOverlayConstants.REASON_AUTH_KEYGUARD, this);
try {
- mCancellationSignal = getFreshDaemon().detectInteraction();
+ mCancellationSignal = doDetectInteraction();
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception when requesting finger detect", e);
mSensorOverlays.hide(getSensorId());
@@ -92,6 +95,22 @@
}
}
+ private ICancellationSignal doDetectInteraction() throws RemoteException {
+ final AidlSession session = getFreshDaemon();
+
+ if (session.hasContextMethods()) {
+ final OperationContext context = new OperationContext();
+ // TODO: add reason, id, and isAoD
+ context.id = 0;
+ context.reason = OperationReason.UNKNOWN;
+ context.isAoD = false;
+ context.isCrypto = isCryptoOperation();
+ return session.getSession().detectInteractionWithContext(context);
+ } else {
+ return session.getSession().detectInteraction();
+ }
+ }
+
@Override
public void onInteractionDetected() {
vibrateSuccess();
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 169c3eb..d0c5bb8 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
@@ -24,12 +24,15 @@
import android.hardware.biometrics.BiometricFingerprintConstants.FingerprintAcquired;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.common.ICancellationSignal;
-import android.hardware.biometrics.fingerprint.ISession;
+import android.hardware.biometrics.common.OperationContext;
+import android.hardware.biometrics.common.OperationReason;
+import android.hardware.biometrics.fingerprint.PointerContext;
import android.hardware.fingerprint.Fingerprint;
import android.hardware.fingerprint.FingerprintManager;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.hardware.fingerprint.ISidefpsController;
import android.hardware.fingerprint.IUdfpsOverlayController;
+import android.hardware.keymaster.HardwareAuthToken;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
@@ -46,7 +49,9 @@
import com.android.server.biometrics.sensors.fingerprint.Udfps;
import com.android.server.biometrics.sensors.fingerprint.UdfpsHelper;
-class FingerprintEnrollClient extends EnrollClient<ISession> implements Udfps {
+import java.util.function.Supplier;
+
+class FingerprintEnrollClient extends EnrollClient<AidlSession> implements Udfps {
private static final String TAG = "FingerprintEnrollClient";
@@ -59,7 +64,7 @@
private boolean mIsPointerDown;
FingerprintEnrollClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, @NonNull IBinder token, long requestId,
+ @NonNull Supplier<AidlSession> lazyDaemon, @NonNull IBinder token, long requestId,
@NonNull ClientMonitorCallbackConverter listener, int userId,
@NonNull byte[] hardwareAuthToken, @NonNull String owner,
@NonNull BiometricUtils<Fingerprint> utils, int sensorId,
@@ -156,8 +161,7 @@
BiometricNotificationUtils.cancelBadCalibrationNotification(getContext());
try {
- mCancellationSignal = getFreshDaemon().enroll(
- HardwareAuthTokenUtils.toHardwareAuthToken(mHardwareAuthToken));
+ mCancellationSignal = doEnroll();
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception when requesting enroll", e);
onError(BiometricFingerprintConstants.FINGERPRINT_ERROR_UNABLE_TO_PROCESS,
@@ -166,11 +170,42 @@
}
}
+ private ICancellationSignal doEnroll() throws RemoteException {
+ final AidlSession session = getFreshDaemon();
+ final HardwareAuthToken hat =
+ HardwareAuthTokenUtils.toHardwareAuthToken(mHardwareAuthToken);
+
+ if (session.hasContextMethods()) {
+ final OperationContext context = new OperationContext();
+ // TODO: add reason, id, and isAoD
+ context.id = 0;
+ context.reason = OperationReason.UNKNOWN;
+ context.isAoD = false;
+ context.isCrypto = isCryptoOperation();
+ return session.getSession().enrollWithContext(hat, context);
+ } else {
+ return session.getSession().enroll(hat);
+ }
+ }
+
@Override
public void onPointerDown(int x, int y, float minor, float major) {
try {
mIsPointerDown = true;
- getFreshDaemon().onPointerDown(0 /* pointerId */, x, y, minor, major);
+
+ final AidlSession session = getFreshDaemon();
+ if (session.hasContextMethods()) {
+ final PointerContext context = new PointerContext();
+ context.pointerId = 0;
+ context.x = x;
+ context.y = y;
+ context.minor = minor;
+ context.major = major;
+ context.isAoD = false;
+ session.getSession().onPointerDownWithContext(context);
+ } else {
+ session.getSession().onPointerDown(0 /* pointerId */, x, y, minor, major);
+ }
} catch (RemoteException e) {
Slog.e(TAG, "Unable to send pointer down", e);
}
@@ -180,7 +215,15 @@
public void onPointerUp() {
try {
mIsPointerDown = false;
- getFreshDaemon().onPointerUp(0 /* pointerId */);
+
+ final AidlSession session = getFreshDaemon();
+ if (session.hasContextMethods()) {
+ final PointerContext context = new PointerContext();
+ context.pointerId = 0;
+ session.getSession().onPointerUpWithContext(context);
+ } else {
+ session.getSession().onPointerUp(0 /* pointerId */);
+ }
} catch (RemoteException e) {
Slog.e(TAG, "Unable to send pointer up", e);
}
@@ -194,7 +237,7 @@
@Override
public void onUiReady() {
try {
- getFreshDaemon().onUiReady();
+ getFreshDaemon().getSession().onUiReady();
} catch (RemoteException e) {
Slog.e(TAG, "Unable to send UI ready", e);
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintGenerateChallengeClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintGenerateChallengeClient.java
index 4f54f8a..04a7ca0 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintGenerateChallengeClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintGenerateChallengeClient.java
@@ -19,7 +19,6 @@
import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.fingerprint.IFingerprint;
-import android.hardware.biometrics.fingerprint.ISession;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
@@ -27,14 +26,16 @@
import com.android.server.biometrics.sensors.ClientMonitorCallbackConverter;
import com.android.server.biometrics.sensors.GenerateChallengeClient;
+import java.util.function.Supplier;
+
/**
* Fingerprint-specific generateChallenge client for the {@link IFingerprint} AIDL HAL interface.
*/
-class FingerprintGenerateChallengeClient extends GenerateChallengeClient<ISession> {
+class FingerprintGenerateChallengeClient extends GenerateChallengeClient<AidlSession> {
private static final String TAG = "FingerprintGenerateChallengeClient";
FingerprintGenerateChallengeClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon,
+ @NonNull Supplier<AidlSession> lazyDaemon,
@NonNull IBinder token,
@NonNull ClientMonitorCallbackConverter listener,
int userId, @NonNull String owner, int sensorId) {
@@ -44,7 +45,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().generateChallenge();
+ getFreshDaemon().getSession().generateChallenge();
} catch (RemoteException e) {
Slog.e(TAG, "Unable to generateChallenge", e);
mCallback.onClientFinished(this, false /* success */);
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintGetAuthenticatorIdClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintGetAuthenticatorIdClient.java
index 52bd234..3a487fc 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintGetAuthenticatorIdClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintGetAuthenticatorIdClient.java
@@ -19,7 +19,6 @@
import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.BiometricsProtoEnums;
-import android.hardware.biometrics.fingerprint.ISession;
import android.os.RemoteException;
import android.util.Slog;
@@ -28,15 +27,16 @@
import com.android.server.biometrics.sensors.HalClientMonitor;
import java.util.Map;
+import java.util.function.Supplier;
-class FingerprintGetAuthenticatorIdClient extends HalClientMonitor<ISession> {
+class FingerprintGetAuthenticatorIdClient extends HalClientMonitor<AidlSession> {
private static final String TAG = "FingerprintGetAuthenticatorIdClient";
private final Map<Integer, Long> mAuthenticatorIds;
FingerprintGetAuthenticatorIdClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, int userId, @NonNull String owner,
+ @NonNull Supplier<AidlSession> lazyDaemon, int userId, @NonNull String owner,
int sensorId, Map<Integer, Long> authenticatorIds) {
super(context, lazyDaemon, null /* token */, null /* listener */, userId, owner,
0 /* cookie */, sensorId, BiometricsProtoEnums.MODALITY_FINGERPRINT,
@@ -57,7 +57,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().getAuthenticatorId();
+ getFreshDaemon().getSession().getAuthenticatorId();
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception", e);
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalCleanupClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalCleanupClient.java
index 0de3f4f..0ecad72 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalCleanupClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalCleanupClient.java
@@ -19,7 +19,6 @@
import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.BiometricsProtoEnums;
-import android.hardware.biometrics.fingerprint.ISession;
import android.hardware.fingerprint.Fingerprint;
import android.os.IBinder;
@@ -31,15 +30,16 @@
import java.util.List;
import java.util.Map;
+import java.util.function.Supplier;
/**
* Fingerprint-specific internal cleanup client supporting the
* {@link android.hardware.biometrics.fingerprint.IFingerprint} AIDL interface.
*/
-class FingerprintInternalCleanupClient extends InternalCleanupClient<Fingerprint, ISession> {
+class FingerprintInternalCleanupClient extends InternalCleanupClient<Fingerprint, AidlSession> {
FingerprintInternalCleanupClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, int userId, @NonNull String owner,
+ @NonNull Supplier<AidlSession> lazyDaemon, int userId, @NonNull String owner,
int sensorId, @NonNull List<Fingerprint> enrolledList,
@NonNull FingerprintUtils utils, @NonNull Map<Integer, Long> authenticatorIds) {
super(context, lazyDaemon, userId, owner, sensorId,
@@ -47,16 +47,16 @@
}
@Override
- protected InternalEnumerateClient<ISession> getEnumerateClient(Context context,
- LazyDaemon<ISession> lazyDaemon, IBinder token, int userId, String owner,
+ protected InternalEnumerateClient<AidlSession> getEnumerateClient(Context context,
+ Supplier<AidlSession> lazyDaemon, IBinder token, int userId, String owner,
List<Fingerprint> enrolledList, BiometricUtils<Fingerprint> utils, int sensorId) {
return new FingerprintInternalEnumerateClient(context, lazyDaemon, token, userId, owner,
enrolledList, utils, sensorId);
}
@Override
- protected RemovalClient<Fingerprint, ISession> getRemovalClient(Context context,
- LazyDaemon<ISession> lazyDaemon, IBinder token, int biometricId, int userId,
+ protected RemovalClient<Fingerprint, AidlSession> getRemovalClient(Context context,
+ Supplier<AidlSession> lazyDaemon, IBinder token, int biometricId, int userId,
String owner, BiometricUtils<Fingerprint> utils, int sensorId,
Map<Integer, Long> authenticatorIds) {
return new FingerprintRemovalClient(context, lazyDaemon, token,
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalEnumerateClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalEnumerateClient.java
index e20544a..06ba6d4 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalEnumerateClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalEnumerateClient.java
@@ -19,7 +19,6 @@
import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.BiometricsProtoEnums;
-import android.hardware.biometrics.fingerprint.ISession;
import android.hardware.fingerprint.Fingerprint;
import android.os.IBinder;
import android.os.RemoteException;
@@ -29,16 +28,17 @@
import com.android.server.biometrics.sensors.InternalEnumerateClient;
import java.util.List;
+import java.util.function.Supplier;
/**
* Fingerprint-specific internal client supporting the
* {@link android.hardware.biometrics.fingerprint.IFingerprint} AIDL interface.
*/
-class FingerprintInternalEnumerateClient extends InternalEnumerateClient<ISession> {
+class FingerprintInternalEnumerateClient extends InternalEnumerateClient<AidlSession> {
private static final String TAG = "FingerprintInternalEnumerateClient";
protected FingerprintInternalEnumerateClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, @NonNull IBinder token, int userId,
+ @NonNull Supplier<AidlSession> lazyDaemon, @NonNull IBinder token, int userId,
@NonNull String owner, @NonNull List<Fingerprint> enrolledList,
@NonNull BiometricUtils<Fingerprint> utils, int sensorId) {
super(context, lazyDaemon, token, userId, owner, enrolledList, utils, sensorId,
@@ -48,7 +48,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().enumerateEnrollments();
+ getFreshDaemon().getSession().enumerateEnrollments();
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception when requesting enumerate", e);
mCallback.onClientFinished(this, false /* success */);
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInvalidationClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInvalidationClient.java
index 6cd2ef1..1ee32e9 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInvalidationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInvalidationClient.java
@@ -19,7 +19,6 @@
import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.IInvalidationCallback;
-import android.hardware.biometrics.fingerprint.ISession;
import android.hardware.fingerprint.Fingerprint;
import android.os.RemoteException;
import android.util.Slog;
@@ -27,12 +26,13 @@
import com.android.server.biometrics.sensors.InvalidationClient;
import java.util.Map;
+import java.util.function.Supplier;
-public class FingerprintInvalidationClient extends InvalidationClient<Fingerprint, ISession> {
+public class FingerprintInvalidationClient extends InvalidationClient<Fingerprint, AidlSession> {
private static final String TAG = "FingerprintInvalidationClient";
public FingerprintInvalidationClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, int userId, int sensorId,
+ @NonNull Supplier<AidlSession> lazyDaemon, int userId, int sensorId,
@NonNull Map<Integer, Long> authenticatorIds, @NonNull IInvalidationCallback callback) {
super(context, lazyDaemon, userId, sensorId, authenticatorIds, callback);
}
@@ -40,7 +40,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().invalidateAuthenticatorId();
+ getFreshDaemon().getSession().invalidateAuthenticatorId();
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception", e);
mCallback.onClientFinished(this, false /* success */);
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintRemovalClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintRemovalClient.java
index 9a9d6ab..fbc1dc0 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintRemovalClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintRemovalClient.java
@@ -20,7 +20,6 @@
import android.annotation.Nullable;
import android.content.Context;
import android.hardware.biometrics.BiometricsProtoEnums;
-import android.hardware.biometrics.fingerprint.ISession;
import android.hardware.fingerprint.Fingerprint;
import android.os.IBinder;
import android.os.RemoteException;
@@ -31,18 +30,19 @@
import com.android.server.biometrics.sensors.RemovalClient;
import java.util.Map;
+import java.util.function.Supplier;
/**
* Fingerprint-specific removal client supporting the
* {@link android.hardware.biometrics.fingerprint.IFingerprint} interface.
*/
-class FingerprintRemovalClient extends RemovalClient<Fingerprint, ISession> {
+class FingerprintRemovalClient extends RemovalClient<Fingerprint, AidlSession> {
private static final String TAG = "FingerprintRemovalClient";
private final int[] mBiometricIds;
FingerprintRemovalClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<AidlSession> lazyDaemon, @NonNull IBinder token,
@Nullable ClientMonitorCallbackConverter listener, int[] biometricIds, int userId,
@NonNull String owner, @NonNull BiometricUtils<Fingerprint> utils, int sensorId,
@NonNull Map<Integer, Long> authenticatorIds) {
@@ -54,7 +54,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().removeEnrollments(mBiometricIds);
+ getFreshDaemon().getSession().removeEnrollments(mBiometricIds);
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception when requesting remove", e);
mCallback.onClientFinished(this, false /* success */);
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintResetLockoutClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintResetLockoutClient.java
index ee8d170..0e64dab 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintResetLockoutClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintResetLockoutClient.java
@@ -20,7 +20,6 @@
import android.content.Context;
import android.hardware.biometrics.BiometricsProtoEnums;
import android.hardware.biometrics.fingerprint.IFingerprint;
-import android.hardware.biometrics.fingerprint.ISession;
import android.hardware.keymaster.HardwareAuthToken;
import android.os.RemoteException;
import android.util.Slog;
@@ -34,12 +33,14 @@
import com.android.server.biometrics.sensors.LockoutResetDispatcher;
import com.android.server.biometrics.sensors.LockoutTracker;
+import java.util.function.Supplier;
+
/**
* Fingerprint-specific resetLockout client for the {@link IFingerprint} AIDL HAL interface.
* Updates the framework's lockout cache and notifies clients such as Keyguard when lockout is
* cleared.
*/
-class FingerprintResetLockoutClient extends HalClientMonitor<ISession> implements ErrorConsumer {
+class FingerprintResetLockoutClient extends HalClientMonitor<AidlSession> implements ErrorConsumer {
private static final String TAG = "FingerprintResetLockoutClient";
@@ -48,7 +49,7 @@
private final LockoutResetDispatcher mLockoutResetDispatcher;
FingerprintResetLockoutClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, int userId, String owner, int sensorId,
+ @NonNull Supplier<AidlSession> lazyDaemon, int userId, String owner, int sensorId,
@NonNull byte[] hardwareAuthToken, @NonNull LockoutCache lockoutTracker,
@NonNull LockoutResetDispatcher lockoutResetDispatcher) {
super(context, lazyDaemon, null /* token */, null /* listener */, userId, owner,
@@ -73,7 +74,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().resetLockout(mHardwareAuthToken);
+ getFreshDaemon().getSession().resetLockout(mHardwareAuthToken);
} catch (RemoteException e) {
Slog.e(TAG, "Unable to reset lockout", e);
mCallback.onClientFinished(this, false /* success */);
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintRevokeChallengeClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintRevokeChallengeClient.java
index 9e6f1bc..fd93867 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintRevokeChallengeClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintRevokeChallengeClient.java
@@ -19,24 +19,25 @@
import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.fingerprint.IFingerprint;
-import android.hardware.biometrics.fingerprint.ISession;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
import com.android.server.biometrics.sensors.RevokeChallengeClient;
+import java.util.function.Supplier;
+
/**
* Fingerprint-specific revokeChallenge client for the {@link IFingerprint} AIDL HAL interface.
*/
-class FingerprintRevokeChallengeClient extends RevokeChallengeClient<ISession> {
+class FingerprintRevokeChallengeClient extends RevokeChallengeClient<AidlSession> {
private static final String TAG = "FingerpirntRevokeChallengeClient";
private final long mChallenge;
FingerprintRevokeChallengeClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<AidlSession> lazyDaemon, @NonNull IBinder token,
int userId, @NonNull String owner, int sensorId, long challenge) {
super(context, lazyDaemon, token, userId, owner, sensorId);
mChallenge = challenge;
@@ -45,7 +46,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().revokeChallenge(mChallenge);
+ getFreshDaemon().getSession().revokeChallenge(mChallenge);
} catch (RemoteException e) {
Slog.e(TAG, "Unable to revokeChallenge", e);
mCallback.onClientFinished(this, false /* success */);
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintStartUserClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintStartUserClient.java
index 9f11df6..9dc06e1 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintStartUserClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintStartUserClient.java
@@ -30,13 +30,15 @@
import com.android.server.biometrics.sensors.ClientMonitorCallback;
import com.android.server.biometrics.sensors.StartUserClient;
+import java.util.function.Supplier;
+
public class FingerprintStartUserClient extends StartUserClient<IFingerprint, ISession> {
private static final String TAG = "FingerprintStartUserClient";
@NonNull private final ISessionCallback mSessionCallback;
public FingerprintStartUserClient(@NonNull Context context,
- @NonNull LazyDaemon<IFingerprint> lazyDaemon,
+ @NonNull Supplier<IFingerprint> lazyDaemon,
@Nullable IBinder token, int userId, int sensorId,
@NonNull ISessionCallback sessionCallback,
@NonNull UserStartedCallback<ISession> callback) {
@@ -53,10 +55,12 @@
@Override
protected void startHalOperation() {
try {
- final ISession newSession = getFreshDaemon().createSession(getSensorId(),
+ final IFingerprint hal = getFreshDaemon();
+ final int version = hal.getInterfaceVersion();
+ final ISession newSession = hal.createSession(getSensorId(),
getTargetUserId(), mSessionCallback);
Binder.allowBlocking(newSession.asBinder());
- mUserStartedCallback.onUserStarted(getTargetUserId(), newSession);
+ mUserStartedCallback.onUserStarted(getTargetUserId(), newSession, version);
getCallback().onClientFinished(this, true /* success */);
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception", e);
@@ -66,6 +70,5 @@
@Override
public void unableToStart() {
-
}
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintStopUserClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintStopUserClient.java
index 9d38145..fac17f2c 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintStopUserClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintStopUserClient.java
@@ -19,7 +19,6 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
-import android.hardware.biometrics.fingerprint.ISession;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
@@ -27,11 +26,13 @@
import com.android.server.biometrics.sensors.ClientMonitorCallback;
import com.android.server.biometrics.sensors.StopUserClient;
-public class FingerprintStopUserClient extends StopUserClient<ISession> {
+import java.util.function.Supplier;
+
+public class FingerprintStopUserClient extends StopUserClient<AidlSession> {
private static final String TAG = "FingerprintStopUserClient";
public FingerprintStopUserClient(@NonNull Context context,
- @NonNull LazyDaemon<ISession> lazyDaemon, @Nullable IBinder token, int userId,
+ @NonNull Supplier<AidlSession> lazyDaemon, @Nullable IBinder token, int userId,
int sensorId, @NonNull UserStoppedCallback callback) {
super(context, lazyDaemon, token, userId, sensorId, callback);
}
@@ -45,7 +46,7 @@
@Override
protected void startHalOperation() {
try {
- getFreshDaemon().close();
+ getFreshDaemon().getSession().close();
} catch (RemoteException e) {
Slog.e(TAG, "Remote exception", e);
getCallback().onClientFinished(this, false /* success */);
@@ -54,6 +55,5 @@
@Override
public void unableToStart() {
-
}
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/Sensor.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/Sensor.java
index 59e4b58..2276232 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/Sensor.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/Sensor.java
@@ -51,7 +51,6 @@
import com.android.server.biometrics.sensors.BiometricScheduler;
import com.android.server.biometrics.sensors.EnumerateConsumer;
import com.android.server.biometrics.sensors.ErrorConsumer;
-import com.android.server.biometrics.sensors.HalClientMonitor;
import com.android.server.biometrics.sensors.LockoutCache;
import com.android.server.biometrics.sensors.LockoutConsumer;
import com.android.server.biometrics.sensors.LockoutResetDispatcher;
@@ -66,6 +65,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
+import java.util.function.Supplier;
/**
* Maintains the state of a single sensor within an instance of the
@@ -86,24 +86,8 @@
@NonNull private final LockoutCache mLockoutCache;
@NonNull private final Map<Integer, Long> mAuthenticatorIds;
- @Nullable private Session mCurrentSession;
- @NonNull private final HalClientMonitor.LazyDaemon<ISession> mLazySession;
-
- static class Session {
- @NonNull private final String mTag;
- @NonNull private final ISession mSession;
- private final int mUserId;
- @NonNull final HalSessionCallback mHalSessionCallback;
-
- Session(@NonNull String tag, @NonNull ISession session, int userId,
- @NonNull HalSessionCallback halSessionCallback) {
- mTag = tag;
- mSession = session;
- mUserId = userId;
- mHalSessionCallback = halSessionCallback;
- Slog.d(mTag, "New session created for user: " + userId);
- }
- }
+ @Nullable private AidlSession mCurrentSession;
+ @NonNull private final Supplier<AidlSession> mLazySession;
static class HalSessionCallback extends ISessionCallback.Stub {
@@ -452,7 +436,7 @@
mScheduler = new UserAwareBiometricScheduler(tag,
BiometricScheduler.sensorTypeFromFingerprintProperties(mSensorProperties),
gestureAvailabilityDispatcher,
- () -> mCurrentSession != null ? mCurrentSession.mUserId : UserHandle.USER_NULL,
+ () -> mCurrentSession != null ? mCurrentSession.getUserId() : UserHandle.USER_NULL,
new UserAwareBiometricScheduler.UserSwitchCallback() {
@NonNull
@Override
@@ -464,20 +448,21 @@
@NonNull
@Override
public StartUserClient<?, ?> getStartUserClient(int newUserId) {
- final HalSessionCallback.Callback callback = () -> {
- Slog.e(mTag, "Got ERROR_HW_UNAVAILABLE");
- mCurrentSession = null;
- };
-
final int sensorId = mSensorProperties.sensorId;
final HalSessionCallback resultController = new HalSessionCallback(mContext,
mHandler, mTag, mScheduler, sensorId, newUserId, mLockoutCache,
- lockoutResetDispatcher, callback);
+ lockoutResetDispatcher, () -> {
+ Slog.e(mTag, "Got ERROR_HW_UNAVAILABLE");
+ mCurrentSession = null;
+ });
final StartUserClient.UserStartedCallback<ISession> userStartedCallback =
- (userIdStarted, newSession) -> {
- mCurrentSession = new Session(mTag,
+ (userIdStarted, newSession, halInterfaceVersion) -> {
+ Slog.d(mTag, "New session created for user: "
+ + userIdStarted + " with hal version: "
+ + halInterfaceVersion);
+ mCurrentSession = new AidlSession(halInterfaceVersion,
newSession, userIdStarted, resultController);
if (FingerprintUtils.getInstance(sensorId)
.isInvalidationInProgress(mContext, userIdStarted)) {
@@ -497,10 +482,10 @@
}
});
mAuthenticatorIds = new HashMap<>();
- mLazySession = () -> mCurrentSession != null ? mCurrentSession.mSession : null;
+ mLazySession = () -> mCurrentSession != null ? mCurrentSession : null;
}
- @NonNull HalClientMonitor.LazyDaemon<ISession> getLazySession() {
+ @NonNull Supplier<AidlSession> getLazySession() {
return mLazySession;
}
@@ -508,8 +493,8 @@
return mSensorProperties;
}
- @Nullable Session getSessionForUser(int userId) {
- if (mCurrentSession != null && mCurrentSession.mUserId == userId) {
+ @Nullable AidlSession getSessionForUser(int userId) {
+ if (mCurrentSession != null && mCurrentSession.getUserId() == userId) {
return mCurrentSession;
} else {
return null;
@@ -539,10 +524,10 @@
if (enabled != mTestHalEnabled) {
// The framework should retrieve a new session from the HAL.
try {
- if (mCurrentSession != null && mCurrentSession.mSession != null) {
+ if (mCurrentSession != null) {
// TODO(181984005): This should be scheduled instead of directly invoked
Slog.d(mTag, "Closing old session");
- mCurrentSession.mSession.close();
+ mCurrentSession.getSession().close();
}
} catch (RemoteException e) {
Slog.e(mTag, "RemoteException", e);
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/TestHal.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/TestHal.java
index 1eb153c..452c972 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/TestHal.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/TestHal.java
@@ -212,6 +212,11 @@
public void onPointerUpWithContext(PointerContext context) {
onPointerUp(context.pointerId);
}
+
+ @Override
+ public void onContextChanged(OperationContext context) {
+ Slog.w(TAG, "onContextChanged");
+ }
};
}
}
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 f160dff..29d460f 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
@@ -67,7 +67,6 @@
import com.android.server.biometrics.sensors.ClientMonitorCompositeCallback;
import com.android.server.biometrics.sensors.EnumerateConsumer;
import com.android.server.biometrics.sensors.ErrorConsumer;
-import com.android.server.biometrics.sensors.HalClientMonitor;
import com.android.server.biometrics.sensors.LockoutResetDispatcher;
import com.android.server.biometrics.sensors.LockoutTracker;
import com.android.server.biometrics.sensors.PerformanceTracker;
@@ -90,6 +89,7 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
+import java.util.function.Supplier;
/**
* Supports a single instance of the {@link android.hardware.biometrics.fingerprint.V2_1} or
@@ -111,7 +111,7 @@
private final LockoutResetDispatcher mLockoutResetDispatcher;
private final LockoutFrameworkImpl mLockoutTracker;
private final BiometricTaskStackListener mTaskStackListener;
- private final HalClientMonitor.LazyDaemon<IBiometricsFingerprint> mLazyDaemon;
+ private final Supplier<IBiometricsFingerprint> mLazyDaemon;
private final Map<Integer, Long> mAuthenticatorIds;
@Nullable private IBiometricsFingerprint mDaemon;
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintAuthenticationClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintAuthenticationClient.java
index 87d47c1..589bfcf 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintAuthenticationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintAuthenticationClient.java
@@ -45,6 +45,7 @@
import com.android.server.biometrics.sensors.fingerprint.UdfpsHelper;
import java.util.ArrayList;
+import java.util.function.Supplier;
/**
* Fingerprint-specific authentication client supporting the
@@ -64,7 +65,7 @@
private boolean mIsPointerDown;
FingerprintAuthenticationClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFingerprint> lazyDaemon,
+ @NonNull Supplier<IBiometricsFingerprint> lazyDaemon,
@NonNull IBinder token, long requestId,
@NonNull ClientMonitorCallbackConverter listener, int targetUserId, long operationId,
boolean restricted, @NonNull String owner, int cookie, boolean requireConfirmation,
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintDetectClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintDetectClient.java
index 9137212..8848746 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintDetectClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintDetectClient.java
@@ -40,6 +40,7 @@
import com.android.server.biometrics.sensors.fingerprint.UdfpsHelper;
import java.util.ArrayList;
+import java.util.function.Supplier;
/**
* Performs fingerprint detection without exposing any matching information (e.g. accept/reject
@@ -55,7 +56,7 @@
private boolean mIsPointerDown;
public FingerprintDetectClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFingerprint> lazyDaemon,
+ @NonNull Supplier<IBiometricsFingerprint> lazyDaemon,
@NonNull IBinder token, long requestId,
@NonNull ClientMonitorCallbackConverter listener, int userId, @NonNull String owner,
int sensorId, @Nullable IUdfpsOverlayController udfpsOverlayController,
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 82b046d..c69deac 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
@@ -41,6 +41,8 @@
import com.android.server.biometrics.sensors.fingerprint.Udfps;
import com.android.server.biometrics.sensors.fingerprint.UdfpsHelper;
+import java.util.function.Supplier;
+
/**
* Fingerprint-specific enroll client supporting the
* {@link android.hardware.biometrics.fingerprint.V2_1} and
@@ -56,7 +58,7 @@
private boolean mIsPointerDown;
FingerprintEnrollClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFingerprint> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<IBiometricsFingerprint> lazyDaemon, @NonNull IBinder token,
long requestId, @NonNull ClientMonitorCallbackConverter listener, int userId,
@NonNull byte[] hardwareAuthToken, @NonNull String owner,
@NonNull BiometricUtils<Fingerprint> utils, int timeoutSec, int sensorId,
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintGenerateChallengeClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintGenerateChallengeClient.java
index db2f045..591f542 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintGenerateChallengeClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintGenerateChallengeClient.java
@@ -26,6 +26,8 @@
import com.android.server.biometrics.sensors.ClientMonitorCallbackConverter;
import com.android.server.biometrics.sensors.GenerateChallengeClient;
+import java.util.function.Supplier;
+
/**
* Fingerprint-specific generateChallenge/preEnroll client supporting the
* {@link android.hardware.biometrics.fingerprint.V2_1} and
@@ -37,7 +39,7 @@
private static final String TAG = "FingerprintGenerateChallengeClient";
FingerprintGenerateChallengeClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFingerprint> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<IBiometricsFingerprint> lazyDaemon, @NonNull IBinder token,
@NonNull ClientMonitorCallbackConverter listener, int userId, @NonNull String owner,
int sensorId) {
super(context, lazyDaemon, token, listener, userId, owner, sensorId);
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintInternalCleanupClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintInternalCleanupClient.java
index a42a8ae..403602b 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintInternalCleanupClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintInternalCleanupClient.java
@@ -30,6 +30,7 @@
import java.util.List;
import java.util.Map;
+import java.util.function.Supplier;
/**
* Fingerprint-specific internal cleanup client supporting the
@@ -40,7 +41,7 @@
extends InternalCleanupClient<Fingerprint, IBiometricsFingerprint> {
FingerprintInternalCleanupClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFingerprint> lazyDaemon, int userId,
+ @NonNull Supplier<IBiometricsFingerprint> lazyDaemon, int userId,
@NonNull String owner, int sensorId, @NonNull List<Fingerprint> enrolledList,
@NonNull BiometricUtils<Fingerprint> utils,
@NonNull Map<Integer, Long> authenticatorIds) {
@@ -50,7 +51,7 @@
@Override
protected InternalEnumerateClient<IBiometricsFingerprint> getEnumerateClient(
- Context context, LazyDaemon<IBiometricsFingerprint> lazyDaemon, IBinder token,
+ Context context, Supplier<IBiometricsFingerprint> lazyDaemon, IBinder token,
int userId, String owner, List<Fingerprint> enrolledList,
BiometricUtils<Fingerprint> utils, int sensorId) {
return new FingerprintInternalEnumerateClient(context, lazyDaemon, token, userId, owner,
@@ -59,7 +60,7 @@
@Override
protected RemovalClient<Fingerprint, IBiometricsFingerprint> getRemovalClient(Context context,
- LazyDaemon<IBiometricsFingerprint> lazyDaemon, IBinder token,
+ Supplier<IBiometricsFingerprint> lazyDaemon, IBinder token,
int biometricId, int userId, String owner, BiometricUtils<Fingerprint> utils,
int sensorId, Map<Integer, Long> authenticatorIds) {
// Internal remove does not need to send results to anyone. Cleanup (enumerate + remove)
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintInternalEnumerateClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintInternalEnumerateClient.java
index 7117cf3..def8ed0 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintInternalEnumerateClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintInternalEnumerateClient.java
@@ -29,6 +29,7 @@
import com.android.server.biometrics.sensors.InternalEnumerateClient;
import java.util.List;
+import java.util.function.Supplier;
/**
* Fingerprint-specific internal enumerate client supporting the
@@ -39,7 +40,7 @@
private static final String TAG = "FingerprintInternalEnumerateClient";
FingerprintInternalEnumerateClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFingerprint> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<IBiometricsFingerprint> lazyDaemon, @NonNull IBinder token,
int userId, @NonNull String owner, @NonNull List<Fingerprint> enrolledList,
@NonNull BiometricUtils<Fingerprint> utils, int sensorId) {
super(context, lazyDaemon, token, userId, owner, enrolledList, utils, sensorId,
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintRemovalClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintRemovalClient.java
index 2f360f3..77c201c 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintRemovalClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintRemovalClient.java
@@ -30,6 +30,7 @@
import com.android.server.biometrics.sensors.RemovalClient;
import java.util.Map;
+import java.util.function.Supplier;
/**
* Fingerprint-specific removal client supporting the
@@ -42,7 +43,7 @@
private final int mBiometricId;
FingerprintRemovalClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFingerprint> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<IBiometricsFingerprint> lazyDaemon, @NonNull IBinder token,
@NonNull ClientMonitorCallbackConverter listener, int biometricId, int userId,
@NonNull String owner, @NonNull BiometricUtils<Fingerprint> utils, int sensorId,
@NonNull Map<Integer, Long> authenticatorIds) {
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintRevokeChallengeClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintRevokeChallengeClient.java
index b6b29b3..0180a46 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintRevokeChallengeClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintRevokeChallengeClient.java
@@ -25,6 +25,8 @@
import com.android.server.biometrics.sensors.RevokeChallengeClient;
+import java.util.function.Supplier;
+
/**
* Fingerprint-specific revokeChallenge client supporting the
* {@link android.hardware.biometrics.fingerprint.V2_1} and
@@ -36,7 +38,7 @@
private static final String TAG = "FingerprintRevokeChallengeClient";
FingerprintRevokeChallengeClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFingerprint> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<IBiometricsFingerprint> lazyDaemon, @NonNull IBinder token,
int userId, @NonNull String owner, int sensorId) {
super(context, lazyDaemon, token, userId, owner, sensorId);
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintUpdateActiveUserClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintUpdateActiveUserClient.java
index d317984..cb9c33e 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintUpdateActiveUserClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintUpdateActiveUserClient.java
@@ -49,7 +49,7 @@
private File mDirectory;
FingerprintUpdateActiveUserClient(@NonNull Context context,
- @NonNull LazyDaemon<IBiometricsFingerprint> lazyDaemon, int userId,
+ @NonNull Supplier<IBiometricsFingerprint> lazyDaemon, int userId,
@NonNull String owner, int sensorId, Supplier<Integer> currentUserId,
boolean hasEnrolledBiometrics, @NonNull Map<Integer, Long> authenticatorIds,
boolean forceUpdateAuthenticatorId) {
diff --git a/services/core/java/com/android/server/clipboard/OWNERS b/services/core/java/com/android/server/clipboard/OWNERS
index 5449df9..0d5dbf9 100644
--- a/services/core/java/com/android/server/clipboard/OWNERS
+++ b/services/core/java/com/android/server/clipboard/OWNERS
@@ -1 +1,3 @@
per-file EmulatorClipboardMonitor.java = bohu@google.com,lfy@google.com,rkir@google.com
+
+olilan@google.com
diff --git a/services/core/java/com/android/server/connectivity/MultipathPolicyTracker.java b/services/core/java/com/android/server/connectivity/MultipathPolicyTracker.java
index a5024ff..603f206 100644
--- a/services/core/java/com/android/server/connectivity/MultipathPolicyTracker.java
+++ b/services/core/java/com/android/server/connectivity/MultipathPolicyTracker.java
@@ -24,7 +24,6 @@
import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
import static android.net.NetworkPolicy.LIMIT_DISABLED;
import static android.net.NetworkPolicy.WARNING_DISABLED;
-import static android.net.NetworkTemplate.OEM_MANAGED_ALL;
import static android.provider.Settings.Global.NETWORK_DEFAULT_DAILY_MULTIPATH_QUOTA_BYTES;
import static android.telephony.SubscriptionManager.INVALID_SUBSCRIPTION_ID;
@@ -94,6 +93,7 @@
private static String TAG = MultipathPolicyTracker.class.getSimpleName();
private static final boolean DBG = false;
+ private static final long MIN_THRESHOLD_BYTES = 2 * 1_048_576L; // 2MiB
// This context is for the current user.
private final Context mContext;
@@ -278,15 +278,11 @@
}
private NetworkIdentity getTemplateMatchingNetworkIdentity(NetworkCapabilities nc) {
- return new NetworkIdentity(
- ConnectivityManager.TYPE_MOBILE,
- 0 /* subType, unused for template matching */,
- subscriberId,
- null /* networkId, unused for matching mobile networks */,
- !nc.hasCapability(NET_CAPABILITY_NOT_ROAMING),
- !nc.hasCapability(NET_CAPABILITY_NOT_METERED),
- false /* defaultNetwork, templates should have DEFAULT_NETWORK_ALL */,
- OEM_MANAGED_ALL);
+ return new NetworkIdentity.Builder().setType(ConnectivityManager.TYPE_MOBILE)
+ .setSubscriberId(subscriberId)
+ .setRoaming(!nc.hasCapability(NET_CAPABILITY_NOT_ROAMING))
+ .setMetered(!nc.hasCapability(NET_CAPABILITY_NOT_METERED))
+ .build();
}
private long getRemainingDailyBudget(long limitBytes,
@@ -375,7 +371,7 @@
// This will only be called if the total quota for the day changed, not if usage changed
// since last time, so even if this is called very often the budget will not snap to 0
// as soon as there are less than 2MB left for today.
- if (budget > NetworkStatsManager.MIN_THRESHOLD_BYTES) {
+ if (budget > MIN_THRESHOLD_BYTES) {
if (DBG) {
Log.d(TAG, "Setting callback for " + budget + " bytes on network " + network);
}
diff --git a/services/core/java/com/android/server/display/BrightnessMappingStrategy.java b/services/core/java/com/android/server/display/BrightnessMappingStrategy.java
index 240168b..a1d722b 100644
--- a/services/core/java/com/android/server/display/BrightnessMappingStrategy.java
+++ b/services/core/java/com/android/server/display/BrightnessMappingStrategy.java
@@ -32,6 +32,7 @@
import com.android.internal.display.BrightnessSynchronizer;
import com.android.internal.util.Preconditions;
import com.android.server.display.utils.Plog;
+import com.android.server.display.whitebalance.DisplayWhiteBalanceController;
import java.io.PrintWriter;
import java.util.Arrays;
@@ -69,7 +70,7 @@
@Nullable
public static BrightnessMappingStrategy create(Resources resources,
DisplayDeviceConfig displayDeviceConfig) {
- return create(resources, displayDeviceConfig, /* isForIdleMode= */ false);
+ return create(resources, displayDeviceConfig, /* isForIdleMode= */ false, null);
}
/**
@@ -80,8 +81,10 @@
*/
@Nullable
public static BrightnessMappingStrategy createForIdleMode(Resources resources,
- DisplayDeviceConfig displayDeviceConfig) {
- return create(resources, displayDeviceConfig, /* isForIdleMode= */ true);
+ DisplayDeviceConfig displayDeviceConfig, DisplayWhiteBalanceController
+ displayWhiteBalanceController) {
+ return create(resources, displayDeviceConfig, /* isForIdleMode= */ true,
+ displayWhiteBalanceController);
}
/**
@@ -96,7 +99,8 @@
*/
@Nullable
private static BrightnessMappingStrategy create(Resources resources,
- DisplayDeviceConfig displayDeviceConfig, boolean isForIdleMode) {
+ DisplayDeviceConfig displayDeviceConfig, boolean isForIdleMode,
+ DisplayWhiteBalanceController displayWhiteBalanceController) {
// Display independent, mode dependent values
float[] brightnessLevelsNits;
@@ -135,7 +139,7 @@
builder.setShortTermModelLowerLuxMultiplier(SHORT_TERM_MODEL_THRESHOLD_RATIO);
builder.setShortTermModelUpperLuxMultiplier(SHORT_TERM_MODEL_THRESHOLD_RATIO);
return new PhysicalMappingStrategy(builder.build(), nitsRange, brightnessRange,
- autoBrightnessAdjustmentMaxGamma, isForIdleMode);
+ autoBrightnessAdjustmentMaxGamma, isForIdleMode, displayWhiteBalanceController);
} else if (isValidMapping(luxLevels, brightnessLevelsBacklight) && !isForIdleMode) {
return new SimpleMappingStrategy(luxLevels, brightnessLevelsBacklight,
autoBrightnessAdjustmentMaxGamma, shortTermModelTimeout);
@@ -770,9 +774,11 @@
private float mUserLux;
private float mUserBrightness;
private final boolean mIsForIdleMode;
+ private final DisplayWhiteBalanceController mDisplayWhiteBalanceController;
public PhysicalMappingStrategy(BrightnessConfiguration config, float[] nits,
- float[] brightness, float maxGamma, boolean isForIdleMode) {
+ float[] brightness, float maxGamma, boolean isForIdleMode,
+ DisplayWhiteBalanceController displayWhiteBalanceController) {
Preconditions.checkArgument(nits.length != 0 && brightness.length != 0,
"Nits and brightness arrays must not be empty!");
@@ -789,6 +795,7 @@
mAutoBrightnessAdjustment = 0;
mUserLux = -1;
mUserBrightness = -1;
+ mDisplayWhiteBalanceController = displayWhiteBalanceController;
mNits = nits;
mBrightness = brightness;
@@ -836,6 +843,12 @@
public float getBrightness(float lux, String packageName,
@ApplicationInfo.Category int category) {
float nits = mBrightnessSpline.interpolate(lux);
+
+ // Adjust nits to compensate for display white balance colour strength.
+ if (mDisplayWhiteBalanceController != null && isForIdleMode()) {
+ nits = mDisplayWhiteBalanceController.calculateAdjustedBrightnessNits(nits);
+ }
+
float brightness = mNitsToBrightnessSpline.interpolate(nits);
// Correct the brightness according to the current application and its category, but
// only if no user data point is set (as this will override the user setting).
diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java
index 3feffc6..7ad4979 100644
--- a/services/core/java/com/android/server/display/DisplayManagerService.java
+++ b/services/core/java/com/android/server/display/DisplayManagerService.java
@@ -1318,7 +1318,9 @@
if (callingUid != Process.SYSTEM_UID
&& (flags & VIRTUAL_DISPLAY_FLAG_OWN_DISPLAY_GROUP) != 0) {
- if (!checkCallingPermission(ADD_TRUSTED_DISPLAY, "createVirtualDisplay()")) {
+ // The virtualDevice instance has been validated above using isValidVirtualDevice
+ if (virtualDevice == null
+ && !checkCallingPermission(ADD_TRUSTED_DISPLAY, "createVirtualDisplay()")) {
throw new SecurityException("Requires ADD_TRUSTED_DISPLAY permission to "
+ "create a virtual display which is not in the default DisplayGroup.");
}
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
index 31c496ed..ec4b91a 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
@@ -50,6 +50,8 @@
import android.provider.Settings;
import android.util.Log;
import android.util.MathUtils;
+import android.util.MutableFloat;
+import android.util.MutableInt;
import android.util.Slog;
import android.util.TimeUtils;
import android.view.Display;
@@ -895,7 +897,7 @@
mDisplayDeviceConfig);
if (isIdleScreenBrightnessEnabled) {
mIdleModeBrightnessMapper = BrightnessMappingStrategy.createForIdleMode(resources,
- mDisplayDeviceConfig);
+ mDisplayDeviceConfig, mDisplayWhiteBalanceController);
}
if (mInteractiveModeBrightnessMapper != null) {
@@ -1390,6 +1392,7 @@
// Animate the screen brightness when the screen is on or dozing.
// Skip the animation when the screen is off or suspended or transition to/from VR.
+ boolean brightnessAdjusted = false;
if (!mPendingScreenOff) {
if (mSkipScreenOnBrightnessRamp) {
if (state == Display.STATE_ON) {
@@ -1482,15 +1485,19 @@
// slider event so notify as if the system changed the brightness.
userInitiatedChange = false;
}
- notifyBrightnessChanged(brightnessState, userInitiatedChange,
+ notifyBrightnessTrackerChanged(brightnessState, userInitiatedChange,
hadUserBrightnessPoint);
}
// We save the brightness info *after* the brightness setting has been changed and
// adjustments made so that the brightness info reflects the latest value.
- saveBrightnessInfo(getScreenBrightnessSetting(), animateValue);
+ brightnessAdjusted = saveBrightnessInfo(getScreenBrightnessSetting(), animateValue);
} else {
- saveBrightnessInfo(getScreenBrightnessSetting());
+ brightnessAdjusted = saveBrightnessInfo(getScreenBrightnessSetting());
+ }
+
+ if (brightnessAdjusted) {
+ postBrightnessChangeRunnable();
}
// Log any changes to what is currently driving the brightness setting.
@@ -1606,31 +1613,50 @@
public BrightnessInfo getBrightnessInfo() {
synchronized (mCachedBrightnessInfo) {
return new BrightnessInfo(
- mCachedBrightnessInfo.brightness,
- mCachedBrightnessInfo.adjustedBrightness,
- mCachedBrightnessInfo.brightnessMin,
- mCachedBrightnessInfo.brightnessMax,
- mCachedBrightnessInfo.hbmMode,
- mCachedBrightnessInfo.highBrightnessTransitionPoint);
+ mCachedBrightnessInfo.brightness.value,
+ mCachedBrightnessInfo.adjustedBrightness.value,
+ mCachedBrightnessInfo.brightnessMin.value,
+ mCachedBrightnessInfo.brightnessMax.value,
+ mCachedBrightnessInfo.hbmMode.value,
+ mCachedBrightnessInfo.hbmTransitionPoint.value);
}
}
- private void saveBrightnessInfo(float brightness) {
- saveBrightnessInfo(brightness, brightness);
+ private boolean saveBrightnessInfo(float brightness) {
+ return saveBrightnessInfo(brightness, brightness);
}
- private void saveBrightnessInfo(float brightness, float adjustedBrightness) {
+ private boolean saveBrightnessInfo(float brightness, float adjustedBrightness) {
synchronized (mCachedBrightnessInfo) {
- mCachedBrightnessInfo.brightness = brightness;
- mCachedBrightnessInfo.adjustedBrightness = adjustedBrightness;
- mCachedBrightnessInfo.brightnessMin = mHbmController.getCurrentBrightnessMin();
- mCachedBrightnessInfo.brightnessMax = mHbmController.getCurrentBrightnessMax();
- mCachedBrightnessInfo.hbmMode = mHbmController.getHighBrightnessMode();
- mCachedBrightnessInfo.highBrightnessTransitionPoint =
- mHbmController.getTransitionPoint();
+ boolean changed = false;
+
+ changed |=
+ mCachedBrightnessInfo.checkAndSetFloat(mCachedBrightnessInfo.brightness,
+ brightness);
+ changed |=
+ mCachedBrightnessInfo.checkAndSetFloat(mCachedBrightnessInfo.adjustedBrightness,
+ adjustedBrightness);
+ changed |=
+ mCachedBrightnessInfo.checkAndSetFloat(mCachedBrightnessInfo.brightnessMin,
+ mHbmController.getCurrentBrightnessMin());
+ changed |=
+ mCachedBrightnessInfo.checkAndSetFloat(mCachedBrightnessInfo.brightnessMax,
+ mHbmController.getCurrentBrightnessMax());
+ changed |=
+ mCachedBrightnessInfo.checkAndSetInt(mCachedBrightnessInfo.hbmMode,
+ mHbmController.getHighBrightnessMode());
+ changed |=
+ mCachedBrightnessInfo.checkAndSetFloat(mCachedBrightnessInfo.hbmTransitionPoint,
+ mHbmController.getTransitionPoint());
+
+ return changed;
}
}
+ void postBrightnessChangeRunnable() {
+ mHandler.post(mOnBrightnessChangeRunnable);
+ }
+
private HighBrightnessModeController createHbmControllerLocked() {
final DisplayDevice device = mLogicalDisplay.getPrimaryDisplayDeviceLocked();
final DisplayDeviceConfig ddConfig = device.getDisplayDeviceConfig();
@@ -1645,7 +1671,7 @@
displayUniqueId, PowerManager.BRIGHTNESS_MIN, PowerManager.BRIGHTNESS_MAX, hbmData,
() -> {
sendUpdatePowerStateLocked();
- mHandler.post(mOnBrightnessChangeRunnable);
+ postBrightnessChangeRunnable();
// TODO(b/192258832): Switch the HBMChangeCallback to a listener pattern.
if (mAutomaticBrightnessController != null) {
mAutomaticBrightnessController.update();
@@ -2147,7 +2173,7 @@
private void setCurrentScreenBrightness(float brightnessValue) {
if (brightnessValue != mCurrentScreenBrightnessSetting) {
mCurrentScreenBrightnessSetting = brightnessValue;
- mHandler.post(mOnBrightnessChangeRunnable);
+ postBrightnessChangeRunnable();
}
}
@@ -2199,7 +2225,7 @@
return true;
}
- private void notifyBrightnessChanged(float brightness, boolean userInitiated,
+ private void notifyBrightnessTrackerChanged(float brightness, boolean userInitiated,
boolean hadUserDataPoint) {
final float brightnessInNits = convertToNits(brightness);
if (mPowerRequest.useAutoBrightness && brightnessInNits >= 0.0f
@@ -2309,16 +2335,17 @@
pw.println(" mColorFadeFadesConfig=" + mColorFadeFadesConfig);
pw.println(" mColorFadeEnabled=" + mColorFadeEnabled);
synchronized (mCachedBrightnessInfo) {
- pw.println(" mCachedBrightnessInfo.brightness=" + mCachedBrightnessInfo.brightness);
+ pw.println(" mCachedBrightnessInfo.brightness=" +
+ mCachedBrightnessInfo.brightness.value);
pw.println(" mCachedBrightnessInfo.adjustedBrightness=" +
- mCachedBrightnessInfo.adjustedBrightness);
+ mCachedBrightnessInfo.adjustedBrightness.value);
pw.println(" mCachedBrightnessInfo.brightnessMin=" +
- mCachedBrightnessInfo.brightnessMin);
+ mCachedBrightnessInfo.brightnessMin.value);
pw.println(" mCachedBrightnessInfo.brightnessMax=" +
- mCachedBrightnessInfo.brightnessMax);
- pw.println(" mCachedBrightnessInfo.hbmMode=" + mCachedBrightnessInfo.hbmMode);
- pw.println(" mCachedBrightnessInfo.highBrightnessTransitionPoint=" +
- mCachedBrightnessInfo.highBrightnessTransitionPoint);
+ mCachedBrightnessInfo.brightnessMax.value);
+ pw.println(" mCachedBrightnessInfo.hbmMode=" + mCachedBrightnessInfo.hbmMode.value);
+ pw.println(" mCachedBrightnessInfo.hbmTransitionPoint=" +
+ mCachedBrightnessInfo.hbmTransitionPoint.value);
}
pw.println(" mDisplayBlanksAfterDozeConfig=" + mDisplayBlanksAfterDozeConfig);
pw.println(" mBrightnessBucketsInDozeConfig=" + mBrightnessBucketsInDozeConfig);
@@ -2476,7 +2503,10 @@
private void reportStats(float brightness) {
float hbmTransitionPoint = PowerManager.BRIGHTNESS_MAX;
synchronized(mCachedBrightnessInfo) {
- hbmTransitionPoint = mCachedBrightnessInfo.highBrightnessTransitionPoint;
+ if (mCachedBrightnessInfo.hbmTransitionPoint == null) {
+ return;
+ }
+ hbmTransitionPoint = mCachedBrightnessInfo.hbmTransitionPoint.value;
}
final boolean aboveTransition = brightness > hbmTransitionPoint;
@@ -2773,11 +2803,31 @@
}
static class CachedBrightnessInfo {
- public float brightness;
- public float adjustedBrightness;
- public float brightnessMin;
- public float brightnessMax;
- public int hbmMode;
- public float highBrightnessTransitionPoint;
+ public MutableFloat brightness = new MutableFloat(PowerManager.BRIGHTNESS_INVALID_FLOAT);
+ public MutableFloat adjustedBrightness =
+ new MutableFloat(PowerManager.BRIGHTNESS_INVALID_FLOAT);
+ public MutableFloat brightnessMin =
+ new MutableFloat(PowerManager.BRIGHTNESS_INVALID_FLOAT);
+ public MutableFloat brightnessMax =
+ new MutableFloat(PowerManager.BRIGHTNESS_INVALID_FLOAT);
+ public MutableInt hbmMode = new MutableInt(BrightnessInfo.HIGH_BRIGHTNESS_MODE_OFF);
+ public MutableFloat hbmTransitionPoint =
+ new MutableFloat(HighBrightnessModeController.HBM_TRANSITION_POINT_INVALID);
+
+ public boolean checkAndSetFloat(MutableFloat mf, float f) {
+ if (mf.value != f) {
+ mf.value = f;
+ return true;
+ }
+ return false;
+ }
+
+ public boolean checkAndSetInt(MutableInt mi, int i) {
+ if (mi.value != i) {
+ mi.value = i;
+ return true;
+ }
+ return false;
+ }
}
}
diff --git a/services/core/java/com/android/server/display/color/ColorDisplayService.java b/services/core/java/com/android/server/display/color/ColorDisplayService.java
index f9a1368..8035526 100644
--- a/services/core/java/com/android/server/display/color/ColorDisplayService.java
+++ b/services/core/java/com/android/server/display/color/ColorDisplayService.java
@@ -1453,7 +1453,7 @@
/**
* Local service that allows color transforms to be enabled from other system services.
*/
- public final class ColorDisplayServiceInternal {
+ public class ColorDisplayServiceInternal {
/**
* Set the current CCT value for the display white balance transform, and if the transform
@@ -1472,6 +1472,11 @@
return false;
}
+ /** Get the luminance of the current chromatic adaptation matrix. */
+ public float getDisplayWhiteBalanceLuminance() {
+ return mDisplayWhiteBalanceTintController.getLuminance();
+ }
+
/**
* Reset the CCT value for the display white balance transform to its default value.
*/
diff --git a/services/core/java/com/android/server/display/color/DisplayWhiteBalanceTintController.java b/services/core/java/com/android/server/display/color/DisplayWhiteBalanceTintController.java
index bdbaaa8..936149c 100644
--- a/services/core/java/com/android/server/display/color/DisplayWhiteBalanceTintController.java
+++ b/services/core/java/com/android/server/display/color/DisplayWhiteBalanceTintController.java
@@ -251,6 +251,18 @@
}
}
+ public float getLuminance() {
+ synchronized (mLock) {
+ if (mChromaticAdaptationMatrix != null && mChromaticAdaptationMatrix.length == 9) {
+ // Compute only the luminance (y) value of the xyz * [1 1 1] transform.
+ return 1 / (mChromaticAdaptationMatrix[1] + mChromaticAdaptationMatrix[4]
+ + mChromaticAdaptationMatrix[7]);
+ } else {
+ return -1;
+ }
+ }
+ }
+
private ColorSpace.Rgb makeRgbColorSpaceFromXYZ(float[] redGreenBlueXYZ, float[] whiteXYZ) {
return new ColorSpace.Rgb(
"Display Color Space",
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 d64fcbc..151ec81 100644
--- a/services/core/java/com/android/server/display/whitebalance/DisplayWhiteBalanceController.java
+++ b/services/core/java/com/android/server/display/whitebalance/DisplayWhiteBalanceController.java
@@ -21,7 +21,6 @@
import android.util.Spline;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.util.Preconditions;
import com.android.server.LocalServices;
import com.android.server.display.color.ColorDisplayService.ColorDisplayServiceInternal;
import com.android.server.display.utils.AmbientFilter;
@@ -456,6 +455,22 @@
}
/**
+ * Calculate the adjusted brightness, in nits, due to the DWB color adaptation
+ *
+ * @param requestedBrightnessNits brightness the framework requires to be output
+ * @return the adjusted brightness the framework needs to output to counter the drop in
+ * brightness due to DWB, or the requestedBrightnessNits if an adjustment cannot be made
+ */
+ public float calculateAdjustedBrightnessNits(float requestedBrightnessNits) {
+ float luminance = mColorDisplayServiceInternal.getDisplayWhiteBalanceLuminance();
+ if (luminance == -1) {
+ return requestedBrightnessNits;
+ }
+ float effectiveBrightness = requestedBrightnessNits * luminance;
+ return (requestedBrightnessNits - effectiveBrightness) + requestedBrightnessNits;
+ }
+
+ /**
* The DisplayWhiteBalanceController decouples itself from its parent (DisplayPowerController)
* by providing this interface to implement (and a method to set its callbacks object), and
* calling these methods.
diff --git a/services/core/java/com/android/server/dreams/DreamManagerService.java b/services/core/java/com/android/server/dreams/DreamManagerService.java
index 258689a..611b288 100644
--- a/services/core/java/com/android/server/dreams/DreamManagerService.java
+++ b/services/core/java/com/android/server/dreams/DreamManagerService.java
@@ -484,14 +484,15 @@
}
private static String componentsToString(ComponentName[] componentNames) {
+ if (componentNames == null) {
+ return null;
+ }
StringBuilder names = new StringBuilder();
- if (componentNames != null) {
- for (ComponentName componentName : componentNames) {
- if (names.length() > 0) {
- names.append(',');
- }
- names.append(componentName.flattenToString());
+ for (ComponentName componentName : componentNames) {
+ if (names.length() > 0) {
+ names.append(',');
}
+ names.append(componentName.flattenToString());
}
return names.toString();
}
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index 8a6aa0d..feb0d138 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -203,7 +203,7 @@
/**
* This class provides a system service that manages input methods.
*/
-public class InputMethodManagerService extends IInputMethodManager.Stub
+public final class InputMethodManagerService extends IInputMethodManager.Stub
implements Handler.Callback {
static final boolean DEBUG = false;
static final String TAG = "InputMethodManagerService";
diff --git a/services/core/java/com/android/server/location/GeocoderProxy.java b/services/core/java/com/android/server/location/GeocoderProxy.java
index 57a7620..ac42646 100644
--- a/services/core/java/com/android/server/location/GeocoderProxy.java
+++ b/services/core/java/com/android/server/location/GeocoderProxy.java
@@ -83,9 +83,9 @@
}
@Override
- public void onError() {
+ public void onError(Throwable t) {
try {
- listener.onResults("Service not Available", Collections.emptyList());
+ listener.onResults(t.toString(), Collections.emptyList());
} catch (RemoteException e) {
// ignore
}
@@ -110,9 +110,9 @@
}
@Override
- public void onError() {
+ public void onError(Throwable t) {
try {
- listener.onResults("Service not Available", Collections.emptyList());
+ listener.onResults(t.toString(), Collections.emptyList());
} catch (RemoteException e) {
// ignore
}
diff --git a/services/core/java/com/android/server/location/gnss/GnssNetworkConnectivityHandler.java b/services/core/java/com/android/server/location/gnss/GnssNetworkConnectivityHandler.java
index 4d9253e..718f98a 100644
--- a/services/core/java/com/android/server/location/gnss/GnssNetworkConnectivityHandler.java
+++ b/services/core/java/com/android/server/location/gnss/GnssNetworkConnectivityHandler.java
@@ -215,7 +215,9 @@
}
@Override
public void onPreciseCallStateChanged(PreciseCallState state) {
- if (state.PRECISE_CALL_STATE_ACTIVE == state.getForegroundCallState()) {
+ if (PreciseCallState.PRECISE_CALL_STATE_ACTIVE == state.getForegroundCallState()
+ || PreciseCallState.PRECISE_CALL_STATE_DIALING
+ == state.getForegroundCallState()) {
mActiveSubId = mSubId;
if (DEBUG) Log.d(TAG, "mActiveSubId: " + mActiveSubId);
}
diff --git a/services/core/java/com/android/server/location/provider/proxy/ProxyLocationProvider.java b/services/core/java/com/android/server/location/provider/proxy/ProxyLocationProvider.java
index 2b3f4207..05966da 100644
--- a/services/core/java/com/android/server/location/provider/proxy/ProxyLocationProvider.java
+++ b/services/core/java/com/android/server/location/provider/proxy/ProxyLocationProvider.java
@@ -208,7 +208,7 @@
}
@Override
- public void onError() {
+ public void onError(Throwable t) {
synchronized (mLock) {
mFlushListeners.remove(callback);
}
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
index c01851a..fac7a40 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
@@ -100,7 +100,6 @@
import static android.net.NetworkTemplate.MATCH_WIFI;
import static android.net.NetworkTemplate.buildTemplateCarrierMetered;
import static android.net.NetworkTemplate.buildTemplateMobileAll;
-import static android.net.TrafficStats.MB_IN_BYTES;
import static android.net.netstats.provider.NetworkStatsProvider.QUOTA_UNLIMITED;
import static android.os.Trace.TRACE_TAG_NETWORK;
import static android.provider.Settings.Global.NETPOLICY_OVERRIDE_ENABLED;
@@ -182,7 +181,6 @@
import android.net.NetworkStateSnapshot;
import android.net.NetworkTemplate;
import android.net.TelephonyNetworkSpecifier;
-import android.net.TrafficStats;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.os.BestClock;
@@ -2299,7 +2297,7 @@
if (dataWarningConfig == WARNING_DISABLED) {
return WARNING_DISABLED;
} else {
- return dataWarningConfig * MB_IN_BYTES;
+ return DataUnit.MEBIBYTES.toBytes(dataWarningConfig);
}
}
@@ -3468,9 +3466,9 @@
plans.add(SubscriptionPlan.Builder
.createRecurringMonthly(ZonedDateTime.parse("2007-03-14T00:00:00.000Z"))
.setTitle("G-Mobile")
- .setDataLimit(5 * TrafficStats.GB_IN_BYTES,
+ .setDataLimit(DataUnit.GIBIBYTES.toBytes(5),
SubscriptionPlan.LIMIT_BEHAVIOR_BILLED)
- .setDataUsage(1 * TrafficStats.GB_IN_BYTES,
+ .setDataUsage(DataUnit.GIBIBYTES.toBytes(1),
ZonedDateTime.now().minusHours(36).toInstant().toEpochMilli())
.build());
plans.add(SubscriptionPlan.Builder
@@ -3478,15 +3476,15 @@
.setTitle("G-Mobile Happy")
.setDataLimit(SubscriptionPlan.BYTES_UNLIMITED,
SubscriptionPlan.LIMIT_BEHAVIOR_BILLED)
- .setDataUsage(5 * TrafficStats.GB_IN_BYTES,
+ .setDataUsage(DataUnit.GIBIBYTES.toBytes(5),
ZonedDateTime.now().minusHours(36).toInstant().toEpochMilli())
.build());
plans.add(SubscriptionPlan.Builder
.createRecurringMonthly(ZonedDateTime.parse("2017-03-14T00:00:00.000Z"))
.setTitle("G-Mobile, Charged after limit")
- .setDataLimit(5 * TrafficStats.GB_IN_BYTES,
+ .setDataLimit(DataUnit.GIBIBYTES.toBytes(5),
SubscriptionPlan.LIMIT_BEHAVIOR_BILLED)
- .setDataUsage(5 * TrafficStats.GB_IN_BYTES,
+ .setDataUsage(DataUnit.GIBIBYTES.toBytes(5),
ZonedDateTime.now().minusHours(36).toInstant().toEpochMilli())
.build());
} else if ("month_soft".equals(fake)) {
@@ -3495,25 +3493,25 @@
.setTitle("G-Mobile is the carriers name who this plan belongs to")
.setSummary("Crazy unlimited bandwidth plan with incredibly long title "
+ "that should be cut off to prevent UI from looking terrible")
- .setDataLimit(5 * TrafficStats.GB_IN_BYTES,
+ .setDataLimit(DataUnit.GIBIBYTES.toBytes(5),
SubscriptionPlan.LIMIT_BEHAVIOR_THROTTLED)
- .setDataUsage(1 * TrafficStats.GB_IN_BYTES,
+ .setDataUsage(DataUnit.GIBIBYTES.toBytes(1),
ZonedDateTime.now().minusHours(1).toInstant().toEpochMilli())
.build());
plans.add(SubscriptionPlan.Builder
.createRecurringMonthly(ZonedDateTime.parse("2017-03-14T00:00:00.000Z"))
.setTitle("G-Mobile, Throttled after limit")
- .setDataLimit(5 * TrafficStats.GB_IN_BYTES,
+ .setDataLimit(DataUnit.GIBIBYTES.toBytes(5),
SubscriptionPlan.LIMIT_BEHAVIOR_THROTTLED)
- .setDataUsage(5 * TrafficStats.GB_IN_BYTES,
+ .setDataUsage(DataUnit.GIBIBYTES.toBytes(5),
ZonedDateTime.now().minusHours(1).toInstant().toEpochMilli())
.build());
plans.add(SubscriptionPlan.Builder
.createRecurringMonthly(ZonedDateTime.parse("2017-03-14T00:00:00.000Z"))
.setTitle("G-Mobile, No data connection after limit")
- .setDataLimit(5 * TrafficStats.GB_IN_BYTES,
+ .setDataLimit(DataUnit.GIBIBYTES.toBytes(5),
SubscriptionPlan.LIMIT_BEHAVIOR_DISABLED)
- .setDataUsage(5 * TrafficStats.GB_IN_BYTES,
+ .setDataUsage(DataUnit.GIBIBYTES.toBytes(5),
ZonedDateTime.now().minusHours(1).toInstant().toEpochMilli())
.build());
@@ -3521,25 +3519,25 @@
plans.add(SubscriptionPlan.Builder
.createRecurringMonthly(ZonedDateTime.parse("2007-03-14T00:00:00.000Z"))
.setTitle("G-Mobile is the carriers name who this plan belongs to")
- .setDataLimit(5 * TrafficStats.GB_IN_BYTES,
+ .setDataLimit(DataUnit.GIBIBYTES.toBytes(5),
SubscriptionPlan.LIMIT_BEHAVIOR_THROTTLED)
- .setDataUsage(6 * TrafficStats.GB_IN_BYTES,
+ .setDataUsage(DataUnit.GIBIBYTES.toBytes(6),
ZonedDateTime.now().minusHours(1).toInstant().toEpochMilli())
.build());
plans.add(SubscriptionPlan.Builder
.createRecurringMonthly(ZonedDateTime.parse("2017-03-14T00:00:00.000Z"))
.setTitle("G-Mobile, Throttled after limit")
- .setDataLimit(5 * TrafficStats.GB_IN_BYTES,
+ .setDataLimit(DataUnit.GIBIBYTES.toBytes(5),
SubscriptionPlan.LIMIT_BEHAVIOR_THROTTLED)
- .setDataUsage(5 * TrafficStats.GB_IN_BYTES,
+ .setDataUsage(DataUnit.GIBIBYTES.toBytes(5),
ZonedDateTime.now().minusHours(1).toInstant().toEpochMilli())
.build());
plans.add(SubscriptionPlan.Builder
.createRecurringMonthly(ZonedDateTime.parse("2017-03-14T00:00:00.000Z"))
.setTitle("G-Mobile, No data connection after limit")
- .setDataLimit(5 * TrafficStats.GB_IN_BYTES,
+ .setDataLimit(DataUnit.GIBIBYTES.toBytes(5),
SubscriptionPlan.LIMIT_BEHAVIOR_DISABLED)
- .setDataUsage(5 * TrafficStats.GB_IN_BYTES,
+ .setDataUsage(DataUnit.GIBIBYTES.toBytes(5),
ZonedDateTime.now().minusHours(1).toInstant().toEpochMilli())
.build());
@@ -3553,9 +3551,9 @@
.createNonrecurring(ZonedDateTime.now().minusDays(20),
ZonedDateTime.now().plusDays(10))
.setTitle("G-Mobile")
- .setDataLimit(512 * TrafficStats.MB_IN_BYTES,
+ .setDataLimit(DataUnit.MEBIBYTES.toBytes(512),
SubscriptionPlan.LIMIT_BEHAVIOR_DISABLED)
- .setDataUsage(100 * TrafficStats.MB_IN_BYTES,
+ .setDataUsage(DataUnit.MEBIBYTES.toBytes(100),
ZonedDateTime.now().minusHours(3).toInstant().toEpochMilli())
.build());
} else if ("prepaid_crazy".equals(fake)) {
@@ -3563,9 +3561,9 @@
.createNonrecurring(ZonedDateTime.now().minusDays(20),
ZonedDateTime.now().plusDays(10))
.setTitle("G-Mobile Anytime")
- .setDataLimit(512 * TrafficStats.MB_IN_BYTES,
+ .setDataLimit(DataUnit.MEBIBYTES.toBytes(512),
SubscriptionPlan.LIMIT_BEHAVIOR_DISABLED)
- .setDataUsage(100 * TrafficStats.MB_IN_BYTES,
+ .setDataUsage(DataUnit.MEBIBYTES.toBytes(100),
ZonedDateTime.now().minusHours(3).toInstant().toEpochMilli())
.build());
plans.add(SubscriptionPlan.Builder
@@ -3573,9 +3571,9 @@
ZonedDateTime.now().plusDays(20))
.setTitle("G-Mobile Nickel Nights")
.setSummary("5¢/GB between 1-5AM")
- .setDataLimit(5 * TrafficStats.GB_IN_BYTES,
+ .setDataLimit(DataUnit.GIBIBYTES.toBytes(5),
SubscriptionPlan.LIMIT_BEHAVIOR_THROTTLED)
- .setDataUsage(15 * TrafficStats.MB_IN_BYTES,
+ .setDataUsage(DataUnit.MEBIBYTES.toBytes(15),
ZonedDateTime.now().minusHours(30).toInstant().toEpochMilli())
.build());
plans.add(SubscriptionPlan.Builder
@@ -3583,9 +3581,9 @@
ZonedDateTime.now().plusDays(20))
.setTitle("G-Mobile Bonus 3G")
.setSummary("Unlimited 3G data")
- .setDataLimit(1 * TrafficStats.GB_IN_BYTES,
+ .setDataLimit(DataUnit.GIBIBYTES.toBytes(1),
SubscriptionPlan.LIMIT_BEHAVIOR_THROTTLED)
- .setDataUsage(300 * TrafficStats.MB_IN_BYTES,
+ .setDataUsage(DataUnit.MEBIBYTES.toBytes(300),
ZonedDateTime.now().minusHours(1).toInstant().toEpochMilli())
.build());
} else if ("unlimited".equals(fake)) {
@@ -3595,7 +3593,7 @@
.setTitle("G-Mobile Awesome")
.setDataLimit(SubscriptionPlan.BYTES_UNLIMITED,
SubscriptionPlan.LIMIT_BEHAVIOR_THROTTLED)
- .setDataUsage(50 * TrafficStats.MB_IN_BYTES,
+ .setDataUsage(DataUnit.MEBIBYTES.toBytes(50),
ZonedDateTime.now().minusHours(3).toInstant().toEpochMilli())
.build());
}
diff --git a/services/core/java/com/android/server/notification/VibratorHelper.java b/services/core/java/com/android/server/notification/VibratorHelper.java
index 54dd113..e5d07bc 100644
--- a/services/core/java/com/android/server/notification/VibratorHelper.java
+++ b/services/core/java/com/android/server/notification/VibratorHelper.java
@@ -16,6 +16,9 @@
package com.android.server.notification;
+import static android.os.VibrationEffect.VibrationParameter.targetAmplitude;
+import static android.os.VibrationEffect.VibrationParameter.targetFrequency;
+
import android.annotation.Nullable;
import android.content.Context;
import android.content.res.Resources;
@@ -30,6 +33,7 @@
import com.android.internal.R;
import com.android.server.pm.PackageManagerService;
+import java.time.Duration;
import java.util.Arrays;
/**
@@ -89,8 +93,7 @@
* Safely create a {@link VibrationEffect} from given waveform description.
*
* <p>The waveform is described by a sequence of values for target amplitude, frequency and
- * duration, that are forwarded to
- * {@link VibrationEffect.WaveformBuilder#addRamp(float, float, int)}.
+ * duration, that are forwarded to {@link VibrationEffect.WaveformBuilder#addTransition}.
*
* <p>This method returns {@code null} if the pattern is also {@code null} or invalid.
*
@@ -114,16 +117,17 @@
VibrationEffect.WaveformBuilder waveformBuilder = VibrationEffect.startWaveform();
for (int i = 0; i < length; i += 3) {
- waveformBuilder.addRamp(
- /* amplitude= */ values[i],
- /* frequencyHz= */ values[i + 1],
- /* duration= */ (int) values[i + 2]);
+ waveformBuilder.addTransition(Duration.ofMillis((int) values[i + 2]),
+ targetAmplitude(values[i]), targetFrequency(values[i + 1]));
}
+ VibrationEffect effect = waveformBuilder.build();
if (insistent) {
- return waveformBuilder.build(/* repeat= */ 0);
+ return VibrationEffect.startComposition()
+ .repeatEffectIndefinitely(effect)
+ .compose();
}
- return waveformBuilder.build();
+ return effect;
} catch (IllegalArgumentException e) {
Slog.e(TAG, "Error creating vibration PWLE waveform with pattern: "
+ Arrays.toString(values));
diff --git a/services/core/java/com/android/server/pm/InstallPackageHelper.java b/services/core/java/com/android/server/pm/InstallPackageHelper.java
index d98626f..b636c8e 100644
--- a/services/core/java/com/android/server/pm/InstallPackageHelper.java
+++ b/services/core/java/com/android/server/pm/InstallPackageHelper.java
@@ -168,10 +168,7 @@
import dalvik.system.VMRuntime;
-import libcore.io.IoUtils;
-
import java.io.File;
-import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.DigestException;
@@ -1788,9 +1785,7 @@
*/
private void setUpFsVerityIfPossible(AndroidPackage pkg) throws Installer.InstallerException,
PrepareFailure, IOException, DigestException, NoSuchAlgorithmException {
- final boolean standardMode = PackageManagerServiceUtils.isApkVerityEnabled();
- final boolean legacyMode = PackageManagerServiceUtils.isLegacyApkVerityEnabled();
- if (!standardMode && !legacyMode) {
+ if (!PackageManagerServiceUtils.isApkVerityEnabled()) {
return;
}
@@ -1801,36 +1796,24 @@
// Collect files we care for fs-verity setup.
ArrayMap<String, String> fsverityCandidates = new ArrayMap<>();
- if (legacyMode) {
- synchronized (mPm.mLock) {
- final PackageSetting ps = mPm.mSettings.getPackageLPr(pkg.getPackageName());
- if (ps != null && ps.isPrivileged()) {
- fsverityCandidates.put(pkg.getBaseApkPath(), null);
- for (String splitPath : pkg.getSplitCodePaths()) {
- fsverityCandidates.put(splitPath, null);
- }
- }
- }
- } else {
- // NB: These files will become only accessible if the signing key is loaded in kernel's
- // .fs-verity keyring.
- fsverityCandidates.put(pkg.getBaseApkPath(),
- VerityUtils.getFsveritySignatureFilePath(pkg.getBaseApkPath()));
+ // NB: These files will become only accessible if the signing key is loaded in kernel's
+ // .fs-verity keyring.
+ fsverityCandidates.put(pkg.getBaseApkPath(),
+ VerityUtils.getFsveritySignatureFilePath(pkg.getBaseApkPath()));
- final String dmPath = DexMetadataHelper.buildDexMetadataPathForApk(
- pkg.getBaseApkPath());
- if (new File(dmPath).exists()) {
- fsverityCandidates.put(dmPath, VerityUtils.getFsveritySignatureFilePath(dmPath));
- }
+ final String dmPath = DexMetadataHelper.buildDexMetadataPathForApk(
+ pkg.getBaseApkPath());
+ if (new File(dmPath).exists()) {
+ fsverityCandidates.put(dmPath, VerityUtils.getFsveritySignatureFilePath(dmPath));
+ }
- for (String path : pkg.getSplitCodePaths()) {
- fsverityCandidates.put(path, VerityUtils.getFsveritySignatureFilePath(path));
+ for (String path : pkg.getSplitCodePaths()) {
+ fsverityCandidates.put(path, VerityUtils.getFsveritySignatureFilePath(path));
- final String splitDmPath = DexMetadataHelper.buildDexMetadataPathForApk(path);
- if (new File(splitDmPath).exists()) {
- fsverityCandidates.put(splitDmPath,
- VerityUtils.getFsveritySignatureFilePath(splitDmPath));
- }
+ final String splitDmPath = DexMetadataHelper.buildDexMetadataPathForApk(path);
+ if (new File(splitDmPath).exists()) {
+ fsverityCandidates.put(splitDmPath,
+ VerityUtils.getFsveritySignatureFilePath(splitDmPath));
}
}
@@ -1839,43 +1822,14 @@
final String filePath = entry.getKey();
final String signaturePath = entry.getValue();
- if (!legacyMode) {
- // fs-verity is optional for now. Only set up if signature is provided.
- if (new File(signaturePath).exists() && !VerityUtils.hasFsverity(filePath)) {
- try {
- VerityUtils.setUpFsverity(filePath, signaturePath);
- } catch (IOException e) {
- throw new PrepareFailure(PackageManager.INSTALL_FAILED_BAD_SIGNATURE,
- "Failed to enable fs-verity: " + e);
- }
- }
- continue;
- }
-
- // In legacy mode, fs-verity can only be enabled by process with CAP_SYS_ADMIN.
- final VerityUtils.SetupResult result = VerityUtils.generateApkVeritySetupData(filePath);
- if (result.isOk()) {
- if (Build.IS_DEBUGGABLE) Slog.i(TAG, "Enabling verity to " + filePath);
- final FileDescriptor fd = result.getUnownedFileDescriptor();
+ // fs-verity is optional for now. Only set up if signature is provided.
+ if (new File(signaturePath).exists() && !VerityUtils.hasFsverity(filePath)) {
try {
- final byte[] rootHash = VerityUtils.generateApkVerityRootHash(filePath);
- try {
- // A file may already have fs-verity, e.g. when reused during a split
- // install. If the measurement succeeds, no need to attempt to set up.
- mPm.mInstaller.assertFsverityRootHashMatches(packageName, filePath,
- rootHash);
- } catch (Installer.InstallerException e) {
- mPm.mInstaller.installApkVerity(packageName, filePath, fd,
- result.getContentSize());
- mPm.mInstaller.assertFsverityRootHashMatches(packageName, filePath,
- rootHash);
- }
- } finally {
- IoUtils.closeQuietly(fd);
+ VerityUtils.setUpFsverity(filePath, signaturePath);
+ } catch (IOException e) {
+ throw new PrepareFailure(PackageManager.INSTALL_FAILED_BAD_SIGNATURE,
+ "Failed to enable fs-verity: " + e);
}
- } else if (result.isFailed()) {
- throw new PrepareFailure(PackageManager.INSTALL_FAILED_BAD_SIGNATURE,
- "Failed to generate verity");
}
}
}
@@ -3959,14 +3913,14 @@
*/
private boolean canSkipForcedPackageVerification(AndroidPackage pkg) {
final String packageName = pkg.getPackageName();
- if (!canSkipForcedApkVerification(packageName, pkg.getBaseApkPath())) {
+ if (!VerityUtils.hasFsverity(pkg.getBaseApkPath())) {
return false;
}
// TODO: Allow base and splits to be verified individually.
String[] splitCodePaths = pkg.getSplitCodePaths();
if (!ArrayUtils.isEmpty(splitCodePaths)) {
for (int i = 0; i < splitCodePaths.length; i++) {
- if (!canSkipForcedApkVerification(packageName, splitCodePaths[i])) {
+ if (!VerityUtils.hasFsverity(splitCodePaths[i])) {
return false;
}
}
@@ -3975,34 +3929,6 @@
}
/**
- * Returns if forced apk verification can be skipped, depending on current FSVerity setup and
- * whether the apk contains signed root hash. Note that the signer's certificate still needs to
- * match one in a trusted source, and should be done separately.
- */
- private boolean canSkipForcedApkVerification(String packageName, String apkPath) {
- if (!PackageManagerServiceUtils.isLegacyApkVerityEnabled()) {
- return VerityUtils.hasFsverity(apkPath);
- }
-
- try {
- final byte[] rootHashObserved = VerityUtils.generateApkVerityRootHash(apkPath);
- if (rootHashObserved == null) {
- return false; // APK does not contain Merkle tree root hash.
- }
- synchronized (mPm.mInstallLock) {
- // Returns whether the observed root hash matches what kernel has.
- mPm.mInstaller.assertFsverityRootHashMatches(packageName, apkPath,
- rootHashObserved);
- return true;
- }
- } catch (Installer.InstallerException | IOException | DigestException
- | NoSuchAlgorithmException e) {
- Slog.w(TAG, "Error in fsverity check. Fallback to full apk verification.", e);
- }
- return false;
- }
-
- /**
* Clear the package profile if this was an upgrade and the package
* version was updated.
*/
diff --git a/services/core/java/com/android/server/pm/Installer.java b/services/core/java/com/android/server/pm/Installer.java
index 47be7e6..c4389a7 100644
--- a/services/core/java/com/android/server/pm/Installer.java
+++ b/services/core/java/com/android/server/pm/Installer.java
@@ -39,7 +39,6 @@
import dalvik.system.BlockGuard;
import dalvik.system.VMRuntime;
-import java.io.FileDescriptor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -726,34 +725,6 @@
}
}
- /**
- * Enables legacy apk-verity for an apk.
- */
- public void installApkVerity(String packageName, String filePath, FileDescriptor verityInput,
- int contentSize) throws InstallerException {
- if (!checkBeforeRemote()) return;
- BlockGuard.getVmPolicy().onPathAccess(filePath);
- try {
- mInstalld.installApkVerity(packageName, filePath, verityInput, contentSize);
- } catch (Exception e) {
- throw InstallerException.from(e);
- }
- }
-
- /**
- * Checks if provided hash matches the file's fs-verity merkle tree root hash.
- */
- public void assertFsverityRootHashMatches(String packageName, String filePath,
- @NonNull byte[] expectedHash) throws InstallerException {
- if (!checkBeforeRemote()) return;
- BlockGuard.getVmPolicy().onPathAccess(filePath);
- try {
- mInstalld.assertFsverityRootHashMatches(packageName, filePath, expectedHash);
- } catch (Exception e) {
- throw InstallerException.from(e);
- }
- }
-
public boolean reconcileSecondaryDexFile(String apkPath, String packageName, int uid,
String[] isas, @Nullable String volumeUuid, int flags) throws InstallerException {
for (int i = 0; i < isas.length; i++) {
diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java
index d9ade96..390dd3f 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerSession.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java
@@ -2264,10 +2264,6 @@
}
if (params.isStaged) {
- // TODO(b/136257624): CTS test fails if we don't send session finished broadcast, even
- // though ideally, we just need to send session committed broadcast.
- sendUpdateToRemoteStatusReceiver(INSTALL_SUCCEEDED, "Session staged", null);
-
mStagedSession.verifySession();
} else {
verify();
@@ -2514,6 +2510,7 @@
mStagedSession.notifyEndPreRebootVerification();
if (error == SessionInfo.SESSION_NO_ERROR) {
mStagingManager.commitSession(mStagedSession);
+ sendUpdateToRemoteStatusReceiver(INSTALL_SUCCEEDED, "Session staged", null);
} else {
dispatchSessionFinished(INSTALL_FAILED_VERIFICATION_FAILURE, msg, null);
maybeFinishChildSessions(INSTALL_FAILED_VERIFICATION_FAILURE, msg);
diff --git a/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java b/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
index 1d2b829..dcc4386 100644
--- a/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
+++ b/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
@@ -482,12 +482,6 @@
/** Default is to not use fs-verity since it depends on kernel support. */
private static final int FSVERITY_DISABLED = 0;
- /**
- * Experimental implementation targeting priv apps, with Android specific kernel patches to
- * extend fs-verity.
- */
- private static final int FSVERITY_LEGACY = 1;
-
/** Standard fs-verity. */
private static final int FSVERITY_ENABLED = 2;
@@ -498,10 +492,6 @@
== FSVERITY_ENABLED;
}
- static boolean isLegacyApkVerityEnabled() {
- return SystemProperties.getInt("ro.apk_verity.mode", FSVERITY_DISABLED) == FSVERITY_LEGACY;
- }
-
/** Returns true to force apk verification if the package is considered privileged. */
static boolean isApkVerificationForced(@Nullable PackageSetting ps) {
// TODO(b/154310064): re-enable.
diff --git a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
index fd2256f..99f70b2 100644
--- a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
+++ b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
@@ -3563,18 +3563,27 @@
}
final LocalIntentReceiver receiver = new LocalIntentReceiver();
session.commit(receiver.getIntentSender());
- final Intent result = receiver.getResult();
- final int status = result.getIntExtra(PackageInstaller.EXTRA_STATUS,
- PackageInstaller.STATUS_FAILURE);
- if (status == PackageInstaller.STATUS_SUCCESS) {
+ if (!session.isStaged()) {
+ final Intent result = receiver.getResult();
+ final int status = result.getIntExtra(PackageInstaller.EXTRA_STATUS,
+ PackageInstaller.STATUS_FAILURE);
+ if (status == PackageInstaller.STATUS_SUCCESS) {
+ if (logSuccess) {
+ pw.println("Success");
+ }
+ } else {
+ pw.println("Failure ["
+ + result.getStringExtra(PackageInstaller.EXTRA_STATUS_MESSAGE) + "]");
+ }
+ return status;
+ } else {
+ // Return immediately without retrieving the result. The caller will decide
+ // whether to wait for the session to become ready.
if (logSuccess) {
pw.println("Success");
}
- } else {
- pw.println("Failure ["
- + result.getStringExtra(PackageInstaller.EXTRA_STATUS_MESSAGE) + "]");
+ return PackageInstaller.STATUS_SUCCESS;
}
- return status;
} finally {
IoUtils.closeQuietly(session);
}
diff --git a/services/core/java/com/android/server/pm/ShortcutPackage.java b/services/core/java/com/android/server/pm/ShortcutPackage.java
index 15e64df..72db242 100644
--- a/services/core/java/com/android/server/pm/ShortcutPackage.java
+++ b/services/core/java/com/android/server/pm/ShortcutPackage.java
@@ -35,8 +35,8 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.LocusId;
-import android.content.pm.AppSearchPerson;
import android.content.pm.AppSearchShortcutInfo;
+import android.content.pm.AppSearchShortcutPerson;
import android.content.pm.PackageInfo;
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutManager;
@@ -965,7 +965,7 @@
*/
public ArraySet<String> getUsedBitmapFiles() {
final ArraySet<String> usedFiles = new ArraySet<>(1);
- forEachShortcut(AppSearchShortcutInfo.QUERY_HAS_BITMAP_PATH, si -> {
+ forEachShortcut(si -> {
if (si.getBitmapPath() != null) {
usedFiles.add(getFileName(si.getBitmapPath()));
}
@@ -1176,7 +1176,7 @@
// Keep the previous IDs.
final ArraySet<String> toDisableList = new ArraySet<>(1);
- forEachShortcut(AppSearchShortcutInfo.QUERY_IS_MANIFEST, si -> {
+ forEachShortcut(si -> {
if (si.isManifestShortcut()) {
toDisableList.add(si.getId());
}
@@ -1319,7 +1319,7 @@
private ArrayMap<ComponentName, ArrayList<ShortcutInfo>> sortShortcutsToActivities() {
final ArrayMap<ComponentName, ArrayList<ShortcutInfo>> activitiesToShortcuts
= new ArrayMap<>();
- forEachShortcut(AppSearchShortcutInfo.QUERY_IS_NOT_FLOATING, si -> {
+ forEachShortcut(si -> {
if (si.isFloating()) {
return; // Ignore floating shortcuts, which are not tied to any activities.
}
@@ -1369,14 +1369,7 @@
// (If it's for update, then don't count dynamic shortcuts, since they'll be replaced
// anyway.)
final ArrayMap<ComponentName, Integer> counts = new ArrayMap<>(4);
- final String query;
- if (operation != ShortcutService.OPERATION_SET) {
- query = AppSearchShortcutInfo.QUERY_IS_MANIFEST + " OR "
- + AppSearchShortcutInfo.QUERY_IS_DYNAMIC;
- } else {
- query = AppSearchShortcutInfo.QUERY_IS_MANIFEST;
- }
- forEachShortcut(query, shortcut -> {
+ forEachShortcut(shortcut -> {
if (shortcut.isManifestShortcut()) {
incrementCountForActivity(counts, shortcut.getActivity(), 1);
} else if (shortcut.isDynamic() && (operation != ShortcutService.OPERATION_SET)) {
@@ -1539,7 +1532,7 @@
/** @return true if there's any shortcuts that are not manifest shortcuts. */
public boolean hasNonManifestShortcuts() {
final boolean[] condition = new boolean[1];
- forEachShortcutStopWhen(AppSearchShortcutInfo.QUERY_IS_NOT_MANIFEST, si -> {
+ forEachShortcutStopWhen(si -> {
if (!si.isDeclaredInManifest()) {
condition[0] = true;
return true;
@@ -2287,12 +2280,7 @@
}
private void forEachShortcut(@NonNull final Consumer<ShortcutInfo> cb) {
- forEachShortcut("", cb);
- }
-
- private void forEachShortcut(
- @NonNull final String query, @NonNull final Consumer<ShortcutInfo> cb) {
- forEachShortcutStopWhen(query, si -> {
+ forEachShortcutStopWhen(si -> {
cb.accept(si);
return false;
});
@@ -2307,11 +2295,6 @@
private void forEachShortcutStopWhen(
@NonNull final Function<ShortcutInfo, Boolean> cb) {
- forEachShortcutStopWhen("", cb);
- }
-
- private void forEachShortcutStopWhen(
- @NonNull final String query, @NonNull final Function<ShortcutInfo, Boolean> cb) {
for (int i = mShortcuts.size() - 1; i >= 0; i--) {
final ShortcutInfo si = mShortcuts.valueAt(i);
if (cb.apply(si)) {
@@ -2328,12 +2311,12 @@
+ " pkg=" + getPackageName());
}
SetSchemaRequest.Builder schemaBuilder = new SetSchemaRequest.Builder()
- .addSchemas(AppSearchPerson.SCHEMA, AppSearchShortcutInfo.SCHEMA)
+ .addSchemas(AppSearchShortcutPerson.SCHEMA, AppSearchShortcutInfo.SCHEMA)
.setForceOverride(true);
for (PackageIdentifier pi : mPackageIdentifiers.values()) {
schemaBuilder = schemaBuilder
.setSchemaTypeVisibilityForPackage(
- AppSearchPerson.SCHEMA_TYPE, true, pi)
+ AppSearchShortcutPerson.SCHEMA_TYPE, true, pi)
.setSchemaTypeVisibilityForPackage(
AppSearchShortcutInfo.SCHEMA_TYPE, true, pi);
}
@@ -2403,8 +2386,8 @@
.addIds(ids).build(), mShortcutUser.mExecutor, result -> {
final List<ShortcutInfo> ret = result.getSuccesses().values()
.stream().map(doc ->
- new AppSearchShortcutInfo(doc)
- .toShortcutInfo(mShortcutUser.getUserId()))
+ ShortcutInfo.createFromGenericDocument(
+ mShortcutUser.getUserId(), doc))
.collect(Collectors.toList());
cb.accept(ret);
});
@@ -2480,8 +2463,8 @@
}
cb.complete(results.getResultValue().stream()
.map(SearchResult::getGenericDocument)
- .map(AppSearchShortcutInfo::new)
- .map(si -> si.toShortcutInfo(mShortcutUser.getUserId()))
+ .map(doc -> ShortcutInfo.createFromGenericDocument(
+ mShortcutUser.getUserId(), doc))
.collect(Collectors.toList()));
});
}));
diff --git a/services/core/java/com/android/server/pm/ShortcutService.java b/services/core/java/com/android/server/pm/ShortcutService.java
index 057f8de..8393dee 100644
--- a/services/core/java/com/android/server/pm/ShortcutService.java
+++ b/services/core/java/com/android/server/pm/ShortcutService.java
@@ -41,7 +41,6 @@
import android.content.IntentSender.SendIntentException;
import android.content.LocusId;
import android.content.pm.ActivityInfo;
-import android.content.pm.AppSearchShortcutInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.ComponentInfo;
import android.content.pm.IPackageManager;
@@ -2805,28 +2804,6 @@
}
}
- private String createQuery(final boolean matchDynamic, final boolean matchPinned,
- final boolean matchManifest, final boolean matchCached) {
-
- final List<String> queries = new ArrayList<>(1);
- if (matchDynamic) {
- queries.add(AppSearchShortcutInfo.QUERY_IS_DYNAMIC);
- }
- if (matchPinned) {
- queries.add(AppSearchShortcutInfo.QUERY_IS_PINNED);
- }
- if (matchManifest) {
- queries.add(AppSearchShortcutInfo.QUERY_IS_MANIFEST);
- }
- if (matchCached) {
- queries.add(AppSearchShortcutInfo.QUERY_IS_CACHED);
- }
- if (queries.isEmpty()) {
- return "";
- }
- return "(" + String.join(" OR ", queries) + ")";
- }
-
/**
* Remove all the information associated with a package. This will really remove all the
* information, including the restore information (i.e. it'll remove packages even if they're
diff --git a/services/core/java/com/android/server/pm/UserDataPreparer.java b/services/core/java/com/android/server/pm/UserDataPreparer.java
index 045a295..5047690 100644
--- a/services/core/java/com/android/server/pm/UserDataPreparer.java
+++ b/services/core/java/com/android/server/pm/UserDataPreparer.java
@@ -22,6 +22,7 @@
import android.content.pm.UserInfo;
import android.os.Environment;
import android.os.FileUtils;
+import android.os.RecoverySystem;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
import android.os.SystemProperties;
@@ -115,6 +116,13 @@
// Try one last time; if we fail again we're really in trouble
prepareUserDataLI(volumeUuid, userId, userSerial,
flags | StorageManager.FLAG_STORAGE_DE, false);
+ } else {
+ try {
+ Log.e(TAG, "prepareUserData failed", e);
+ RecoverySystem.rebootPromptAndWipeUserData(mContext, "prepareUserData failed");
+ } catch (IOException e2) {
+ throw new RuntimeException("error rebooting into recovery", e2);
+ }
}
}
}
diff --git a/services/core/java/com/android/server/power/PowerGroup.java b/services/core/java/com/android/server/power/PowerGroup.java
index 9127484..c1bfdf7 100644
--- a/services/core/java/com/android/server/power/PowerGroup.java
+++ b/services/core/java/com/android/server/power/PowerGroup.java
@@ -16,9 +16,16 @@
package com.android.server.power;
+import static android.os.PowerManagerInternal.WAKEFULNESS_ASLEEP;
import static android.os.PowerManagerInternal.WAKEFULNESS_AWAKE;
+import static android.os.PowerManagerInternal.WAKEFULNESS_DOZING;
+import static android.os.PowerManagerInternal.WAKEFULNESS_DREAMING;
+import static android.os.PowerManagerInternal.isInteractive;
import android.hardware.display.DisplayManagerInternal.DisplayPowerRequest;
+import android.os.PowerManager;
+import android.os.Trace;
+import android.util.Slog;
import android.view.Display;
/**
@@ -31,47 +38,66 @@
*/
public class PowerGroup {
private static final String TAG = PowerGroup.class.getSimpleName();
+ private static final boolean DEBUG = false;
private final DisplayPowerRequest mDisplayPowerRequest;
+ private final PowerGroupListener mWakefulnessListener;
private final boolean mSupportsSandman;
private final int mGroupId;
-
- // True if DisplayManagerService has applied all the latest display states that were requested
- // for this group
+ /** True if DisplayManagerService has applied all the latest display states that were requested
+ * for this group. */
private boolean mReady;
- // True if this group is in the process of powering on
+ /** True if this group is in the process of powering on */
private boolean mPoweringOn;
- // True if this group is about to dream
+ /** True if this group is about to dream */
private boolean mIsSandmanSummoned;
private int mUserActivitySummary;
- // The current wakefulness of this group
+ /** The current wakefulness of this group */
private int mWakefulness;
private int mWakeLockSummary;
private long mLastPowerOnTime;
private long mLastUserActivityTime;
private long mLastUserActivityTimeNoChangeLights;
+ /** Timestamp (milliseconds since boot) of the last time the power group was awoken.*/
+ private long mLastWakeTime;
+ /** Timestamp (milliseconds since boot) of the last time the power group was put to sleep. */
+ private long mLastSleepTime;
- PowerGroup(int groupId, DisplayPowerRequest displayPowerRequest, int wakefulness, boolean ready,
- boolean supportsSandman) {
- this.mGroupId = groupId;
- this.mDisplayPowerRequest = displayPowerRequest;
- this.mWakefulness = wakefulness;
- this.mReady = ready;
- this.mSupportsSandman = supportsSandman;
+ PowerGroup(int groupId, PowerGroupListener wakefulnessListener,
+ DisplayPowerRequest displayPowerRequest, int wakefulness, boolean ready,
+ boolean supportsSandman, long eventTime) {
+ mGroupId = groupId;
+ mWakefulnessListener = wakefulnessListener;
+ mDisplayPowerRequest = displayPowerRequest;
+ mWakefulness = wakefulness;
+ mReady = ready;
+ mSupportsSandman = supportsSandman;
+ mLastWakeTime = eventTime;
+ mLastSleepTime = eventTime;
}
- PowerGroup() {
- this.mGroupId = Display.DEFAULT_DISPLAY_GROUP;
- this.mDisplayPowerRequest = new DisplayPowerRequest();
- this.mWakefulness = WAKEFULNESS_AWAKE;
- this.mReady = false;
- this.mSupportsSandman = true;
- }
+ PowerGroup(int wakefulness, PowerGroupListener wakefulnessListener, long eventTime) {
+ mGroupId = Display.DEFAULT_DISPLAY_GROUP;
+ mWakefulnessListener = wakefulnessListener;
+ mDisplayPowerRequest = new DisplayPowerRequest();
+ mWakefulness = wakefulness;
+ mReady = false;
+ mSupportsSandman = true;
+ mLastWakeTime = eventTime;
+ mLastSleepTime = eventTime; }
DisplayPowerRequest getDisplayPowerRequestLocked() {
return mDisplayPowerRequest;
}
+ long getLastWakeTimeLocked() {
+ return mLastWakeTime;
+ }
+
+ long getLastSleepTimeLocked() {
+ return mLastSleepTime;
+ }
+
int getWakefulnessLocked() {
return mWakefulness;
}
@@ -85,9 +111,19 @@
*
* @return {@code true} if the wakefulness value was changed; {@code false} otherwise.
*/
- boolean setWakefulnessLocked(int newWakefulness) {
+ boolean setWakefulnessLocked(int newWakefulness, long eventTime, int uid, int reason, int opUid,
+ String opPackageName, String details) {
if (mWakefulness != newWakefulness) {
+ if (newWakefulness == WAKEFULNESS_AWAKE) {
+ setLastPowerOnTimeLocked(eventTime);
+ setIsPoweringOnLocked(true);
+ mLastWakeTime = eventTime;
+ } else if (isInteractive(mWakefulness) && !isInteractive(newWakefulness)) {
+ mLastSleepTime = eventTime;
+ }
mWakefulness = newWakefulness;
+ mWakefulnessListener.onWakefulnessChangedLocked(mGroupId, mWakefulness, eventTime,
+ reason, uid, opUid, opPackageName, details);
return true;
}
return false;
@@ -105,8 +141,9 @@
* Sets whether the displays of this group are all ready.
*
* <p>A display is ready if its reported
- * {@link DisplayManagerInternal.DisplayPowerCallbacks#onStateChanged() actual state} matches
- * its {@link DisplayManagerInternal#requestPowerState requested state}.
+ * {@link android.hardware.display.DisplayManagerInternal.DisplayPowerCallbacks#onStateChanged()
+ * actual state} matches its
+ * {@link android.hardware.display.DisplayManagerInternal#requestPowerState requested state}.
*
* @param isReady {@code true} if every display in the group is ready; otherwise {@code false}.
* @return {@code true} if the ready state changed; otherwise {@code false}.
@@ -148,6 +185,62 @@
mIsSandmanSummoned = isSandmanSummoned;
}
+ boolean dreamLocked(long eventTime, int uid) {
+ if (eventTime < mLastWakeTime || mWakefulness != WAKEFULNESS_AWAKE) {
+ return false;
+ }
+
+ Trace.traceBegin(Trace.TRACE_TAG_POWER, "dreamPowerGroup" + getGroupId());
+ try {
+ Slog.i(TAG, "Napping power group (groupId=" + getGroupId() + ", uid=" + uid + ")...");
+ setSandmanSummonedLocked(true);
+ setWakefulnessLocked(WAKEFULNESS_DREAMING, eventTime, uid, /* reason= */0,
+ /* opUid= */ 0, /* opPackageName= */ null, /* details= */ null);
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_POWER);
+ }
+ return true;
+ }
+
+ boolean dozeLocked(long eventTime, int uid, int reason) {
+ if (eventTime < getLastWakeTimeLocked() || !isInteractive(mWakefulness)) {
+ return false;
+ }
+
+ Trace.traceBegin(Trace.TRACE_TAG_POWER, "powerOffDisplay");
+ try {
+ reason = Math.min(PowerManager.GO_TO_SLEEP_REASON_MAX,
+ Math.max(reason, PowerManager.GO_TO_SLEEP_REASON_MIN));
+ Slog.i(TAG, "Powering off display group due to "
+ + PowerManager.sleepReasonToString(reason) + " (groupId= " + getGroupId()
+ + ", uid= " + uid + ")...");
+
+ setSandmanSummonedLocked(/* isSandmanSummoned= */ true);
+ setWakefulnessLocked(WAKEFULNESS_DOZING, eventTime, uid, reason, /* opUid= */ 0,
+ /* opPackageName= */ null, /* details= */ null);
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_POWER);
+ }
+ return true;
+ }
+
+ boolean sleepLocked(long eventTime, int uid, int reason) {
+ if (eventTime < mLastWakeTime || getWakefulnessLocked() == WAKEFULNESS_ASLEEP) {
+ return false;
+ }
+
+ Trace.traceBegin(Trace.TRACE_TAG_POWER, "sleepPowerGroup");
+ try {
+ Slog.i(TAG, "Sleeping power group (groupId=" + getGroupId() + ", uid=" + uid + ")...");
+ setSandmanSummonedLocked(/* isSandmanSummoned= */ true);
+ setWakefulnessLocked(WAKEFULNESS_ASLEEP, eventTime, uid, reason, /* opUid= */0,
+ /* opPackageName= */ null, /* details= */ null);
+ } finally {
+ Trace.traceEnd(Trace.TRACE_TAG_POWER);
+ }
+ return true;
+ }
+
long getLastUserActivityTimeLocked() {
return mLastUserActivityTime;
}
@@ -187,4 +280,22 @@
public boolean supportsSandmanLocked() {
return mSupportsSandman;
}
+
+ protected interface PowerGroupListener {
+ /**
+ * Informs the recipient about a wakefulness change of a {@link PowerGroup}.
+ *
+ * @param groupId The PowerGroup's id for which the wakefulness has changed.
+ * @param wakefulness The new wakefulness.
+ * @param eventTime The time of the event.
+ * @param reason The reason, any of {@link android.os.PowerManager.WakeReason} or
+ * {@link android.os.PowerManager.GoToSleepReason}.
+ * @param uid The uid which caused the wakefulness change.
+ * @param opUid The uid used for AppOps.
+ * @param opPackageName The Package name used for AppOps.
+ * @param details Details about the event.
+ */
+ void onWakefulnessChangedLocked(int groupId, int wakefulness, long eventTime, int reason,
+ int uid, int opUid, String opPackageName, String details);
+ }
}
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index abfa016..4185b2d9 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -29,6 +29,7 @@
import static android.os.PowerManagerInternal.WAKEFULNESS_AWAKE;
import static android.os.PowerManagerInternal.WAKEFULNESS_DOZING;
import static android.os.PowerManagerInternal.WAKEFULNESS_DREAMING;
+import static android.os.PowerManagerInternal.isInteractive;
import static android.os.PowerManagerInternal.wakefulnessToString;
import static com.android.internal.util.LatencyTracker.ACTION_TURN_ON_SCREEN;
@@ -338,12 +339,12 @@
private boolean mRequestWaitForNegativeProximity;
// Timestamp of the last time the device was awoken or put to sleep.
- private long mLastWakeTime;
- private long mLastSleepTime;
+ private long mLastGlobalWakeTime;
+ private long mLastGlobalSleepTime;
// Last reason the device went to sleep.
- private @WakeReason int mLastWakeReason;
- private int mLastSleepReason;
+ private @WakeReason int mLastGlobalWakeReason;
+ private int mLastGlobalSleepReason;
// Timestamp of last time power boost interaction was sent.
private long mLastInteractivePowerHintTime;
@@ -352,6 +353,8 @@
private long mLastScreenBrightnessBoostTime;
private boolean mScreenBrightnessBoostInProgress;
+ private final PowerGroupWakefulnessChangeListener mPowerGroupWakefulnessChangeListener;
+
// The suspend blocker used to keep the CPU alive while the device is booting.
private final SuspendBlocker mBootingSuspendBlocker;
@@ -397,6 +400,10 @@
// The current battery level percentage.
private int mBatteryLevel;
+ // True if updatePowerStateLocked() is already in progress.
+ // TODO(b/215518989): Remove this once transactions are in place
+ private boolean mUpdatePowerStateInProgress;
+
/**
* The lock that should be held when interacting with {@link #mEnhancedDischargeTimeElapsed},
* {@link #mLastEnhancedDischargeTimeUpdatedElapsed}, and
@@ -640,6 +647,23 @@
// but the DreamService has not yet been told to start (it's an async process).
private boolean mDozeStartInProgress;
+ private final class PowerGroupWakefulnessChangeListener implements
+ PowerGroup.PowerGroupListener {
+ @GuardedBy("mLock")
+ @Override
+ public void onWakefulnessChangedLocked(int groupId, int wakefulness, long eventTime,
+ int reason, int uid, int opUid, String opPackageName, String details) {
+ if (wakefulness == WAKEFULNESS_AWAKE) {
+ // Kick user activity to prevent newly awake group from timing out instantly.
+ userActivityNoUpdateLocked(mPowerGroups.get(groupId), eventTime,
+ PowerManager.USER_ACTIVITY_EVENT_OTHER, 0, uid);
+ }
+ mDirty |= DIRTY_DISPLAY_GROUP_WAKEFULNESS;
+ updateGlobalWakefulnessLocked(eventTime, reason, uid, opUid, opPackageName, details);
+ updatePowerStateLocked();
+ }
+ }
+
private final class DisplayGroupPowerChangeListener implements
DisplayManagerInternal.DisplayGroupListener {
@@ -658,10 +682,12 @@
final boolean supportsSandman = groupId == Display.DEFAULT_DISPLAY_GROUP;
final PowerGroup powerGroup = new PowerGroup(
groupId,
+ mPowerGroupWakefulnessChangeListener,
new DisplayPowerRequest(),
- getGlobalWakefulnessLocked(),
+ WAKEFULNESS_AWAKE,
/* ready= */ false,
- supportsSandman);
+ supportsSandman,
+ mClock.uptimeMillis());
mPowerGroups.append(groupId, powerGroup);
onPowerGroupEventLocked(DISPLAY_GROUP_ADDED, powerGroup);
}
@@ -992,6 +1018,8 @@
mInattentiveSleepWarningOverlayController =
mInjector.createInattentiveSleepWarningController();
+ mPowerGroupWakefulnessChangeListener = new PowerGroupWakefulnessChangeListener();
+
// Save brightness values:
// Get float values from config.
// Store float if valid
@@ -1144,10 +1172,10 @@
updatePowerStateLocked();
if (sQuiescent) {
- sleepDisplayGroupNoUpdateLocked(mPowerGroups.get(Display.DEFAULT_DISPLAY_GROUP),
+ sleepPowerGroupLocked(mPowerGroups.get(Display.DEFAULT_DISPLAY_GROUP),
mClock.uptimeMillis(),
PowerManager.GO_TO_SLEEP_REASON_QUIESCENT,
- PowerManager.GO_TO_SLEEP_FLAG_NO_DOZE, Process.SYSTEM_UID);
+ Process.SYSTEM_UID);
}
mContext.getSystemService(DeviceStateManager.class).registerCallback(
@@ -1164,7 +1192,9 @@
mPolicy = getLocalService(WindowManagerPolicy.class);
mBatteryManagerInternal = getLocalService(BatteryManagerInternal.class);
mAttentionDetector.systemReady(mContext);
- mPowerGroups.append(Display.DEFAULT_DISPLAY_GROUP, new PowerGroup());
+ mPowerGroups.append(Display.DEFAULT_DISPLAY_GROUP,
+ new PowerGroup(WAKEFULNESS_AWAKE, mPowerGroupWakefulnessChangeListener,
+ mClock.uptimeMillis()));
DisplayGroupPowerChangeListener displayGroupPowerChangeListener =
new DisplayGroupPowerChangeListener();
mDisplayManagerInternal.registerDisplayGroupListener(displayGroupPowerChangeListener);
@@ -1503,7 +1533,7 @@
opUid = wakeLock.mOwnerUid;
}
for (int idx = 0; idx < mPowerGroups.size(); idx++) {
- wakeDisplayGroupNoUpdateLocked(mPowerGroups.valueAt(idx), mClock.uptimeMillis(),
+ wakePowerGroupLocked(mPowerGroups.valueAt(idx), mClock.uptimeMillis(),
PowerManager.WAKE_REASON_APPLICATION, wakeLock.mTag, opUid, opPackageName,
opUid);
}
@@ -1777,13 +1807,15 @@
@GuardedBy("mLock")
private boolean userActivityNoUpdateLocked(final PowerGroup powerGroup, long eventTime,
int event, int flags, int uid) {
+ final int groupId = powerGroup.getGroupId();
if (DEBUG_SPEW) {
- Slog.d(TAG, "userActivityNoUpdateLocked: groupId=" + powerGroup.getGroupId()
+ Slog.d(TAG, "userActivityNoUpdateLocked: groupId=" + groupId
+ ", eventTime=" + eventTime + ", event=" + event
+ ", flags=0x" + Integer.toHexString(flags) + ", uid=" + uid);
}
- if (eventTime < mLastSleepTime || eventTime < mLastWakeTime || !mSystemReady) {
+ if (eventTime < powerGroup.getLastSleepTimeLocked()
+ || eventTime < powerGroup.getLastWakeTimeLocked() || !mSystemReady) {
return false;
}
@@ -1801,7 +1833,6 @@
mUserInactiveOverrideFromWindowManager = false;
mOverriddenTimeout = -1;
}
-
final int wakefulness = powerGroup.getWakefulnessLocked();
if (wakefulness == WAKEFULNESS_ASLEEP
|| wakefulness == WAKEFULNESS_DOZING
@@ -1846,42 +1877,33 @@
}
}
- private void wakeDisplayGroup(int groupId, long eventTime, @WakeReason int reason,
- String details, int uid, String opPackageName, int opUid) {
- synchronized (mLock) {
- if (wakeDisplayGroupNoUpdateLocked(mPowerGroups.get(groupId), eventTime, reason,
- details, uid, opPackageName, opUid)) {
- updatePowerStateLocked();
- }
- }
- }
-
@GuardedBy("mLock")
- private boolean wakeDisplayGroupNoUpdateLocked(final PowerGroup powerGroup, long eventTime,
+ private void wakePowerGroupLocked(final PowerGroup powerGroup, long eventTime,
@WakeReason int reason, String details, int uid, String opPackageName, int opUid) {
final int groupId = powerGroup.getGroupId();
if (DEBUG_SPEW) {
- Slog.d(TAG, "wakeDisplayGroupNoUpdateLocked: eventTime=" + eventTime
+ Slog.d(TAG, "wakePowerGroupLocked: eventTime=" + eventTime
+ ", groupId=" + groupId + ", uid=" + uid);
}
- if (eventTime < mLastSleepTime || mForceSuspendActive || !mSystemReady) {
- return false;
+ if (eventTime < powerGroup.getLastSleepTimeLocked() || mForceSuspendActive
+ || !mSystemReady) {
+ return;
}
- final int currentState = powerGroup.getWakefulnessLocked();
- if (currentState == WAKEFULNESS_AWAKE) {
+ final int currentWakefulness = powerGroup.getWakefulnessLocked();
+ if (currentWakefulness == WAKEFULNESS_AWAKE) {
if (!mBootCompleted && sQuiescent) {
mDirty |= DIRTY_QUIESCENT;
- return true;
+ updatePowerStateLocked();
}
- return false;
+ return;
}
Trace.traceBegin(Trace.TRACE_TAG_POWER, "powerOnDisplay");
try {
- Slog.i(TAG, "Powering on display group from"
- + PowerManagerInternal.wakefulnessToString(currentState)
+ Slog.i(TAG, "Waking up power group from "
+ + PowerManagerInternal.wakefulnessToString(currentWakefulness)
+ " (groupId=" + groupId
+ ", uid=" + uid
+ ", reason=" + PowerManager.wakeReasonToString(reason)
@@ -1892,183 +1914,96 @@
LatencyTracker.getInstance(mContext)
.onActionStart(ACTION_TURN_ON_SCREEN, String.valueOf(groupId));
- setWakefulnessLocked(powerGroup, WAKEFULNESS_AWAKE, eventTime, uid, reason, opUid,
+ powerGroup.setWakefulnessLocked(WAKEFULNESS_AWAKE, eventTime, uid, reason, opUid,
opPackageName, details);
- powerGroup.setLastPowerOnTimeLocked(eventTime);
- powerGroup.setIsPoweringOnLocked(true);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_POWER);
}
-
- return true;
- }
-
- private void sleepDisplayGroup(int groupId, long eventTime, int reason, int flags,
- int uid) {
- synchronized (mLock) {
- if (sleepDisplayGroupNoUpdateLocked(mPowerGroups.get(groupId), eventTime, reason, flags,
- uid)) {
- updatePowerStateLocked();
- }
- }
}
@GuardedBy("mLock")
- private boolean sleepDisplayGroupNoUpdateLocked(final PowerGroup powerGroup, long eventTime,
- int reason, int flags, int uid) {
+ private boolean dreamPowerGroupLocked(PowerGroup powerGroup, long eventTime, int uid) {
+ if (DEBUG_SPEW) {
+ Slog.d(TAG, "dreamPowerGroup: groupId=" + powerGroup.getGroupId() + ", eventTime="
+ + eventTime + ", uid=" + uid);
+ }
+ if (!mBootCompleted || !mSystemReady) {
+ return false;
+ }
+ return powerGroup.dreamLocked(eventTime, uid);
+ }
+
+ @GuardedBy("mLock")
+ private boolean dozePowerGroupLocked(final PowerGroup powerGroup, long eventTime,
+ int reason, int uid) {
if (DEBUG_SPEW) {
Slog.d(TAG, "sleepDisplayGroupNoUpdateLocked: eventTime=" + eventTime
+ ", groupId=" + powerGroup.getGroupId() + ", reason=" + reason
- + ", flags=" + flags + ", uid=" + uid);
+ + ", uid=" + uid);
}
- if (eventTime < mLastWakeTime
- || !PowerManagerInternal.isInteractive(getWakefulnessLocked())
- || !mSystemReady
- || !mBootCompleted) {
+ if (!mSystemReady || !mBootCompleted) {
return false;
}
- final int wakefulness = powerGroup.getWakefulnessLocked();
- if (!PowerManagerInternal.isInteractive(wakefulness)) {
- return false;
- }
-
- Trace.traceBegin(Trace.TRACE_TAG_POWER, "powerOffDisplay");
- try {
- reason = Math.min(PowerManager.GO_TO_SLEEP_REASON_MAX,
- Math.max(reason, PowerManager.GO_TO_SLEEP_REASON_MIN));
- Slog.i(TAG, "Powering off display group due to "
- + PowerManager.sleepReasonToString(reason)
- + " (groupId= " + powerGroup.getGroupId() + ", uid= " + uid + ")...");
-
- powerGroup.setSandmanSummonedLocked(/* isSandmanSummoned= */ true);
- setWakefulnessLocked(powerGroup, WAKEFULNESS_DOZING, eventTime, uid, reason,
- /* opUid= */ 0, /* opPackageName= */ null, /* details= */ null);
- if ((flags & PowerManager.GO_TO_SLEEP_FLAG_NO_DOZE) != 0) {
- reallySleepDisplayGroupNoUpdateLocked(powerGroup, eventTime, uid);
- }
- } finally {
- Trace.traceEnd(Trace.TRACE_TAG_POWER);
- }
- return true;
- }
-
- private void dreamDisplayGroup(int groupId, long eventTime, int uid) {
- synchronized (mLock) {
- if (dreamDisplayGroupNoUpdateLocked(mPowerGroups.get(groupId), eventTime, uid)) {
- updatePowerStateLocked();
- }
- }
+ return powerGroup.dozeLocked(eventTime, uid, reason);
}
@GuardedBy("mLock")
- private boolean dreamDisplayGroupNoUpdateLocked(final PowerGroup powerGroup, long eventTime,
+ private boolean sleepPowerGroupLocked(final PowerGroup powerGroup, long eventTime, int reason,
int uid) {
if (DEBUG_SPEW) {
- Slog.d(TAG, "dreamDisplayGroupNoUpdateLocked: eventTime=" + eventTime
- + ", uid=" + uid);
+ Slog.d(TAG, "sleepPowerGroup: eventTime=" + eventTime + ", uid=" + uid);
}
-
- if (eventTime < mLastWakeTime || getWakefulnessLocked() != WAKEFULNESS_AWAKE
- || !mBootCompleted || !mSystemReady) {
+ if (!mBootCompleted || !mSystemReady) {
return false;
}
- Trace.traceBegin(Trace.TRACE_TAG_POWER, "napDisplayGroup");
- try {
- Slog.i(TAG, "Napping display group (groupId=" + powerGroup.getGroupId() + ", uid=" + uid
- + ")...");
-
- powerGroup.setSandmanSummonedLocked(/* isSandmanSummoned= */ true);
- setWakefulnessLocked(powerGroup, WAKEFULNESS_DREAMING, eventTime, uid,
- /* reason= */0, /* opUid= */ 0, /* opPackageName= */ null, /* details= */ null);
-
- } finally {
- Trace.traceEnd(Trace.TRACE_TAG_POWER);
- }
- return true;
- }
-
- @GuardedBy("mLock")
- private boolean reallySleepDisplayGroupNoUpdateLocked(final PowerGroup powerGroup,
- long eventTime, int uid) {
- if (DEBUG_SPEW) {
- Slog.d(TAG, "reallySleepDisplayGroupNoUpdateLocked: eventTime=" + eventTime
- + ", uid=" + uid);
- }
-
- if (eventTime < mLastWakeTime || getWakefulnessLocked() == WAKEFULNESS_ASLEEP
- || !mBootCompleted || !mSystemReady
- || powerGroup.getWakefulnessLocked()
- == WAKEFULNESS_ASLEEP) {
- return false;
- }
-
- Trace.traceBegin(Trace.TRACE_TAG_POWER, "reallySleepDisplayGroup");
- try {
- Slog.i(TAG,
- "Sleeping display group (groupId=" + powerGroup.getGroupId() + ", uid=" + uid
- + ")...");
-
- setWakefulnessLocked(powerGroup, WAKEFULNESS_ASLEEP, eventTime, uid,
- PowerManager.GO_TO_SLEEP_REASON_TIMEOUT, /* opUid= */ 0,
- /* opPackageName= */ null, /* details= */ null);
- } finally {
- Trace.traceEnd(Trace.TRACE_TAG_POWER);
- }
- return true;
+ return powerGroup.sleepLocked(eventTime, uid, reason);
}
@VisibleForTesting
@GuardedBy("mLock")
void setWakefulnessLocked(int groupId, int wakefulness, long eventTime, int uid, int reason,
int opUid, String opPackageName, String details) {
- setWakefulnessLocked(mPowerGroups.get(groupId), wakefulness, eventTime, uid, reason, opUid,
+ mPowerGroups.get(groupId).setWakefulnessLocked(wakefulness, eventTime, uid, reason, opUid,
opPackageName, details);
}
- @GuardedBy("mLock")
- private void setWakefulnessLocked(final PowerGroup powerGroup, int wakefulness, long eventTime,
- int uid, int reason, int opUid, String opPackageName, String details) {
- if (powerGroup.setWakefulnessLocked(wakefulness)) {
- mDirty |= DIRTY_DISPLAY_GROUP_WAKEFULNESS;
- setGlobalWakefulnessLocked(getGlobalWakefulnessLocked(),
- eventTime, reason, uid, opUid, opPackageName, details);
- if (wakefulness == WAKEFULNESS_AWAKE) {
- // Kick user activity to prevent newly awake group from timing out instantly.
- userActivityNoUpdateLocked(powerGroup, eventTime,
- PowerManager.USER_ACTIVITY_EVENT_OTHER, 0, uid);
- }
- }
- }
-
@SuppressWarnings("deprecation")
@GuardedBy("mLock")
- private void setGlobalWakefulnessLocked(int wakefulness, long eventTime, int reason, int uid,
+ private void updateGlobalWakefulnessLocked(long eventTime, int reason, int uid,
int opUid, String opPackageName, String details) {
- if (getWakefulnessLocked() == wakefulness) {
+ int newWakefulness = recalculateGlobalWakefulnessLocked();
+ int currentWakefulness = getGlobalWakefulnessLocked();
+ if (currentWakefulness == newWakefulness) {
return;
}
// Phase 1: Handle pre-wakefulness change bookkeeping.
final String traceMethodName;
- switch (wakefulness) {
+ switch (newWakefulness) {
case WAKEFULNESS_ASLEEP:
traceMethodName = "reallyGoToSleep";
Slog.i(TAG, "Sleeping (uid " + uid + ")...");
+ // TODO(b/215518989): Remove this once transactions are in place
+ if (currentWakefulness != WAKEFULNESS_DOZING) {
+ // in case we are going to sleep without dozing before
+ mLastGlobalSleepTime = eventTime;
+ mLastGlobalSleepReason = reason;
+ }
break;
case WAKEFULNESS_AWAKE:
traceMethodName = "wakeUp";
Slog.i(TAG, "Waking up from "
- + PowerManagerInternal.wakefulnessToString(getWakefulnessLocked())
+ + PowerManagerInternal.wakefulnessToString(currentWakefulness)
+ " (uid=" + uid
+ ", reason=" + PowerManager.wakeReasonToString(reason)
+ ", details=" + details
+ ")...");
- mLastWakeTime = eventTime;
- mLastWakeReason = reason;
+ mLastGlobalWakeTime = eventTime;
+ mLastGlobalWakeReason = reason;
break;
case WAKEFULNESS_DREAMING:
@@ -2081,13 +2016,13 @@
Slog.i(TAG, "Going to sleep due to " + PowerManager.sleepReasonToString(reason)
+ " (uid " + uid + ")...");
- mLastSleepTime = eventTime;
- mLastSleepReason = reason;
+ mLastGlobalSleepTime = eventTime;
+ mLastGlobalSleepReason = reason;
mDozeStartInProgress = true;
break;
default:
- throw new IllegalArgumentException("Unexpected wakefulness: " + wakefulness);
+ throw new IllegalArgumentException("Unexpected wakefulness: " + newWakefulness);
}
Trace.traceBegin(Trace.TRACE_TAG_POWER, traceMethodName);
@@ -2095,20 +2030,20 @@
// Phase 2: Handle wakefulness change and bookkeeping.
// Under lock, invalidate before set ensures caches won't return stale values.
mInjector.invalidateIsInteractiveCaches();
- mWakefulnessRaw = wakefulness;
+ mWakefulnessRaw = newWakefulness;
mWakefulnessChanging = true;
mDirty |= DIRTY_WAKEFULNESS;
// This is only valid while we are in wakefulness dozing. Set to false otherwise.
- mDozeStartInProgress &= (getWakefulnessLocked() == WAKEFULNESS_DOZING);
+ mDozeStartInProgress &= (newWakefulness == WAKEFULNESS_DOZING);
if (mNotifier != null) {
- mNotifier.onWakefulnessChangeStarted(wakefulness, reason, eventTime);
+ mNotifier.onWakefulnessChangeStarted(newWakefulness, reason, eventTime);
}
- mAttentionDetector.onWakefulnessChangeStarted(wakefulness);
+ mAttentionDetector.onWakefulnessChangeStarted(newWakefulness);
// Phase 3: Handle post-wakefulness change bookkeeping.
- switch (wakefulness) {
+ switch (newWakefulness) {
case WAKEFULNESS_AWAKE:
mNotifier.onWakeUp(reason, details, uid, opPackageName, opUid);
if (sQuiescent) {
@@ -2116,7 +2051,13 @@
}
break;
+ case WAKEFULNESS_ASLEEP:
+ // fallthrough
case WAKEFULNESS_DOZING:
+ if (!isInteractive(currentWakefulness)) {
+ // TODO(b/215518989): remove this once transactions are in place
+ break;
+ }
// Report the number of wake locks that will be cleared by going to sleep.
int numWakeLocksCleared = 0;
final int numWakeLocks = mWakeLocks.size();
@@ -2140,7 +2081,7 @@
@VisibleForTesting
@GuardedBy("mLock")
- int getWakefulnessLocked() {
+ int getGlobalWakefulnessLocked() {
return mWakefulnessRaw;
}
@@ -2163,10 +2104,9 @@
* </ol>
*/
@GuardedBy("mLock")
- int getGlobalWakefulnessLocked() {
- final int size = mPowerGroups.size();
+ int recalculateGlobalWakefulnessLocked() {
int deviceWakefulness = WAKEFULNESS_ASLEEP;
- for (int i = 0; i < size; i++) {
+ for (int i = 0; i < mPowerGroups.size(); i++) {
final int wakefulness = mPowerGroups.valueAt(i).getWakefulnessLocked();
if (wakefulness == WAKEFULNESS_AWAKE) {
return WAKEFULNESS_AWAKE;
@@ -2187,10 +2127,10 @@
void onPowerGroupEventLocked(int event, PowerGroup powerGroup) {
final int groupId = powerGroup.getGroupId();
if (event == DisplayGroupPowerChangeListener.DISPLAY_GROUP_REMOVED) {
- mPowerGroups.remove(groupId);
+ mPowerGroups.delete(groupId);
}
- final int oldWakefulness = getWakefulnessLocked();
- final int newWakefulness = getGlobalWakefulnessLocked();
+ final int oldWakefulness = getGlobalWakefulnessLocked();
+ final int newWakefulness = recalculateGlobalWakefulnessLocked();
if (event == DisplayGroupPowerChangeListener.DISPLAY_GROUP_ADDED
&& newWakefulness == WAKEFULNESS_AWAKE) {
@@ -2215,13 +2155,9 @@
default:
reason = 0;
}
-
- setGlobalWakefulnessLocked(
- getGlobalWakefulnessLocked(),
- mClock.uptimeMillis(), reason, Process.SYSTEM_UID, Process.SYSTEM_UID,
- mContext.getOpPackageName(), "groupId: " + groupId);
+ updateGlobalWakefulnessLocked(mClock.uptimeMillis(), reason, Process.SYSTEM_UID,
+ Process.SYSTEM_UID, mContext.getOpPackageName(), "groupId: " + groupId);
}
-
mDirty |= DIRTY_DISPLAY_GROUP_WAKEFULNESS;
updatePowerStateLocked();
}
@@ -2243,15 +2179,15 @@
@GuardedBy("mLock")
private void finishWakefulnessChangeIfNeededLocked() {
if (mWakefulnessChanging && areAllDisplaysReadyLocked()) {
- if (getWakefulnessLocked() == WAKEFULNESS_DOZING
+ if (getGlobalWakefulnessLocked() == WAKEFULNESS_DOZING
&& (mWakeLockSummary & WAKE_LOCK_DOZE) == 0) {
return; // wait until dream has enabled dozing
} else {
// Doze wakelock acquired (doze started) or device is no longer dozing.
mDozeStartInProgress = false;
}
- if (getWakefulnessLocked() == WAKEFULNESS_DOZING
- || getWakefulnessLocked() == WAKEFULNESS_ASLEEP) {
+ if (getGlobalWakefulnessLocked() == WAKEFULNESS_DOZING
+ || getGlobalWakefulnessLocked() == WAKEFULNESS_ASLEEP) {
logSleepTimeoutRecapturedLocked();
}
mWakefulnessChanging = false;
@@ -2282,7 +2218,7 @@
*/
@GuardedBy("mLock")
private void updatePowerStateLocked() {
- if (!mSystemReady || mDirty == 0) {
+ if (!mSystemReady || mDirty == 0 || mUpdatePowerStateInProgress) {
return;
}
if (!Thread.holdsLock(mLock)) {
@@ -2290,6 +2226,7 @@
}
Trace.traceBegin(Trace.TRACE_TAG_POWER, "updatePowerState");
+ mUpdatePowerStateInProgress = true;
try {
// Phase 0: Basic state updates.
updateIsPoweredLocked(mDirty);
@@ -2332,6 +2269,7 @@
updateSuspendBlockerLocked();
} finally {
Trace.traceEnd(Trace.TRACE_TAG_POWER);
+ mUpdatePowerStateInProgress = false;
}
}
@@ -2397,7 +2335,7 @@
final long now = mClock.uptimeMillis();
if (shouldWakeUpWhenPluggedOrUnpluggedLocked(wasPowered, oldPlugType,
dockedOnWirelessCharger)) {
- wakeDisplayGroupNoUpdateLocked(mPowerGroups.get(Display.DEFAULT_DISPLAY_GROUP),
+ wakePowerGroupLocked(mPowerGroups.get(Display.DEFAULT_DISPLAY_GROUP),
now, PowerManager.WAKE_REASON_PLUGGED_IN,
"android.server.power:PLUGGED:" + mIsPowered, Process.SYSTEM_UID,
mContext.getOpPackageName(), Process.SYSTEM_UID);
@@ -2446,7 +2384,7 @@
}
// If already dreaming and becoming powered, then don't wake.
- if (mIsPowered && getWakefulnessLocked() == WAKEFULNESS_DREAMING) {
+ if (mIsPowered && getGlobalWakefulnessLocked() == WAKEFULNESS_DREAMING) {
return false;
}
@@ -2456,7 +2394,7 @@
}
// On Always On Display, SystemUI shows the charging indicator
- if (mAlwaysOnEnabled && getWakefulnessLocked() == WAKEFULNESS_DOZING) {
+ if (mAlwaysOnEnabled && getGlobalWakefulnessLocked() == WAKEFULNESS_DOZING) {
return false;
}
@@ -2540,24 +2478,23 @@
for (int idx = 0; idx < mPowerGroups.size(); idx++) {
final PowerGroup powerGroup = mPowerGroups.valueAt(idx);
- final int wakeLockSummary = adjustWakeLockSummary(
- powerGroup.getWakefulnessLocked(),
+ final int wakeLockSummary = adjustWakeLockSummary(powerGroup.getWakefulnessLocked(),
invalidGroupWakeLockSummary | powerGroup.getWakeLockSummaryLocked());
powerGroup.setWakeLockSummaryLocked(wakeLockSummary);
}
- mWakeLockSummary = adjustWakeLockSummary(getWakefulnessLocked(),
+ mWakeLockSummary = adjustWakeLockSummary(getGlobalWakefulnessLocked(),
mWakeLockSummary);
for (int i = 0; i < numProfiles; i++) {
final ProfilePowerState profile = mProfilePowerState.valueAt(i);
- profile.mWakeLockSummary = adjustWakeLockSummary(getWakefulnessLocked(),
+ profile.mWakeLockSummary = adjustWakeLockSummary(getGlobalWakefulnessLocked(),
profile.mWakeLockSummary);
}
if (DEBUG_SPEW) {
Slog.d(TAG, "updateWakeLockSummaryLocked: mWakefulness="
- + PowerManagerInternal.wakefulnessToString(getWakefulnessLocked())
+ + PowerManagerInternal.wakefulnessToString(getGlobalWakefulnessLocked())
+ ", mWakeLockSummary=0x" + Integer.toHexString(mWakeLockSummary));
}
}
@@ -2706,11 +2643,12 @@
int groupUserActivitySummary = 0;
long groupNextTimeout = 0;
final PowerGroup powerGroup = mPowerGroups.valueAt(idx);
- if (powerGroup.getWakefulnessLocked() != WAKEFULNESS_ASLEEP) {
+ final int wakefulness = powerGroup.getWakefulnessLocked();
+ if (wakefulness != WAKEFULNESS_ASLEEP) {
final long lastUserActivityTime = powerGroup.getLastUserActivityTimeLocked();
final long lastUserActivityTimeNoChangeLights =
powerGroup.getLastUserActivityTimeNoChangeLightsLocked();
- if (lastUserActivityTime >= mLastWakeTime) {
+ if (lastUserActivityTime >= powerGroup.getLastWakeTimeLocked()) {
groupNextTimeout = lastUserActivityTime + screenOffTimeout - screenDimDuration;
if (now < groupNextTimeout) {
groupUserActivitySummary = USER_ACTIVITY_SCREEN_BRIGHT;
@@ -2721,8 +2659,8 @@
}
}
}
- if (groupUserActivitySummary == 0
- && lastUserActivityTimeNoChangeLights >= mLastWakeTime) {
+ if (groupUserActivitySummary == 0 && lastUserActivityTimeNoChangeLights
+ >= powerGroup.getLastWakeTimeLocked()) {
groupNextTimeout = lastUserActivityTimeNoChangeLights + screenOffTimeout;
if (now < groupNextTimeout) {
final DisplayPowerRequest displayPowerRequest =
@@ -2740,7 +2678,7 @@
if (sleepTimeout >= 0) {
final long anyUserActivity = Math.max(lastUserActivityTime,
lastUserActivityTimeNoChangeLights);
- if (anyUserActivity >= mLastWakeTime) {
+ if (anyUserActivity >= powerGroup.getLastWakeTimeLocked()) {
groupNextTimeout = anyUserActivity + sleepTimeout;
if (now < groupNextTimeout) {
groupUserActivitySummary = USER_ACTIVITY_SCREEN_DREAM;
@@ -2786,7 +2724,7 @@
if (DEBUG_SPEW) {
Slog.d(TAG, "updateUserActivitySummaryLocked: groupId=" + powerGroup.getGroupId()
- + ", mWakefulness=" + wakefulnessToString(powerGroup.getWakefulnessLocked())
+ + ", mWakefulness=" + wakefulnessToString(wakefulness)
+ ", mUserActivitySummary=0x" + Integer.toHexString(
groupUserActivitySummary)
+ ", nextTimeout=" + TimeUtils.formatUptime(groupNextTimeout));
@@ -2884,7 +2822,7 @@
return false;
}
- if (getWakefulnessLocked() != WAKEFULNESS_AWAKE) {
+ if (getGlobalWakefulnessLocked() != WAKEFULNESS_AWAKE) {
mInattentiveSleepWarningOverlayController.dismiss(false);
return true;
} else if (attentiveTimeout < 0 || isBeingKeptFromInattentiveSleepLocked()
@@ -3024,14 +2962,13 @@
if (DEBUG) {
Slog.i(TAG, "Going to sleep now due to long user inactivity");
}
- changed = sleepDisplayGroupNoUpdateLocked(powerGroup, time,
- PowerManager.GO_TO_SLEEP_REASON_INATTENTIVE,
- PowerManager.GO_TO_SLEEP_FLAG_NO_DOZE, Process.SYSTEM_UID);
+ changed = sleepPowerGroupLocked(powerGroup, time,
+ PowerManager.GO_TO_SLEEP_REASON_INATTENTIVE, Process.SYSTEM_UID);
} else if (shouldNapAtBedTimeLocked()) {
- changed = dreamDisplayGroupNoUpdateLocked(powerGroup, time, Process.SYSTEM_UID);
+ changed = dreamPowerGroupLocked(powerGroup, time, Process.SYSTEM_UID);
} else {
- changed = sleepDisplayGroupNoUpdateLocked(powerGroup, time,
- PowerManager.GO_TO_SLEEP_REASON_TIMEOUT, 0, Process.SYSTEM_UID);
+ changed = dozePowerGroupLocked(powerGroup, time,
+ PowerManager.GO_TO_SLEEP_REASON_TIMEOUT, Process.SYSTEM_UID);
}
}
return changed;
@@ -3228,25 +3165,27 @@
// Dream has ended or will be stopped. Update the power state.
if (isItBedTimeYetLocked(powerGroup)) {
- final int flags = isAttentiveTimeoutExpired(powerGroup, now)
- ? PowerManager.GO_TO_SLEEP_FLAG_NO_DOZE : 0;
- sleepDisplayGroupNoUpdateLocked(powerGroup, now,
- PowerManager.GO_TO_SLEEP_REASON_TIMEOUT, flags, Process.SYSTEM_UID);
+ if (isAttentiveTimeoutExpired(powerGroup, now)) {
+ sleepPowerGroupLocked(powerGroup, now,
+ PowerManager.GO_TO_SLEEP_REASON_TIMEOUT, Process.SYSTEM_UID);
+ } else {
+ dozePowerGroupLocked(powerGroup, now,
+ PowerManager.GO_TO_SLEEP_REASON_TIMEOUT, Process.SYSTEM_UID);
+ }
} else {
- wakeDisplayGroupNoUpdateLocked(powerGroup, now,
+ wakePowerGroupLocked(powerGroup, now,
PowerManager.WAKE_REASON_UNKNOWN,
"android.server.power:DREAM_FINISHED", Process.SYSTEM_UID,
mContext.getOpPackageName(), Process.SYSTEM_UID);
}
- updatePowerStateLocked();
} else if (wakefulness == WAKEFULNESS_DOZING) {
if (isDreaming) {
return; // continue dozing
}
// Doze has ended or will be stopped. Update the power state.
- reallySleepDisplayGroupNoUpdateLocked(powerGroup, now, Process.SYSTEM_UID);
- updatePowerStateLocked();
+ sleepPowerGroupLocked(powerGroup, now, PowerManager.GO_TO_SLEEP_REASON_TIMEOUT,
+ Process.SYSTEM_UID);
}
}
@@ -3263,7 +3202,7 @@
private boolean canDreamLocked(final PowerGroup powerGroup) {
final DisplayPowerRequest displayPowerRequest = powerGroup.getDisplayPowerRequestLocked();
if (!mBootCompleted
- || getWakefulnessLocked() != WAKEFULNESS_DREAMING
+ || getGlobalWakefulnessLocked() != WAKEFULNESS_DREAMING
|| !mDreamsSupportedConfig
|| !mDreamsEnabledSetting
|| !displayPowerRequest.isBrightOrDim()
@@ -3294,7 +3233,7 @@
@GuardedBy("mLock")
private boolean canDozeLocked() {
// TODO (b/175764708): Support per-display doze.
- return getWakefulnessLocked() == WAKEFULNESS_DOZING;
+ return getGlobalWakefulnessLocked() == WAKEFULNESS_DOZING;
}
/**
@@ -3375,15 +3314,15 @@
final boolean ready = mDisplayManagerInternal.requestPowerState(groupId,
displayPowerRequest, mRequestWaitForNegativeProximity);
- mNotifier.onScreenPolicyUpdate(groupId, displayPowerRequest.policy);
+ mNotifier.onScreenPolicyUpdate(powerGroup.getGroupId(), displayPowerRequest.policy);
+ int wakefulness = powerGroup.getWakefulnessLocked();
if (DEBUG_SPEW) {
Slog.d(TAG, "updateDisplayPowerStateLocked: displayReady=" + ready
+ ", groupId=" + groupId
+ ", policy=" + policyToString(displayPowerRequest.policy)
+ ", mWakefulness="
- + PowerManagerInternal.wakefulnessToString(
- powerGroup.getWakefulnessLocked())
+ + PowerManagerInternal.wakefulnessToString(wakefulness)
+ ", mWakeLockSummary=0x" + Integer.toHexString(
powerGroup.getWakeLockSummaryLocked())
+ ", mUserActivitySummary=0x" + Integer.toHexString(
@@ -3401,7 +3340,7 @@
final boolean displayReadyStateChanged = powerGroup.setReadyLocked(ready);
final boolean poweringOn = powerGroup.isPoweringOnLocked();
if (ready && displayReadyStateChanged && poweringOn
- && powerGroup.getWakefulnessLocked() == WAKEFULNESS_AWAKE) {
+ && wakefulness == WAKEFULNESS_AWAKE) {
powerGroup.setIsPoweringOnLocked(false);
LatencyTracker.getInstance(mContext).onActionEnd(ACTION_TURN_ON_SCREEN);
Trace.asyncTraceEnd(Trace.TRACE_TAG_POWER, TRACE_SCREEN_ON, groupId);
@@ -3424,7 +3363,7 @@
if (mScreenBrightnessBoostInProgress) {
final long now = mClock.uptimeMillis();
mHandler.removeMessages(MSG_SCREEN_BRIGHTNESS_BOOST_TIMEOUT);
- if (mLastScreenBrightnessBoostTime > mLastSleepTime) {
+ if (mLastScreenBrightnessBoostTime > mLastGlobalSleepTime) {
final long boostTimeout = mLastScreenBrightnessBoostTime +
SCREEN_BRIGHTNESS_BOOST_TIMEOUT;
if (boostTimeout > now) {
@@ -3656,7 +3595,7 @@
// Here we wait for mWakefulnessChanging to become false since the wakefulness
// transition to DOZING isn't considered "changed" until the doze wake lock is
// acquired.
- if (getWakefulnessLocked() == WAKEFULNESS_DOZING && mDozeStartInProgress) {
+ if (getGlobalWakefulnessLocked() == WAKEFULNESS_DOZING && mDozeStartInProgress) {
return true;
}
@@ -3721,7 +3660,7 @@
private boolean isInteractiveInternal() {
synchronized (mLock) {
- return PowerManagerInternal.isInteractive(getWakefulnessLocked());
+ return PowerManagerInternal.isInteractive(getGlobalWakefulnessLocked());
}
}
@@ -4092,7 +4031,7 @@
private void boostScreenBrightnessInternal(long eventTime, int uid) {
synchronized (mLock) {
- if (!mSystemReady || getWakefulnessLocked() == WAKEFULNESS_ASLEEP
+ if (!mSystemReady || getGlobalWakefulnessLocked() == WAKEFULNESS_ASLEEP
|| eventTime < mLastScreenBrightnessBoostTime) {
return;
}
@@ -4225,14 +4164,9 @@
synchronized (mLock) {
mForceSuspendActive = true;
// Place the system in an non-interactive state
- boolean updatePowerState = false;
for (int idx = 0; idx < mPowerGroups.size(); idx++) {
- updatePowerState |= sleepDisplayGroupNoUpdateLocked(mPowerGroups.valueAt(idx),
- mClock.uptimeMillis(), PowerManager.GO_TO_SLEEP_REASON_FORCE_SUSPEND,
- PowerManager.GO_TO_SLEEP_FLAG_NO_DOZE, uid);
- }
- if (updatePowerState) {
- updatePowerStateLocked();
+ sleepPowerGroupLocked(mPowerGroups.valueAt(idx), mClock.uptimeMillis(),
+ PowerManager.GO_TO_SLEEP_REASON_FORCE_SUSPEND, uid);
}
// Disable all the partial wake locks as well
@@ -4331,7 +4265,7 @@
mConstants.dump(pw);
pw.println(" mDirty=0x" + Integer.toHexString(mDirty));
pw.println(" mWakefulness="
- + PowerManagerInternal.wakefulnessToString(getWakefulnessLocked()));
+ + PowerManagerInternal.wakefulnessToString(getGlobalWakefulnessLocked()));
pw.println(" mWakefulnessChanging=" + mWakefulnessChanging);
pw.println(" mIsPowered=" + mIsPowered);
pw.println(" mPlugType=" + mPlugType);
@@ -4382,9 +4316,10 @@
pw.println(" mDeviceIdleMode=" + mDeviceIdleMode);
pw.println(" mDeviceIdleWhitelist=" + Arrays.toString(mDeviceIdleWhitelist));
pw.println(" mDeviceIdleTempWhitelist=" + Arrays.toString(mDeviceIdleTempWhitelist));
- pw.println(" mLastWakeTime=" + TimeUtils.formatUptime(mLastWakeTime));
- pw.println(" mLastSleepTime=" + TimeUtils.formatUptime(mLastSleepTime));
- pw.println(" mLastSleepReason=" + PowerManager.sleepReasonToString(mLastSleepReason));
+ pw.println(" mLastWakeTime=" + TimeUtils.formatUptime(mLastGlobalWakeTime));
+ pw.println(" mLastSleepTime=" + TimeUtils.formatUptime(mLastGlobalSleepTime));
+ pw.println(" mLastSleepReason=" + PowerManager.sleepReasonToString(
+ mLastGlobalSleepReason));
pw.println(" mLastInteractivePowerHintTime="
+ TimeUtils.formatUptime(mLastInteractivePowerHintTime));
pw.println(" mLastScreenBrightnessBoostTime="
@@ -4565,7 +4500,7 @@
synchronized (mLock) {
mConstants.dumpProto(proto);
proto.write(PowerManagerServiceDumpProto.DIRTY, mDirty);
- proto.write(PowerManagerServiceDumpProto.WAKEFULNESS, getWakefulnessLocked());
+ proto.write(PowerManagerServiceDumpProto.WAKEFULNESS, getGlobalWakefulnessLocked());
proto.write(PowerManagerServiceDumpProto.IS_WAKEFULNESS_CHANGING, mWakefulnessChanging);
proto.write(PowerManagerServiceDumpProto.IS_POWERED, mIsPowered);
proto.write(PowerManagerServiceDumpProto.PLUG_TYPE, mPlugType);
@@ -4664,8 +4599,8 @@
proto.write(PowerManagerServiceDumpProto.DEVICE_IDLE_TEMP_WHITELIST, id);
}
- proto.write(PowerManagerServiceDumpProto.LAST_WAKE_TIME_MS, mLastWakeTime);
- proto.write(PowerManagerServiceDumpProto.LAST_SLEEP_TIME_MS, mLastSleepTime);
+ proto.write(PowerManagerServiceDumpProto.LAST_WAKE_TIME_MS, mLastGlobalWakeTime);
+ proto.write(PowerManagerServiceDumpProto.LAST_SLEEP_TIME_MS, mLastGlobalSleepTime);
proto.write(
PowerManagerServiceDumpProto.LAST_INTERACTIVE_POWER_HINT_TIME_MS,
mLastInteractivePowerHintTime);
@@ -5505,8 +5440,10 @@
final int uid = Binder.getCallingUid();
final long ident = Binder.clearCallingIdentity();
try {
- wakeDisplayGroup(Display.DEFAULT_DISPLAY_GROUP, eventTime, reason, details, uid,
- opPackageName, uid);
+ synchronized (mLock) {
+ wakePowerGroupLocked(mPowerGroups.get(Display.DEFAULT_DISPLAY_GROUP), eventTime,
+ reason, details, uid, opPackageName, uid);
+ }
} finally {
Binder.restoreCallingIdentity(ident);
}
@@ -5524,7 +5461,14 @@
final int uid = Binder.getCallingUid();
final long ident = Binder.clearCallingIdentity();
try {
- sleepDisplayGroup(Display.DEFAULT_DISPLAY_GROUP, eventTime, reason, flags, uid);
+ synchronized (mLock) {
+ PowerGroup defaultPowerGroup = mPowerGroups.get(Display.DEFAULT_DISPLAY_GROUP);
+ if ((flags & PowerManager.GO_TO_SLEEP_FLAG_NO_DOZE) != 0) {
+ sleepPowerGroupLocked(defaultPowerGroup, eventTime, reason, uid);
+ } else {
+ dozePowerGroupLocked(defaultPowerGroup, eventTime, reason, uid);
+ }
+ }
} finally {
Binder.restoreCallingIdentity(ident);
}
@@ -5542,7 +5486,10 @@
final int uid = Binder.getCallingUid();
final long ident = Binder.clearCallingIdentity();
try {
- dreamDisplayGroup(Display.DEFAULT_DISPLAY_GROUP, eventTime, uid);
+ synchronized (mLock) {
+ dreamPowerGroupLocked(mPowerGroups.get(Display.DEFAULT_DISPLAY_GROUP),
+ eventTime, uid);
+ }
} finally {
Binder.restoreCallingIdentity(ident);
}
@@ -6181,13 +6128,15 @@
private int getLastSleepReasonInternal() {
synchronized (mLock) {
- return mLastSleepReason;
+ return mLastGlobalSleepReason;
}
}
+ @VisibleForTesting
private PowerManager.WakeData getLastWakeupInternal() {
synchronized (mLock) {
- return new WakeData(mLastWakeTime, mLastWakeReason, mLastWakeTime - mLastSleepTime);
+ return new WakeData(mLastGlobalWakeTime, mLastGlobalWakeReason,
+ mLastGlobalWakeTime - mLastGlobalSleepTime);
}
}
diff --git a/services/core/java/com/android/server/servicewatcher/ServiceWatcher.java b/services/core/java/com/android/server/servicewatcher/ServiceWatcher.java
index 030bbd2..5636718 100644
--- a/services/core/java/com/android/server/servicewatcher/ServiceWatcher.java
+++ b/services/core/java/com/android/server/servicewatcher/ServiceWatcher.java
@@ -70,7 +70,7 @@
* cleanup in response to a single binder operation, it should not be used to propagate
* errors further. Run on the ServiceWatcher thread.
*/
- default void onError() {}
+ default void onError(Throwable t) {}
}
/**
diff --git a/services/core/java/com/android/server/servicewatcher/ServiceWatcherImpl.java b/services/core/java/com/android/server/servicewatcher/ServiceWatcherImpl.java
index 631be38..94ea463 100644
--- a/services/core/java/com/android/server/servicewatcher/ServiceWatcherImpl.java
+++ b/services/core/java/com/android/server/servicewatcher/ServiceWatcherImpl.java
@@ -25,6 +25,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
+import android.os.DeadObjectException;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
@@ -239,7 +240,7 @@
Preconditions.checkState(Looper.myLooper() == mHandler.getLooper());
if (mBinder == null) {
- operation.onError();
+ operation.onError(new DeadObjectException());
return;
}
@@ -249,7 +250,7 @@
// binders may propagate some specific non-RemoteExceptions from the other side
// through the binder as well - we cannot allow those to crash the system server
Log.e(TAG, "[" + mTag + "] error running operation on " + mBoundServiceInfo, e);
- operation.onError();
+ operation.onError(e);
}
}
diff --git a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
index e180032..277d802 100644
--- a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
+++ b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
@@ -23,13 +23,13 @@
import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
import static android.net.NetworkCapabilities.TRANSPORT_ETHERNET;
import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
-import static android.net.NetworkIdentity.OEM_PAID;
-import static android.net.NetworkIdentity.OEM_PRIVATE;
import static android.net.NetworkStats.METERED_YES;
import static android.net.NetworkTemplate.MATCH_ETHERNET;
import static android.net.NetworkTemplate.MATCH_MOBILE;
import static android.net.NetworkTemplate.MATCH_WIFI;
import static android.net.NetworkTemplate.OEM_MANAGED_ALL;
+import static android.net.NetworkTemplate.OEM_MANAGED_PAID;
+import static android.net.NetworkTemplate.OEM_MANAGED_PRIVATE;
import static android.net.NetworkTemplate.getAllCollapsedRatTypes;
import static android.os.Debug.getIonHeapsSizeKb;
import static android.os.Process.LAST_SHARED_APPLICATION_GID;
@@ -1292,7 +1292,8 @@
new Pair(MATCH_MOBILE, TRANSPORT_CELLULAR),
new Pair(MATCH_WIFI, TRANSPORT_WIFI)
);
- final int[] oemManagedTypes = new int[] {OEM_PAID | OEM_PRIVATE, OEM_PAID, OEM_PRIVATE};
+ final int[] oemManagedTypes = new int[] {OEM_MANAGED_PAID | OEM_MANAGED_PRIVATE,
+ OEM_MANAGED_PAID, OEM_MANAGED_PRIVATE};
final List<NetworkStatsExt> ret = new ArrayList<>();
@@ -1368,12 +1369,12 @@
NetworkStatsUtils.fromPublicNetworkStats(queryNonTaggedStats);
if (!includeTags) return nonTaggedStats;
- final android.app.usage.NetworkStats quaryTaggedStats =
+ final android.app.usage.NetworkStats queryTaggedStats =
mNetworkStatsManager.queryTaggedSummary(template,
currentTimeInMillis - elapsedMillisSinceBoot - bucketDuration,
currentTimeInMillis);
final NetworkStats taggedStats =
- NetworkStatsUtils.fromPublicNetworkStats(quaryTaggedStats);
+ NetworkStatsUtils.fromPublicNetworkStats(queryTaggedStats);
return nonTaggedStats.add(taggedStats);
}
@@ -1470,7 +1471,7 @@
*/
@NonNull private NetworkStats sliceNetworkStats(@NonNull NetworkStats stats,
@NonNull Function<NetworkStats.Entry, NetworkStats.Entry> slicer) {
- NetworkStats ret = new NetworkStats(stats.getElapsedRealtime(), 1);
+ NetworkStats ret = new NetworkStats(0, 1);
NetworkStats.Entry entry = new NetworkStats.Entry();
for (NetworkStats.Entry e : stats) {
if (slicer != null) {
diff --git a/services/core/java/com/android/server/statusbar/SessionMonitor.java b/services/core/java/com/android/server/statusbar/SessionMonitor.java
new file mode 100644
index 0000000..f4356bd
--- /dev/null
+++ b/services/core/java/com/android/server/statusbar/SessionMonitor.java
@@ -0,0 +1,166 @@
+/**
+ * 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.server.statusbar;
+
+import static android.app.StatusBarManager.ALL_SESSIONS;
+import static android.app.StatusBarManager.SESSION_BIOMETRIC_PROMPT;
+import static android.app.StatusBarManager.SESSION_KEYGUARD;
+import static android.app.StatusBarManager.SessionFlags;
+
+import android.Manifest;
+import android.annotation.NonNull;
+import android.content.Context;
+import android.os.RemoteException;
+import android.util.Log;
+
+import com.android.internal.logging.InstanceId;
+import com.android.internal.statusbar.ISessionListener;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Monitors session starts and ends. Session instanceIds can be used to correlate logs.
+ */
+public class SessionMonitor {
+ private static final String TAG = "SessionMonitor";
+
+ private final Context mContext;
+ private final Map<Integer, Set<ISessionListener>> mSessionToListeners =
+ new HashMap<>();
+
+ /** */
+ public SessionMonitor(Context context) {
+ mContext = context;
+ // initialize all sessions in the map
+ for (int session : ALL_SESSIONS) {
+ mSessionToListeners.put(session, new HashSet<>());
+ }
+ }
+
+ /**
+ * Registers a listener for all sessionTypes included in sessionFlags.
+ */
+ public void registerSessionListener(@SessionFlags int sessionFlags,
+ ISessionListener listener) {
+ requireListenerPermissions(sessionFlags);
+ synchronized (mSessionToListeners) {
+ for (int sessionType : ALL_SESSIONS) {
+ if ((sessionFlags & sessionType) != 0) {
+ mSessionToListeners.get(sessionType).add(listener);
+ }
+ }
+ }
+ }
+
+ /**
+ * Unregisters a listener for all sessionTypes included in sessionFlags.
+ */
+ public void unregisterSessionListener(@SessionFlags int sessionFlags,
+ ISessionListener listener) {
+ synchronized (mSessionToListeners) {
+ for (int sessionType : ALL_SESSIONS) {
+ if ((sessionFlags & sessionType) != 0) {
+ mSessionToListeners.get(sessionType).remove(listener);
+ }
+ }
+ }
+ }
+
+ /**
+ * Starts a session with the given sessionType, creating a new instanceId.
+ * Sends this message to all listeners registered for the given sessionType.
+ *
+ * Callers require special permission to start and end a session depending on the session.
+ */
+ public void onSessionStarted(@SessionFlags int sessionType, @NonNull InstanceId instanceId) {
+ requireSetterPermissions(sessionType);
+
+ if (!isValidSessionType(sessionType)) {
+ Log.e(TAG, "invalid onSessionStarted sessionType=" + sessionType);
+ return;
+ }
+
+ synchronized (mSessionToListeners) {
+ for (ISessionListener listener : mSessionToListeners.get(sessionType)) {
+ try {
+ listener.onSessionStarted(sessionType, instanceId);
+ } catch (RemoteException e) {
+ Log.e(TAG, "unable to send session start to listener=" + listener, e);
+ }
+ }
+ }
+ }
+
+ /**
+ * Ends a session with the given sessionType and instanceId. Sends this message
+ * to all listeners registered for the given sessionType.
+ *
+ * Callers require special permission to start and end a session depending on the session.
+ */
+ public void onSessionEnded(@SessionFlags int sessionType, @NonNull InstanceId instanceId) {
+ requireSetterPermissions(sessionType);
+
+ if (!isValidSessionType(sessionType)) {
+ Log.e(TAG, "invalid onSessionEnded sessionType=" + sessionType);
+ return;
+ }
+
+ synchronized (mSessionToListeners) {
+ for (ISessionListener listener : mSessionToListeners.get(sessionType)) {
+ try {
+ listener.onSessionEnded(sessionType, instanceId);
+ } catch (RemoteException e) {
+ Log.e(TAG, "unable to send session end to listener=" + listener, e);
+ }
+ }
+ }
+ }
+
+ private boolean isValidSessionType(@SessionFlags int sessionType) {
+ return ALL_SESSIONS.contains(sessionType);
+ }
+
+ private void requireListenerPermissions(@SessionFlags int sessionFlags) {
+ if ((sessionFlags & SESSION_KEYGUARD) != 0) {
+ mContext.enforceCallingOrSelfPermission(
+ Manifest.permission.MANAGE_BIOMETRIC,
+ "StatusBarManagerService.SessionMonitor");
+ }
+
+ if ((sessionFlags & SESSION_BIOMETRIC_PROMPT) != 0) {
+ mContext.enforceCallingOrSelfPermission(
+ Manifest.permission.MANAGE_BIOMETRIC,
+ "StatusBarManagerService.SessionMonitor");
+ }
+ }
+
+ private void requireSetterPermissions(@SessionFlags int sessionFlags) {
+ if ((sessionFlags & SESSION_KEYGUARD) != 0) {
+ mContext.enforceCallingOrSelfPermission(
+ Manifest.permission.CONTROL_KEYGUARD,
+ "StatusBarManagerService.SessionMonitor");
+ }
+
+ if ((sessionFlags & SESSION_BIOMETRIC_PROMPT) != 0) {
+ mContext.enforceCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR_SERVICE,
+ "StatusBarManagerService.SessionMonitor");
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
index 0edd06a..e71ff78 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
@@ -21,6 +21,7 @@
import static android.app.StatusBarManager.NAV_BAR_MODE_OVERRIDE_KIDS;
import static android.app.StatusBarManager.NAV_BAR_MODE_OVERRIDE_NONE;
import static android.app.StatusBarManager.NavBarModeOverride;
+import static android.app.StatusBarManager.SessionFlags;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY;
@@ -84,8 +85,10 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.inputmethod.SoftInputShowHideReason;
+import com.android.internal.logging.InstanceId;
import com.android.internal.os.TransferPipe;
import com.android.internal.statusbar.IAddTileResultCallback;
+import com.android.internal.statusbar.ISessionListener;
import com.android.internal.statusbar.IStatusBar;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.statusbar.NotificationVisibility;
@@ -145,6 +148,7 @@
private final ActivityManagerInternal mActivityManagerInternal;
private final ActivityTaskManagerInternal mActivityTaskManager;
private final PackageManagerInternal mPackageManagerInternal;
+ private final SessionMonitor mSessionMonitor;
private int mCurrentUserId;
private boolean mTracingEnabled;
@@ -260,6 +264,7 @@
mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class);
mTileRequestTracker = new TileRequestTracker(mContext);
+ mSessionMonitor = new SessionMonitor(mContext);
}
private IOverlayManager getOverlayManager() {
@@ -1870,6 +1875,28 @@
}
}
+ @Override
+ public void onSessionStarted(@SessionFlags int sessionType, InstanceId instance) {
+ mSessionMonitor.onSessionStarted(sessionType, instance);
+ }
+
+ @Override
+ public void onSessionEnded(@SessionFlags int sessionType, InstanceId instance) {
+ mSessionMonitor.onSessionEnded(sessionType, instance);
+ }
+
+ @Override
+ public void registerSessionListener(@SessionFlags int sessionFlags,
+ ISessionListener listener) {
+ mSessionMonitor.registerSessionListener(sessionFlags, listener);
+ }
+
+ @Override
+ public void unregisterSessionListener(@SessionFlags int sessionFlags,
+ ISessionListener listener) {
+ mSessionMonitor.unregisterSessionListener(sessionFlags, listener);
+ }
+
public String[] getStatusBarIcons() {
return mContext.getResources().getStringArray(R.array.config_statusBarIcons);
}
diff --git a/services/core/java/com/android/server/tv/interactive/TvInteractiveAppManagerService.java b/services/core/java/com/android/server/tv/interactive/TvInteractiveAppManagerService.java
index b3649a7..53a9244 100644
--- a/services/core/java/com/android/server/tv/interactive/TvInteractiveAppManagerService.java
+++ b/services/core/java/com/android/server/tv/interactive/TvInteractiveAppManagerService.java
@@ -134,7 +134,12 @@
for (ResolveInfo ri : services) {
ServiceInfo si = ri.serviceInfo;
- // TODO: add BIND_TV_INTERACTIVE_APP permission and check it here
+ if (!android.Manifest.permission.BIND_TV_INTERACTIVE_APP.equals(si.permission)) {
+ Slog.w(TAG, "Skipping TV interactiva app service " + si.name
+ + ": it does not require the permission "
+ + android.Manifest.permission.BIND_TV_INTERACTIVE_APP);
+ continue;
+ }
ComponentName component = new ComponentName(si.packageName, si.name);
try {
@@ -788,10 +793,12 @@
componentName, tiasId, resolvedUserId);
serviceState.addPendingAppLinkCommand(command);
userState.mServiceStateMap.put(componentName, serviceState);
+ updateServiceConnectionLocked(componentName, resolvedUserId);
} else if (serviceState.mService != null) {
serviceState.mService.sendAppLinkCommand(command);
} else {
serviceState.addPendingAppLinkCommand(command);
+ updateServiceConnectionLocked(componentName, resolvedUserId);
}
}
} catch (RemoteException e) {
@@ -1673,7 +1680,8 @@
boolean shouldBind = (!serviceState.mSessionTokens.isEmpty())
|| (serviceState.mPendingPrepare)
- || (!serviceState.mPendingAppLinkInfo.isEmpty());
+ || (!serviceState.mPendingAppLinkInfo.isEmpty())
+ || (!serviceState.mPendingAppLinkCommand.isEmpty());
if (serviceState.mService == null && shouldBind) {
// This means that the service is not yet connected but its state indicates that we
@@ -2092,7 +2100,7 @@
@Override
public void onCommandRequest(
- @TvInteractiveAppService.InteractiveAppServiceCommandType String cmdType,
+ @TvInteractiveAppService.PlaybackCommandType String cmdType,
Bundle parameters) {
synchronized (mLock) {
if (DEBUG) {
diff --git a/services/core/java/com/android/server/vibrator/VibrationSettings.java b/services/core/java/com/android/server/vibrator/VibrationSettings.java
index eafd9d7..6c5d952 100644
--- a/services/core/java/com/android/server/vibrator/VibrationSettings.java
+++ b/services/core/java/com/android/server/vibrator/VibrationSettings.java
@@ -179,7 +179,7 @@
try {
ActivityManager.getService().registerUidObserver(mUidObserver,
ActivityManager.UID_OBSERVER_PROCSTATE | ActivityManager.UID_OBSERVER_GONE,
- ActivityManager.PROCESS_STATE_UNKNOWN, mContext.getOpPackageName());
+ ActivityManager.PROCESS_STATE_UNKNOWN, null);
} catch (RemoteException e) {
// ignored; both services live in system_server
}
diff --git a/services/core/java/com/android/server/vibrator/VibratorManagerService.java b/services/core/java/com/android/server/vibrator/VibratorManagerService.java
index a95b6c9..b2e34da 100644
--- a/services/core/java/com/android/server/vibrator/VibratorManagerService.java
+++ b/services/core/java/com/android/server/vibrator/VibratorManagerService.java
@@ -16,6 +16,9 @@
package com.android.server.vibrator;
+import static android.os.VibrationEffect.VibrationParameter.targetAmplitude;
+import static android.os.VibrationEffect.VibrationParameter.targetFrequency;
+
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.ActivityManager;
@@ -65,6 +68,7 @@
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.lang.ref.WeakReference;
+import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
@@ -1711,7 +1715,8 @@
long duration = Long.parseLong(getNextArgRequired());
int amplitude = hasAmplitude ? Integer.parseInt(getNextArgRequired())
: VibrationEffect.DEFAULT_AMPLITUDE;
- composition.addEffect(VibrationEffect.createOneShot(duration, amplitude), delay);
+ composition.addOffDuration(Duration.ofMillis(delay));
+ composition.addEffect(VibrationEffect.createOneShot(duration, amplitude));
}
private void addWaveformToComposition(VibrationEffect.Composition composition) {
@@ -1762,23 +1767,44 @@
}
}
+ // Add delay before the waveform.
+ composition.addOffDuration(Duration.ofMillis(delay));
+
VibrationEffect.WaveformBuilder waveform = VibrationEffect.startWaveform();
for (int i = 0; i < durations.size(); i++) {
- if (isContinuous) {
- if (hasFrequencies) {
- waveform.addRamp(amplitudes.get(i), frequencies.get(i), durations.get(i));
- } else {
- waveform.addRamp(amplitudes.get(i), durations.get(i));
- }
+ Duration transitionDuration = isContinuous
+ ? Duration.ofMillis(durations.get(i))
+ : Duration.ZERO;
+
+ if (hasFrequencies) {
+ waveform.addTransition(transitionDuration, targetAmplitude(amplitudes.get(i)),
+ targetFrequency(frequencies.get(i)));
} else {
+ waveform.addTransition(transitionDuration, targetAmplitude(amplitudes.get(i)));
+ }
+ if (!isContinuous) {
+ waveform.addSustain(Duration.ofMillis(durations.get(i)));
+ }
+
+ if ((i > 0) && (i == repeat)) {
+ // Add segment that is not repeated to the composition and reset builder.
+ composition.addEffect(waveform.build());
+
if (hasFrequencies) {
- waveform.addStep(amplitudes.get(i), frequencies.get(i), durations.get(i));
+ waveform = VibrationEffect.startWaveform(targetAmplitude(amplitudes.get(i)),
+ targetFrequency(frequencies.get(i)));
} else {
- waveform.addStep(amplitudes.get(i), durations.get(i));
+ waveform = VibrationEffect.startWaveform(
+ targetAmplitude(amplitudes.get(i)));
}
}
}
- composition.addEffect(waveform.build(repeat), delay);
+ if (repeat < 0) {
+ composition.addEffect(waveform.build());
+ } else {
+ // The waveform was already split at the repeat index, just repeat what remains.
+ composition.repeatEffectIndefinitely(waveform.build());
+ }
}
private void addPrebakedToComposition(VibrationEffect.Composition composition) {
@@ -1796,7 +1822,8 @@
}
int effectId = Integer.parseInt(getNextArgRequired());
- composition.addEffect(VibrationEffect.get(effectId, shouldFallback), delay);
+ composition.addOffDuration(Duration.ofMillis(delay));
+ composition.addEffect(VibrationEffect.get(effectId, shouldFallback));
}
private void addPrimitivesToComposition(VibrationEffect.Composition composition) {
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 49d6a34..c0eee61 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -395,9 +395,9 @@
// How many activities have to be scheduled to stop to force a stop pass.
private static final int MAX_STOPPING_TO_FORCE = 3;
- private static final int STARTING_WINDOW_TYPE_NONE = 0;
- private static final int STARTING_WINDOW_TYPE_SNAPSHOT = 1;
- private static final int STARTING_WINDOW_TYPE_SPLASH_SCREEN = 2;
+ static final int STARTING_WINDOW_TYPE_NONE = 0;
+ static final int STARTING_WINDOW_TYPE_SNAPSHOT = 1;
+ static final int STARTING_WINDOW_TYPE_SPLASH_SCREEN = 2;
static final int INVALID_PID = -1;
@@ -2149,7 +2149,8 @@
final int typeParameter = StartingSurfaceController
.makeStartingWindowTypeParameter(newTask, taskSwitch, processRunning,
- allowTaskSnapshot, activityCreated, useEmpty, useLegacy, activityAllDrawn);
+ allowTaskSnapshot, activityCreated, useEmpty, useLegacy, activityAllDrawn,
+ type, packageName, mUserId);
if (type == STARTING_WINDOW_TYPE_SNAPSHOT) {
if (isActivityTypeHome()) {
@@ -6567,7 +6568,8 @@
return null;
}
- private boolean shouldUseEmptySplashScreen(ActivityRecord sourceRecord, boolean startActivity) {
+ private boolean shouldUseEmptySplashScreen(ActivityRecord sourceRecord, boolean startActivity,
+ ActivityOptions options) {
if (sourceRecord == null && !startActivity) {
// Use empty style if this activity is not top activity. This could happen when adding
// a splash screen window to the warm start activity which is re-create because top is
@@ -6577,8 +6579,8 @@
return true;
}
}
- if (mPendingOptions != null) {
- final int optionsStyle = mPendingOptions.getSplashScreenStyle();
+ if (options != null) {
+ final int optionsStyle = options.getSplashScreenStyle();
if (optionsStyle == SplashScreen.SPLASH_SCREEN_STYLE_EMPTY) {
return true;
} else if (optionsStyle == SplashScreen.SPLASH_SCREEN_STYLE_ICON) {
@@ -6607,11 +6609,11 @@
|| mLaunchSourceType == LAUNCH_SOURCE_TYPE_HOME);
}
- private int getSplashscreenTheme() {
+ private int getSplashscreenTheme(ActivityOptions options) {
// Find the splash screen theme. User can override the persisted theme by
// ActivityOptions.
- String splashScreenThemeResName = mPendingOptions != null
- ? mPendingOptions.getSplashScreenThemeResName() : null;
+ String splashScreenThemeResName = options != null
+ ? options.getSplashScreenThemeResName() : null;
if (splashScreenThemeResName == null || splashScreenThemeResName.isEmpty()) {
try {
splashScreenThemeResName = mAtmService.getPackageManager()
@@ -6638,7 +6640,7 @@
void showStartingWindow(ActivityRecord prev, boolean newTask, boolean taskSwitch,
boolean startActivity, ActivityRecord sourceRecord) {
showStartingWindow(prev, newTask, taskSwitch, isProcessRunning(), startActivity,
- sourceRecord);
+ sourceRecord, null /* candidateOptions */);
}
/**
@@ -6646,22 +6648,27 @@
* @param processRunning Whether the client process is running.
* @param startActivity Whether this activity is just created from starter.
* @param sourceRecord The source activity which start this activity.
+ * @param candidateOptions The options for the style of starting window.
*/
void showStartingWindow(ActivityRecord prev, boolean newTask, boolean taskSwitch,
- boolean processRunning, boolean startActivity, ActivityRecord sourceRecord) {
+ boolean processRunning, boolean startActivity, ActivityRecord sourceRecord,
+ ActivityOptions candidateOptions) {
if (mTaskOverlay) {
// We don't show starting window for overlay activities.
return;
}
- if (mPendingOptions != null
- && mPendingOptions.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) {
+ final ActivityOptions startOptions = candidateOptions != null
+ ? candidateOptions : mPendingOptions;
+ if (startOptions != null
+ && startOptions.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) {
// Don't show starting window when using shared element transition.
return;
}
- mSplashScreenStyleEmpty = shouldUseEmptySplashScreen(sourceRecord, startActivity);
+ mSplashScreenStyleEmpty = shouldUseEmptySplashScreen(
+ sourceRecord, startActivity, startOptions);
- final int splashScreenTheme = startActivity ? getSplashscreenTheme() : 0;
+ final int splashScreenTheme = startActivity ? getSplashscreenTheme(startOptions) : 0;
final int resolvedTheme = evaluateStartingWindowTheme(prev, packageName, theme,
splashScreenTheme);
diff --git a/services/core/java/com/android/server/wm/ActivityStartController.java b/services/core/java/com/android/server/wm/ActivityStartController.java
index 87fb290..2a26050 100644
--- a/services/core/java/com/android/server/wm/ActivityStartController.java
+++ b/services/core/java/com/android/server/wm/ActivityStartController.java
@@ -484,7 +484,8 @@
}
}
} finally {
- mService.mWindowManager.mStartingSurfaceController.endDeferAddStartingWindow();
+ mService.mWindowManager.mStartingSurfaceController.endDeferAddStartingWindow(
+ options != null ? options.getOriginalOptions() : null);
mService.continueWindowLayout();
}
}
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java
index e119a9a..5164bf0 100644
--- a/services/core/java/com/android/server/wm/ActivityStarter.java
+++ b/services/core/java/com/android/server/wm/ActivityStarter.java
@@ -2924,7 +2924,7 @@
final boolean onTop =
(aOptions == null || !aOptions.getAvoidMoveToFront()) && !mLaunchTaskBehind;
return mRootWindowContainer.getLaunchRootTask(r, aOptions, task, mSourceRootTask, onTop,
- mLaunchParams, launchFlags, mRequest.realCallingPid, mRequest.realCallingUid);
+ mLaunchParams, launchFlags);
}
private boolean isLaunchModeOneOf(int mode1, int mode2) {
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index ed9dcef..fc252ef 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -3959,6 +3959,11 @@
getActivityStartController().dump(pw, "", dumpPackage);
}
+ /** Dumps installed packages having app-specific config. */
+ void dumpInstalledPackagesConfig(PrintWriter pw) {
+ mPackageConfigPersister.dump(pw, getCurrentUserId());
+ }
+
/**
* There are three things that cmd can be:
* - a flattened component name that matches an existing activity
diff --git a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
index dd394ca..5d879ce 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
@@ -2224,25 +2224,9 @@
return;
}
- if (!task.supportsSplitScreenWindowingMode() || forceNonResizable) {
- if (task.mTransitionController.isShellTransitionsEnabled()) return;
- // Dismiss docked root task. If task appeared to be in docked root task but is not
- // resizable - we need to move it to top of fullscreen root task, otherwise it will
- // be covered.
- final TaskDisplayArea taskDisplayArea = task.getDisplayArea();
- if (taskDisplayArea.isSplitScreenModeActivated()) {
- // Display a warning toast that we tried to put an app that doesn't support
- // split-screen in split-screen.
- mService.getTaskChangeNotificationController()
- .notifyActivityDismissingDockedRootTask();
- taskDisplayArea.onSplitScreenModeDismissed(task);
- taskDisplayArea.mDisplayContent.ensureActivitiesVisible(null, 0, PRESERVE_WINDOWS,
- true /* notifyClients */);
- }
- return;
+ if (!forceNonResizable) {
+ handleForcedResizableTaskIfNeeded(task, FORCED_RESIZEABLE_REASON_SPLIT_SCREEN);
}
-
- handleForcedResizableTaskIfNeeded(task, FORCED_RESIZEABLE_REASON_SPLIT_SCREEN);
}
/** Notifies that the top activity of the task is forced to be resizeable. */
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 5facc0d..a1c823e 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -3043,13 +3043,6 @@
mTouchExcludeRegion.op(mTmpRegion, Region.Op.UNION);
}
amendWindowTapExcludeRegion(mTouchExcludeRegion);
- // TODO(multi-display): Support docked root tasks on secondary displays & task containers.
- if (mDisplayId == DEFAULT_DISPLAY
- && getDefaultTaskDisplayArea().isSplitScreenModeActivated()) {
- mDividerControllerLocked.getTouchRegion(mTmpRect);
- mTmpRegion.set(mTmpRect);
- mTouchExcludeRegion.op(mTmpRegion, Op.UNION);
- }
mTapDetector.setTouchExcludeRegion(mTouchExcludeRegion);
}
@@ -3440,12 +3433,6 @@
if (rootPinnedTask != null) {
pw.println(prefix + "rootPinnedTask=" + rootPinnedTask.getName());
}
- final Task rootSplitScreenPrimaryTask = getDefaultTaskDisplayArea()
- .getRootSplitScreenPrimaryTask();
- if (rootSplitScreenPrimaryTask != null) {
- pw.println(
- prefix + "rootSplitScreenPrimaryTask=" + rootSplitScreenPrimaryTask.getName());
- }
// TODO: Support recents on non-default task containers
final Task rootRecentsTask = getDefaultTaskDisplayArea().getRootTask(
WINDOWING_MODE_UNDEFINED, ACTIVITY_TYPE_RECENTS);
@@ -4849,13 +4836,10 @@
}
private static boolean skipImeWindowsDuringTraversal(DisplayContent dc) {
- // We skip IME windows so they're processed just above their target, except
- // in split-screen mode where we process the IME containers above the docked divider.
+ // We skip IME windows so they're processed just above their target.
// Note that this method check should align with {@link
// WindowState#applyImeWindowsIfNeeded} in case of any state mismatch.
return dc.mImeLayeringTarget != null
- && (!dc.getDefaultTaskDisplayArea().isSplitScreenModeActivated()
- || dc.mImeLayeringTarget.getTask() == null)
// Make sure that the IME window won't be skipped to report that it has
// completed the orientation change.
&& !dc.mWmService.mDisplayFrozen;
diff --git a/services/core/java/com/android/server/wm/EmbeddedWindowController.java b/services/core/java/com/android/server/wm/EmbeddedWindowController.java
index e04e3a3..0e2d847 100644
--- a/services/core/java/com/android/server/wm/EmbeddedWindowController.java
+++ b/services/core/java/com/android/server/wm/EmbeddedWindowController.java
@@ -41,8 +41,6 @@
private static final String TAG = TAG_WITH_CLASS_NAME ? "EmbeddedWindowController" : TAG_WM;
/* maps input token to an embedded window */
private ArrayMap<IBinder /*input token */, EmbeddedWindow> mWindows = new ArrayMap<>();
- private ArrayMap<IBinder /*focus grant token */, EmbeddedWindow> mWindowsByFocusToken =
- new ArrayMap<>();
private final Object mGlobalLock;
private final ActivityTaskManagerService mAtmService;
@@ -61,13 +59,10 @@
void add(IBinder inputToken, EmbeddedWindow window) {
try {
mWindows.put(inputToken, window);
- final IBinder focusToken = window.getFocusGrantToken();
- mWindowsByFocusToken.put(focusToken, window);
updateProcessController(window);
window.mClient.asBinder().linkToDeath(()-> {
synchronized (mGlobalLock) {
mWindows.remove(inputToken);
- mWindowsByFocusToken.remove(focusToken);
}
}, 0);
} catch (RemoteException e) {
@@ -112,10 +107,8 @@
void remove(IWindow client) {
for (int i = mWindows.size() - 1; i >= 0; i--) {
- EmbeddedWindow ew = mWindows.valueAt(i);
- if (ew.mClient.asBinder() == client.asBinder()) {
+ if (mWindows.valueAt(i).mClient.asBinder() == client.asBinder()) {
mWindows.removeAt(i).onRemoved();
- mWindowsByFocusToken.remove(ew.getFocusGrantToken());
return;
}
}
@@ -123,10 +116,8 @@
void onWindowRemoved(WindowState host) {
for (int i = mWindows.size() - 1; i >= 0; i--) {
- EmbeddedWindow ew = mWindows.valueAt(i);
- if (ew.mHostWindowState == host) {
+ if (mWindows.valueAt(i).mHostWindowState == host) {
mWindows.removeAt(i).onRemoved();
- mWindowsByFocusToken.remove(ew.getFocusGrantToken());
}
}
}
@@ -135,10 +126,6 @@
return mWindows.get(inputToken);
}
- EmbeddedWindow getByFocusToken(IBinder focusGrantToken) {
- return mWindowsByFocusToken.get(focusGrantToken);
- }
-
void onActivityRemoved(ActivityRecord activityRecord) {
for (int i = mWindows.size() - 1; i >= 0; i--) {
final EmbeddedWindow window = mWindows.valueAt(i);
@@ -170,8 +157,6 @@
// and this variable is mostly used for tracking that.
boolean mIsOverlay = false;
- private IBinder mFocusGrantToken;
-
/**
* @param session calling session to check ownership of the window
* @param clientToken client token used to clean up the map if the embedding process dies
@@ -186,7 +171,7 @@
*/
EmbeddedWindow(Session session, WindowManagerService service, IWindow clientToken,
WindowState hostWindowState, int ownerUid, int ownerPid, int windowType,
- int displayId, IBinder focusGrantToken) {
+ int displayId) {
mSession = session;
mWmService = service;
mClient = clientToken;
@@ -197,7 +182,6 @@
mOwnerPid = ownerPid;
mWindowType = windowType;
mDisplayId = displayId;
- mFocusGrantToken = focusGrantToken;
}
@Override
@@ -258,17 +242,6 @@
return mIsOverlay;
}
- IBinder getFocusGrantToken() {
- return mFocusGrantToken;
- }
-
- IBinder getInputChannelToken() {
- if (mInputChannel != null) {
- return mInputChannel.getToken();
- }
- return null;
- }
-
/**
* System hosted overlays need the WM to invoke grantEmbeddedWindowFocus and
* so we need to participate inside handlePointerDownOutsideFocus logic
@@ -282,7 +255,7 @@
private void handleTap(boolean grantFocus) {
if (mInputChannel != null) {
- mWmService.grantEmbeddedWindowFocus(mSession, mFocusGrantToken, grantFocus);
+ mWmService.grantEmbeddedWindowFocus(mSession, mInputChannel.getToken(), grantFocus);
}
}
diff --git a/services/core/java/com/android/server/wm/KeyguardController.java b/services/core/java/com/android/server/wm/KeyguardController.java
index baf7f87..5c8502b 100644
--- a/services/core/java/com/android/server/wm/KeyguardController.java
+++ b/services/core/java/com/android/server/wm/KeyguardController.java
@@ -450,16 +450,6 @@
return;
}
- // Dismiss split screen
- // The lock screen is currently showing, but is occluded by a window that can
- // show on top of the lock screen. In this can we want to dismiss the docked
- // stack since it will be complicated/risky to try to put the activity on top
- // of the lock screen in the right fullscreen configuration.
- final TaskDisplayArea taskDisplayArea = mRootWindowContainer.getDefaultTaskDisplayArea();
- if (taskDisplayArea.isSplitScreenModeActivated()) {
- taskDisplayArea.onSplitScreenModeDismissed();
- }
-
// Dismiss freeform windowing mode
if (currentTaskControllingOcclusion == null) {
return;
diff --git a/services/core/java/com/android/server/wm/LaunchParamsController.java b/services/core/java/com/android/server/wm/LaunchParamsController.java
index 3793e4b..8e5d73f 100644
--- a/services/core/java/com/android/server/wm/LaunchParamsController.java
+++ b/services/core/java/com/android/server/wm/LaunchParamsController.java
@@ -150,10 +150,8 @@
if (mTmpParams.hasWindowingMode() && task.isRootTask()
&& mTmpParams.mWindowingMode != task.getWindowingMode()) {
- final int activityType = activity != null
- ? activity.getActivityType() : task.getActivityType();
task.setWindowingMode(task.getDisplayArea().validateWindowingMode(
- mTmpParams.mWindowingMode, activity, task, activityType));
+ mTmpParams.mWindowingMode, activity, task));
}
if (mTmpParams.mBounds.isEmpty()) {
diff --git a/services/core/java/com/android/server/wm/PackageConfigPersister.java b/services/core/java/com/android/server/wm/PackageConfigPersister.java
index 7a7fb65..16f4377 100644
--- a/services/core/java/com/android/server/wm/PackageConfigPersister.java
+++ b/services/core/java/com/android/server/wm/PackageConfigPersister.java
@@ -40,6 +40,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.PrintWriter;
import java.util.HashMap;
/**
@@ -308,6 +309,27 @@
}
}
+ /**
+ * Dumps app-specific configurations for all packages for which the records
+ * exist.
+ */
+ void dump(PrintWriter pw, int userId) {
+ pw.println("INSTALLED PACKAGES HAVING APP-SPECIFIC CONFIGURATIONS");
+ pw.println("Current user ID : " + userId);
+ synchronized (mLock) {
+ HashMap<String, PackageConfigRecord> persistedPackageConfigMap = mModified.get(userId);
+ if (persistedPackageConfigMap != null) {
+ for (PackageConfigPersister.PackageConfigRecord packageConfig
+ : persistedPackageConfigMap.values()) {
+ pw.println();
+ pw.println(" PackageName : " + packageConfig.mName);
+ pw.println(" NightMode : " + packageConfig.mNightMode);
+ pw.println(" Locales : " + packageConfig.mLocales);
+ }
+ }
+ }
+ }
+
// store a changed data so we don't need to get the process
static class PackageConfigRecord {
final String mName;
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index 4c72d02b..76a7981 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -1907,10 +1907,6 @@
final Task topFocusedRootTask = getTopDisplayFocusedRootTask();
final int focusRootTaskId = topFocusedRootTask != null
? topFocusedRootTask.getRootTaskId() : INVALID_TASK_ID;
- // We dismiss the docked root task whenever we switch users.
- if (getDefaultTaskDisplayArea().isSplitScreenModeActivated()) {
- getDefaultTaskDisplayArea().onSplitScreenModeDismissed();
- }
// Also dismiss the pinned root task whenever we switch users. Removing the pinned root task
// will also cause all tasks to be moved to the fullscreen root task at a position that is
// appropriate.
@@ -2765,8 +2761,7 @@
Task getLaunchRootTask(@Nullable ActivityRecord r, @Nullable ActivityOptions options,
@Nullable Task candidateTask, boolean onTop) {
return getLaunchRootTask(r, options, candidateTask, null /* sourceTask */, onTop,
- null /* launchParams */, 0 /* launchFlags */, -1 /* no realCallingPid */,
- -1 /* no realCallingUid */);
+ null /* launchParams */, 0 /* launchFlags */);
}
/**
@@ -2785,8 +2780,7 @@
Task getLaunchRootTask(@Nullable ActivityRecord r,
@Nullable ActivityOptions options, @Nullable Task candidateTask,
@Nullable Task sourceTask, boolean onTop,
- @Nullable LaunchParamsController.LaunchParams launchParams, int launchFlags,
- int realCallingPid, int realCallingUid) {
+ @Nullable LaunchParamsController.LaunchParams launchParams, int launchFlags) {
int taskId = INVALID_TASK_ID;
int displayId = INVALID_DISPLAY;
TaskDisplayArea taskDisplayArea = null;
@@ -2835,11 +2829,7 @@
if (taskDisplayArea != null) {
final int tdaDisplayId = taskDisplayArea.getDisplayId();
- final boolean canLaunchOnDisplayFromStartRequest =
- realCallingPid != 0 && realCallingUid > 0 && r != null
- && mTaskSupervisor.canPlaceEntityOnDisplay(tdaDisplayId,
- realCallingPid, realCallingUid, r.info);
- if (canLaunchOnDisplayFromStartRequest || canLaunchOnDisplay(r, tdaDisplayId)) {
+ if (canLaunchOnDisplay(r, tdaDisplayId)) {
if (r != null) {
final Task result = getValidLaunchRootTaskInTaskDisplayArea(
taskDisplayArea, r, candidateTask, options, launchParams);
@@ -2872,8 +2862,7 @@
container = rootTask.getDisplayArea();
if (container != null && canLaunchOnDisplay(r, container.mDisplayContent.mDisplayId)) {
if (windowingMode == WindowConfiguration.WINDOWING_MODE_UNDEFINED) {
- windowingMode = container.resolveWindowingMode(r, options, candidateTask,
- activityType);
+ windowingMode = container.resolveWindowingMode(r, options, candidateTask);
}
// Always allow organized tasks that created by organizer since the activity type
// of an organized task is decided by the activity type of its top child, which
@@ -2889,8 +2878,7 @@
|| !canLaunchOnDisplay(r, container.mDisplayContent.mDisplayId)) {
container = getDefaultTaskDisplayArea();
if (windowingMode == WindowConfiguration.WINDOWING_MODE_UNDEFINED) {
- windowingMode = container.resolveWindowingMode(r, options, candidateTask,
- activityType);
+ windowingMode = container.resolveWindowingMode(r, options, candidateTask);
}
}
@@ -2952,8 +2940,7 @@
windowingMode = options != null ? options.getLaunchWindowingMode()
: r.getWindowingMode();
}
- windowingMode = taskDisplayArea.validateWindowingMode(windowingMode, r, candidateTask,
- r.getActivityType());
+ windowingMode = taskDisplayArea.validateWindowingMode(windowingMode, r, candidateTask);
// Return the topmost valid root task on the display.
final int targetWindowingMode = windowingMode;
diff --git a/services/core/java/com/android/server/wm/Session.java b/services/core/java/com/android/server/wm/Session.java
index 98acc46..9b94f44 100644
--- a/services/core/java/com/android/server/wm/Session.java
+++ b/services/core/java/com/android/server/wm/Session.java
@@ -813,7 +813,7 @@
@Override
public void grantInputChannel(int displayId, SurfaceControl surface,
IWindow window, IBinder hostInputToken, int flags, int privateFlags, int type,
- IBinder focusGrantToken, InputChannel outInputChannel) {
+ InputChannel outInputChannel) {
if (hostInputToken == null && !mCanAddInternalSystemWindow) {
// Callers without INTERNAL_SYSTEM_WINDOW permission cannot grant input channel to
// embedded windows without providing a host window input token
@@ -829,7 +829,7 @@
try {
mService.grantInputChannel(this, mUid, mPid, displayId, surface, window, hostInputToken,
flags, mCanAddInternalSystemWindow ? privateFlags : 0,
- mCanAddInternalSystemWindow ? type : 0, focusGrantToken, outInputChannel);
+ mCanAddInternalSystemWindow ? type : 0, outInputChannel);
} finally {
Binder.restoreCallingIdentity(identity);
}
diff --git a/services/core/java/com/android/server/wm/ShellRoot.java b/services/core/java/com/android/server/wm/ShellRoot.java
index 6ed59e9..2eab3ba 100644
--- a/services/core/java/com/android/server/wm/ShellRoot.java
+++ b/services/core/java/com/android/server/wm/ShellRoot.java
@@ -141,8 +141,7 @@
&& mShellRootLayer != SHELL_ROOT_LAYER_PIP) {
return null;
}
- if (mShellRootLayer == SHELL_ROOT_LAYER_DIVIDER
- && !mDisplayContent.getDefaultTaskDisplayArea().isSplitScreenModeActivated()) {
+ if (mShellRootLayer == SHELL_ROOT_LAYER_DIVIDER) {
return null;
}
if (mShellRootLayer == SHELL_ROOT_LAYER_PIP
diff --git a/services/core/java/com/android/server/wm/StartingSurfaceController.java b/services/core/java/com/android/server/wm/StartingSurfaceController.java
index eb73cd8..58091c8 100644
--- a/services/core/java/com/android/server/wm/StartingSurfaceController.java
+++ b/services/core/java/com/android/server/wm/StartingSurfaceController.java
@@ -18,6 +18,7 @@
import static android.window.StartingWindowInfo.TYPE_PARAMETER_ACTIVITY_CREATED;
import static android.window.StartingWindowInfo.TYPE_PARAMETER_ACTIVITY_DRAWN;
+import static android.window.StartingWindowInfo.TYPE_PARAMETER_ALLOW_HANDLE_EMPTY_SCREEN;
import static android.window.StartingWindowInfo.TYPE_PARAMETER_ALLOW_TASK_SNAPSHOT;
import static android.window.StartingWindowInfo.TYPE_PARAMETER_LEGACY_SPLASH_SCREEN;
import static android.window.StartingWindowInfo.TYPE_PARAMETER_NEW_TASK;
@@ -25,12 +26,18 @@
import static android.window.StartingWindowInfo.TYPE_PARAMETER_TASK_SWITCH;
import static android.window.StartingWindowInfo.TYPE_PARAMETER_USE_EMPTY_SPLASH_SCREEN;
+import static com.android.server.wm.ActivityRecord.STARTING_WINDOW_TYPE_SPLASH_SCREEN;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.app.ActivityOptions;
+import android.app.compat.CompatChanges;
+import android.compat.annotation.ChangeId;
+import android.compat.annotation.EnabledSince;
import android.content.pm.ApplicationInfo;
+import android.os.UserHandle;
import android.util.Slog;
import android.window.TaskSnapshot;
@@ -43,6 +50,14 @@
public class StartingSurfaceController {
private static final String TAG = TAG_WITH_CLASS_NAME
? StartingSurfaceController.class.getSimpleName() : TAG_WM;
+ /**
+ * Allow the empty style splash screen view can be copy and transfer to another process if
+ * the app targeting to {@link android.os.Build.VERSION_CODES#TIRAMISU} or higher.
+ */
+ @ChangeId
+ @EnabledSince(targetSdkVersion = android.os.Build.VERSION_CODES.TIRAMISU)
+ private static final long ALLOW_COPY_EMPTY_VIEW = 205907456L;
+
private final WindowManagerService mService;
private final SplashScreenExceptionList mSplashScreenExceptionsList;
@@ -81,7 +96,8 @@
static int makeStartingWindowTypeParameter(boolean newTask, boolean taskSwitch,
boolean processRunning, boolean allowTaskSnapshot, boolean activityCreated,
- boolean useEmpty, boolean useLegacy, boolean activityDrawn) {
+ boolean useEmpty, boolean useLegacy, boolean activityDrawn, int startingWindowType,
+ String packageName, int userId) {
int parameter = 0;
if (newTask) {
parameter |= TYPE_PARAMETER_NEW_TASK;
@@ -107,6 +123,11 @@
if (activityDrawn) {
parameter |= TYPE_PARAMETER_ACTIVITY_DRAWN;
}
+ if (startingWindowType == STARTING_WINDOW_TYPE_SPLASH_SCREEN
+ && CompatChanges.isChangeEnabled(ALLOW_COPY_EMPTY_VIEW, packageName,
+ UserHandle.of(userId))) {
+ parameter |= TYPE_PARAMETER_ALLOW_HANDLE_EMPTY_SCREEN;
+ }
return parameter;
}
@@ -195,12 +216,12 @@
deferring, prev, source));
}
- private void showStartingWindowFromDeferringActivities() {
+ private void showStartingWindowFromDeferringActivities(ActivityOptions topOptions) {
// Attempt to add starting window from the top-most activity.
for (int i = mDeferringAddStartActivities.size() - 1; i >= 0; --i) {
final DeferringStartingWindowRecord next = mDeferringAddStartActivities.get(i);
next.mDeferring.showStartingWindow(next.mPrev, mInitNewTask, mInitTaskSwitch,
- mInitProcessRunning, true /* startActivity */, next.mSource);
+ mInitProcessRunning, true /* startActivity */, next.mSource, topOptions);
// If one succeeds, it is done.
if (next.mDeferring.mStartingData != null) {
break;
@@ -223,9 +244,9 @@
/**
* End deferring add starting window.
*/
- void endDeferAddStartingWindow() {
+ void endDeferAddStartingWindow(ActivityOptions topOptions) {
mDeferringAddStartingWindow = false;
- showStartingWindowFromDeferringActivities();
+ showStartingWindowFromDeferringActivities(topOptions);
}
final class StartingSurface {
diff --git a/services/core/java/com/android/server/wm/SurfaceAnimator.java b/services/core/java/com/android/server/wm/SurfaceAnimator.java
index 50c9b31..53e3378 100644
--- a/services/core/java/com/android/server/wm/SurfaceAnimator.java
+++ b/services/core/java/com/android/server/wm/SurfaceAnimator.java
@@ -88,6 +88,8 @@
private boolean mAnimationStartDelayed;
+ private boolean mAnimationFinished;
+
/**
* @param animatable The object to animate.
* @param staticAnimationFinishedCallback Callback to invoke when an animation has finished
@@ -137,6 +139,7 @@
|| anim.shouldDeferAnimationFinish(resetAndInvokeFinish))) {
resetAndInvokeFinish.run();
}
+ mAnimationFinished = true;
}
};
}
@@ -302,6 +305,9 @@
Slog.w(TAG, "Unable to transfer animation, surface or parent is null");
cancelAnimation();
return;
+ } else if (from.mAnimationFinished) {
+ Slog.w(TAG, "Unable to transfer animation, because " + from + " animation is finished");
+ return;
}
endDelayingAnimationStart();
final Transaction t = mAnimatable.getPendingTransaction();
@@ -392,6 +398,7 @@
SurfaceControl leash = mLeash;
mLeash = null;
final boolean scheduleAnim = removeLeash(t, mAnimatable, leash, destroyLeash);
+ mAnimationFinished = false;
if (scheduleAnim) {
mService.scheduleAnimationLocked();
}
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index ff9d9f7..91c1374 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -4500,22 +4500,11 @@
// right mode.
if (!creating) {
if (!taskDisplayArea.isValidWindowingMode(windowingMode, null /* ActivityRecord */,
- topTask, getActivityType())) {
+ topTask)) {
windowingMode = WINDOWING_MODE_UNDEFINED;
}
}
- final boolean alreadyInSplitScreenMode = taskDisplayArea.isSplitScreenModeActivated();
-
- if (creating && alreadyInSplitScreenMode && windowingMode == WINDOWING_MODE_FULLSCREEN
- && isActivityTypeStandardOrUndefined()) {
- // If the root task is being created explicitly in fullscreen mode, dismiss split-screen
- // and display a warning toast about it.
- mAtmService.getTaskChangeNotificationController()
- .notifyActivityDismissingDockedRootTask();
- taskDisplayArea.onSplitScreenModeDismissed(this);
- }
-
if (currentMode == windowingMode) {
// You are already in the window mode, so we can skip most of the work below. However,
// it's possible that we have inherited the current windowing mode from a parent. So,
@@ -6501,9 +6490,8 @@
if (!TaskDisplayArea.isWindowingModeSupported(mWindowingMode,
mAtmService.mSupportsMultiWindow,
- mAtmService.mSupportsSplitScreenMultiWindow,
mAtmService.mSupportsFreeformWindowManagement,
- mAtmService.mSupportsPictureInPicture, mActivityType)) {
+ mAtmService.mSupportsPictureInPicture)) {
throw new IllegalArgumentException("Can't create root task for unsupported "
+ "windowingMode=" + mWindowingMode);
}
diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java
index dfb559f..1bba103 100644
--- a/services/core/java/com/android/server/wm/TaskDisplayArea.java
+++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java
@@ -24,8 +24,6 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
-import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
-import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
@@ -53,8 +51,6 @@
import android.util.Slog;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
-import android.window.WindowContainerToken;
-import android.window.WindowContainerTransaction;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.protolog.common.ProtoLog;
@@ -114,7 +110,6 @@
// through the list to find them.
private Task mRootHomeTask;
private Task mRootPinnedTask;
- private Task mRootSplitScreenPrimaryTask;
// TODO(b/159029784): Remove when getStack() behavior is cleaned-up
private Task mRootRecentsTask;
@@ -232,8 +227,6 @@
}
if (windowingMode == WINDOWING_MODE_PINNED) {
return mRootPinnedTask;
- } else if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) {
- return mRootSplitScreenPrimaryTask;
}
return getRootTask(rootTask -> {
if (activityType == ACTIVITY_TYPE_UNDEFINED
@@ -265,21 +258,6 @@
return mRootPinnedTask;
}
- Task getRootSplitScreenPrimaryTask() {
- return mRootSplitScreenPrimaryTask;
- }
-
- Task getRootSplitScreenSecondaryTask() {
- // Only check the direct child Task for now, since the primary is also a direct child Task.
- for (int i = mChildren.size() - 1; i >= 0; --i) {
- final Task task = mChildren.get(i).asTask();
- if (task != null && task.inSplitScreenSecondaryWindowingMode()) {
- return task;
- }
- }
- return null;
- }
-
ArrayList<Task> getVisibleTasks() {
final ArrayList<Task> visibleTasks = new ArrayList<>();
forAllTasks(task -> {
@@ -333,14 +311,6 @@
+ " already exist on display=" + this + " rootTask=" + rootTask);
}
mRootPinnedTask = rootTask;
- } else if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) {
- if (mRootSplitScreenPrimaryTask != null) {
- throw new IllegalArgumentException(
- "addRootTaskReferenceIfNeeded: root split screen primary task="
- + mRootSplitScreenPrimaryTask
- + " already exist on display=" + this + " rootTask=" + rootTask);
- }
- mRootSplitScreenPrimaryTask = rootTask;
}
}
@@ -351,8 +321,6 @@
mRootRecentsTask = null;
} else if (rootTask == mRootPinnedTask) {
mRootPinnedTask = null;
- } else if (rootTask == mRootSplitScreenPrimaryTask) {
- mRootSplitScreenPrimaryTask = null;
}
}
@@ -708,39 +676,13 @@
}, SCREEN_ORIENTATION_UNSET);
}
- if (isRootTaskVisible(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY)) {
- // Apps and their containers are not allowed to specify an orientation while using
- // root tasks...except for the root home task if it is not resizable and currently
- // visible (top of) its root task.
- if (mRootHomeTask != null && !mRootHomeTask.isResizeable()) {
- // Manually nest one-level because because getOrientation() checks fillsParent()
- // which checks that requestedOverrideBounds() is empty. However, in this case,
- // it is not empty because it's been overridden to maintain the fullscreen size
- // within a smaller split-root.
- final Task topHomeTask = mRootHomeTask.getTopMostTask();
- final ActivityRecord topHomeActivity = topHomeTask.getTopNonFinishingActivity();
- // If a home activity is in the process of launching and isn't yet visible we
- // should still respect the root task's preferred orientation to ensure rotation
- // occurs before the home activity finishes launching.
- final boolean isHomeActivityLaunching = topHomeActivity != null
- && topHomeActivity.mVisibleRequested;
- if (topHomeTask.isVisible() || isHomeActivityLaunching) {
- final int orientation = topHomeTask.getOrientation();
- if (orientation != SCREEN_ORIENTATION_UNSET) {
- return orientation;
- }
- }
- }
+ // Apps and their containers are not allowed to specify an orientation of non floating
+ // visible tasks created by organizer. The organizer handles the orientation instead.
+ final Task nonFloatingTopTask =
+ getRootTask(t -> !t.getWindowConfiguration().tasksAreFloating());
+ if (nonFloatingTopTask != null && nonFloatingTopTask.mCreatedByOrganizer
+ && nonFloatingTopTask.isVisible()) {
return SCREEN_ORIENTATION_UNSPECIFIED;
- } else {
- // Apps and their containers are not allowed to specify an orientation of non floating
- // visible tasks created by organizer. The organizer handles the orientation instead.
- final Task nonFloatingTopTask =
- getRootTask(t -> !t.getWindowConfiguration().tasksAreFloating());
- if (nonFloatingTopTask != null && nonFloatingTopTask.mCreatedByOrganizer
- && nonFloatingTopTask.isVisible()) {
- return SCREEN_ORIENTATION_UNSPECIFIED;
- }
}
final int orientation = super.getOrientation(candidate);
@@ -845,7 +787,7 @@
&& child.inMultiWindowMode()
&& childTask.getRootTask().getAdjacentTaskFragment() != null;
- if (inAdjacentTask || child.inSplitScreenWindowingMode()) {
+ if (inAdjacentTask) {
hasAdjacentTask = true;
} else if (hasAdjacentTask && startLayer < SPLIT_DIVIDER_LAYER) {
// Task on top of adjacent tasks should be higher than split divider layer so
@@ -1086,7 +1028,7 @@
// Validate that our desired windowingMode will work under the current conditions.
// UNDEFINED windowing mode is a valid result and means that the new root task will inherit
// it's display's windowing mode.
- windowingMode = validateWindowingMode(windowingMode, r, candidateTask, activityType);
+ windowingMode = validateWindowingMode(windowingMode, r, candidateTask);
return getOrCreateRootTask(windowingMode, activityType, onTop, candidateTask, sourceTask,
options, launchFlags);
}
@@ -1283,23 +1225,6 @@
continue;
}
- if (currentWindowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY
- && candidate == null && rootTask.inSplitScreenPrimaryWindowingMode()) {
- // If the currently focused root task is in split-screen secondary we save off the
- // top primary split-screen root task as a candidate for focus because we might
- // prefer focus to move to an other root task to avoid primary split-screen root
- // task overlapping with a fullscreen root task when a fullscreen root task is
- // higher in z than the next split-screen root task. Assistant root task, I am
- // looking at you...
- // We only move the focus to the primary-split screen root task if there isn't a
- // better alternative.
- candidate = rootTask;
- continue;
- }
- if (candidate != null && rootTask.inSplitScreenSecondaryWindowingMode()) {
- // Use the candidate root task since we are now at the secondary split-screen.
- return candidate;
- }
return rootTask;
}
return candidate;
@@ -1416,75 +1341,18 @@
return someActivityPaused[0] > 0;
}
- void onSplitScreenModeDismissed() {
- // The focused task could be a non-resizeable fullscreen root task that is on top of the
- // other split-screen tasks, therefore had to dismiss split-screen, make sure the current
- // focused root task can still be on top after dismissal
- final Task rootTask = getFocusedRootTask();
- final Task toTop =
- rootTask != null && !rootTask.inSplitScreenWindowingMode() ? rootTask : null;
- onSplitScreenModeDismissed(toTop);
- }
-
- void onSplitScreenModeDismissed(Task toTop) {
- mAtmService.deferWindowLayout();
- try {
- moveSplitScreenTasksToFullScreen();
- } finally {
- final Task topFullscreenRootTask = toTop != null
- ? toTop : getTopRootTaskInWindowingMode(WINDOWING_MODE_FULLSCREEN);
- final Task rootHomeTask = getOrCreateRootHomeTask();
- if (rootHomeTask != null && ((topFullscreenRootTask != null && !isTopRootTask(
- rootHomeTask)) || toTop != null)) {
- // Whenever split-screen is dismissed we want the root home task directly behind the
- // current top fullscreen root task so it shows up when the top root task is
- // finished. Or, if the caller specified a root task to be on top after
- // split-screen is dismissed.
- // TODO: Would be better to use ActivityDisplay.positionChildAt() for this, however
- // ActivityDisplay doesn't have a direct controller to WM side yet. We can switch
- // once we have that.
- rootHomeTask.moveToFront("onSplitScreenModeDismissed");
- topFullscreenRootTask.moveToFront("onSplitScreenModeDismissed");
- }
- mAtmService.continueWindowLayout();
- }
- }
-
- private void moveSplitScreenTasksToFullScreen() {
- final WindowContainerTransaction wct = new WindowContainerTransaction();
- mTmpTasks.clear();
- forAllTasks(task -> {
- if (task.mCreatedByOrganizer && task.inSplitScreenWindowingMode() && task.hasChild()) {
- mTmpTasks.add(task);
- }
- });
-
- for (int i = mTmpTasks.size() - 1; i >= 0; i--) {
- final Task root = mTmpTasks.get(i);
- for (int j = 0; j < root.getChildCount(); j++) {
- final WindowContainerToken token =
- root.getChildAt(j).mRemoteToken.toWindowContainerToken();
- wct.reparent(token, null, true /* toTop */);
- wct.setBounds(token, null);
- }
- }
- mAtmService.mWindowOrganizerController.applyTransaction(wct);
- }
/**
* Returns true if the {@param windowingMode} is supported based on other parameters passed in.
*
* @param windowingMode The windowing mode we are checking support for.
* @param supportsMultiWindow If we should consider support for multi-window mode in general.
- * @param supportsSplitScreen If we should consider support for split-screen multi-window.
* @param supportsFreeform If we should consider support for freeform multi-window.
* @param supportsPip If we should consider support for picture-in-picture mutli-window.
- * @param activityType The activity type under consideration.
* @return true if the windowing mode is supported.
*/
static boolean isWindowingModeSupported(int windowingMode, boolean supportsMultiWindow,
- boolean supportsSplitScreen, boolean supportsFreeform, boolean supportsPip,
- int activityType) {
+ boolean supportsFreeform, boolean supportsPip) {
if (windowingMode == WINDOWING_MODE_UNDEFINED
|| windowingMode == WINDOWING_MODE_FULLSCREEN) {
@@ -1498,12 +1366,6 @@
return true;
}
- if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY
- || windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) {
- return supportsSplitScreen
- && WindowConfiguration.supportSplitScreenWindowingMode(activityType);
- }
-
if (!supportsFreeform && windowingMode == WINDOWING_MODE_FREEFORM) {
return false;
}
@@ -1525,7 +1387,7 @@
* @return The resolved (not UNDEFINED) windowing-mode that the activity would be in.
*/
int resolveWindowingMode(@Nullable ActivityRecord r, @Nullable ActivityOptions options,
- @Nullable Task task, int activityType) {
+ @Nullable Task task) {
// First preference if the windowing mode in the activity options if set.
int windowingMode = (options != null)
@@ -1545,7 +1407,7 @@
windowingMode = getWindowingMode();
}
}
- windowingMode = validateWindowingMode(windowingMode, r, task, activityType);
+ windowingMode = validateWindowingMode(windowingMode, r, task);
return windowingMode != WINDOWING_MODE_UNDEFINED
? windowingMode : WINDOWING_MODE_FULLSCREEN;
}
@@ -1557,19 +1419,16 @@
* @param windowingMode The windowing-mode to validate.
* @param r The {@link ActivityRecord} to check against.
* @param task The {@link Task} to check against.
- * @param activityType An activity type.
* @return {@code true} if windowingMode is valid, {@code false} otherwise.
*/
- boolean isValidWindowingMode(int windowingMode, @Nullable ActivityRecord r, @Nullable Task task,
- int activityType) {
+ boolean isValidWindowingMode(int windowingMode, @Nullable ActivityRecord r, @Nullable Task task
+ ) {
// Make sure the windowing mode we are trying to use makes sense for what is supported.
boolean supportsMultiWindow = mAtmService.mSupportsMultiWindow;
- boolean supportsSplitScreen = mAtmService.mSupportsSplitScreenMultiWindow;
boolean supportsFreeform = mAtmService.mSupportsFreeformWindowManagement;
boolean supportsPip = mAtmService.mSupportsPictureInPicture;
if (supportsMultiWindow) {
if (task != null) {
- supportsSplitScreen = task.supportsSplitScreenWindowingModeInDisplayArea(this);
supportsFreeform = task.supportsFreeformInDisplayArea(this);
supportsMultiWindow = task.supportsMultiWindowInDisplayArea(this)
// When the activity needs to be moved to PIP while the Task is not in PIP,
@@ -1577,7 +1436,6 @@
// always valid for Task as long as the device supports it.
|| (windowingMode == WINDOWING_MODE_PINNED && supportsPip);
} else if (r != null) {
- supportsSplitScreen = r.supportsSplitScreenWindowingModeInDisplayArea(this);
supportsFreeform = r.supportsFreeformInDisplayArea(this);
supportsPip = r.supportsPictureInPicture();
supportsMultiWindow = r.supportsMultiWindowInDisplayArea(this);
@@ -1585,8 +1443,8 @@
}
return windowingMode != WINDOWING_MODE_UNDEFINED
- && isWindowingModeSupported(windowingMode, supportsMultiWindow, supportsSplitScreen,
- supportsFreeform, supportsPip, activityType);
+ && isWindowingModeSupported(windowingMode, supportsMultiWindow, supportsFreeform,
+ supportsPip);
}
/**
@@ -1596,20 +1454,10 @@
* @param windowingMode The windowing-mode to validate.
* @param r The {@link ActivityRecord} to check against.
* @param task The {@link Task} to check against.
- * @param activityType An activity type.
* @return The provided windowingMode or the closest valid mode which is appropriate.
*/
- int validateWindowingMode(int windowingMode, @Nullable ActivityRecord r, @Nullable Task task,
- int activityType) {
- final boolean inSplitScreenMode = isSplitScreenModeActivated();
- if (!inSplitScreenMode && windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) {
- // Switch to the display's windowing mode if we are not in split-screen mode and we are
- // trying to launch in split-screen secondary.
- windowingMode = WINDOWING_MODE_UNDEFINED;
- } else if (inSplitScreenMode && windowingMode == WINDOWING_MODE_UNDEFINED) {
- windowingMode = WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
- }
- if (!isValidWindowingMode(windowingMode, r, task, activityType)) {
+ int validateWindowingMode(int windowingMode, @Nullable ActivityRecord r, @Nullable Task task) {
+ if (!isValidWindowingMode(windowingMode, r, task)) {
return WINDOWING_MODE_UNDEFINED;
}
return windowingMode;
@@ -1774,11 +1622,6 @@
return homeTask;
}
- boolean isSplitScreenModeActivated() {
- Task task = getRootSplitScreenPrimaryTask();
- return task != null && task.hasChild();
- }
-
/**
* Returns the topmost root task on the display that is compatible with the input windowing
* mode. Null is no compatible root task on the display.
@@ -1866,8 +1709,7 @@
continue;
}
final int winMode = s.getWindowingMode();
- final boolean isValidWindowingMode = winMode == WINDOWING_MODE_FULLSCREEN
- || winMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
+ final boolean isValidWindowingMode = winMode == WINDOWING_MODE_FULLSCREEN;
if (s.shouldBeVisible(null) && isValidWindowingMode) {
// Move the provided root task to behind this root task
final int position = Math.max(0, rootTaskNdx - 1);
@@ -1882,8 +1724,7 @@
private Task getBottomMostVisibleRootTask(Task excludeRootTask) {
return getRootTask(task -> {
final int winMode = task.getWindowingMode();
- final boolean isValidWindowingMode = winMode == WINDOWING_MODE_FULLSCREEN
- || winMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
+ final boolean isValidWindowingMode = winMode == WINDOWING_MODE_FULLSCREEN;
return task.shouldBeVisible(null) && isValidWindowingMode;
}, false /* traverseTopToBottom */);
}
@@ -2067,20 +1908,11 @@
numRootTasks = mChildren.size();
}
- if (lastReparentedRootTask != null) {
- if (toDisplayArea.isSplitScreenModeActivated()
- && !lastReparentedRootTask.supportsSplitScreenWindowingModeInDisplayArea(
- toDisplayArea)) {
- // Dismiss split screen if the last reparented root task doesn't support split mode.
- mAtmService.getTaskChangeNotificationController()
- .notifyActivityDismissingDockedRootTask();
- toDisplayArea.onSplitScreenModeDismissed(lastReparentedRootTask);
- } else if (!lastReparentedRootTask.isRootTask()) {
- // Update focus when the last reparented root task is not a root task anymore.
- // (For example, if it has been reparented to a split screen root task, move the
- // focus to the split root task)
- lastReparentedRootTask.getRootTask().moveToFront("display-removed");
- }
+ if (lastReparentedRootTask != null && !lastReparentedRootTask.isRootTask()) {
+ // Update focus when the last reparented root task is not a root task anymore.
+ // (For example, if it has been reparented to a split screen root task, move the
+ // focus to the split root task)
+ lastReparentedRootTask.getRootTask().moveToFront("display-removed");
}
mRemoved = true;
diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java
index 11d1983..08130b6 100644
--- a/services/core/java/com/android/server/wm/WindowContainer.java
+++ b/services/core/java/com/android/server/wm/WindowContainer.java
@@ -3604,6 +3604,16 @@
mOverlayHost = new OverlayHost(mWmService);
}
mOverlayHost.addOverlay(overlay, mSurfaceControl);
+
+ // Emit an initial onConfigurationChanged to ensure the overlay
+ // can receive any changes between their creation time and
+ // attach time.
+ try {
+ overlay.getRemoteInterface().onConfigurationChanged(getConfiguration());
+ } catch (Exception e) {
+ Slog.e(TAG, "Error sending initial configuration change to WindowContainer overlay");
+ removeOverlay(overlay);
+ }
}
void removeOverlay(SurfaceControlViewHost.SurfacePackage overlay) {
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 6e20fced..5397c48 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -2622,6 +2622,10 @@
void finishDrawingWindow(Session session, IWindow client,
@Nullable SurfaceControl.Transaction postDrawTransaction) {
+ if (postDrawTransaction != null) {
+ postDrawTransaction.sanitize();
+ }
+
final long origId = Binder.clearCallingIdentity();
try {
synchronized (mGlobalLock) {
@@ -6618,6 +6622,7 @@
pw.println(" d[isplays]: active display contents");
pw.println(" t[okens]: token list");
pw.println(" w[indows]: window list");
+ pw.println(" package-config: installed packages having app-specific config");
pw.println(" trace: print trace status and write Winscope trace to file");
pw.println(" cmd may also be a NAME to dump windows. NAME may");
pw.println(" be a partial substring in a window name, a");
@@ -6704,6 +6709,9 @@
} else if ("constants".equals(cmd)) {
mConstants.dump(pw);
return;
+ } else if ("package-config".equals(cmd)) {
+ mAtmService.dumpInstalledPackagesConfig(pw);
+ return;
} else {
// Dumping a single name?
if (!dumpWindows(pw, cmd, args, opti, dumpAll)) {
@@ -6770,6 +6778,10 @@
if (dumpAll) {
pw.println(separator);
}
+ mAtmService.dumpInstalledPackagesConfig(pw);
+ if (dumpAll) {
+ pw.println(separator);
+ }
mConstants.dump(pw);
}
}
@@ -8272,8 +8284,7 @@
*/
void grantInputChannel(Session session, int callingUid, int callingPid, int displayId,
SurfaceControl surface, IWindow window, IBinder hostInputToken,
- int flags, int privateFlags, int type, IBinder focusGrantToken,
- InputChannel outInputChannel) {
+ int flags, int privateFlags, int type, InputChannel outInputChannel) {
final InputApplicationHandle applicationHandle;
final String name;
final InputChannel clientChannel;
@@ -8281,7 +8292,7 @@
EmbeddedWindowController.EmbeddedWindow win =
new EmbeddedWindowController.EmbeddedWindow(session, this, window,
mInputToWindowMap.get(hostInputToken), callingUid, callingPid, type,
- displayId, focusGrantToken);
+ displayId);
clientChannel = win.openInputChannel();
mEmbeddedWindowController.add(clientChannel.getToken(), win);
applicationHandle = win.getApplicationHandle();
@@ -8560,10 +8571,10 @@
}
}
- void grantEmbeddedWindowFocus(Session session, IBinder focusToken, boolean grantFocus) {
+ void grantEmbeddedWindowFocus(Session session, IBinder inputToken, boolean grantFocus) {
synchronized (mGlobalLock) {
final EmbeddedWindowController.EmbeddedWindow embeddedWindow =
- mEmbeddedWindowController.getByFocusToken(focusToken);
+ mEmbeddedWindowController.get(inputToken);
if (embeddedWindow == null) {
Slog.e(TAG, "Embedded window not found");
return;
@@ -8572,11 +8583,6 @@
Slog.e(TAG, "Window not in session:" + session);
return;
}
- IBinder inputToken = embeddedWindow.getInputChannelToken();
- if (inputToken == null) {
- Slog.e(TAG, "Focus token found but input channel token not found");
- return;
- }
SurfaceControl.Transaction t = mTransactionFactory.get();
final int displayId = embeddedWindow.mDisplayId;
if (grantFocus) {
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index a228d6a..8864b98 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -1731,20 +1731,6 @@
} else {
intersectWithRootTaskBounds = false;
}
- if (inSplitScreenPrimaryWindowingMode()) {
- // If this is in the primary split and the root home task is the top visible task in
- // the secondary split, it means this is "minimized" and thus must prevent
- // overlapping with home.
- // TODO(b/158242495): get rid of this when drag/drop can use surface bounds.
- final Task rootSecondary =
- task.getDisplayArea().getRootSplitScreenSecondaryTask();
- if (rootSecondary.isActivityTypeHome() || rootSecondary.isActivityTypeRecents()) {
- final WindowContainer topTask = rootSecondary.getTopChild();
- if (topTask.isVisible()) {
- cutRect(mTmpRect, topTask.getBounds());
- }
- }
- }
}
bounds.set(mWindowFrames.mFrame);
@@ -4714,14 +4700,6 @@
if (!isImeLayeringTarget()) {
return false;
}
- // If we are in split screen which case we process the IME at the DisplayContent level to
- // ensure it is above the docked divider.
- // i.e. Like {@link DisplayContent.ImeContainer#skipImeWindowsDuringTraversal}, the IME
- // window will be ignored to traverse when the IME target is still in split-screen mode.
- if (mDisplayContent.getDefaultTaskDisplayArea().isSplitScreenModeActivated()
- && getTask() != null) {
- return false;
- }
// Note that we don't process IME window if the IME input target is not on the screen.
// In case some unexpected IME visibility cases happen like starting the remote
// animation on the keyguard but seeing the IME window that originally on the app
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
index 79a980f..95ef5f7 100644
--- a/services/core/jni/Android.bp
+++ b/services/core/jni/Android.bp
@@ -145,8 +145,8 @@
"libutils",
"libhwui",
"libbpf_android",
- "libnetdbpf",
"libnetdutils",
+ "libnetworkstats",
"libpsi",
"libdataloader",
"libincfs",
diff --git a/services/core/jni/com_android_server_UsbAlsaJackDetector.cpp b/services/core/jni/com_android_server_UsbAlsaJackDetector.cpp
index 1c574fb..436ac1b 100644
--- a/services/core/jni/com_android_server_UsbAlsaJackDetector.cpp
+++ b/services/core/jni/com_android_server_UsbAlsaJackDetector.cpp
@@ -25,7 +25,6 @@
#include <stdio.h>
#include <string.h>
-#include <asm/byteorder.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/services/core/jni/com_android_server_UsbDescriptorParser.cpp b/services/core/jni/com_android_server_UsbDescriptorParser.cpp
index d29d3fc..9917bcb 100644
--- a/services/core/jni/com_android_server_UsbDescriptorParser.cpp
+++ b/services/core/jni/com_android_server_UsbDescriptorParser.cpp
@@ -15,16 +15,14 @@
*/
#define LOG_TAG "UsbHostManagerJNI"
-#include "utils/Log.h"
-
+#include <nativehelper/JNIHelp.h>
#include <stdlib.h>
+#include <usbhost/usbhost.h>
+#include <usbhost/usbhost_jni.h>
#include "jni.h"
-#include <nativehelper/JNIHelp.h>
+#include "utils/Log.h"
-#include <usbhost/usbhost.h>
-
-#define MAX_DESCRIPTORS_LENGTH 4096
static const int USB_CONTROL_TRANSFER_TIMEOUT_MS = 200;
// com.android.server.usb.descriptors
@@ -41,26 +39,9 @@
}
int fd = usb_device_get_fd(device);
- if (fd < 0) {
- usb_device_close(device);
- return NULL;
- }
-
- // from android_hardware_UsbDeviceConnection_get_desc()
- jbyte buffer[MAX_DESCRIPTORS_LENGTH];
- lseek(fd, 0, SEEK_SET);
- int numBytes = read(fd, buffer, sizeof(buffer));
- jbyteArray ret = NULL;
+ jbyteArray descriptors = usb_jni_read_descriptors(env, fd);
usb_device_close(device);
-
- if (numBytes > 0) {
- ret = env->NewByteArray(numBytes);
- env->SetByteArrayRegion(ret, 0, numBytes, buffer);
- } else {
- ALOGE("error reading descriptors\n");
- }
-
- return ret;
+ return descriptors;
}
jstring JNICALL Java_com_android_server_usb_descriptors_UsbDescriptorParser_getDescriptorString_1native(
diff --git a/services/core/jni/com_android_server_UsbDeviceManager.cpp b/services/core/jni/com_android_server_UsbDeviceManager.cpp
index 3ab5920..0a9ce2f 100644
--- a/services/core/jni/com_android_server_UsbDeviceManager.cpp
+++ b/services/core/jni/com_android_server_UsbDeviceManager.cpp
@@ -25,7 +25,6 @@
#include "MtpDescriptors.h"
#include <stdio.h>
-#include <asm/byteorder.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/services/core/jni/com_android_server_UsbHostManager.cpp b/services/core/jni/com_android_server_UsbHostManager.cpp
index a629b69..e29d2ca 100644
--- a/services/core/jni/com_android_server_UsbHostManager.cpp
+++ b/services/core/jni/com_android_server_UsbHostManager.cpp
@@ -23,7 +23,6 @@
#include "android_runtime/Log.h"
#include <stdio.h>
-#include <asm/byteorder.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -31,8 +30,6 @@
#include <usbhost/usbhost.h>
-#define MAX_DESCRIPTORS_LENGTH 4096
-
namespace android
{
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/CertificateMonitor.java b/services/devicepolicy/java/com/android/server/devicepolicy/CertificateMonitor.java
index cc385c7..a1cba94 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/CertificateMonitor.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/CertificateMonitor.java
@@ -35,6 +35,7 @@
import android.security.Credentials;
import android.security.KeyChain;
import android.security.KeyChain.KeyChainConnection;
+import android.util.PluralsMessageFormatter;
import com.android.internal.R;
import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
@@ -46,7 +47,9 @@
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
public class CertificateMonitor {
protected static final int MONITORING_CERT_NOTIFICATION_ID = SystemMessage.NOTE_SSL_CERT_INFO;
@@ -212,10 +215,15 @@
dialogIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE,
null, UserHandle.of(parentUserId));
+ Map<String, Object> arguments = new HashMap<>();
+ arguments.put("count", pendingCertificateCount);
+
return new Notification.Builder(userContext, SystemNotificationChannels.SECURITY)
.setSmallIcon(smallIconId)
- .setContentTitle(resources.getQuantityText(R.plurals.ssl_ca_cert_warning,
- pendingCertificateCount))
+ .setContentTitle(PluralsMessageFormatter.format(
+ resources,
+ arguments,
+ R.string.ssl_ca_cert_warning))
.setContentText(contentText)
.setContentIntent(notifyIntent)
.setShowWhen(false)
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index e0b6273..733cfcd 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -11042,7 +11042,8 @@
@Override
public int getLogoutUserId() {
- Preconditions.checkCallAuthorization(canManageUsers(getCallerIdentity()));
+ Preconditions.checkCallAuthorization(canManageUsers(getCallerIdentity())
+ || hasCallingOrSelfPermission(permission.INTERACT_ACROSS_USERS));
return getLogoutUserIdUnchecked();
}
@@ -11057,16 +11058,7 @@
}
}
- @Override
- public void clearLogoutUser() {
- CallerIdentity caller = getCallerIdentity();
- Preconditions.checkCallAuthorization(canManageUsers(caller));
-
- Slogf.i(LOG_TAG, "Clearing logout user as requested by %s", caller);
- clearLogoutUserUnchecked();
- }
-
- private void clearLogoutUserUnchecked() {
+ private void clearLogoutUser() {
if (!mInjector.userManagerIsHeadlessSystemUserMode()) return; // ignore
synchronized (getLockObject()) {
@@ -11167,6 +11159,21 @@
return stopUserUnchecked(callingUserId);
}
+ return logoutUserUnchecked(/* userIdToStop= */ callingUserId);
+ }
+
+ @Override
+ public int logoutUserInternal() {
+ CallerIdentity caller = getCallerIdentity();
+ Preconditions.checkCallAuthorization(
+ canManageUsers(caller) || hasCallingOrSelfPermission(permission.CREATE_USERS));
+
+ int result = logoutUserUnchecked(getCurrentForegroundUserId());
+ Slogf.d(LOG_TAG, "logout called by uid %d. Result: %d", caller.getUid(), result);
+ return result;
+ }
+
+ private int logoutUserUnchecked(@UserIdInt int userIdToStop) {
int logoutUserId = getLogoutUserIdUnchecked();
if (logoutUserId == UserHandle.USER_NULL) {
// Could happen on devices using headless system user mode when called before calling
@@ -11182,7 +11189,7 @@
// This should never happen as target user is determined by getPreviousUserId()
return UserManager.USER_OPERATION_ERROR_UNKNOWN;
}
- clearLogoutUserUnchecked();
+ clearLogoutUser();
} catch (RemoteException e) {
// Same process, should not happen.
return UserManager.USER_OPERATION_ERROR_UNKNOWN;
@@ -11190,7 +11197,7 @@
mInjector.binderRestoreCallingIdentity(id);
}
- return stopUserUnchecked(callingUserId);
+ return stopUserUnchecked(userIdToStop);
}
private int stopUserUnchecked(@UserIdInt int userId) {
diff --git a/services/tests/mockingservicestests/Android.bp b/services/tests/mockingservicestests/Android.bp
index 36246e5..9e221be 100644
--- a/services/tests/mockingservicestests/Android.bp
+++ b/services/tests/mockingservicestests/Android.bp
@@ -62,12 +62,14 @@
"truth-prebuilt",
// TODO: remove once Android migrates to JUnit 4.12, which provides assertThrows
"testng",
+ "compatibility-device-util-axt",
],
libs: [
"android.test.mock",
"android.test.base",
"android.test.runner",
+ "servicestests-core-utils",
],
jni_libs: [
diff --git a/services/tests/mockingservicestests/src/com/android/server/AppStateTrackerTest.java b/services/tests/mockingservicestests/src/com/android/server/AppStateTrackerTest.java
index 40b3664..9b04ae4 100644
--- a/services/tests/mockingservicestests/src/com/android/server/AppStateTrackerTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/AppStateTrackerTest.java
@@ -344,6 +344,30 @@
callStart(instance);
assertFalse(instance.isForceAllAppsStandbyEnabled());
+
+ when(mMockIActivityManagerInternal.isBgAutoRestrictedBucketFeatureFlagEnabled())
+ .thenReturn(false);
+
+ areJobsRestricted(instance,
+ new int[] {UID_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {false, false, false, false},
+ false);
+ areJobsRestricted(instance,
+ new int[] {UID_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {false, false, false, false},
+ true);
+ areAlarmsRestrictedByBatterySaver(instance,
+ new int[] {UID_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {false, false, false, false});
+
+ // Toggle the auto restricted bucket feature flag on bg restriction, shouldn't make a
+ // difference.
+ when(mMockIActivityManagerInternal.isBgAutoRestrictedBucketFeatureFlagEnabled())
+ .thenReturn(true);
+
areJobsRestricted(instance,
new int[] {UID_1, UID_2, UID_10_2, Process.SYSTEM_UID},
new String[] {PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
@@ -364,6 +388,9 @@
assertTrue(instance.isForceAllAppsStandbyEnabled());
+ when(mMockIActivityManagerInternal.isBgAutoRestrictedBucketFeatureFlagEnabled())
+ .thenReturn(false);
+
areJobsRestricted(instance,
new int[] {UID_1, UID_2, UID_10_2, Process.SYSTEM_UID},
new String[] {PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
@@ -379,6 +406,29 @@
new String[] {PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
new boolean[] {true, true, true, false});
+ // Toggle the auto restricted bucket feature flag on bg restriction, shouldn't make a
+ // difference.
+ when(mMockIActivityManagerInternal.isBgAutoRestrictedBucketFeatureFlagEnabled())
+ .thenReturn(true);
+
+ areJobsRestricted(instance,
+ new int[] {UID_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {true, true, true, false},
+ false);
+ areJobsRestricted(instance,
+ new int[] {UID_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {false, false, false, false},
+ true);
+ areAlarmsRestrictedByBatterySaver(instance,
+ new int[] {UID_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {true, true, true, false});
+
+ when(mMockIActivityManagerInternal.isBgAutoRestrictedBucketFeatureFlagEnabled())
+ .thenReturn(false);
+
// Toggle the foreground state.
assertFalse(instance.isUidActive(UID_1));
@@ -500,9 +550,35 @@
new String[] {PACKAGE_1, PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
new boolean[] {true, false, false, true, false});
+ // Toggle the auto restricted bucket feature flag on bg restriction.
+ when(mMockIActivityManagerInternal.isBgAutoRestrictedBucketFeatureFlagEnabled())
+ .thenReturn(true);
+
+ areJobsRestricted(instance,
+ new int[] {UID_1, UID_10_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {false, false, false, false, false},
+ false);
+ areJobsRestricted(instance,
+ new int[] {UID_1, UID_10_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {false, false, false, false, false},
+ true);
+
+ areAlarmsRestrictedByBatterySaver(instance,
+ new int[] {UID_1, UID_10_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {false, false, false, false, false});
+ areAlarmsRestrictedByFAS(instance,
+ new int[] {UID_1, UID_10_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {false, false, false, false, false});
+
// Toggle power saver, should still be the same.
mPowerSaveMode = true;
mPowerSaveObserver.accept(getPowerSaveState());
+ when(mMockIActivityManagerInternal.isBgAutoRestrictedBucketFeatureFlagEnabled())
+ .thenReturn(false);
areJobsRestricted(instance,
new int[] {UID_1, UID_10_1, UID_2, UID_10_2, Process.SYSTEM_UID},
@@ -524,9 +600,36 @@
new String[] {PACKAGE_1, PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
new boolean[] {true, false, false, true, false});
+ // Toggle the auto restricted bucket feature flag on bg restriction.
+ when(mMockIActivityManagerInternal.isBgAutoRestrictedBucketFeatureFlagEnabled())
+ .thenReturn(true);
+
+ areJobsRestricted(instance,
+ new int[] {UID_1, UID_10_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {true, true, true, true, false},
+ false);
+ areJobsRestricted(instance,
+ new int[] {UID_1, UID_10_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {false, false, false, false, false},
+ true);
+
+ areAlarmsRestrictedByBatterySaver(instance,
+ new int[] {UID_1, UID_10_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {true, true, true, true, false});
+ areAlarmsRestrictedByFAS(instance,
+ new int[] {UID_1, UID_10_1, UID_2, UID_10_2, Process.SYSTEM_UID},
+ new String[] {PACKAGE_1, PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
+ new boolean[] {false, false, false, false, false});
+
mPowerSaveMode = false;
mPowerSaveObserver.accept(getPowerSaveState());
+ when(mMockIActivityManagerInternal.isBgAutoRestrictedBucketFeatureFlagEnabled())
+ .thenReturn(false);
+
areJobsRestricted(instance,
new int[] {UID_1, UID_10_1, UID_2, UID_10_2, Process.SYSTEM_UID},
new String[] {PACKAGE_1, PACKAGE_1, PACKAGE_2, PACKAGE_2, PACKAGE_SYSTEM},
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/BackgroundRestrictionTest.java b/services/tests/mockingservicestests/src/com/android/server/am/BackgroundRestrictionTest.java
new file mode 100644
index 0000000..28c91aa
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/am/BackgroundRestrictionTest.java
@@ -0,0 +1,2441 @@
+/*
+ * 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.server.am;
+
+import static android.Manifest.permission.ACCESS_BACKGROUND_LOCATION;
+import static android.app.ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE;
+import static android.app.ActivityManager.PROCESS_STATE_TOP;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_ADAPTIVE_BUCKET;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_BACKGROUND_RESTRICTED;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_EXEMPTED;
+import static android.app.ActivityManager.RESTRICTION_LEVEL_RESTRICTED_BUCKET;
+import static android.app.usage.UsageStatsManager.REASON_MAIN_FORCED_BY_SYSTEM;
+import static android.app.usage.UsageStatsManager.REASON_MAIN_FORCED_BY_USER;
+import static android.app.usage.UsageStatsManager.REASON_MAIN_USAGE;
+import static android.app.usage.UsageStatsManager.REASON_SUB_FORCED_SYSTEM_FLAG_ABUSE;
+import static android.app.usage.UsageStatsManager.REASON_SUB_FORCED_USER_FLAG_INTERACTION;
+import static android.app.usage.UsageStatsManager.REASON_SUB_USAGE_USER_INTERACTION;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_ACTIVE;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_EXEMPTED;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_FREQUENT;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_NEVER;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_RARE;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_RESTRICTED;
+import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_WORKING_SET;
+import static android.content.pm.PackageManager.PERMISSION_DENIED;
+import static android.content.pm.PackageManager.PERMISSION_GRANTED;
+import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA;
+import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION;
+import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK;
+import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_NONE;
+
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
+
+import static com.android.internal.notification.SystemNotificationChannels.ABUSIVE_BACKGROUND_APPS;
+import static com.android.server.am.AppBatteryTracker.BATT_DIMEN_BG;
+import static com.android.server.am.AppBatteryTracker.BATT_DIMEN_FG;
+import static com.android.server.am.AppBatteryTracker.BATT_DIMEN_FGS;
+import static com.android.server.am.AppRestrictionController.STOCK_PM_FLAGS;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.anyBoolean;
+import static org.mockito.Mockito.anyInt;
+import static org.mockito.Mockito.anyLong;
+import static org.mockito.Mockito.anyObject;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.atLeast;
+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.spy;
+import static org.mockito.Mockito.timeout;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import android.app.ActivityManagerInternal;
+import android.app.ActivityManagerInternal.AppBackgroundRestrictionListener;
+import android.app.ActivityManagerInternal.BindServiceEventListener;
+import android.app.ActivityManagerInternal.BroadcastEventListener;
+import android.app.AppOpsManager;
+import android.app.IActivityManager;
+import android.app.IUidObserver;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.role.RoleManager;
+import android.app.usage.AppStandbyInfo;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManagerInternal;
+import android.media.session.MediaController;
+import android.media.session.MediaSession;
+import android.media.session.MediaSessionManager;
+import android.media.session.MediaSessionManager.OnActiveSessionsChangedListener;
+import android.os.BatteryManagerInternal;
+import android.os.BatteryStatsInternal;
+import android.os.BatteryUsageStats;
+import android.os.Handler;
+import android.os.MessageQueue;
+import android.os.Process;
+import android.os.RemoteException;
+import android.os.SystemClock;
+import android.os.UidBatteryConsumer;
+import android.os.UserHandle;
+import android.provider.DeviceConfig;
+import android.util.Log;
+import android.util.Pair;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.server.AppStateTracker;
+import com.android.server.DeviceIdleInternal;
+import com.android.server.am.AppBatteryExemptionTracker.AppBatteryExemptionPolicy;
+import com.android.server.am.AppBatteryExemptionTracker.UidBatteryStates;
+import com.android.server.am.AppBatteryExemptionTracker.UidStateEventWithBattery;
+import com.android.server.am.AppBatteryTracker.AppBatteryPolicy;
+import com.android.server.am.AppBindServiceEventsTracker.AppBindServiceEventsPolicy;
+import com.android.server.am.AppBroadcastEventsTracker.AppBroadcastEventsPolicy;
+import com.android.server.am.AppFGSTracker.AppFGSPolicy;
+import com.android.server.am.AppMediaSessionTracker.AppMediaSessionPolicy;
+import com.android.server.am.AppRestrictionController.NotificationHelper;
+import com.android.server.am.AppRestrictionController.UidBatteryUsageProvider;
+import com.android.server.am.BaseAppStateTimeEvents.BaseTimeEvent;
+import com.android.server.apphibernation.AppHibernationManagerInternal;
+import com.android.server.pm.UserManagerInternal;
+import com.android.server.pm.permission.PermissionManagerServiceInternal;
+import com.android.server.usage.AppStandbyInternal;
+import com.android.server.usage.AppStandbyInternal.AppIdleStateChangeListener;
+
+import org.junit.After;
+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 org.mockito.verification.VerificationMode;
+
+import java.time.Duration;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import java.util.function.BiConsumer;
+
+/**
+ * Tests for {@link AppRestrictionController}.
+ *
+ * Build/Install/Run:
+ * atest FrameworksMockingServicesTests:BackgroundRestrictionTest
+ */
+@RunWith(AndroidJUnit4.class)
+public final class BackgroundRestrictionTest {
+ private static final String TAG = BackgroundRestrictionTest.class.getSimpleName();
+
+ private static final int TEST_USER0 = UserHandle.USER_SYSTEM;
+ private static final int TEST_USER1 = UserHandle.MIN_SECONDARY_USER_ID;
+ private static final int[] TEST_USERS = new int[] {TEST_USER0, TEST_USER1};
+ private static final String TEST_PACKAGE_BASE = "test_";
+ private static final int TEST_PACKAGE_APPID_BASE = Process.FIRST_APPLICATION_UID;
+ private static final int[] TEST_PACKAGE_USER0_UIDS = new int[] {
+ UserHandle.getUid(TEST_USER0, TEST_PACKAGE_APPID_BASE + 0),
+ UserHandle.getUid(TEST_USER0, TEST_PACKAGE_APPID_BASE + 1),
+ UserHandle.getUid(TEST_USER0, TEST_PACKAGE_APPID_BASE + 2),
+ UserHandle.getUid(TEST_USER0, TEST_PACKAGE_APPID_BASE + 3),
+ UserHandle.getUid(TEST_USER0, TEST_PACKAGE_APPID_BASE + 4),
+ UserHandle.getUid(TEST_USER0, TEST_PACKAGE_APPID_BASE + 5),
+ UserHandle.getUid(TEST_USER0, TEST_PACKAGE_APPID_BASE + 6),
+ };
+ private static final int[] TEST_PACKAGE_USER1_UIDS = new int[] {
+ UserHandle.getUid(TEST_USER1, TEST_PACKAGE_APPID_BASE + 0),
+ UserHandle.getUid(TEST_USER1, TEST_PACKAGE_APPID_BASE + 1),
+ UserHandle.getUid(TEST_USER1, TEST_PACKAGE_APPID_BASE + 2),
+ UserHandle.getUid(TEST_USER1, TEST_PACKAGE_APPID_BASE + 3),
+ UserHandle.getUid(TEST_USER1, TEST_PACKAGE_APPID_BASE + 4),
+ UserHandle.getUid(TEST_USER1, TEST_PACKAGE_APPID_BASE + 5),
+ UserHandle.getUid(TEST_USER1, TEST_PACKAGE_APPID_BASE + 6),
+ };
+ private static final int[][] TEST_UIDS = new int[][] {
+ TEST_PACKAGE_USER0_UIDS,
+ TEST_PACKAGE_USER1_UIDS,
+ };
+ private static final int[] TEST_STANDBY_BUCKETS = new int[] {
+ STANDBY_BUCKET_EXEMPTED,
+ STANDBY_BUCKET_ACTIVE,
+ STANDBY_BUCKET_WORKING_SET,
+ STANDBY_BUCKET_FREQUENT,
+ STANDBY_BUCKET_RARE,
+ STANDBY_BUCKET_RESTRICTED,
+ STANDBY_BUCKET_NEVER,
+ };
+
+ private static final int BATTERY_FULL_CHARGE_MAH = 5_000;
+
+ @Mock private ActivityManagerInternal mActivityManagerInternal;
+ @Mock private ActivityManagerService mActivityManagerService;
+ @Mock private AppOpsManager mAppOpsManager;
+ @Mock private AppStandbyInternal mAppStandbyInternal;
+ @Mock private AppHibernationManagerInternal mAppHibernationInternal;
+ @Mock private AppStateTracker mAppStateTracker;
+ @Mock private BatteryManagerInternal mBatteryManagerInternal;
+ @Mock private BatteryStatsInternal mBatteryStatsInternal;
+ @Mock private DeviceIdleInternal mDeviceIdleInternal;
+ @Mock private IActivityManager mIActivityManager;
+ @Mock private UserManagerInternal mUserManagerInternal;
+ @Mock private PackageManager mPackageManager;
+ @Mock private PackageManagerInternal mPackageManagerInternal;
+ @Mock private NotificationManager mNotificationManager;
+ @Mock private PermissionManagerServiceInternal mPermissionManagerServiceInternal;
+ @Mock private MediaSessionManager mMediaSessionManager;
+ @Mock private RoleManager mRoleManager;
+
+ private long mCurrentTimeMillis;
+
+ @Captor private ArgumentCaptor<AppStateTracker.BackgroundRestrictedAppListener> mFasListenerCap;
+ private AppStateTracker.BackgroundRestrictedAppListener mFasListener;
+
+ @Captor private ArgumentCaptor<AppIdleStateChangeListener> mIdleStateListenerCap;
+ private AppIdleStateChangeListener mIdleStateListener;
+
+ @Captor private ArgumentCaptor<IUidObserver> mUidObserversCap;
+ private IUidObserver mUidObservers;
+
+ @Captor private ArgumentCaptor<OnActiveSessionsChangedListener> mActiveSessionListenerCap;
+ private OnActiveSessionsChangedListener mActiveSessionListener;
+
+ @Captor private ArgumentCaptor<BroadcastEventListener> mBroadcastEventListenerCap;
+ private BroadcastEventListener mBroadcastEventListener;
+
+ @Captor private ArgumentCaptor<BindServiceEventListener> mBindServiceEventListenerCap;
+ private BindServiceEventListener mBindServiceEventListener;
+
+ private Context mContext = getInstrumentation().getTargetContext();
+ private TestBgRestrictionInjector mInjector;
+ private AppRestrictionController mBgRestrictionController;
+ private AppBatteryTracker mAppBatteryTracker;
+ private AppBatteryPolicy mAppBatteryPolicy;
+ private AppBatteryExemptionTracker mAppBatteryExemptionTracker;
+ private AppBroadcastEventsTracker mAppBroadcastEventsTracker;
+ private AppBindServiceEventsTracker mAppBindServiceEventsTracker;
+ private AppFGSTracker mAppFGSTracker;
+ private AppMediaSessionTracker mAppMediaSessionTracker;
+
+ @Before
+ public void setUp() throws Exception {
+ MockitoAnnotations.initMocks(this);
+ initController();
+ }
+
+ private void initController() throws Exception {
+ mInjector = spy(new TestBgRestrictionInjector(mContext));
+ mBgRestrictionController = spy(new AppRestrictionController(mInjector,
+ mActivityManagerService));
+
+ doReturn(PROCESS_STATE_FOREGROUND_SERVICE).when(mActivityManagerInternal)
+ .getUidProcessState(anyInt());
+ doReturn(TEST_USERS).when(mUserManagerInternal).getUserIds();
+ for (int userId: TEST_USERS) {
+ final ArrayList<AppStandbyInfo> appStandbyInfoList = new ArrayList<>();
+ for (int i = 0; i < TEST_STANDBY_BUCKETS.length; i++) {
+ final String packageName = TEST_PACKAGE_BASE + i;
+ final int uid = UserHandle.getUid(userId, TEST_PACKAGE_APPID_BASE + i);
+ appStandbyInfoList.add(new AppStandbyInfo(packageName, TEST_STANDBY_BUCKETS[i]));
+ doReturn(uid)
+ .when(mPackageManagerInternal)
+ .getPackageUid(packageName, STOCK_PM_FLAGS, userId);
+ doReturn(false)
+ .when(mAppStateTracker)
+ .isAppBackgroundRestricted(uid, packageName);
+ doReturn(TEST_STANDBY_BUCKETS[i])
+ .when(mAppStandbyInternal)
+ .getAppStandbyBucket(eq(packageName), eq(userId), anyLong(), anyBoolean());
+ doReturn(new String[]{packageName})
+ .when(mPackageManager)
+ .getPackagesForUid(eq(uid));
+ doReturn(AppOpsManager.MODE_IGNORED)
+ .when(mAppOpsManager)
+ .checkOpNoThrow(AppOpsManager.OP_ACTIVATE_VPN, uid, packageName);
+ doReturn(AppOpsManager.MODE_IGNORED)
+ .when(mAppOpsManager)
+ .checkOpNoThrow(AppOpsManager.OP_ACTIVATE_PLATFORM_VPN, uid, packageName);
+ doReturn(PERMISSION_DENIED)
+ .when(mPermissionManagerServiceInternal)
+ .checkUidPermission(uid, ACCESS_BACKGROUND_LOCATION);
+ doReturn(PERMISSION_DENIED)
+ .when(mPermissionManagerServiceInternal)
+ .checkPermission(packageName, ACCESS_BACKGROUND_LOCATION, userId);
+ }
+ doReturn(appStandbyInfoList).when(mAppStandbyInternal).getAppStandbyBuckets(userId);
+ }
+
+ doReturn(BATTERY_FULL_CHARGE_MAH * 1000).when(mBatteryManagerInternal)
+ .getBatteryFullCharge();
+
+ mBgRestrictionController.onSystemReady();
+
+ verify(mInjector.getAppStateTracker())
+ .addBackgroundRestrictedAppListener(mFasListenerCap.capture());
+ mFasListener = mFasListenerCap.getValue();
+ verify(mInjector.getAppStandbyInternal())
+ .addListener(mIdleStateListenerCap.capture());
+ mIdleStateListener = mIdleStateListenerCap.getValue();
+ verify(mInjector.getIActivityManager())
+ .registerUidObserver(mUidObserversCap.capture(),
+ anyInt(), anyInt(), anyString());
+ mUidObservers = mUidObserversCap.getValue();
+ verify(mAppMediaSessionTracker.mInjector.getMediaSessionManager())
+ .addOnActiveSessionsChangedListener(any(), any(), any(),
+ mActiveSessionListenerCap.capture());
+ mActiveSessionListener = mActiveSessionListenerCap.getValue();
+ verify(mAppBroadcastEventsTracker.mInjector.getActivityManagerInternal())
+ .addBroadcastEventListener(mBroadcastEventListenerCap.capture());
+ mBroadcastEventListener = mBroadcastEventListenerCap.getValue();
+ verify(mAppBindServiceEventsTracker.mInjector.getActivityManagerInternal())
+ .addBindServiceEventListener(mBindServiceEventListenerCap.capture());
+ mBindServiceEventListener = mBindServiceEventListenerCap.getValue();
+ }
+
+ @After
+ public void tearDown() {
+ mBgRestrictionController.getBackgroundHandlerThread().quitSafely();
+ }
+
+ @Test
+ public void testInitialLevels() throws Exception {
+ final int[] expectedLevels = {
+ RESTRICTION_LEVEL_EXEMPTED,
+ RESTRICTION_LEVEL_ADAPTIVE_BUCKET,
+ RESTRICTION_LEVEL_ADAPTIVE_BUCKET,
+ RESTRICTION_LEVEL_ADAPTIVE_BUCKET,
+ RESTRICTION_LEVEL_ADAPTIVE_BUCKET,
+ RESTRICTION_LEVEL_RESTRICTED_BUCKET,
+ RESTRICTION_LEVEL_BACKGROUND_RESTRICTED,
+ };
+ for (int i = 0; i < TEST_UIDS.length; i++) {
+ final int[] uids = TEST_UIDS[i];
+ for (int j = 0; j < uids.length; j++) {
+ assertEquals(expectedLevels[j],
+ mBgRestrictionController.getRestrictionLevel(uids[j]));
+ assertEquals(expectedLevels[j],
+ mBgRestrictionController.getRestrictionLevel(uids[j],
+ TEST_PACKAGE_BASE + j));
+ }
+ }
+ }
+
+ @Test
+ public void testTogglingBackgroundRestrict() throws Exception {
+ final int testPkgIndex = 2;
+ final String testPkgName = TEST_PACKAGE_BASE + testPkgIndex;
+ final int testUser = TEST_USER0;
+ final int testUid = UserHandle.getUid(testUser, TEST_PACKAGE_APPID_BASE + testPkgIndex);
+ final TestAppRestrictionLevelListener listener = new TestAppRestrictionLevelListener();
+ final long timeout = 1_000; // ms
+
+ mBgRestrictionController.addAppBackgroundRestrictionListener(listener);
+
+ setBackgroundRestrict(testPkgName, testUid, false, listener);
+
+ // Verify the current settings.
+ verifyRestrictionLevel(RESTRICTION_LEVEL_ADAPTIVE_BUCKET, testPkgName, testUid);
+ assertEquals(STANDBY_BUCKET_WORKING_SET, mInjector.getAppStandbyInternal()
+ .getAppStandbyBucket(testPkgName, testUser, SystemClock.elapsedRealtime(), false));
+
+ // Now toggling ON the background restrict.
+ setBackgroundRestrict(testPkgName, testUid, true, listener);
+
+ // We should have been in the background restricted level.
+ verifyRestrictionLevel(RESTRICTION_LEVEL_BACKGROUND_RESTRICTED, testPkgName, testUid);
+
+ listener.verify(timeout, testUid, testPkgName, RESTRICTION_LEVEL_BACKGROUND_RESTRICTED);
+
+ // The app should have been put into the restricted standby bucket.
+ verify(mInjector.getAppStandbyInternal(), atLeast(1)).restrictApp(
+ eq(testPkgName),
+ eq(testUser),
+ eq(REASON_MAIN_FORCED_BY_USER),
+ eq(REASON_SUB_FORCED_USER_FLAG_INTERACTION));
+
+ // Changing to the restricted standby bucket won't make a difference.
+ listener.mLatchHolder[0] = new CountDownLatch(1);
+ mIdleStateListener.onAppIdleStateChanged(testPkgName, testUser, false,
+ STANDBY_BUCKET_RESTRICTED, REASON_MAIN_USAGE);
+ waitForIdleHandler(mBgRestrictionController.getBackgroundHandler());
+ verifyRestrictionLevel(RESTRICTION_LEVEL_BACKGROUND_RESTRICTED, testPkgName, testUid);
+ try {
+ listener.verify(timeout, testUid, testPkgName, RESTRICTION_LEVEL_BACKGROUND_RESTRICTED);
+ fail("There shouldn't be any level change events");
+ } catch (Exception e) {
+ // Expected.
+ }
+
+ clearInvocations(mInjector.getAppStandbyInternal());
+
+ // Toggling back.
+ setBackgroundRestrict(testPkgName, testUid, false, listener);
+
+ // It should have gone back to adaptive level.
+ verifyRestrictionLevel(RESTRICTION_LEVEL_ADAPTIVE_BUCKET, testPkgName, testUid);
+
+ // The app standby bucket should be the rare.
+ verify(mInjector.getAppStandbyInternal(), atLeast(1)).maybeUnrestrictApp(
+ eq(testPkgName),
+ eq(testUser),
+ eq(REASON_MAIN_FORCED_BY_USER),
+ eq(REASON_SUB_FORCED_USER_FLAG_INTERACTION),
+ eq(REASON_MAIN_USAGE),
+ eq(REASON_SUB_USAGE_USER_INTERACTION));
+
+ listener.verify(timeout, testUid, testPkgName, RESTRICTION_LEVEL_ADAPTIVE_BUCKET);
+
+ clearInvocations(mInjector.getAppStandbyInternal());
+
+ // Now set its UID state active.
+ mUidObservers.onUidActive(testUid);
+
+ // Now toggling ON the background restrict.
+ setBackgroundRestrict(testPkgName, testUid, true, listener);
+
+ // We should have been in the background restricted level.
+ verifyRestrictionLevel(RESTRICTION_LEVEL_BACKGROUND_RESTRICTED, testPkgName, testUid);
+
+ listener.verify(timeout, testUid, testPkgName, RESTRICTION_LEVEL_BACKGROUND_RESTRICTED);
+
+ // The app should have NOT been put into the restricted standby bucket.
+ verify(mInjector.getAppStandbyInternal(), never()).restrictApp(
+ eq(testPkgName),
+ eq(testUser),
+ eq(REASON_MAIN_FORCED_BY_USER),
+ eq(REASON_SUB_FORCED_USER_FLAG_INTERACTION));
+
+ // Now set its UID to idle.
+ mUidObservers.onUidIdle(testUid, false);
+
+ // The app should have been put into the restricted standby bucket because we're idle now.
+ verify(mInjector.getAppStandbyInternal(), timeout(timeout).times(1)).restrictApp(
+ eq(testPkgName),
+ eq(testUser),
+ eq(REASON_MAIN_FORCED_BY_USER),
+ eq(REASON_SUB_FORCED_USER_FLAG_INTERACTION));
+ }
+
+ @Test
+ public void testTogglingStandbyBucket() throws Exception {
+ final int testPkgIndex = 2;
+ final String testPkgName = TEST_PACKAGE_BASE + testPkgIndex;
+ final int testUser = TEST_USER0;
+ final int testUid = UserHandle.getUid(testUser, TEST_PACKAGE_APPID_BASE + testPkgIndex);
+ final TestAppRestrictionLevelListener listener = new TestAppRestrictionLevelListener();
+ final long timeout = 1_000; // ms
+
+ mBgRestrictionController.addAppBackgroundRestrictionListener(listener);
+
+ setBackgroundRestrict(testPkgName, testUid, false, listener);
+
+ // Verify the current settings.
+ verifyRestrictionLevel(RESTRICTION_LEVEL_ADAPTIVE_BUCKET, testPkgName, testUid);
+
+ for (int bucket: Arrays.asList(STANDBY_BUCKET_ACTIVE, STANDBY_BUCKET_WORKING_SET,
+ STANDBY_BUCKET_FREQUENT, STANDBY_BUCKET_RARE)) {
+ listener.mLatchHolder[0] = new CountDownLatch(1);
+ mIdleStateListener.onAppIdleStateChanged(testPkgName, testUser, false,
+ bucket, REASON_MAIN_USAGE);
+ waitForIdleHandler(mBgRestrictionController.getBackgroundHandler());
+ verifyRestrictionLevel(RESTRICTION_LEVEL_ADAPTIVE_BUCKET, testPkgName, testUid);
+
+ try {
+ listener.verify(timeout, testUid, testPkgName, RESTRICTION_LEVEL_ADAPTIVE_BUCKET);
+ fail("There shouldn't be any level change events");
+ } catch (Exception e) {
+ // Expected.
+ }
+ }
+
+ // Toggling restricted bucket.
+ listener.mLatchHolder[0] = new CountDownLatch(1);
+ mIdleStateListener.onAppIdleStateChanged(testPkgName, testUser, false,
+ STANDBY_BUCKET_RESTRICTED, REASON_MAIN_USAGE);
+ waitForIdleHandler(mBgRestrictionController.getBackgroundHandler());
+ verifyRestrictionLevel(RESTRICTION_LEVEL_RESTRICTED_BUCKET, testPkgName, testUid);
+ listener.verify(timeout, testUid, testPkgName, RESTRICTION_LEVEL_RESTRICTED_BUCKET);
+
+ // Toggling exempted bucket.
+ listener.mLatchHolder[0] = new CountDownLatch(1);
+ mIdleStateListener.onAppIdleStateChanged(testPkgName, testUser, false,
+ STANDBY_BUCKET_EXEMPTED, REASON_MAIN_FORCED_BY_SYSTEM);
+ waitForIdleHandler(mBgRestrictionController.getBackgroundHandler());
+ verifyRestrictionLevel(RESTRICTION_LEVEL_EXEMPTED, testPkgName, testUid);
+ listener.verify(timeout, testUid, testPkgName, RESTRICTION_LEVEL_EXEMPTED);
+ }
+
+ @Test
+ public void testBgCurrentDrainMonitor() throws Exception {
+ final BatteryUsageStats stats = mock(BatteryUsageStats.class);
+ final List<BatteryUsageStats> statsList = Arrays.asList(stats);
+ final int testPkgIndex = 2;
+ final String testPkgName = TEST_PACKAGE_BASE + testPkgIndex;
+ final int testUser = TEST_USER0;
+ final int testUid = UserHandle.getUid(testUser,
+ TEST_PACKAGE_APPID_BASE + testPkgIndex);
+ final int testUid2 = UserHandle.getUid(testUser,
+ TEST_PACKAGE_APPID_BASE + testPkgIndex + 1);
+ final TestAppRestrictionLevelListener listener = new TestAppRestrictionLevelListener();
+ final long timeout =
+ AppBatteryTracker.BATTERY_USAGE_STATS_POLLING_INTERVAL_MS_DEBUG * 2;
+ final long windowMs = 2_000;
+ final float restrictBucketThreshold = 2.0f;
+ final float restrictBucketThresholdMah =
+ BATTERY_FULL_CHARGE_MAH * restrictBucketThreshold / 100.0f;
+ final float bgRestrictedThreshold = 4.0f;
+ final float bgRestrictedThresholdMah =
+ BATTERY_FULL_CHARGE_MAH * bgRestrictedThreshold / 100.0f;
+
+ DeviceConfigSession<Boolean> bgCurrentDrainMonitor = null;
+ DeviceConfigSession<Long> bgCurrentDrainWindow = null;
+ DeviceConfigSession<Float> bgCurrentDrainRestrictedBucketThreshold = null;
+ DeviceConfigSession<Float> bgCurrentDrainBgRestrictedThreshold = null;
+
+ mBgRestrictionController.addAppBackgroundRestrictionListener(listener);
+
+ setBackgroundRestrict(testPkgName, testUid, false, listener);
+
+ // Verify the current settings.
+ verifyRestrictionLevel(RESTRICTION_LEVEL_ADAPTIVE_BUCKET, testPkgName, testUid);
+
+ final double[] zeros = new double[]{0.0f, 0.0f};
+ final int[] uids = new int[]{testUid, testUid2};
+
+ try {
+ bgCurrentDrainMonitor = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_MONITOR_ENABLED,
+ DeviceConfig::getBoolean,
+ AppBatteryPolicy.DEFAULT_BG_CURRENT_DRAIN_MONITOR_ENABLED);
+ bgCurrentDrainMonitor.set(true);
+
+ bgCurrentDrainWindow = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_WINDOW,
+ DeviceConfig::getLong,
+ AppBatteryPolicy.DEFAULT_BG_CURRENT_DRAIN_WINDOW_MS);
+ bgCurrentDrainWindow.set(windowMs);
+
+ bgCurrentDrainRestrictedBucketThreshold = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_RESTRICTED_BUCKET,
+ DeviceConfig::getFloat,
+ AppBatteryPolicy.DEFAULT_BG_CURRENT_DRAIN_BG_RESTRICTED_THRESHOLD);
+ bgCurrentDrainRestrictedBucketThreshold.set(restrictBucketThreshold);
+
+ bgCurrentDrainBgRestrictedThreshold = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_BG_RESTRICTED,
+ DeviceConfig::getFloat,
+ AppBatteryPolicy.DEFAULT_BG_CURRENT_DRAIN_BG_RESTRICTED_THRESHOLD);
+ bgCurrentDrainBgRestrictedThreshold.set(bgRestrictedThreshold);
+
+ mCurrentTimeMillis = 10_000L;
+ doReturn(mCurrentTimeMillis - windowMs).when(stats).getStatsStartTimestamp();
+ doReturn(statsList).when(mBatteryStatsInternal).getBatteryUsageStats(anyObject());
+
+ runTestBgCurrentDrainMonitorOnce(listener, stats, uids,
+ new double[]{restrictBucketThresholdMah - 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ () -> {
+ doReturn(mCurrentTimeMillis).when(stats).getStatsStartTimestamp();
+ mCurrentTimeMillis += windowMs + 1;
+ try {
+ listener.verify(timeout, testUid, testPkgName,
+ RESTRICTION_LEVEL_ADAPTIVE_BUCKET);
+ fail("There shouldn't be any level change events");
+ } catch (Exception e) {
+ // Expected.
+ }
+ });
+
+ runTestBgCurrentDrainMonitorOnce(listener, stats, uids,
+ new double[]{restrictBucketThresholdMah + 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ () -> {
+ doReturn(mCurrentTimeMillis).when(stats).getStatsStartTimestamp();
+ mCurrentTimeMillis += windowMs + 1;
+ // It should have gone to the restricted bucket.
+ listener.verify(timeout, testUid, testPkgName,
+ RESTRICTION_LEVEL_RESTRICTED_BUCKET);
+ verify(mInjector.getAppStandbyInternal()).restrictApp(
+ eq(testPkgName),
+ eq(testUser),
+ anyInt(), anyInt());
+ });
+
+
+ runTestBgCurrentDrainMonitorOnce(listener, stats, uids,
+ new double[]{restrictBucketThresholdMah - 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ () -> {
+ doReturn(mCurrentTimeMillis).when(stats).getStatsStartTimestamp();
+ mCurrentTimeMillis += windowMs + 1;
+ // We won't change restriction level until user interactions.
+ try {
+ listener.verify(timeout, testUid, testPkgName,
+ RESTRICTION_LEVEL_ADAPTIVE_BUCKET);
+ fail("There shouldn't be any level change events");
+ } catch (Exception e) {
+ // Expected.
+ }
+ verify(mInjector.getAppStandbyInternal(), never()).setAppStandbyBucket(
+ eq(testPkgName),
+ eq(STANDBY_BUCKET_RARE),
+ eq(testUser),
+ anyInt(), anyInt());
+ });
+
+ // Trigger user interaction.
+ runTestBgCurrentDrainMonitorOnce(listener, stats, uids,
+ new double[]{restrictBucketThresholdMah - 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ () -> {
+ doReturn(mCurrentTimeMillis).when(stats).getStatsStartTimestamp();
+ mCurrentTimeMillis += windowMs + 1;
+ mIdleStateListener.onUserInteractionStarted(testPkgName, testUser);
+ waitForIdleHandler(mBgRestrictionController.getBackgroundHandler());
+ // It should have been back to normal.
+ listener.verify(timeout, testUid, testPkgName,
+ RESTRICTION_LEVEL_ADAPTIVE_BUCKET);
+ verify(mInjector.getAppStandbyInternal(), atLeast(1)).maybeUnrestrictApp(
+ eq(testPkgName),
+ eq(testUser),
+ eq(REASON_MAIN_FORCED_BY_SYSTEM),
+ eq(REASON_SUB_FORCED_SYSTEM_FLAG_ABUSE),
+ eq(REASON_MAIN_USAGE),
+ eq(REASON_SUB_USAGE_USER_INTERACTION));
+ });
+
+ clearInvocations(mInjector.getAppStandbyInternal());
+
+ runTestBgCurrentDrainMonitorOnce(listener, stats, uids,
+ new double[]{restrictBucketThresholdMah + 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ () -> {
+ doReturn(mCurrentTimeMillis).when(stats).getStatsStartTimestamp();
+ mCurrentTimeMillis += windowMs + 1;
+ // It should have gone to the restricted bucket.
+ listener.verify(timeout, testUid, testPkgName,
+ RESTRICTION_LEVEL_RESTRICTED_BUCKET);
+ verify(mInjector.getAppStandbyInternal(), times(1)).restrictApp(
+ eq(testPkgName),
+ eq(testUser),
+ anyInt(), anyInt());
+ });
+
+ clearInvocations(mInjector.getAppStandbyInternal());
+ // Drain a bit more, there shouldn't be any level changes.
+ runTestBgCurrentDrainMonitorOnce(listener, stats, uids,
+ new double[]{restrictBucketThresholdMah + 2, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ () -> {
+ doReturn(mCurrentTimeMillis).when(stats).getStatsStartTimestamp();
+ mCurrentTimeMillis += windowMs + 1;
+ // We won't change restriction level until user interactions.
+ try {
+ listener.verify(timeout, testUid, testPkgName,
+ RESTRICTION_LEVEL_ADAPTIVE_BUCKET);
+ fail("There shouldn't be any level change events");
+ } catch (Exception e) {
+ // Expected.
+ }
+ verify(mInjector.getAppStandbyInternal(), never()).setAppStandbyBucket(
+ eq(testPkgName),
+ eq(STANDBY_BUCKET_RARE),
+ eq(testUser),
+ anyInt(), anyInt());
+ });
+
+ // Sleep a while and set a higher drain
+ Thread.sleep(windowMs);
+ clearInvocations(mInjector.getAppStandbyInternal());
+ clearInvocations(mBgRestrictionController);
+ runTestBgCurrentDrainMonitorOnce(listener, stats, uids,
+ new double[]{bgRestrictedThresholdMah + 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ () -> {
+ doReturn(mCurrentTimeMillis).when(stats).getStatsStartTimestamp();
+ mCurrentTimeMillis += windowMs + 1;
+ // We won't change restriction level automatically because it needs
+ // user consent.
+ try {
+ listener.verify(timeout, testUid, testPkgName,
+ RESTRICTION_LEVEL_BACKGROUND_RESTRICTED);
+ fail("There shouldn't be level change event like this");
+ } catch (Exception e) {
+ // Expected.
+ }
+ verify(mInjector.getAppStandbyInternal(), never()).setAppStandbyBucket(
+ eq(testPkgName),
+ eq(STANDBY_BUCKET_RARE),
+ eq(testUser),
+ anyInt(), anyInt());
+ // We should have requested to goto background restricted level.
+ verify(mBgRestrictionController, times(1)).handleRequestBgRestricted(
+ eq(testPkgName),
+ eq(testUid));
+ // Verify we have the notification posted.
+ checkNotificationShown(new String[] {testPkgName}, atLeast(1), true);
+ });
+
+ // Turn ON the FAS for real.
+ setBackgroundRestrict(testPkgName, testUid, true, listener);
+
+ // Verify it's background restricted now.
+ verifyRestrictionLevel(RESTRICTION_LEVEL_BACKGROUND_RESTRICTED, testPkgName, testUid);
+ listener.verify(timeout, testUid, testPkgName, RESTRICTION_LEVEL_BACKGROUND_RESTRICTED);
+
+ // Trigger user interaction.
+ mIdleStateListener.onUserInteractionStarted(testPkgName, testUser);
+ waitForIdleHandler(mBgRestrictionController.getBackgroundHandler());
+
+ listener.mLatchHolder[0] = new CountDownLatch(1);
+ try {
+ listener.verify(timeout, testUid, testPkgName,
+ RESTRICTION_LEVEL_ADAPTIVE_BUCKET);
+ fail("There shouldn't be level change event like this");
+ } catch (Exception e) {
+ // Expected.
+ }
+
+ // Turn OFF the FAS.
+ listener.mLatchHolder[0] = new CountDownLatch(1);
+ clearInvocations(mInjector.getAppStandbyInternal());
+ clearInvocations(mBgRestrictionController);
+ setBackgroundRestrict(testPkgName, testUid, false, listener);
+
+ // It'll go back to restricted bucket because it used to behave poorly.
+ listener.verify(timeout, testUid, testPkgName, RESTRICTION_LEVEL_RESTRICTED_BUCKET);
+ verifyRestrictionLevel(RESTRICTION_LEVEL_RESTRICTED_BUCKET, testPkgName, testUid);
+ } finally {
+ closeIfNotNull(bgCurrentDrainMonitor);
+ closeIfNotNull(bgCurrentDrainWindow);
+ closeIfNotNull(bgCurrentDrainRestrictedBucketThreshold);
+ closeIfNotNull(bgCurrentDrainBgRestrictedThreshold);
+ }
+ }
+
+ @Test
+ public void testLongFGSMonitor() throws Exception {
+ final int testPkgIndex1 = 1;
+ final String testPkgName1 = TEST_PACKAGE_BASE + testPkgIndex1;
+ final int testUser1 = TEST_USER0;
+ final int testUid1 = UserHandle.getUid(testUser1, TEST_PACKAGE_APPID_BASE + testPkgIndex1);
+ final int testPid1 = 1234;
+
+ final int testPkgIndex2 = 2;
+ final String testPkgName2 = TEST_PACKAGE_BASE + testPkgIndex2;
+ final int testUser2 = TEST_USER0;
+ final int testUid2 = UserHandle.getUid(testUser2, TEST_PACKAGE_APPID_BASE + testPkgIndex2);
+ final int testPid2 = 1235;
+
+ final long windowMs = 2_000;
+ final long thresholdMs = 1_000;
+ final long shortMs = 100;
+
+ DeviceConfigSession<Boolean> longRunningFGSMonitor = null;
+ DeviceConfigSession<Long> longRunningFGSWindow = null;
+ DeviceConfigSession<Long> longRunningFGSThreshold = null;
+
+ try {
+ longRunningFGSMonitor = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppFGSPolicy.KEY_BG_FGS_MONITOR_ENABLED,
+ DeviceConfig::getBoolean,
+ AppFGSPolicy.DEFAULT_BG_FGS_MONITOR_ENABLED);
+ longRunningFGSMonitor.set(true);
+
+ longRunningFGSWindow = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppFGSPolicy.KEY_BG_FGS_LONG_RUNNING_WINDOW,
+ DeviceConfig::getLong,
+ AppFGSPolicy.DEFAULT_BG_FGS_LONG_RUNNING_WINDOW);
+ longRunningFGSWindow.set(windowMs);
+
+ longRunningFGSThreshold = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppFGSPolicy.KEY_BG_FGS_LONG_RUNNING_THRESHOLD,
+ DeviceConfig::getLong,
+ AppFGSPolicy.DEFAULT_BG_FGS_LONG_RUNNING_THRESHOLD);
+ longRunningFGSThreshold.set(thresholdMs);
+
+ // Basic case
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName1, testUid1,
+ testPid1, true);
+ // Verify we have the notification, it'll include the summary notification though.
+ int notificationId = checkNotificationShown(
+ new String[] {testPkgName1}, timeout(windowMs * 2).times(2), true)[0];
+
+ clearInvocations(mInjector.getNotificationManager());
+ // Sleep a while, verify it won't show another notification.
+ Thread.sleep(windowMs * 2);
+ checkNotificationShown(
+ new String[] {testPkgName1}, timeout(windowMs * 2).times(0), false);
+
+ // Stop this FGS
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName1, testUid1,
+ testPid1, false);
+ checkNotificationGone(testPkgName1, timeout(windowMs), notificationId);
+
+ clearInvocations(mInjector.getNotificationManager());
+ // Start another one and stop it.
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName2, testUid2,
+ testPid2, true);
+ Thread.sleep(shortMs);
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName2, testUid2,
+ testPid2, false);
+
+ // Not long enough, it shouldn't show notification in this case.
+ checkNotificationShown(
+ new String[] {testPkgName2}, timeout(windowMs * 2).times(0), false);
+
+ clearInvocations(mInjector.getNotificationManager());
+ // Start the FGS again.
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName2, testUid2,
+ testPid2, true);
+ // Verify we have the notification.
+ notificationId = checkNotificationShown(
+ new String[] {testPkgName2}, timeout(windowMs * 2).times(2), true)[0];
+
+ // Stop this FGS
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName2, testUid2,
+ testPid2, false);
+ checkNotificationGone(testPkgName2, timeout(windowMs), notificationId);
+
+ // Start over with concurrent cases.
+ clearInvocations(mInjector.getNotificationManager());
+ mBgRestrictionController.resetRestrictionSettings();
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName2, testUid2,
+ testPid2, true);
+ Thread.sleep(shortMs);
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName1, testUid1,
+ testPid1, true);
+
+ // Verify we've seen both notifications, and test pkg2 should be shown before test pkg1.
+ int[] notificationIds = checkNotificationShown(
+ new String[] {testPkgName2, testPkgName1},
+ timeout(windowMs * 2).times(4), true);
+
+ // Stop both of them.
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName1, testUid1,
+ testPid1, false);
+ checkNotificationGone(testPkgName1, timeout(windowMs), notificationIds[1]);
+ clearInvocations(mInjector.getNotificationManager());
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName2, testUid2,
+ testPid2, false);
+ checkNotificationGone(testPkgName2, timeout(windowMs), notificationIds[0]);
+
+ // Test the interlaced case.
+ clearInvocations(mInjector.getNotificationManager());
+ mBgRestrictionController.resetRestrictionSettings();
+ mAppFGSTracker.reset();
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName1, testUid1,
+ testPid1, true);
+
+ final long initialWaitMs = thresholdMs / 2;
+ Thread.sleep(initialWaitMs);
+
+ for (long remaining = thresholdMs - initialWaitMs; remaining > 0;) {
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName1, testUid1,
+ testPid1, false);
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName2, testUid2,
+ testPid2, true);
+ Thread.sleep(shortMs);
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName1, testUid1,
+ testPid1, true);
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName2, testUid2,
+ testPid2, false);
+ Thread.sleep(shortMs);
+ remaining -= shortMs;
+ }
+
+ // Verify test pkg1 got the notification, but not test pkg2.
+ notificationId = checkNotificationShown(
+ new String[] {testPkgName1}, timeout(windowMs).times(2), true)[0];
+
+ clearInvocations(mInjector.getNotificationManager());
+ // Stop the FGS.
+ mAppFGSTracker.onForegroundServiceStateChanged(testPkgName1, testUid1,
+ testPid1, false);
+ checkNotificationGone(testPkgName1, timeout(windowMs), notificationId);
+ } finally {
+ closeIfNotNull(longRunningFGSMonitor);
+ closeIfNotNull(longRunningFGSWindow);
+ closeIfNotNull(longRunningFGSThreshold);
+ }
+ }
+
+ @Test
+ public void testLongFGSExemptions() throws Exception {
+ final int testPkgIndex1 = 1;
+ final String testPkgName1 = TEST_PACKAGE_BASE + testPkgIndex1;
+ final int testUser1 = TEST_USER0;
+ final int testUid1 = UserHandle.getUid(testUser1, TEST_PACKAGE_APPID_BASE + testPkgIndex1);
+ final int testPid1 = 1234;
+
+ final int testPkgIndex2 = 2;
+ final String testPkgName2 = TEST_PACKAGE_BASE + testPkgIndex2;
+ final int testUser2 = TEST_USER0;
+ final int testUid2 = UserHandle.getUid(testUser2, TEST_PACKAGE_APPID_BASE + testPkgIndex2);
+ final int testPid2 = 1235;
+
+ final long windowMs = 2_000;
+ final long thresholdMs = 1_000;
+
+ DeviceConfigSession<Boolean> longRunningFGSMonitor = null;
+ DeviceConfigSession<Long> longRunningFGSWindow = null;
+ DeviceConfigSession<Long> longRunningFGSThreshold = null;
+ DeviceConfigSession<Long> mediaPlaybackFGSThreshold = null;
+ DeviceConfigSession<Long> locationFGSThreshold = null;
+
+ doReturn(testPkgName1).when(mInjector).getPackageName(testPid1);
+ doReturn(testPkgName2).when(mInjector).getPackageName(testPid2);
+
+ try {
+ longRunningFGSMonitor = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppFGSPolicy.KEY_BG_FGS_MONITOR_ENABLED,
+ DeviceConfig::getBoolean,
+ AppFGSPolicy.DEFAULT_BG_FGS_MONITOR_ENABLED);
+ longRunningFGSMonitor.set(true);
+
+ longRunningFGSWindow = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppFGSPolicy.KEY_BG_FGS_LONG_RUNNING_WINDOW,
+ DeviceConfig::getLong,
+ AppFGSPolicy.DEFAULT_BG_FGS_LONG_RUNNING_WINDOW);
+ longRunningFGSWindow.set(windowMs);
+
+ longRunningFGSThreshold = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppFGSPolicy.KEY_BG_FGS_LONG_RUNNING_THRESHOLD,
+ DeviceConfig::getLong,
+ AppFGSPolicy.DEFAULT_BG_FGS_LONG_RUNNING_THRESHOLD);
+ longRunningFGSThreshold.set(thresholdMs);
+
+ mediaPlaybackFGSThreshold = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppFGSPolicy.KEY_BG_FGS_MEDIA_PLAYBACK_THRESHOLD,
+ DeviceConfig::getLong,
+ AppFGSPolicy.DEFAULT_BG_FGS_MEDIA_PLAYBACK_THRESHOLD);
+ mediaPlaybackFGSThreshold.set(thresholdMs);
+
+ locationFGSThreshold = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppFGSPolicy.KEY_BG_FGS_LOCATION_THRESHOLD,
+ DeviceConfig::getLong,
+ AppFGSPolicy.DEFAULT_BG_FGS_LOCATION_THRESHOLD);
+ locationFGSThreshold.set(thresholdMs);
+
+ // Long-running FGS with type "location", but ran for a very short time.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_LOCATION, 0, null, null, null,
+ timeout(windowMs * 2).times(2));
+
+ // Long-running FGS with type "location", and ran for a while.
+ // We shouldn't see notifications in this case.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_LOCATION, thresholdMs * 2, null, null, null,
+ timeout(windowMs * 2).times(0));
+
+ // Long-running FGS with background location permission.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_LOCATION, 0, ACCESS_BACKGROUND_LOCATION, null, null,
+ timeout(windowMs * 2).times(0));
+
+ // Long-running FGS with type "mediaPlayback", but ran for a very short time.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK, 0, null, null, null,
+ timeout(windowMs * 2).times(2));
+
+ // Long-running FGS with type "mediaPlayback", and ran for a while.
+ // We shouldn't see notifications in this case.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK, thresholdMs * 2, null, null, null,
+ timeout(windowMs * 2).times(0));
+
+ // Long-running FGS with type "camera", and ran for a while.
+ // We shouldn't see notifications in this case.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_CAMERA, thresholdMs * 2, null, null, null,
+ timeout(windowMs * 2).times(0));
+
+ // Long-running FGS with type "location|mediaPlayback", but ran for a very short time.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_LOCATION | FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK,
+ 0, null, null, null, timeout(windowMs * 2).times(2));
+
+ // Long-running FGS with type "location|mediaPlayback", and ran for a while.
+ // We shouldn't see notifications in this case.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_LOCATION | FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK,
+ thresholdMs * 2, null, null, null, timeout(windowMs * 2).times(0));
+
+ // Long-running FGS with a media session starts/stops right away.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, 0, null,
+ List.of(Pair.create(createMediaControllers(
+ new String[] {testPkgName1}, new int[] {testUid1}), 0L)), null,
+ timeout(windowMs * 2).times(2));
+
+ // Long-running FGS with media session, and ran for a while.
+ // We shouldn't see notifications in this case.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, thresholdMs * 2, null,
+ List.of(Pair.create(createMediaControllers(new String[] {testPkgName1},
+ new int[] {testUid1}), thresholdMs * 2)), null,
+ timeout(windowMs * 2).times(0));
+
+ // Long-running FGS with 2 media sessions start/stop right away
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, 0, null,
+ List.of(Pair.create(createMediaControllers(
+ new String[] {testPkgName1, testPkgName2},
+ new int[] {testUid1, testUid2}), 0L)), null,
+ timeout(windowMs * 2).times(2));
+
+ // Long-running FGS with 2 media sessions start/stop interlaced.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, 0, null,
+ List.of(Pair.create(createMediaControllers(
+ new String[] {testPkgName1, testPkgName2},
+ new int[] {testUid1, testUid2}), thresholdMs),
+ Pair.create(createMediaControllers(
+ new String[] {testPkgName1},
+ new int[] {testUid1}), thresholdMs / 10),
+ Pair.create(createMediaControllers(
+ new String[] {testPkgName2},
+ new int[] {testUid2}), thresholdMs / 10),
+ Pair.create(createMediaControllers(
+ new String[] {testPkgName1},
+ new int[] {testUid1}), thresholdMs / 10)
+ ), null,
+ timeout(windowMs * 2).times(0));
+
+ // Long-running FGS with top state for a very short time.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, 0, null, null, List.of(0L),
+ timeout(windowMs * 2).times(2));
+
+ // Long-running FGS with top state for extended time.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, 0, null, null, List.of(0L, windowMs * 2, 0L),
+ timeout(windowMs * 2).times(0));
+
+ // Long-running FGS with top state, on and off frequently.
+ runTestLongFGSExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, 0, null, null,
+ List.of(0L, thresholdMs / 10, thresholdMs / 10, thresholdMs / 10,
+ thresholdMs / 10, thresholdMs / 10, thresholdMs / 10),
+ timeout(windowMs * 2).times(2));
+ } finally {
+ closeIfNotNull(longRunningFGSMonitor);
+ closeIfNotNull(longRunningFGSWindow);
+ closeIfNotNull(longRunningFGSThreshold);
+ closeIfNotNull(mediaPlaybackFGSThreshold);
+ closeIfNotNull(locationFGSThreshold);
+ }
+ }
+
+ private void resetBgRestrictionController() {
+ mBgRestrictionController.resetRestrictionSettings();
+ waitForIdleHandler(mBgRestrictionController.getBackgroundHandler());
+ }
+
+ private void runTestLongFGSExemptionOnce(String packageName, int uid, int pid,
+ int serviceType, long sleepMs, String perm,
+ List<Pair<List<MediaController>, Long>> mediaControllers, List<Long> topStateChanges,
+ VerificationMode mode) throws Exception {
+ runExemptionTestOnce(
+ packageName, uid, pid, serviceType, sleepMs, true, perm, mediaControllers,
+ topStateChanges, true, true,
+ () -> checkNotificationShown(new String[] {packageName}, mode, false)
+ );
+ }
+
+ private void runExemptionTestOnce(String packageName, int uid, int pid,
+ int serviceType, long sleepMs, boolean stopAfterSleep, String perm,
+ List<Pair<List<MediaController>, Long>> mediaControllers,
+ List<Long> topStateChanges, boolean resetFGSTracker, boolean resetController,
+ RunnableWithException r) throws Exception {
+ if (resetFGSTracker) {
+ mAppFGSTracker.reset();
+ mAppMediaSessionTracker.reset();
+ }
+ if (resetController) {
+ resetBgRestrictionController();
+ }
+ clearInvocations(mInjector.getNotificationManager());
+
+ Thread topStateThread = null;
+ if (topStateChanges != null) {
+ final CountDownLatch latch = new CountDownLatch(1);
+ topStateThread = new Thread(() -> {
+ try {
+ latch.await();
+ boolean top = false;
+ for (long l: topStateChanges) {
+ mUidObservers.onUidStateChanged(uid,
+ top ? PROCESS_STATE_TOP : PROCESS_STATE_FOREGROUND_SERVICE,
+ 0, 0);
+ top = !top;
+ Thread.sleep(l);
+ }
+ mUidObservers.onUidGone(uid, false);
+ } catch (InterruptedException | RemoteException e) {
+ }
+ });
+ topStateThread.start();
+ latch.countDown();
+ }
+
+ mAppFGSTracker.onForegroundServiceStateChanged(packageName, uid, pid, true);
+ if (serviceType != FOREGROUND_SERVICE_TYPE_NONE) {
+ mAppFGSTracker.mProcessObserver.onForegroundServicesChanged(pid, uid, serviceType);
+ Thread.sleep(sleepMs);
+ if (stopAfterSleep) {
+ // Stop it now.
+ mAppFGSTracker.mProcessObserver.onForegroundServicesChanged(pid, uid,
+ FOREGROUND_SERVICE_TYPE_NONE);
+ }
+ }
+
+ if (perm != null) {
+ doReturn(PERMISSION_GRANTED)
+ .when(mPermissionManagerServiceInternal)
+ .checkPermission(packageName, perm, UserHandle.getUserId(uid));
+ doReturn(PERMISSION_GRANTED)
+ .when(mPermissionManagerServiceInternal)
+ .checkUidPermission(uid, ACCESS_BACKGROUND_LOCATION);
+ }
+
+ if (mediaControllers != null) {
+ for (Pair<List<MediaController>, Long> entry: mediaControllers) {
+ mActiveSessionListener.onActiveSessionsChanged(entry.first);
+ Thread.sleep(entry.second);
+ }
+ if (stopAfterSleep) {
+ // Stop it now.
+ mActiveSessionListener.onActiveSessionsChanged(null);
+ }
+ }
+
+ r.run();
+
+ // Stop this FGS
+ mAppFGSTracker.onForegroundServiceStateChanged(packageName, uid, pid, false);
+
+ if (perm != null) {
+ doReturn(PERMISSION_DENIED)
+ .when(mPermissionManagerServiceInternal)
+ .checkPermission(packageName, perm, UserHandle.getUserId(uid));
+ doReturn(PERMISSION_DENIED)
+ .when(mPermissionManagerServiceInternal)
+ .checkUidPermission(uid, ACCESS_BACKGROUND_LOCATION);
+ }
+ if (topStateThread != null) {
+ topStateThread.join();
+ }
+ }
+
+ private List<MediaController> createMediaControllers(String[] packageNames, int[] uids) {
+ final ArrayList<MediaController> controllers = new ArrayList<>();
+ for (int i = 0; i < packageNames.length; i++) {
+ controllers.add(createMediaController(packageNames[i], uids[i]));
+ }
+ return controllers;
+ }
+
+ private MediaController createMediaController(String packageName, int uid) {
+ final MediaController controller = mock(MediaController.class);
+ final MediaSession.Token token = mock(MediaSession.Token.class);
+ doReturn(packageName).when(controller).getPackageName();
+ doReturn(token).when(controller).getSessionToken();
+ doReturn(uid).when(token).getUid();
+ return controller;
+ }
+
+ @Test
+ public void testBgCurrentDrainMonitorExemptions() throws Exception {
+ final BatteryUsageStats stats = mock(BatteryUsageStats.class);
+ final List<BatteryUsageStats> statsList = Arrays.asList(stats);
+ final int testPkgIndex1 = 1;
+ final String testPkgName1 = TEST_PACKAGE_BASE + testPkgIndex1;
+ final int testUser = TEST_USER0;
+ final int testUid1 = UserHandle.getUid(testUser,
+ TEST_PACKAGE_APPID_BASE + testPkgIndex1);
+ final int testPid1 = 1234;
+ final int testPkgIndex2 = 2;
+ final String testPkgName2 = TEST_PACKAGE_BASE + testPkgIndex2;
+ final int testUid2 = UserHandle.getUid(testUser,
+ TEST_PACKAGE_APPID_BASE + testPkgIndex2);
+ final int testPid2 = 1235;
+ final TestAppRestrictionLevelListener listener = new TestAppRestrictionLevelListener();
+ final long timeout =
+ AppBatteryTracker.BATTERY_USAGE_STATS_POLLING_INTERVAL_MS_DEBUG * 2;
+ final long windowMs = 2_000;
+ final float restrictBucketThreshold = 2.0f;
+ final float restrictBucketThresholdMah =
+ BATTERY_FULL_CHARGE_MAH * restrictBucketThreshold / 100.0f;
+ final float bgRestrictedThreshold = 4.0f;
+ final float bgRestrictedThresholdMah =
+ BATTERY_FULL_CHARGE_MAH * bgRestrictedThreshold / 100.0f;
+ final float restrictBucketHighThreshold = 25.0f;
+ final float restrictBucketHighThresholdMah =
+ BATTERY_FULL_CHARGE_MAH * restrictBucketHighThreshold / 100.0f;
+ final float bgRestrictedHighThreshold = 25.0f;
+ final float bgRestrictedHighThresholdMah =
+ BATTERY_FULL_CHARGE_MAH * bgRestrictedHighThreshold / 100.0f;
+ final long bgMediaPlaybackMinDuration = 1_000L;
+ final long bgLocationMinDuration = 1_000L;
+
+ DeviceConfigSession<Boolean> bgCurrentDrainMonitor = null;
+ DeviceConfigSession<Long> bgCurrentDrainWindow = null;
+ DeviceConfigSession<Float> bgCurrentDrainRestrictedBucketThreshold = null;
+ DeviceConfigSession<Float> bgCurrentDrainBgRestrictedThreshold = null;
+ DeviceConfigSession<Float> bgCurrentDrainRestrictedBucketHighThreshold = null;
+ DeviceConfigSession<Float> bgCurrentDrainBgRestrictedHighThreshold = null;
+ DeviceConfigSession<Long> bgMediaPlaybackMinDurationThreshold = null;
+ DeviceConfigSession<Long> bgLocationMinDurationThreshold = null;
+ DeviceConfigSession<Boolean> bgCurrentDrainEventDurationBasedThresholdEnabled = null;
+ DeviceConfigSession<Boolean> bgBatteryExemptionEnabled = null;
+
+ mBgRestrictionController.addAppBackgroundRestrictionListener(listener);
+
+ setBackgroundRestrict(testPkgName1, testUid1, false, listener);
+
+ // Verify the current settings.
+ verifyRestrictionLevel(RESTRICTION_LEVEL_ADAPTIVE_BUCKET, testPkgName1, testUid1);
+
+ final double[] zeros = new double[]{0.0f, 0.0f};
+ final int[] uids = new int[]{testUid1, testUid2};
+
+ doReturn(testPkgName1).when(mInjector).getPackageName(testPid1);
+ doReturn(testPkgName2).when(mInjector).getPackageName(testPid2);
+
+ try {
+ bgCurrentDrainMonitor = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_MONITOR_ENABLED,
+ DeviceConfig::getBoolean,
+ AppBatteryPolicy.DEFAULT_BG_CURRENT_DRAIN_MONITOR_ENABLED);
+ bgCurrentDrainMonitor.set(true);
+
+ bgCurrentDrainWindow = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_WINDOW,
+ DeviceConfig::getLong,
+ AppBatteryPolicy.DEFAULT_BG_CURRENT_DRAIN_WINDOW_MS);
+ bgCurrentDrainWindow.set(windowMs);
+
+ bgCurrentDrainRestrictedBucketThreshold = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_RESTRICTED_BUCKET,
+ DeviceConfig::getFloat,
+ AppBatteryPolicy.DEFAULT_BG_CURRENT_DRAIN_BG_RESTRICTED_THRESHOLD);
+ bgCurrentDrainRestrictedBucketThreshold.set(restrictBucketThreshold);
+
+ bgCurrentDrainBgRestrictedThreshold = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_THRESHOLD_TO_BG_RESTRICTED,
+ DeviceConfig::getFloat,
+ AppBatteryPolicy.DEFAULT_BG_CURRENT_DRAIN_BG_RESTRICTED_THRESHOLD);
+ bgCurrentDrainBgRestrictedThreshold.set(bgRestrictedThreshold);
+
+ bgCurrentDrainRestrictedBucketHighThreshold = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_HIGH_THRESHOLD_TO_RESTRICTED_BUCKET,
+ DeviceConfig::getFloat,
+ AppBatteryPolicy.DEFAULT_BG_CURRENT_DRAIN_RESTRICTED_BUCKET_HIGH_THRESHOLD);
+ bgCurrentDrainRestrictedBucketHighThreshold.set(restrictBucketHighThreshold);
+
+ bgCurrentDrainBgRestrictedHighThreshold = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_HIGH_THRESHOLD_TO_BG_RESTRICTED,
+ DeviceConfig::getFloat,
+ AppBatteryPolicy.DEFAULT_BG_CURRENT_DRAIN_BG_RESTRICTED_HIGH_THRESHOLD);
+ bgCurrentDrainBgRestrictedHighThreshold.set(bgRestrictedHighThreshold);
+
+ bgMediaPlaybackMinDurationThreshold = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_MEDIA_PLAYBACK_MIN_DURATION,
+ DeviceConfig::getLong,
+ AppBatteryPolicy.DEFAULT_BG_CURRENT_DRAIN_MEDIA_PLAYBACK_MIN_DURATION);
+ bgMediaPlaybackMinDurationThreshold.set(bgMediaPlaybackMinDuration);
+
+ bgLocationMinDurationThreshold = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_LOCATION_MIN_DURATION,
+ DeviceConfig::getLong,
+ AppBatteryPolicy.DEFAULT_BG_CURRENT_DRAIN_LOCATION_MIN_DURATION);
+ bgLocationMinDurationThreshold.set(bgLocationMinDuration);
+
+ bgCurrentDrainEventDurationBasedThresholdEnabled = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryPolicy.KEY_BG_CURRENT_DRAIN_EVENT_DURATION_BASED_THRESHOLD_ENABLED,
+ DeviceConfig::getBoolean,
+ AppBatteryPolicy
+ .DEFAULT_BG_CURRENT_DRAIN_EVENT_DURATION_BASED_THRESHOLD_ENABLED);
+ bgCurrentDrainEventDurationBasedThresholdEnabled.set(true);
+
+ bgBatteryExemptionEnabled = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ AppBatteryExemptionPolicy.KEY_BG_BATTERY_EXEMPTION_ENABLED,
+ DeviceConfig::getBoolean,
+ AppBatteryExemptionPolicy.DEFAULT_BG_BATTERY_EXEMPTION_ENABLED);
+ bgBatteryExemptionEnabled.set(false);
+
+ mCurrentTimeMillis = 10_000L;
+ doReturn(mCurrentTimeMillis - windowMs).when(stats).getStatsStartTimestamp();
+ doReturn(statsList).when(mBatteryStatsInternal).getBatteryUsageStats(anyObject());
+
+ // Run with a media playback service which starts/stops immediately, we should
+ // goto the restricted bucket.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK, 0, true,
+ null, null, null, listener, stats, uids,
+ new double[]{restrictBucketThresholdMah + 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ false, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, true,
+ null, windowMs, null, null, null);
+
+ // Run with a media playback service with extended time. We should be back to normal.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK, bgMediaPlaybackMinDuration * 2, false,
+ null, null, null, listener, stats, uids,
+ new double[]{restrictBucketThresholdMah + 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ true, RESTRICTION_LEVEL_ADAPTIVE_BUCKET, timeout, false,
+ () -> {
+ // A user interaction will bring it back to normal.
+ mIdleStateListener.onUserInteractionStarted(testPkgName1,
+ UserHandle.getUserId(testUid1));
+ waitForIdleHandler(mBgRestrictionController.getBackgroundHandler());
+ // It should have been back to normal.
+ listener.verify(timeout, testUid1, testPkgName1,
+ RESTRICTION_LEVEL_ADAPTIVE_BUCKET);
+ verify(mInjector.getAppStandbyInternal(), times(1)).maybeUnrestrictApp(
+ eq(testPkgName1),
+ eq(UserHandle.getUserId(testUid1)),
+ eq(REASON_MAIN_FORCED_BY_SYSTEM),
+ eq(REASON_SUB_FORCED_SYSTEM_FLAG_ABUSE),
+ eq(REASON_MAIN_USAGE),
+ eq(REASON_SUB_USAGE_USER_INTERACTION));
+ }, windowMs, null, null, null);
+
+ // Start over.
+ resetBgRestrictionController();
+ setUidBatteryConsumptions(stats, uids, zeros, zeros, zeros);
+ mAppBatteryPolicy.reset();
+
+ // Run with a media playback service with extended time, with higher current drain.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK, bgMediaPlaybackMinDuration * 2, false,
+ null, null, null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah - 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ true, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, true,
+ null, windowMs, null, null, null);
+
+ // Run with a media playback service with extended time, with even higher current drain.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK, bgMediaPlaybackMinDuration * 2, false,
+ null, null, null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah + 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ false, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, false,
+ null, windowMs, null, null, null);
+
+ // Start over.
+ resetBgRestrictionController();
+ setUidBatteryConsumptions(stats, uids, zeros, zeros, zeros);
+ mAppBatteryPolicy.reset();
+
+ // Run with a media session with extended time, with higher current drain.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, bgMediaPlaybackMinDuration * 2, false, null,
+ List.of(Pair.create(createMediaControllers(new String[] {testPkgName1},
+ new int[] {testUid1}), bgMediaPlaybackMinDuration * 2)),
+ null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah - 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ true, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, true,
+ null, windowMs, null, null, null);
+
+ // Run with a media session with extended time, with even higher current drain.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, bgMediaPlaybackMinDuration * 2, false, null,
+ List.of(Pair.create(createMediaControllers(new String[] {testPkgName1},
+ new int[] {testUid1}), bgMediaPlaybackMinDuration * 2)),
+ null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah + 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ false, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, false,
+ null, windowMs, null, null, null);
+
+ // Start over.
+ resetBgRestrictionController();
+ setUidBatteryConsumptions(stats, uids, zeros, zeros, zeros);
+ mAppBatteryPolicy.reset();
+
+ // Run with a media session with extended time, with moderate current drain,
+ // but it ran on the top when the location service is active.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, bgMediaPlaybackMinDuration * 2, false, null,
+ List.of(Pair.create(createMediaControllers(new String[] {testPkgName1},
+ new int[] {testUid1}), bgMediaPlaybackMinDuration * 2)),
+ List.of(0L, timeout * 2), listener, stats, uids,
+ new double[]{restrictBucketThresholdMah + 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ false, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, true,
+ null, windowMs, null, null, null);
+
+ // Start over.
+ resetBgRestrictionController();
+ setUidBatteryConsumptions(stats, uids, zeros, zeros, zeros);
+ mAppBatteryPolicy.reset();
+
+ // Run with a location service with extended time, with higher current drain.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_LOCATION, bgMediaPlaybackMinDuration * 2, false,
+ null, null, null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah - 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ true, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, true,
+ null, windowMs, null, null, null);
+
+ // Run with a location service with extended time, with even higher current drain.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_LOCATION, bgMediaPlaybackMinDuration * 2, false,
+ null, null, null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah + 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ false, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, false,
+ null, windowMs, null, null, null);
+
+ // Start over.
+ resetBgRestrictionController();
+ setUidBatteryConsumptions(stats, uids, zeros, zeros, zeros);
+ mAppBatteryPolicy.reset();
+
+ // Run with a location service with extended time, with moderate current drain,
+ // but it ran on the top when the location service is active.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_LOCATION, bgMediaPlaybackMinDuration * 2, false,
+ null, null, List.of(0L, timeout * 2), listener, stats, uids,
+ new double[]{restrictBucketThresholdMah + 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ false, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, true,
+ null, windowMs, null, null, null);
+
+ // Start over.
+ resetBgRestrictionController();
+ setUidBatteryConsumptions(stats, uids, zeros, zeros, zeros);
+ mAppBatteryPolicy.reset();
+
+ // Run with bg location permission, with higher current drain.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, 0, false,
+ ACCESS_BACKGROUND_LOCATION, null, null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah - 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ true, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, true,
+ null, windowMs, null, null, null);
+
+ // Run with bg location permission, with even higher current drain.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, 0, false,
+ ACCESS_BACKGROUND_LOCATION , null, null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah + 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ false, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, false,
+ null, windowMs, null, null, null);
+
+ // Now turn off the event duration based feature flag.
+ bgCurrentDrainEventDurationBasedThresholdEnabled.set(false);
+ // Turn on the battery exemption feature flag.
+ bgBatteryExemptionEnabled.set(true);
+
+ // Start over.
+ resetBgRestrictionController();
+ setUidBatteryConsumptions(stats, uids, zeros, zeros, zeros);
+ mAppBatteryPolicy.reset();
+
+ waitForIdleHandler(mBgRestrictionController.getBackgroundHandler());
+
+ // Run with a media playback service which starts/stops immediately, we should
+ // goto the restricted bucket.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK, 0, true,
+ null, null, null, listener, stats, uids,
+ new double[]{restrictBucketThresholdMah + 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ false, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, true,
+ null, windowMs, null, null, null);
+
+ // Run with a media playback service with extended time. We should be back to normal.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK, bgMediaPlaybackMinDuration * 2, false,
+ null, null, null, listener, stats, uids,
+ new double[]{restrictBucketThresholdMah + 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ true, RESTRICTION_LEVEL_ADAPTIVE_BUCKET, timeout, false,
+ () -> {
+ // A user interaction will bring it back to normal.
+ mIdleStateListener.onUserInteractionStarted(testPkgName1,
+ UserHandle.getUserId(testUid1));
+ waitForIdleHandler(mBgRestrictionController.getBackgroundHandler());
+ // It should have been back to normal.
+ listener.verify(timeout, testUid1, testPkgName1,
+ RESTRICTION_LEVEL_ADAPTIVE_BUCKET);
+ verify(mInjector.getAppStandbyInternal(), times(1)).maybeUnrestrictApp(
+ eq(testPkgName1),
+ eq(UserHandle.getUserId(testUid1)),
+ eq(REASON_MAIN_FORCED_BY_SYSTEM),
+ eq(REASON_SUB_FORCED_SYSTEM_FLAG_ABUSE),
+ eq(REASON_MAIN_USAGE),
+ eq(REASON_SUB_USAGE_USER_INTERACTION));
+ }, windowMs, null, null, null);
+
+ // Start over.
+ resetBgRestrictionController();
+ setUidBatteryConsumptions(stats, uids, zeros, zeros, zeros);
+ mAppBatteryPolicy.reset();
+
+ final double[] initialBg = {1, 1}, initialFgs = {1, 1}, initialFg = zeros;
+
+ // Run with a media playback service with extended time, with higher current drain.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK, bgMediaPlaybackMinDuration * 2, false,
+ null, null, null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah - 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ true, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, true,
+ null, windowMs, initialBg, initialFgs, initialFg);
+
+ // Run with a media playback service with extended time, with even higher current drain,
+ // it still should stay in the current restriction level as we exempt the media
+ // playback.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK, bgMediaPlaybackMinDuration * 2, false,
+ null, null, null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah + 100, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ true, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, false,
+ null, windowMs, initialBg, initialFgs, initialFg);
+
+ // Start over.
+ resetBgRestrictionController();
+ setUidBatteryConsumptions(stats, uids, zeros, zeros, zeros);
+ mAppBatteryPolicy.reset();
+
+ // Run with a media session with extended time, with higher current drain.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, bgMediaPlaybackMinDuration * 2, false, null,
+ List.of(Pair.create(createMediaControllers(new String[] {testPkgName1},
+ new int[] {testUid1}), bgMediaPlaybackMinDuration * 2)),
+ null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah - 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ true, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, true,
+ null, windowMs, initialBg, initialFgs, initialFg);
+
+ // Run with a media session with extended time, with even higher current drain.
+ // it still should stay in the current restriction level as we exempt the media
+ // session.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_NONE, bgMediaPlaybackMinDuration * 2, false, null,
+ List.of(Pair.create(createMediaControllers(new String[] {testPkgName1},
+ new int[] {testUid1}), bgMediaPlaybackMinDuration * 2)),
+ null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah + 100, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ true, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, true,
+ null, windowMs, initialBg, initialFgs, initialFg);
+
+ // Start over.
+ resetBgRestrictionController();
+ setUidBatteryConsumptions(stats, uids, zeros, zeros, zeros);
+ mAppBatteryPolicy.reset();
+
+ // Run with a location service with extended time, with higher current drain.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_LOCATION, bgMediaPlaybackMinDuration * 2, false,
+ null, null, null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah - 1, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ true, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, true,
+ null, windowMs, initialBg, initialFgs, initialFg);
+
+ // Run with a location service with extended time, with even higher current drain.
+ // it still should stay in the current restriction level as we exempt the location.
+ runTestBgCurrentDrainExemptionOnce(testPkgName1, testUid1, testPid1,
+ FOREGROUND_SERVICE_TYPE_LOCATION, bgMediaPlaybackMinDuration * 2, false,
+ null, null, null, listener, stats, uids,
+ new double[]{restrictBucketHighThresholdMah + 100, 0},
+ new double[]{0, restrictBucketThresholdMah - 1}, zeros,
+ true, RESTRICTION_LEVEL_RESTRICTED_BUCKET, timeout, false,
+ null, windowMs, initialBg, initialFgs, initialFg);
+ } finally {
+ closeIfNotNull(bgCurrentDrainMonitor);
+ closeIfNotNull(bgCurrentDrainWindow);
+ closeIfNotNull(bgCurrentDrainRestrictedBucketThreshold);
+ closeIfNotNull(bgCurrentDrainBgRestrictedThreshold);
+ closeIfNotNull(bgCurrentDrainRestrictedBucketHighThreshold);
+ closeIfNotNull(bgCurrentDrainBgRestrictedHighThreshold);
+ closeIfNotNull(bgMediaPlaybackMinDurationThreshold);
+ closeIfNotNull(bgLocationMinDurationThreshold);
+ closeIfNotNull(bgCurrentDrainEventDurationBasedThresholdEnabled);
+ closeIfNotNull(bgBatteryExemptionEnabled);
+ }
+ }
+
+ private void runTestBgCurrentDrainExemptionOnce(String packageName, int uid, int pid,
+ int serviceType, long sleepMs, boolean stopAfterSleep, String perm,
+ List<Pair<List<MediaController>, Long>> mediaControllers,
+ List<Long> topStateChanges, TestAppRestrictionLevelListener listener,
+ BatteryUsageStats stats, int[] uids, double[] bg, double[] fgs, double[] fg,
+ boolean expectingTimeout, int expectingLevel, long timeout, boolean resetFGSTracker,
+ RunnableWithException extraVerifiers, long windowMs,
+ double[] initialBg, double[] initialFgs, double[] initialFg) throws Exception {
+ listener.mLatchHolder[0] = new CountDownLatch(1);
+ if (initialBg != null) {
+ doReturn(mCurrentTimeMillis).when(stats).getStatsStartTimestamp();
+ mCurrentTimeMillis += windowMs + 1;
+ setUidBatteryConsumptions(stats, uids, initialBg, initialFgs, initialFg);
+ mAppBatteryExemptionTracker.reset();
+ mAppBatteryPolicy.reset();
+ }
+ runExemptionTestOnce(
+ packageName, uid, pid, serviceType, sleepMs, stopAfterSleep,
+ perm, mediaControllers, topStateChanges, resetFGSTracker, false,
+ () -> {
+ clearInvocations(mInjector.getAppStandbyInternal());
+ clearInvocations(mBgRestrictionController);
+ runTestBgCurrentDrainMonitorOnce(listener, stats, uids, bg, fgs, fg, false,
+ () -> {
+ doReturn(mCurrentTimeMillis).when(stats).getStatsStartTimestamp();
+ mCurrentTimeMillis += windowMs + 1;
+ if (expectingTimeout) {
+ try {
+ listener.verify(timeout, uid, packageName, expectingLevel);
+ fail("There shouldn't be any level change events");
+ } catch (Exception e) {
+ // Expected.
+ }
+ } else {
+ listener.verify(timeout, uid, packageName, expectingLevel);
+ }
+ if (expectingLevel == RESTRICTION_LEVEL_RESTRICTED_BUCKET) {
+ verify(mInjector.getAppStandbyInternal(),
+ expectingTimeout ? never() : atLeast(1)).restrictApp(
+ eq(packageName),
+ eq(UserHandle.getUserId(uid)),
+ anyInt(), anyInt());
+ } else if (expectingLevel
+ == RESTRICTION_LEVEL_BACKGROUND_RESTRICTED) {
+ verify(mBgRestrictionController,
+ expectingTimeout ? never() : atLeast(1))
+ .handleRequestBgRestricted(eq(packageName), eq(uid));
+ } else {
+ verify(mInjector.getAppStandbyInternal(),
+ expectingTimeout ? never() : atLeast(1))
+ .setAppStandbyBucket(
+ eq(packageName),
+ eq(STANDBY_BUCKET_RARE),
+ eq(UserHandle.getUserId(uid)),
+ anyInt(), anyInt());
+ }
+ if (extraVerifiers != null) {
+ extraVerifiers.run();
+ }
+ }
+ );
+ }
+ );
+ }
+
+ @Test
+ public void testExcessiveBroadcasts() throws Exception {
+ final long windowMs = 5_000;
+ final int threshold = 10;
+ runTestExcessiveEvent(AppBroadcastEventsPolicy.KEY_BG_BROADCAST_MONITOR_ENABLED,
+ AppBroadcastEventsPolicy.DEFAULT_BG_BROADCAST_MONITOR_ENABLED,
+ AppBroadcastEventsPolicy.KEY_BG_BROADCAST_WINDOW,
+ AppBroadcastEventsPolicy.DEFAULT_BG_BROADCAST_WINDOW,
+ AppBroadcastEventsPolicy.KEY_BG_EX_BROADCAST_THRESHOLD,
+ AppBroadcastEventsPolicy.DEFAULT_BG_EX_BROADCAST_THRESHOLD,
+ windowMs, threshold, mBroadcastEventListener::onSendingBroadcast,
+ mAppBroadcastEventsTracker,
+ new long[][] {
+ new long[] {1_000L, 2_000L, 2_000L},
+ new long[] {2_000L, 2_000L, 1_000L},
+ },
+ new int[][] {
+ new int[] {3, 3, 3},
+ new int[] {3, 3, 4},
+ },
+ new boolean[] {
+ true,
+ false,
+ }
+ );
+ }
+
+ @Test
+ public void testExcessiveBindServices() throws Exception {
+ final long windowMs = 5_000;
+ final int threshold = 10;
+ runTestExcessiveEvent(AppBindServiceEventsPolicy.KEY_BG_BIND_SVC_MONITOR_ENABLED,
+ AppBindServiceEventsPolicy.DEFAULT_BG_BIND_SVC_MONITOR_ENABLED,
+ AppBindServiceEventsPolicy.KEY_BG_BIND_SVC_WINDOW,
+ AppBindServiceEventsPolicy.DEFAULT_BG_BIND_SVC_WINDOW,
+ AppBindServiceEventsPolicy.KEY_BG_EX_BIND_SVC_THRESHOLD,
+ AppBindServiceEventsPolicy.DEFAULT_BG_EX_BIND_SVC_THRESHOLD,
+ windowMs, threshold, mBindServiceEventListener::onBindingService,
+ mAppBindServiceEventsTracker,
+ new long[][] {
+ new long[] {0L, 2_000L, 4_000L, 1_000L},
+ new long[] {2_000L, 2_000L, 2_000L, 2_000L},
+ },
+ new int[][] {
+ new int[] {8, 3, 1, 0}, // Will goto restricted bucket.
+ new int[] {3, 3, 3, 3},
+ },
+ new boolean[] {
+ false,
+ true,
+ }
+ );
+ }
+
+ private void runTestExcessiveEvent(String keyEnable, boolean defaultEnable,
+ String keyWindow, long defaultWindow, String keyThreshold, int defaultThreshold,
+ long windowMs, int threshold, BiConsumer<String, Integer> eventEmitter,
+ BaseAppStateEventsTracker tracker, long[][] waitMs, int[][] events,
+ boolean[] expectingTimeout) throws Exception {
+ final int testPkgIndex = 1;
+ final String testPkgName = TEST_PACKAGE_BASE + testPkgIndex;
+ final int testUser = TEST_USER0;
+ final int testUid = UserHandle.getUid(testUser, TEST_PACKAGE_APPID_BASE + testPkgIndex);
+ final int testPid = 1234;
+
+ final long timeoutMs = 2_000;
+
+ final TestAppRestrictionLevelListener listener = new TestAppRestrictionLevelListener();
+
+ mBgRestrictionController.addAppBackgroundRestrictionListener(listener);
+ setBackgroundRestrict(testPkgName, testUid, false, listener);
+
+ DeviceConfigSession<Boolean> enableMonitor = null;
+ DeviceConfigSession<Long> eventsWindow = null;
+ DeviceConfigSession<Integer> eventsThreshold = null;
+
+ doReturn(testPkgName).when(mInjector).getPackageName(testPid);
+
+ verifyRestrictionLevel(RESTRICTION_LEVEL_ADAPTIVE_BUCKET, testPkgName, testUid);
+
+ try {
+ enableMonitor = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ keyEnable,
+ DeviceConfig::getBoolean,
+ defaultEnable);
+ enableMonitor.set(true);
+
+ eventsWindow = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ keyWindow,
+ DeviceConfig::getLong,
+ defaultWindow);
+ eventsWindow.set(windowMs);
+
+ eventsThreshold = new DeviceConfigSession<>(
+ DeviceConfig.NAMESPACE_ACTIVITY_MANAGER,
+ keyThreshold,
+ DeviceConfig::getInt,
+ defaultThreshold);
+ eventsThreshold.set(threshold);
+
+ for (int i = 0; i < waitMs.length; i++) {
+ resetBgRestrictionController();
+ listener.mLatchHolder[0] = new CountDownLatch(1);
+ tracker.reset();
+ clearInvocations(mInjector.getAppStandbyInternal());
+ clearInvocations(mBgRestrictionController);
+ for (int j = 0; j < waitMs[i].length; j++) {
+ for (int k = 0; k < events[i][j]; k++) {
+ eventEmitter.accept(testPkgName, testUid);
+ }
+ Thread.sleep(waitMs[i][j]);
+ }
+ waitForIdleHandler(mBgRestrictionController.getBackgroundHandler());
+ if (expectingTimeout[i]) {
+ verifyRestrictionLevel(RESTRICTION_LEVEL_ADAPTIVE_BUCKET, testPkgName, testUid);
+ try {
+ listener.verify(timeoutMs, testUid, testPkgName,
+ RESTRICTION_LEVEL_RESTRICTED_BUCKET);
+ fail("There shouldn't be any level change events");
+ } catch (TimeoutException e) {
+ // expected.
+ }
+ } else {
+ verifyRestrictionLevel(RESTRICTION_LEVEL_RESTRICTED_BUCKET,
+ testPkgName, testUid);
+ listener.verify(timeoutMs, testUid, testPkgName,
+ RESTRICTION_LEVEL_RESTRICTED_BUCKET);
+ }
+ }
+ } finally {
+ closeIfNotNull(enableMonitor);
+ closeIfNotNull(eventsWindow);
+ closeIfNotNull(eventsThreshold);
+ }
+ }
+
+ private int[] checkNotificationShown(String[] packageName, VerificationMode mode,
+ boolean verifyNotification) throws Exception {
+ final ArgumentCaptor<Integer> notificationIdCaptor =
+ ArgumentCaptor.forClass(Integer.class);
+ final ArgumentCaptor<Notification> notificationCaptor =
+ ArgumentCaptor.forClass(Notification.class);
+ verify(mInjector.getNotificationManager(), mode).notifyAsUser(any(),
+ notificationIdCaptor.capture(), notificationCaptor.capture(), any());
+ final int[] notificationId = new int[packageName.length];
+ if (verifyNotification) {
+ for (int i = 0, j = 0; i < packageName.length; j++) {
+ final int id = notificationIdCaptor.getAllValues().get(j);
+ if (id == NotificationHelper.SUMMARY_NOTIFICATION_ID) {
+ continue;
+ }
+ final Notification n = notificationCaptor.getAllValues().get(j);
+ notificationId[i] = id;
+ assertTrue(NotificationHelper.SUMMARY_NOTIFICATION_ID < notificationId[i]);
+ assertEquals(NotificationHelper.GROUP_KEY, n.getGroup());
+ assertEquals(ABUSIVE_BACKGROUND_APPS, n.getChannelId());
+ assertEquals(packageName[i], n.extras.getString(Intent.EXTRA_PACKAGE_NAME));
+ i++;
+ }
+ }
+ return notificationId;
+ }
+
+ private void checkNotificationGone(String packageName, VerificationMode mode,
+ int notificationId) throws Exception {
+ final ArgumentCaptor<Integer> notificationIdCaptor =
+ ArgumentCaptor.forClass(Integer.class);
+ verify(mInjector.getNotificationManager(), mode).cancel(notificationIdCaptor.capture());
+ assertEquals(notificationId, notificationIdCaptor.getValue().intValue());
+ }
+
+ private void closeIfNotNull(DeviceConfigSession<?> config) throws Exception {
+ if (config != null) {
+ config.close();
+ }
+ }
+
+ private interface RunnableWithException {
+ void run() throws Exception;
+ }
+
+ private void runTestBgCurrentDrainMonitorOnce(TestAppRestrictionLevelListener listener,
+ BatteryUsageStats stats, int[] uids, double[] bg, double[] fgs, double[] fg,
+ RunnableWithException runnable) throws Exception {
+ runTestBgCurrentDrainMonitorOnce(listener, stats, uids, bg, fgs, fg, true, runnable);
+ }
+
+ private void runTestBgCurrentDrainMonitorOnce(TestAppRestrictionLevelListener listener,
+ BatteryUsageStats stats, int[] uids, double[] bg, double[] fgs, double[] fg,
+ boolean resetListener, RunnableWithException runnable) throws Exception {
+ if (resetListener) {
+ listener.mLatchHolder[0] = new CountDownLatch(1);
+ }
+ setUidBatteryConsumptions(stats, uids, bg, fgs, fg);
+ runnable.run();
+ }
+
+ private void setUidBatteryConsumptions(BatteryUsageStats stats, int[] uids, double[] bg,
+ double[] fgs, double[] fg) {
+ ArrayList<UidBatteryConsumer> consumers = new ArrayList<>();
+ for (int i = 0; i < uids.length; i++) {
+ consumers.add(mockUidBatteryConsumer(uids[i], bg[i], fgs[i], fg[i]));
+ }
+ doReturn(consumers).when(stats).getUidBatteryConsumers();
+ }
+
+ private UidBatteryConsumer mockUidBatteryConsumer(int uid, double bg, double fgs, double fg) {
+ UidBatteryConsumer uidConsumer = mock(UidBatteryConsumer.class);
+ doReturn(uid).when(uidConsumer).getUid();
+ doReturn(bg).when(uidConsumer).getConsumedPower(eq(BATT_DIMEN_BG));
+ doReturn(fgs).when(uidConsumer).getConsumedPower(eq(BATT_DIMEN_FGS));
+ doReturn(fg).when(uidConsumer).getConsumedPower(eq(BATT_DIMEN_FG));
+ return uidConsumer;
+ }
+
+ private void setBackgroundRestrict(String pkgName, int uid, boolean restricted,
+ TestAppRestrictionLevelListener listener) throws Exception {
+ Log.i(TAG, "Setting background restrict to " + restricted + " for " + pkgName + " " + uid);
+ listener.mLatchHolder[0] = new CountDownLatch(1);
+ doReturn(restricted).when(mAppStateTracker).isAppBackgroundRestricted(uid, pkgName);
+ mFasListener.updateBackgroundRestrictedForUidPackage(uid, pkgName, restricted);
+ waitForIdleHandler(mBgRestrictionController.getBackgroundHandler());
+ }
+
+ private class TestAppRestrictionLevelListener implements AppBackgroundRestrictionListener {
+ private final CountDownLatch[] mLatchHolder = new CountDownLatch[1];
+ final int[] mUidHolder = new int[1];
+ final String[] mPkgNameHolder = new String[1];
+ final int[] mLevelHolder = new int[1];
+
+ @Override
+ public void onRestrictionLevelChanged(int uid, String packageName, int newLevel) {
+ mUidHolder[0] = uid;
+ mPkgNameHolder[0] = packageName;
+ mLevelHolder[0] = newLevel;
+ mLatchHolder[0].countDown();
+ };
+
+ void verify(long timeout, int uid, String pkgName, int level) throws Exception {
+ if (!mLatchHolder[0].await(timeout, TimeUnit.MILLISECONDS)) {
+ throw new TimeoutException();
+ }
+ assertEquals(uid, mUidHolder[0]);
+ assertEquals(pkgName, mPkgNameHolder[0]);
+ assertEquals(level, mLevelHolder[0]);
+ }
+ }
+
+ private void verifyRestrictionLevel(int level, String pkgName, int uid) {
+ assertEquals(level, mBgRestrictionController.getRestrictionLevel(uid));
+ assertEquals(level, mBgRestrictionController.getRestrictionLevel(uid, pkgName));
+ }
+
+ private void waitForIdleHandler(Handler handler) {
+ waitForIdleHandler(handler, Duration.ofSeconds(1));
+ }
+
+ private void waitForIdleHandler(Handler handler, Duration timeout) {
+ final MessageQueue queue = handler.getLooper().getQueue();
+ final CountDownLatch latch = new CountDownLatch(1);
+ queue.addIdleHandler(() -> {
+ latch.countDown();
+ // Remove idle handler
+ return false;
+ });
+ try {
+ latch.await(timeout.toMillis(), TimeUnit.MILLISECONDS);
+ } catch (InterruptedException e) {
+ fail("Interrupted unexpectedly: " + e);
+ }
+ }
+
+ @Test
+ public void testMergeAppStateDurations() throws Exception {
+ final BaseAppStateDurations testObj = new BaseAppStateDurations(0, "", 1, "", null) {};
+ assertAppStateDurations(null, testObj.add(null, null));
+ assertAppStateDurations(new LinkedList<BaseTimeEvent>(), testObj.add(
+ null, new LinkedList<BaseTimeEvent>()));
+ assertAppStateDurations(new LinkedList<BaseTimeEvent>(), testObj.add(
+ new LinkedList<BaseTimeEvent>(), null));
+ assertAppStateDurations(createDurations(1), testObj.add(
+ createDurations(1), new LinkedList<BaseTimeEvent>()));
+ assertAppStateDurations(createDurations(1), testObj.add(
+ new LinkedList<BaseTimeEvent>(), createDurations(1)));
+ assertAppStateDurations(createDurations(1, 4, 5, 8, 9), testObj.add(
+ createDurations(1, 3, 5, 7, 9), createDurations(2, 4, 6, 8, 10)));
+ assertAppStateDurations(createDurations(1, 5), testObj.add(
+ createDurations(1, 2, 3, 4), createDurations(2, 3, 4, 5)));
+ assertAppStateDurations(createDurations(1, 4, 6, 9), testObj.add(
+ createDurations(2, 4, 6, 9), createDurations(1, 4, 7, 8)));
+ assertAppStateDurations(createDurations(1, 4, 5, 8, 9, 10), testObj.add(
+ createDurations(1, 4, 6, 8), createDurations(1, 3, 5, 8, 9, 10)));
+ }
+
+ @Test
+ public void testSubtractAppStateDurations() throws Exception {
+ final BaseAppStateDurations testObj = new BaseAppStateDurations(0, "", 1, "", null) {};
+ assertAppStateDurations(null, testObj.subtract(null, null));
+ assertAppStateDurations(null, testObj.subtract(null, new LinkedList<BaseTimeEvent>()));
+ assertAppStateDurations(new LinkedList<BaseTimeEvent>(), testObj.subtract(
+ new LinkedList<BaseTimeEvent>(), null));
+ assertAppStateDurations(createDurations(1), testObj.subtract(
+ createDurations(1), new LinkedList<BaseTimeEvent>()));
+ assertAppStateDurations(new LinkedList<BaseTimeEvent>(), testObj.subtract(
+ new LinkedList<BaseTimeEvent>(), createDurations(1)));
+ assertAppStateDurations(new LinkedList<BaseTimeEvent>(), testObj.subtract(
+ createDurations(1), createDurations(1)));
+ assertAppStateDurations(createDurations(1, 2, 5, 6, 9, 10), testObj.subtract(
+ createDurations(1, 3, 5, 7, 9), createDurations(2, 4, 6, 8, 10)));
+ assertAppStateDurations(createDurations(1, 2, 3, 4), testObj.subtract(
+ createDurations(1, 4, 6, 7, 9, 10), createDurations(2, 3, 5, 8, 9, 10)));
+ assertAppStateDurations(createDurations(3, 4, 9, 10), testObj.subtract(
+ createDurations(1, 4, 6, 8, 9, 10), createDurations(1, 3, 5, 8)));
+ assertAppStateDurations(createDurations(1, 2, 3, 4, 5, 6, 7, 8), testObj.subtract(
+ createDurations(1, 6, 7, 8), createDurations(2, 3, 4, 5, 8, 10)));
+ assertAppStateDurations(createDurations(5, 6), testObj.subtract(
+ createDurations(2, 3, 5, 6), createDurations(1, 4, 7, 8)));
+ assertAppStateDurations(createDurations(2, 3, 4, 5, 6, 7, 8), testObj.subtract(
+ createDurations(1), createDurations(1, 2, 3, 4, 5, 6, 7, 8)));
+ }
+
+ private void assertAppStateDurations(LinkedList<BaseTimeEvent> expected,
+ LinkedList<BaseTimeEvent> actual) throws Exception {
+ assertListEquals(expected, actual);
+ }
+
+ private <T> void assertListEquals(LinkedList<T> expected, LinkedList<T> actual) {
+ assertEquals(expected == null || expected.isEmpty(), actual == null || actual.isEmpty());
+ if (expected != null) {
+ if (expected.size() > 0) {
+ assertEquals(expected.size(), actual.size());
+ }
+ while (expected.peek() != null) {
+ assertTrue(expected.poll().equals(actual.poll()));
+ }
+ }
+ }
+
+ private LinkedList<BaseTimeEvent> createDurations(long... timestamps) {
+ return Arrays.stream(timestamps).mapToObj(BaseTimeEvent::new)
+ .collect(LinkedList<BaseTimeEvent>::new, LinkedList<BaseTimeEvent>::add,
+ (a, b) -> a.addAll(b));
+ }
+
+ private LinkedList<Integer> createIntLinkedList(int[] vals) {
+ return Arrays.stream(vals).collect(LinkedList<Integer>::new, LinkedList<Integer>::add,
+ (a, b) -> a.addAll(b));
+ }
+
+ @Test
+ public void testAppStateTimeSlotEvents() throws Exception {
+ final long maxTrackingDuration = 5_000L;
+ assertAppStateTimeSlotEvents(new int[] {2, 2, 0, 0, 1},
+ new long[] {1_500, 1_500, 2_100, 2_999, 5_999}, 5_000);
+ assertAppStateTimeSlotEvents(new int[] {2, 2, 0, 0, 1, 1},
+ new long[] {1_500, 1_500, 2_100, 2_999, 5_999, 6_000}, 6_000);
+ assertAppStateTimeSlotEvents(new int[] {2, 0, 0, 1, 1, 1},
+ new long[] {1_500, 1_500, 2_100, 2_999, 5_999, 6_000, 7_000}, 7_000);
+ assertMergeAppStateTimeSlotEvents(new int[] {}, new long[] {}, new long[] {}, 0);
+ assertMergeAppStateTimeSlotEvents(new int[] {1}, new long[] {}, new long[] {1_500}, 1_000);
+ assertMergeAppStateTimeSlotEvents(new int[] {1}, new long[] {1_500}, new long[] {}, 1_000);
+ assertMergeAppStateTimeSlotEvents(new int[] {1, 1},
+ new long[] {1_500}, new long[] {2_500}, 2_000);
+ assertMergeAppStateTimeSlotEvents(new int[] {1, 1},
+ new long[] {2_500}, new long[] {1_500}, 2_000);
+ assertMergeAppStateTimeSlotEvents(new int[] {1, 2, 1},
+ new long[] {1_500, 2_500}, new long[] {2_600, 3_000}, 3_000);
+ assertMergeAppStateTimeSlotEvents(new int[] {2, 1, 1},
+ new long[] {2_600, 3_500}, new long[] {1_500, 1_600}, 3_000);
+ assertMergeAppStateTimeSlotEvents(new int[] {1, 2, 1},
+ new long[] {1_500, 3_500}, new long[] {2_600, 2_700}, 3_000);
+ assertMergeAppStateTimeSlotEvents(new int[] {1, 2, 1},
+ new long[] {2_500, 2_600}, new long[] {1_500, 3_700}, 3_000);
+ assertMergeAppStateTimeSlotEvents(new int[] {1, 0, 0, 0, 0, 1},
+ new long[] {2_500, 8_600}, new long[] {1_500, 3_700}, 8_000);
+ }
+
+ private BaseAppStateTimeSlotEvents createBaseAppStateTimeSlotEvents(
+ long slotSize, long maxTrackingDuration, long[] timestamps) {
+ final BaseAppStateTimeSlotEvents testObj = new BaseAppStateTimeSlotEvents(
+ 0, "", 1, slotSize, "", () -> maxTrackingDuration) {};
+ for (int i = 0; i < timestamps.length; i++) {
+ testObj.addEvent(timestamps[i], 0);
+ }
+ return testObj;
+ }
+
+ private void assertAppStateTimeSlotEvents(int[] expectedEvents, long[] timestamps,
+ long expectedCurTimeslot) {
+ final BaseAppStateTimeSlotEvents testObj = createBaseAppStateTimeSlotEvents(1_000L,
+ 5_000L, timestamps);
+ assertEquals(expectedCurTimeslot, testObj.getCurrentSlotStartTime(0));
+ assertListEquals(createIntLinkedList(expectedEvents), testObj.getRawEvents(0));
+ }
+
+ private void assertMergeAppStateTimeSlotEvents(int[] expectedEvents, long[] timestamps1,
+ long[] timestamps2, long expectedCurTimeslot) {
+ final BaseAppStateTimeSlotEvents testObj1 = createBaseAppStateTimeSlotEvents(1_000L,
+ 5_000L, timestamps1);
+ final BaseAppStateTimeSlotEvents testObj2 = createBaseAppStateTimeSlotEvents(1_000L,
+ 5_000L, timestamps2);
+ testObj1.add(testObj2);
+ assertEquals(expectedCurTimeslot, testObj1.getCurrentSlotStartTime(0));
+ assertListEquals(createIntLinkedList(expectedEvents), testObj1.getRawEvents(0));
+ }
+
+ @Test
+ public void testMergeUidBatteryUsage() throws Exception {
+ final UidBatteryStates testObj = new UidBatteryStates(0, "", null);
+ assertListEquals(null, testObj.add(null, null));
+ assertListEquals(new LinkedList<UidStateEventWithBattery>(), testObj.add(
+ null, new LinkedList<UidStateEventWithBattery>()));
+ assertListEquals(new LinkedList<UidStateEventWithBattery>(), testObj.add(
+ new LinkedList<UidStateEventWithBattery>(), null));
+ assertListEquals(createUidStateEventWithBatteryList(
+ new boolean[] {true}, new long[] {10L}, new double[] {10.0d}),
+ testObj.add(createUidStateEventWithBatteryList(
+ new boolean[] {true}, new long[] {10L}, new double[] {10.0d}),
+ new LinkedList<UidStateEventWithBattery>()));
+ assertListEquals(createUidStateEventWithBatteryList(
+ new boolean[] {true}, new long[] {10L}, new double[] {10.0d}),
+ testObj.add(new LinkedList<UidStateEventWithBattery>(),
+ createUidStateEventWithBatteryList(
+ new boolean[] {true}, new long[] {10L}, new double[] {10.0d})));
+ assertListEquals(createUidStateEventWithBatteryList(
+ new boolean[] {true}, new long[] {10L}, new double[] {10.0d}),
+ testObj.add(createUidStateEventWithBatteryList(
+ new boolean[] {true}, new long[] {11L}, new double[] {11.0d}),
+ createUidStateEventWithBatteryList(
+ new boolean[] {true}, new long[] {10L}, new double[] {10.0d})));
+ assertListEquals(createUidStateEventWithBatteryList(
+ new boolean[] {true}, new long[] {10L}, new double[] {10.0d}),
+ testObj.add(createUidStateEventWithBatteryList(
+ new boolean[] {true, false}, new long[] {11L, 12L}, new double[] {11.0d, 1.0d}),
+ createUidStateEventWithBatteryList(
+ new boolean[] {true}, new long[] {10L}, new double[] {10.0d})));
+ assertListEquals(createUidStateEventWithBatteryList(
+ new boolean[] {true}, new long[] {10L}, new double[] {10.0d}),
+ testObj.add(createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true}, new long[] {11L, 12L, 13L},
+ new double[] {11.0d, 1.0d, 13.0d}),
+ createUidStateEventWithBatteryList(
+ new boolean[] {true}, new long[] {10L}, new double[] {10.0d})));
+ assertListEquals(createUidStateEventWithBatteryList(
+ new boolean[] {true, false}, new long[] {10L, 13L}, new double[] {10.0d, 3.0d}),
+ testObj.add(createUidStateEventWithBatteryList(
+ new boolean[] {true, false}, new long[] {11L, 13L}, new double[] {11.0d, 2.0d}),
+ createUidStateEventWithBatteryList(
+ new boolean[] {true, false}, new long[] {10L, 12L}, new double[] {10.0d, 2.0d})));
+ assertListEquals(createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true}, new long[] {10L, 13L, 14L},
+ new double[] {10.0d, 3.0d, 14.0d}),
+ testObj.add(createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true}, new long[] {11L, 13L, 14L},
+ new double[] {11.0d, 2.0d, 14.0d}),
+ createUidStateEventWithBatteryList(
+ new boolean[] {true, false}, new long[] {10L, 12L}, new double[] {10.0d, 2.0d})));
+ assertListEquals(createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true, false, true, false},
+ new long[] {10L, 13L, 14L, 17L, 18L, 21L},
+ new double[] {10.0d, 3.0d, 14.0d, 3.0d, 18.0d, 3.0d}),
+ testObj.add(createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true, false, true, false},
+ new long[] {11L, 13L, 15L, 17L, 19L, 21L},
+ new double[] {11.0d, 2.0d, 15.0d, 2.0d, 19.0d, 2.0d}),
+ createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true, false, true, false},
+ new long[] {10L, 12L, 14L, 16L, 18L, 20L},
+ new double[] {10.0d, 2.0d, 14.0d, 2.0d, 18.0d, 2.0d})));
+ assertListEquals(createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true, false, true, false, true, false, true, false},
+ new long[] {10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L},
+ new double[] {10.0d, 1.0d, 12.0d, 1.0d, 14.0d, 1.0d, 16.0d, 1.0d, 18.0d, 1.0d}),
+ testObj.add(createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true, false},
+ new long[] {12L, 13L, 16L, 17L},
+ new double[] {12.0d, 1.0d, 16.0d, 1.0d}),
+ createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true, false, true, false},
+ new long[] {10L, 11L, 14L, 15L, 18L, 19L},
+ new double[] {10.0d, 1.0d, 14.0d, 1.0d, 18.0d, 1.0d})));
+ assertListEquals(createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true, false},
+ new long[] {10L, 14L, 18L, 19L},
+ new double[] {10.0d, 4.0d, 18.0d, 1.0d}),
+ testObj.add(createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true, false},
+ new long[] {11L, 12L, 13L, 14L},
+ new double[] {11.0d, 1.0d, 13.0d, 1.0d}),
+ createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true, false, true, false},
+ new long[] {10L, 11L, 12L, 13L, 18L, 19L},
+ new double[] {10.0d, 1.0d, 12.0d, 1.0d, 18.0d, 1.0d})));
+ assertListEquals(createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true, false},
+ new long[] {10L, 14L, 18L, 19L},
+ new double[] {10.0d, 4.0d, 18.0d, 1.0d}),
+ testObj.add(createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true, false},
+ new long[] {10L, 14L, 18L, 19L},
+ new double[] {10.0d, 4.0d, 18.0d, 1.0d}),
+ createUidStateEventWithBatteryList(
+ new boolean[] {true, false, true, false, true, false},
+ new long[] {10L, 11L, 12L, 13L, 18L, 19L},
+ new double[] {10.0d, 1.0d, 12.0d, 1.0d, 18.0d, 1.0d})));
+ }
+
+ private LinkedList<UidStateEventWithBattery> createUidStateEventWithBatteryList(
+ boolean[] isStart, long[] timestamps, double[] batteryUsage) {
+ final LinkedList<UidStateEventWithBattery> result = new LinkedList<>();
+ for (int i = 0; i < isStart.length; i++) {
+ result.add(new UidStateEventWithBattery(
+ isStart[i], timestamps[i], batteryUsage[i], null));
+ }
+ return result;
+ }
+
+ private class TestBgRestrictionInjector extends AppRestrictionController.Injector {
+ private Context mContext;
+
+ TestBgRestrictionInjector(Context context) {
+ super(context);
+ mContext = context;
+ }
+
+ @Override
+ void initAppStateTrackers(AppRestrictionController controller) {
+ try {
+ mAppBatteryTracker = new AppBatteryTracker(mContext, controller,
+ TestAppBatteryTrackerInjector.class.getDeclaredConstructor(
+ BackgroundRestrictionTest.class),
+ BackgroundRestrictionTest.this);
+ controller.addAppStateTracker(mAppBatteryTracker);
+ mAppBatteryExemptionTracker = new AppBatteryExemptionTracker(mContext, controller,
+ TestAppBatteryExemptionTrackerInjector.class.getDeclaredConstructor(
+ BackgroundRestrictionTest.class),
+ BackgroundRestrictionTest.this);
+ controller.addAppStateTracker(mAppBatteryExemptionTracker);
+ mAppFGSTracker = new AppFGSTracker(mContext, controller,
+ TestAppFGSTrackerInjector.class.getDeclaredConstructor(
+ BackgroundRestrictionTest.class),
+ BackgroundRestrictionTest.this);
+ controller.addAppStateTracker(mAppFGSTracker);
+ mAppMediaSessionTracker = new AppMediaSessionTracker(mContext, controller,
+ TestAppMediaSessionTrackerInjector.class.getDeclaredConstructor(
+ BackgroundRestrictionTest.class),
+ BackgroundRestrictionTest.this);
+ controller.addAppStateTracker(mAppMediaSessionTracker);
+ mAppBroadcastEventsTracker = new AppBroadcastEventsTracker(mContext, controller,
+ TestAppBroadcastEventsTrackerInjector.class.getDeclaredConstructor(
+ BackgroundRestrictionTest.class),
+ BackgroundRestrictionTest.this);
+ controller.addAppStateTracker(mAppBroadcastEventsTracker);
+ mAppBindServiceEventsTracker = new AppBindServiceEventsTracker(mContext, controller,
+ TestAppBindServiceEventsTrackerInjector.class.getDeclaredConstructor(
+ BackgroundRestrictionTest.class),
+ BackgroundRestrictionTest.this);
+ controller.addAppStateTracker(mAppBindServiceEventsTracker);
+ } catch (NoSuchMethodException e) {
+ // Won't happen.
+ }
+ }
+
+ @Override
+ ActivityManagerInternal getActivityManagerInternal() {
+ return mActivityManagerInternal;
+ }
+
+ @Override
+ AppRestrictionController getAppRestrictionController() {
+ return mBgRestrictionController;
+ }
+
+ @Override
+ AppOpsManager getAppOpsManager() {
+ return mAppOpsManager;
+ }
+
+ @Override
+ AppStandbyInternal getAppStandbyInternal() {
+ return mAppStandbyInternal;
+ }
+
+ @Override
+ AppHibernationManagerInternal getAppHibernationInternal() {
+ return mAppHibernationInternal;
+ }
+
+ @Override
+ AppStateTracker getAppStateTracker() {
+ return mAppStateTracker;
+ }
+
+ @Override
+ IActivityManager getIActivityManager() {
+ return mIActivityManager;
+ }
+
+ @Override
+ UserManagerInternal getUserManagerInternal() {
+ return mUserManagerInternal;
+ }
+
+ @Override
+ PackageManagerInternal getPackageManagerInternal() {
+ return mPackageManagerInternal;
+ }
+
+ @Override
+ PackageManager getPackageManager() {
+ return mPackageManager;
+ }
+
+ @Override
+ NotificationManager getNotificationManager() {
+ return mNotificationManager;
+ }
+
+ @Override
+ RoleManager getRoleManager() {
+ return mRoleManager;
+ }
+
+ @Override
+ AppFGSTracker getAppFGSTracker() {
+ return mAppFGSTracker;
+ }
+
+ @Override
+ AppMediaSessionTracker getAppMediaSessionTracker() {
+ return mAppMediaSessionTracker;
+ }
+
+ @Override
+ ActivityManagerService getActivityManagerService() {
+ return mActivityManagerService;
+ }
+
+ @Override
+ UidBatteryUsageProvider getUidBatteryUsageProvider() {
+ return mAppBatteryTracker;
+ }
+
+ @Override
+ AppBatteryExemptionTracker getAppBatteryExemptionTracker() {
+ return mAppBatteryExemptionTracker;
+ }
+ }
+
+ private class TestBaseTrackerInjector<T extends BaseAppStatePolicy>
+ extends BaseAppStateTracker.Injector<T> {
+ @Override
+ void onSystemReady() {
+ getPolicy().onSystemReady();
+ }
+
+ @Override
+ ActivityManagerInternal getActivityManagerInternal() {
+ return BackgroundRestrictionTest.this.mActivityManagerInternal;
+ }
+
+ @Override
+ BatteryManagerInternal getBatteryManagerInternal() {
+ return BackgroundRestrictionTest.this.mBatteryManagerInternal;
+ }
+
+ @Override
+ BatteryStatsInternal getBatteryStatsInternal() {
+ return BackgroundRestrictionTest.this.mBatteryStatsInternal;
+ }
+
+ @Override
+ DeviceIdleInternal getDeviceIdleInternal() {
+ return BackgroundRestrictionTest.this.mDeviceIdleInternal;
+ }
+
+ @Override
+ UserManagerInternal getUserManagerInternal() {
+ return BackgroundRestrictionTest.this.mUserManagerInternal;
+ }
+
+ @Override
+ long currentTimeMillis() {
+ return BackgroundRestrictionTest.this.mCurrentTimeMillis;
+ }
+
+ @Override
+ PackageManager getPackageManager() {
+ return BackgroundRestrictionTest.this.mPackageManager;
+ }
+
+ @Override
+ PermissionManagerServiceInternal getPermissionManagerServiceInternal() {
+ return BackgroundRestrictionTest.this.mPermissionManagerServiceInternal;
+ }
+
+ @Override
+ AppOpsManager getAppOpsManager() {
+ return BackgroundRestrictionTest.this.mAppOpsManager;
+ }
+
+ @Override
+ MediaSessionManager getMediaSessionManager() {
+ return BackgroundRestrictionTest.this.mMediaSessionManager;
+ }
+
+ @Override
+ long getServiceStartForegroundTimeout() {
+ return 1_000; // ms
+ }
+
+ @Override
+ RoleManager getRoleManager() {
+ return BackgroundRestrictionTest.this.mRoleManager;
+ }
+ }
+
+ private class TestAppBatteryTrackerInjector extends TestBaseTrackerInjector<AppBatteryPolicy> {
+ @Override
+ void setPolicy(AppBatteryPolicy policy) {
+ super.setPolicy(policy);
+ BackgroundRestrictionTest.this.mAppBatteryPolicy = policy;
+ }
+ }
+
+ private class TestAppBatteryExemptionTrackerInjector
+ extends TestBaseTrackerInjector<AppBatteryExemptionPolicy> {
+ }
+
+ private class TestAppFGSTrackerInjector extends TestBaseTrackerInjector<AppFGSPolicy> {
+ }
+
+ private class TestAppMediaSessionTrackerInjector
+ extends TestBaseTrackerInjector<AppMediaSessionPolicy> {
+ }
+
+ private class TestAppBroadcastEventsTrackerInjector
+ extends TestBaseTrackerInjector<AppBroadcastEventsPolicy> {
+ @Override
+ void setPolicy(AppBroadcastEventsPolicy policy) {
+ super.setPolicy(policy);
+ policy.setTimeSlotSize(1_000L);
+ }
+ }
+
+ private class TestAppBindServiceEventsTrackerInjector
+ extends TestBaseTrackerInjector<AppBindServiceEventsPolicy> {
+ @Override
+ void setPolicy(AppBindServiceEventsPolicy policy) {
+ super.setPolicy(policy);
+ policy.setTimeSlotSize(1_000L);
+ }
+ }
+}
diff --git a/services/tests/mockingservicestests/src/com/android/server/app/GameServiceProviderInstanceImplTest.java b/services/tests/mockingservicestests/src/com/android/server/app/GameServiceProviderInstanceImplTest.java
index bdfa3bf..d5e4710 100644
--- a/services/tests/mockingservicestests/src/com/android/server/app/GameServiceProviderInstanceImplTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/app/GameServiceProviderInstanceImplTest.java
@@ -18,6 +18,8 @@
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doAnswer;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession;
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.when;
import static com.android.server.app.GameServiceProviderInstanceImplTest.FakeGameService.GameServiceState;
import static com.google.common.collect.Iterables.getOnlyElement;
@@ -28,16 +30,19 @@
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.verifyZeroInteractions;
import android.annotation.Nullable;
import android.app.ActivityManager.RunningTaskInfo;
import android.app.ActivityTaskManager;
+import android.app.IActivityManager;
import android.app.IActivityTaskManager;
import android.app.ITaskStackListener;
import android.content.ComponentName;
+import android.content.Context;
+import android.content.ContextWrapper;
+import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.Rect;
@@ -57,6 +62,7 @@
import android.view.SurfaceControlViewHost.SurfacePackage;
import androidx.test.filters.SmallTest;
+import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
import com.android.internal.infra.AndroidFuture;
@@ -99,6 +105,10 @@
private static final ComponentName GAME_A_MAIN_ACTIVITY =
new ComponentName(GAME_A_PACKAGE, "com.package.game.a.MainActivity");
+ private static final String GAME_B_PACKAGE = "com.package.game.b";
+ private static final ComponentName GAME_B_MAIN_ACTIVITY =
+ new ComponentName(GAME_B_PACKAGE, "com.package.game.b.MainActivity");
+
private static final Bitmap TEST_BITMAP = Bitmap.createBitmap(32, 32, Bitmap.Config.ARGB_8888);
private MockitoSession mMockingSession;
@@ -109,6 +119,9 @@
private WindowManagerService mMockWindowManagerService;
@Mock
private WindowManagerInternal mMockWindowManagerInternal;
+ @Mock
+ private IActivityManager mMockActivityManager;
+ private FakeContext mFakeContext;
private FakeGameClassifier mFakeGameClassifier;
private FakeGameService mFakeGameService;
private FakeServiceConnector<IGameService> mFakeGameServiceConnector;
@@ -117,6 +130,9 @@
private ArrayList<ITaskStackListener> mTaskStackListeners;
private ArrayList<RunningTaskInfo> mRunningTaskInfos;
+ @Mock
+ private PackageManager mMockPackageManager;
+
@Before
public void setUp() throws PackageManager.NameNotFoundException, RemoteException {
mMockingSession = mockitoSession()
@@ -124,8 +140,11 @@
.strictness(Strictness.LENIENT)
.startMocking();
+ mFakeContext = new FakeContext(InstrumentationRegistry.getInstrumentation().getContext());
+
mFakeGameClassifier = new FakeGameClassifier();
mFakeGameClassifier.recordGamePackage(GAME_A_PACKAGE);
+ mFakeGameClassifier.recordGamePackage(GAME_B_PACKAGE);
mFakeGameService = new FakeGameService();
mFakeGameServiceConnector = new FakeServiceConnector<>(mFakeGameService);
@@ -150,7 +169,9 @@
mGameServiceProviderInstance = new GameServiceProviderInstanceImpl(
new UserHandle(USER_ID),
ConcurrentUtils.DIRECT_EXECUTOR,
+ mFakeContext,
mFakeGameClassifier,
+ mMockActivityManager,
mMockActivityTaskManager,
mMockWindowManagerService,
mMockWindowManagerInternal,
@@ -660,6 +681,58 @@
assertEquals(TEST_BITMAP, result.getBitmap());
}
+ @Test
+ public void restartGame_taskIdAssociatedWithGame_restartsTargetGame() throws Exception {
+ Intent launchIntent = new Intent("com.test.ACTION_LAUNCH_GAME_PACKAGE")
+ .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ when(mMockPackageManager.getLaunchIntentForPackage(GAME_A_PACKAGE))
+ .thenReturn(launchIntent);
+
+ mGameServiceProviderInstance.start();
+
+ startTask(10, GAME_A_MAIN_ACTIVITY);
+ mFakeGameService.requestCreateGameSession(10);
+
+ FakeGameSession gameSession10 = new FakeGameSession();
+ SurfacePackage mockSurfacePackage10 = Mockito.mock(SurfacePackage.class);
+ mFakeGameSessionService.removePendingFutureForTaskId(10)
+ .complete(new CreateGameSessionResult(gameSession10, mockSurfacePackage10));
+
+ startTask(11, GAME_B_MAIN_ACTIVITY);
+ mFakeGameService.requestCreateGameSession(11);
+
+ FakeGameSession gameSession11 = new FakeGameSession();
+ SurfacePackage mockSurfacePackage11 = Mockito.mock(SurfacePackage.class);
+ mFakeGameSessionService.removePendingFutureForTaskId(11)
+ .complete(new CreateGameSessionResult(gameSession11, mockSurfacePackage11));
+
+ mFakeGameSessionService.getCapturedCreateInvocations().get(0)
+ .mGameSessionController.restartGame(10);
+
+ verify(mMockActivityManager).forceStopPackage(GAME_A_PACKAGE, UserHandle.USER_CURRENT);
+ assertThat(mFakeContext.getLastStartedIntent()).isEqualTo(launchIntent);
+ }
+
+ @Test
+ public void restartGame_taskIdNotAssociatedWithGame_noOp() throws Exception {
+ mGameServiceProviderInstance.start();
+
+ startTask(10, GAME_A_MAIN_ACTIVITY);
+ mFakeGameService.requestCreateGameSession(10);
+
+ FakeGameSession gameSession10 = new FakeGameSession();
+ SurfacePackage mockSurfacePackage10 = Mockito.mock(SurfacePackage.class);
+ mFakeGameSessionService.removePendingFutureForTaskId(10)
+ .complete(new CreateGameSessionResult(gameSession10, mockSurfacePackage10));
+
+ getOnlyElement(
+ mFakeGameSessionService.getCapturedCreateInvocations())
+ .mGameSessionController.restartGame(11);
+
+ verifyZeroInteractions(mMockActivityManager);
+ assertThat(mFakeContext.getLastStartedIntent()).isNull();
+ }
+
private void startTask(int taskId, ComponentName componentName) {
RunningTaskInfo runningTaskInfo = new RunningTaskInfo();
runningTaskInfo.taskId = taskId;
@@ -826,4 +899,32 @@
mIsFocused = focused;
}
}
-}
\ No newline at end of file
+
+ private final class FakeContext extends ContextWrapper {
+ private Intent mLastStartedIntent;
+
+ FakeContext(Context base) {
+ super(base);
+ }
+
+ @Override
+ public PackageManager getPackageManager() {
+ return mMockPackageManager;
+ }
+
+ @Override
+ public void startActivity(Intent intent) {
+ mLastStartedIntent = intent;
+ }
+
+ @Override
+ public void enforceCallingPermission(String permission, @Nullable String message) {
+ // Do nothing.
+ }
+
+ Intent getLastStartedIntent() {
+ return mLastStartedIntent;
+ }
+ }
+
+}
diff --git a/services/tests/servicestests/Android.bp b/services/tests/servicestests/Android.bp
index f24059c..a6c81a0 100644
--- a/services/tests/servicestests/Android.bp
+++ b/services/tests/servicestests/Android.bp
@@ -133,9 +133,11 @@
name: "servicestests-core-utils",
srcs: [
"src/com/android/server/pm/PackageSettingBuilder.java",
+ "src/com/android/server/am/DeviceConfigSession.java",
],
static_libs: [
"services.core",
+ "compatibility-device-util-axt",
],
}
diff --git a/services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java
index 677f0f6..36c37c4 100644
--- a/services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java
@@ -541,14 +541,11 @@
| ActivityManager.UID_OBSERVER_CAPABILITY
};
final IUidObserver[] observers = new IUidObserver.Stub[changesToObserve.length];
- doReturn(Process.myUid()).when(sPackageManagerInternal)
- .getPackageUid(mContext.getOpPackageName(), 0 /* flags */, mContext.getUserId());
for (int i = 0; i < observers.length; ++i) {
observers[i] = mock(IUidObserver.Stub.class);
when(observers[i].asBinder()).thenReturn((IBinder) observers[i]);
mAms.registerUidObserver(observers[i], changesToObserve[i] /* which */,
- ActivityManager.PROCESS_STATE_UNKNOWN /* cutpoint */,
- mContext.getOpPackageName());
+ ActivityManager.PROCESS_STATE_UNKNOWN /* cutpoint */, null /* caller */);
// When we invoke AMS.registerUidObserver, there are some interactions with observers[i]
// mock in RemoteCallbackList class. We don't want to test those interactions and
@@ -677,12 +674,10 @@
mockNoteOperation();
final IUidObserver observer = mock(IUidObserver.Stub.class);
+
when(observer.asBinder()).thenReturn((IBinder) observer);
- doReturn(Process.myUid()).when(sPackageManagerInternal)
- .getPackageUid(mContext.getOpPackageName(), 0 /* flags */, mContext.getUserId());
mAms.registerUidObserver(observer, ActivityManager.UID_OBSERVER_PROCSTATE /* which */,
- ActivityManager.PROCESS_STATE_SERVICE /* cutpoint */,
- mContext.getOpPackageName());
+ ActivityManager.PROCESS_STATE_SERVICE /* cutpoint */, null /* callingPackage */);
// When we invoke AMS.registerUidObserver, there are some interactions with observer
// mock in RemoteCallbackList class. We don't want to test those interactions and
// at the same time, we don't want those to interfere with verifyNoMoreInteractions.
@@ -776,9 +771,7 @@
final IUidObserver observer = mock(IUidObserver.Stub.class);
when(observer.asBinder()).thenReturn((IBinder) observer);
- doReturn(Process.myUid()).when(sPackageManagerInternal)
- .getPackageUid(mContext.getOpPackageName(), 0 /* flags */, mContext.getUserId());
- mAms.registerUidObserver(observer, 0, 0, mContext.getOpPackageName());
+ mAms.registerUidObserver(observer, 0, 0, null);
// Verify that when observers are registered, then validateUids is correctly updated.
addPendingUidChanges(pendingItemsForUids);
mAms.mUidObserverController.dispatchUidsChanged();
diff --git a/services/tests/servicestests/src/com/android/server/am/UserControllerTest.java b/services/tests/servicestests/src/com/android/server/am/UserControllerTest.java
index 6818d1f..49635a9 100644
--- a/services/tests/servicestests/src/com/android/server/am/UserControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/UserControllerTest.java
@@ -33,6 +33,7 @@
import static com.android.server.am.UserController.REPORT_LOCKED_BOOT_COMPLETE_MSG;
import static com.android.server.am.UserController.REPORT_USER_SWITCH_COMPLETE_MSG;
import static com.android.server.am.UserController.REPORT_USER_SWITCH_MSG;
+import static com.android.server.am.UserController.USER_COMPLETED_EVENT_MSG;
import static com.android.server.am.UserController.USER_CURRENT_MSG;
import static com.android.server.am.UserController.USER_START_MSG;
import static com.android.server.am.UserController.USER_SWITCH_TIMEOUT_MSG;
@@ -45,6 +46,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Matchers.any;
@@ -91,6 +93,7 @@
import androidx.test.filters.SmallTest;
import com.android.server.FgThread;
+import com.android.server.SystemService;
import com.android.server.am.UserState.KeyEvictedCallback;
import com.android.server.pm.UserManagerInternal;
import com.android.server.pm.UserManagerService;
@@ -167,6 +170,8 @@
doReturn(false).when(mInjector).taskSupervisorSwitchUser(anyInt(), any());
doNothing().when(mInjector).taskSupervisorResumeFocusedStackTopActivity();
doNothing().when(mInjector).systemServiceManagerOnUserStopped(anyInt());
+ doNothing().when(mInjector).systemServiceManagerOnUserCompletedEvent(
+ anyInt(), anyInt());
doNothing().when(mInjector).activityManagerForceStopPackage(anyInt(), anyString());
doNothing().when(mInjector).activityManagerOnUserStopped(anyInt());
doNothing().when(mInjector).clearBroadcastQueueForUser(anyInt());
@@ -719,6 +724,54 @@
}
}
+ @Test
+ public void testScheduleOnUserCompletedEvent() throws Exception {
+ // user1 is starting, switching, and unlocked, but not scheduled unlocked yet
+ // user2 is starting and had unlocked but isn't unlocked anymore for whatever reason
+
+ final int user1 = 101;
+ final int user2 = 102;
+ setUpUser(user1, 0);
+ setUpUser(user2, 0);
+
+ mUserController.startUser(user1, /* foreground= */ true);
+ mUserController.getStartedUserState(user1).setState(UserState.STATE_RUNNING_UNLOCKED);
+
+ mUserController.startUser(user2, /* foreground= */ false);
+ mUserController.getStartedUserState(user2).setState(UserState.STATE_RUNNING_LOCKED);
+
+ final int event1a = SystemService.UserCompletedEventType.EVENT_TYPE_USER_STARTING;
+ final int event1b = SystemService.UserCompletedEventType.EVENT_TYPE_USER_SWITCHING;
+
+ final int event2a = SystemService.UserCompletedEventType.EVENT_TYPE_USER_STARTING;
+ final int event2b = SystemService.UserCompletedEventType.EVENT_TYPE_USER_UNLOCKED;
+
+
+ mUserController.scheduleOnUserCompletedEvent(user1, event1a, 2000);
+ assertNotNull(mInjector.mHandler.getMessageForCode(USER_COMPLETED_EVENT_MSG, user1));
+ assertNull(mInjector.mHandler.getMessageForCode(USER_COMPLETED_EVENT_MSG, user2));
+
+ mUserController.scheduleOnUserCompletedEvent(user2, event2a, 2000);
+ assertNotNull(mInjector.mHandler.getMessageForCode(USER_COMPLETED_EVENT_MSG, user1));
+ assertNotNull(mInjector.mHandler.getMessageForCode(USER_COMPLETED_EVENT_MSG, user2));
+
+ mUserController.scheduleOnUserCompletedEvent(user2, event2b, 2000);
+ mUserController.scheduleOnUserCompletedEvent(user1, event1b, 2000);
+ mUserController.scheduleOnUserCompletedEvent(user1, 0, 2000);
+
+ assertNotNull(mInjector.mHandler.getMessageForCode(USER_COMPLETED_EVENT_MSG, user1));
+ assertNotNull(mInjector.mHandler.getMessageForCode(USER_COMPLETED_EVENT_MSG, user2));
+
+ mUserController.reportOnUserCompletedEvent(user1);
+ verify(mInjector, times(1))
+ .systemServiceManagerOnUserCompletedEvent(eq(user1), eq(event1a | event1b));
+ verify(mInjector, never()).systemServiceManagerOnUserCompletedEvent(eq(user2), anyInt());
+
+ mUserController.reportOnUserCompletedEvent(user2);
+ verify(mInjector, times(1))
+ .systemServiceManagerOnUserCompletedEvent(eq(user2), eq(event2a));
+ }
+
private void setUpAndStartUserInBackground(int userId) throws Exception {
setUpUser(userId, 0);
mUserController.startUser(userId, /* foreground= */ false);
@@ -969,8 +1022,12 @@
}
Message getMessageForCode(int what) {
+ return getMessageForCode(what, null);
+ }
+
+ Message getMessageForCode(int what, Object obj) {
for (Message msg : mMessages) {
- if (msg.what == what) {
+ if (msg.what == what && (obj == null || obj.equals(msg.obj))) {
return msg;
}
}
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/sensors/AcquisitionClientTest.java b/services/tests/servicestests/src/com/android/server/biometrics/sensors/AcquisitionClientTest.java
index fc55a9f..9bb722f 100644
--- a/services/tests/servicestests/src/com/android/server/biometrics/sensors/AcquisitionClientTest.java
+++ b/services/tests/servicestests/src/com/android/server/biometrics/sensors/AcquisitionClientTest.java
@@ -39,6 +39,8 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.function.Supplier;
+
@Presubmit
@SmallTest
public class AcquisitionClientTest {
@@ -87,7 +89,7 @@
boolean mHalOperationRunning;
public TestAcquisitionClient(@NonNull Context context,
- @NonNull LazyDaemon<Object> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<Object> lazyDaemon, @NonNull IBinder token,
@NonNull ClientMonitorCallbackConverter callback) {
super(context, lazyDaemon, token, callback, 0 /* userId */, "Test", 0 /* cookie */,
TEST_SENSOR_ID /* sensorId */, true /* shouldVibrate */, 0 /* statsModality */,
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/sensors/BiometricSchedulerTest.java b/services/tests/servicestests/src/com/android/server/biometrics/sensors/BiometricSchedulerTest.java
index c99d656..ecd9abc 100644
--- a/services/tests/servicestests/src/com/android/server/biometrics/sensors/BiometricSchedulerTest.java
+++ b/services/tests/servicestests/src/com/android/server/biometrics/sensors/BiometricSchedulerTest.java
@@ -61,6 +61,8 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.function.Supplier;
+
@Presubmit
@SmallTest
@RunWith(AndroidTestingRunner.class)
@@ -93,7 +95,7 @@
@Test
public void testClientDuplicateFinish_ignoredBySchedulerAndDoesNotCrash() {
- final HalClientMonitor.LazyDaemon<Object> nonNullDaemon = () -> mock(Object.class);
+ final Supplier<Object> nonNullDaemon = () -> mock(Object.class);
final HalClientMonitor<Object> client1 =
new TestHalClientMonitor(mContext, mToken, nonNullDaemon);
@@ -184,7 +186,7 @@
@Test
public void testCancelNotInvoked_whenOperationWaitingForCookie() {
- final HalClientMonitor.LazyDaemon<Object> lazyDaemon1 = () -> mock(Object.class);
+ final Supplier<Object> lazyDaemon1 = () -> mock(Object.class);
final TestAuthenticationClient client1 = new TestAuthenticationClient(mContext,
lazyDaemon1, mToken, mock(ClientMonitorCallbackConverter.class));
final ClientMonitorCallback callback1 = mock(ClientMonitorCallback.class);
@@ -296,7 +298,7 @@
@Test
public void testCancelPendingAuth() throws RemoteException {
- final HalClientMonitor.LazyDaemon<Object> lazyDaemon = () -> mock(Object.class);
+ final Supplier<Object> lazyDaemon = () -> mock(Object.class);
final TestHalClientMonitor client1 = new TestHalClientMonitor(mContext, mToken, lazyDaemon);
final ClientMonitorCallbackConverter callback = mock(ClientMonitorCallbackConverter.class);
final TestAuthenticationClient client2 = new TestAuthenticationClient(mContext, lazyDaemon,
@@ -360,7 +362,7 @@
private void testCancelsAuthDetectWhenRequestId(@Nullable Long requestId, long cancelRequestId,
boolean started) {
- final HalClientMonitor.LazyDaemon<Object> lazyDaemon = () -> mock(Object.class);
+ final Supplier<Object> lazyDaemon = () -> mock(Object.class);
final ClientMonitorCallbackConverter callback = mock(ClientMonitorCallbackConverter.class);
testCancelsWhenRequestId(requestId, cancelRequestId, started,
new TestAuthenticationClient(mContext, lazyDaemon, mToken, callback));
@@ -383,7 +385,7 @@
private void testCancelsEnrollWhenRequestId(@Nullable Long requestId, long cancelRequestId,
boolean started) {
- final HalClientMonitor.LazyDaemon<Object> lazyDaemon = () -> mock(Object.class);
+ final Supplier<Object> lazyDaemon = () -> mock(Object.class);
final ClientMonitorCallbackConverter callback = mock(ClientMonitorCallbackConverter.class);
testCancelsWhenRequestId(requestId, cancelRequestId, started,
new TestEnrollClient(mContext, lazyDaemon, mToken, callback));
@@ -441,7 +443,7 @@
public void testCancelsPending_whenAuthRequestIdsSet() {
final long requestId1 = 10;
final long requestId2 = 20;
- final HalClientMonitor.LazyDaemon<Object> lazyDaemon = () -> mock(Object.class);
+ final Supplier<Object> lazyDaemon = () -> mock(Object.class);
final ClientMonitorCallbackConverter callback = mock(ClientMonitorCallbackConverter.class);
final TestAuthenticationClient client1 = new TestAuthenticationClient(
mContext, lazyDaemon, mToken, callback);
@@ -500,7 +502,7 @@
@Test
public void testClientDestroyed_afterFinish() {
- final HalClientMonitor.LazyDaemon<Object> nonNullDaemon = () -> mock(Object.class);
+ final Supplier<Object> nonNullDaemon = () -> mock(Object.class);
final TestHalClientMonitor client =
new TestHalClientMonitor(mContext, mToken, nonNullDaemon);
mScheduler.scheduleClientMonitor(client);
@@ -520,7 +522,7 @@
int mNumCancels = 0;
public TestAuthenticationClient(@NonNull Context context,
- @NonNull LazyDaemon<Object> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<Object> lazyDaemon, @NonNull IBinder token,
@NonNull ClientMonitorCallbackConverter listener) {
super(context, lazyDaemon, token, listener, 0 /* targetUserId */, 0 /* operationId */,
false /* restricted */, TAG, 1 /* cookie */, false /* requireConfirmation */,
@@ -567,7 +569,7 @@
int mNumCancels = 0;
TestEnrollClient(@NonNull Context context,
- @NonNull LazyDaemon<Object> lazyDaemon, @NonNull IBinder token,
+ @NonNull Supplier<Object> lazyDaemon, @NonNull IBinder token,
@NonNull ClientMonitorCallbackConverter listener) {
super(context, lazyDaemon, token, listener, 0 /* userId */, new byte[69],
"test" /* owner */, mock(BiometricUtils.class),
@@ -604,12 +606,12 @@
private boolean mDestroyed;
TestHalClientMonitor(@NonNull Context context, @NonNull IBinder token,
- @NonNull LazyDaemon<Object> lazyDaemon) {
+ @NonNull Supplier<Object> lazyDaemon) {
this(context, token, lazyDaemon, 0 /* cookie */, BiometricsProto.CM_UPDATE_ACTIVE_USER);
}
TestHalClientMonitor(@NonNull Context context, @NonNull IBinder token,
- @NonNull LazyDaemon<Object> lazyDaemon, int cookie, int protoEnum) {
+ @NonNull Supplier<Object> lazyDaemon, int cookie, int protoEnum) {
super(context, lazyDaemon, token /* token */, null /* listener */, 0 /* userId */,
TAG, cookie, TEST_SENSOR_ID, 0 /* statsModality */,
0 /* statsAction */, 0 /* statsClient */);
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/sensors/UserAwareBiometricSchedulerTest.java b/services/tests/servicestests/src/com/android/server/biometrics/sensors/UserAwareBiometricSchedulerTest.java
index a11709a..30777cd 100644
--- a/services/tests/servicestests/src/com/android/server/biometrics/sensors/UserAwareBiometricSchedulerTest.java
+++ b/services/tests/servicestests/src/com/android/server/biometrics/sensors/UserAwareBiometricSchedulerTest.java
@@ -47,6 +47,8 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.function.Supplier;
+
@Presubmit
@RunWith(AndroidTestingRunner.class)
@RunWithLooper
@@ -215,7 +217,7 @@
int numInvocations;
@Override
- public void onUserStarted(int newUserId, Object newObject) {
+ public void onUserStarted(int newUserId, Object newObject, int halInterfaceVersion) {
numInvocations++;
mCurrentUserId = newUserId;
}
@@ -223,7 +225,7 @@
private static class TestStopUserClient extends StopUserClient<Object> {
public TestStopUserClient(@NonNull Context context,
- @NonNull LazyDaemon<Object> lazyDaemon, @Nullable IBinder token, int userId,
+ @NonNull Supplier<Object> lazyDaemon, @Nullable IBinder token, int userId,
int sensorId, @NonNull UserStoppedCallback callback) {
super(context, lazyDaemon, token, userId, sensorId, callback);
}
@@ -251,7 +253,7 @@
ClientMonitorCallback mCallback;
public TestStartUserClient(@NonNull Context context,
- @NonNull LazyDaemon<Object> lazyDaemon, @Nullable IBinder token, int userId,
+ @NonNull Supplier<Object> lazyDaemon, @Nullable IBinder token, int userId,
int sensorId, @NonNull UserStartedCallback<Object> callback, boolean shouldFinish) {
super(context, lazyDaemon, token, userId, sensorId, callback);
mShouldFinish = shouldFinish;
@@ -268,7 +270,8 @@
mCallback = callback;
if (mShouldFinish) {
- mUserStartedCallback.onUserStarted(getTargetUserId(), new Object());
+ mUserStartedCallback.onUserStarted(
+ getTargetUserId(), new Object(), 1 /* halInterfaceVersion */);
callback.onClientFinished(this, true /* success */);
}
}
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/SensorTest.java b/services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/SensorTest.java
index 2718bf9..61e4776 100644
--- a/services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/SensorTest.java
+++ b/services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/SensorTest.java
@@ -101,8 +101,8 @@
mLockoutCache.setLockoutModeForUser(USER_ID, LockoutTracker.LOCKOUT_TIMED);
mScheduler.scheduleClientMonitor(new FaceResetLockoutClient(mContext,
- () -> mSession, USER_ID, TAG, SENSOR_ID, HAT, mLockoutCache,
- mLockoutResetDispatcher));
+ () -> new AidlSession(1, mSession, USER_ID, mHalCallback),
+ USER_ID, TAG, SENSOR_ID, HAT, mLockoutCache, mLockoutResetDispatcher));
mLooper.dispatchAll();
verifyNotLocked();
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/aidl/SensorTest.java b/services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/aidl/SensorTest.java
index d4609b5..8b7b484 100644
--- a/services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/aidl/SensorTest.java
+++ b/services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/aidl/SensorTest.java
@@ -101,8 +101,8 @@
mLockoutCache.setLockoutModeForUser(USER_ID, LockoutTracker.LOCKOUT_TIMED);
mScheduler.scheduleClientMonitor(new FingerprintResetLockoutClient(mContext,
- () -> mSession, USER_ID, TAG, SENSOR_ID, HAT, mLockoutCache,
- mLockoutResetDispatcher));
+ () -> new AidlSession(1, mSession, USER_ID, mHalCallback),
+ USER_ID, TAG, SENSOR_ID, HAT, mLockoutCache, mLockoutResetDispatcher));
mLooper.dispatchAll();
verifyNotLocked();
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 c0ad69f..564c4e4 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
@@ -282,6 +282,14 @@
mIsAutomotive = mContext.getPackageManager()
.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE);
+
+ final String TEST_STRING = "{count, plural,\n"
+ + " =1 {Test for exactly 1 cert out of 4}\n"
+ + " other {Test for exactly # certs out of 4}\n"
+ + "}";
+ doReturn(TEST_STRING)
+ .when(mContext.resources)
+ .getString(R.string.ssl_ca_cert_warning);
}
private TransferOwnershipMetadataManager getMockTransferMetadataManager() {
@@ -1784,9 +1792,6 @@
StringParceledListSlice oneCert = asSlice(new String[] {"1"});
StringParceledListSlice fourCerts = asSlice(new String[] {"1", "2", "3", "4"});
- final String TEST_STRING = "Test for exactly 2 certs out of 4";
- doReturn(TEST_STRING).when(mContext.resources).getQuantityText(anyInt(), eq(2));
-
// Given that we have exactly one certificate installed,
when(getServices().keyChainConnection.getService().getUserCaAliases()).thenReturn(oneCert);
// when that certificate is approved,
@@ -1802,9 +1807,10 @@
dpms.approveCaCert(fourCerts.getList().get(0), userId, true);
dpms.approveCaCert(fourCerts.getList().get(1), userId, true);
// a notification should be shown saying that there are two certificates left to approve.
+ final String TEST_STRING_RESULT = "Test for exactly 2 certs out of 4";
verify(getServices().notificationManager, timeout(1000))
.notifyAsUser(anyString(), anyInt(), argThat(hasExtra(EXTRA_TITLE,
- TEST_STRING
+ TEST_STRING_RESULT
)), eq(user));
}
diff --git a/services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java b/services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java
index c675726..24a4751 100644
--- a/services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java
+++ b/services/tests/servicestests/src/com/android/server/display/BrightnessMappingStrategyTest.java
@@ -393,7 +393,8 @@
// Create an idle mode bms
// This will fail if it tries to fetch the wrong configuration.
- BrightnessMappingStrategy bms = BrightnessMappingStrategy.createForIdleMode(res, ddc);
+ BrightnessMappingStrategy bms = BrightnessMappingStrategy.createForIdleMode(res, ddc,
+ null);
assertNotNull("BrightnessMappingStrategy should not be null", bms);
// Ensure that the config is the one we set
diff --git a/services/tests/servicestests/src/com/android/server/display/DisplayManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/display/DisplayManagerServiceTest.java
index eaa271a..1fb5898 100644
--- a/services/tests/servicestests/src/com/android/server/display/DisplayManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/display/DisplayManagerServiceTest.java
@@ -33,6 +33,7 @@
import static org.mockito.Mockito.when;
import android.app.PropertyInvalidatedCache;
+import android.companion.virtual.IVirtualDevice;
import android.compat.testing.PlatformCompatChangeRule;
import android.content.Context;
import android.content.ContextWrapper;
@@ -73,6 +74,7 @@
import com.android.server.LocalServices;
import com.android.server.SystemService;
+import com.android.server.companion.virtual.VirtualDeviceManagerInternal;
import com.android.server.display.DisplayManagerService.SyncRoot;
import com.android.server.lights.LightsManager;
import com.android.server.sensors.SensorManagerInternal;
@@ -167,6 +169,7 @@
};
@Mock InputManagerInternal mMockInputManagerInternal;
+ @Mock VirtualDeviceManagerInternal mMockVirtualDeviceManagerInternal;
@Mock IVirtualDisplayCallback.Stub mMockAppToken;
@Mock IVirtualDisplayCallback.Stub mMockAppToken2;
@Mock WindowManagerInternal mMockWindowManagerInternal;
@@ -187,6 +190,9 @@
LocalServices.addService(LightsManager.class, mMockLightsManager);
LocalServices.removeServiceForTest(SensorManagerInternal.class);
LocalServices.addService(SensorManagerInternal.class, mMockSensorManagerInternal);
+ LocalServices.removeServiceForTest(VirtualDeviceManagerInternal.class);
+ LocalServices.addService(
+ VirtualDeviceManagerInternal.class, mMockVirtualDeviceManagerInternal);
mContext = spy(new ContextWrapper(ApplicationProvider.getApplicationContext()));
mDeviceConfig = new FakeDeviceConfigInterface();
@@ -661,6 +667,101 @@
}
/**
+ * Tests that specifying VIRTUAL_DISPLAY_FLAG_OWN_DISPLAY_GROUP is allowed when the permission
+ * ADD_TRUSTED_DISPLAY is granted.
+ */
+ @Test
+ public void testOwnDisplayGroup_allowCreationWithAddTrustedDisplayPermission() {
+ DisplayManagerService displayManager =
+ new DisplayManagerService(mContext, mBasicInjector);
+ registerDefaultDisplays(displayManager);
+
+ DisplayManagerService.BinderService bs = displayManager.new BinderService();
+ when(mMockAppToken.asBinder()).thenReturn(mMockAppToken);
+
+ when(mContext.checkCallingPermission(ADD_TRUSTED_DISPLAY)).thenReturn(
+ PackageManager.PERMISSION_GRANTED);
+
+ final VirtualDisplayConfig.Builder builder = new VirtualDisplayConfig.Builder(
+ VIRTUAL_DISPLAY_NAME, 600, 800, 320);
+ builder.setFlags(DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_DISPLAY_GROUP);
+ builder.setUniqueId("uniqueId --- OWN_DISPLAY_GROUP");
+
+ int displayId = bs.createVirtualDisplay(builder.build(), mMockAppToken /* callback */,
+ null /* projection */, null /* virtualDeviceToken */, PACKAGE_NAME);
+ displayManager.performTraversalInternal(mock(SurfaceControl.Transaction.class));
+ displayManager.getDisplayHandler().runWithScissors(() -> {}, 0 /* now */);
+ DisplayDeviceInfo ddi = displayManager.getDisplayDeviceInfoInternal(displayId);
+ assertNotNull(ddi);
+ assertNotEquals(0, ddi.flags & DisplayDeviceInfo.FLAG_OWN_DISPLAY_GROUP);
+ }
+
+ /**
+ * Tests that specifying VIRTUAL_DISPLAY_FLAG_OWN_DISPLAY_GROUP is blocked when the permission
+ * ADD_TRUSTED_DISPLAY is denied.
+ */
+ @Test
+ public void testOwnDisplayGroup_withoutAddTrustedDisplayPermission_throwsSecurityException() {
+ DisplayManagerService displayManager =
+ new DisplayManagerService(mContext, mBasicInjector);
+ registerDefaultDisplays(displayManager);
+
+ DisplayManagerService.BinderService bs = displayManager.new BinderService();
+ when(mMockAppToken.asBinder()).thenReturn(mMockAppToken);
+
+ when(mContext.checkCallingPermission(ADD_TRUSTED_DISPLAY)).thenReturn(
+ PackageManager.PERMISSION_DENIED);
+
+ final VirtualDisplayConfig.Builder builder = new VirtualDisplayConfig.Builder(
+ VIRTUAL_DISPLAY_NAME, 600, 800, 320);
+ builder.setFlags(DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_DISPLAY_GROUP);
+ builder.setUniqueId("uniqueId --- OWN_DISPLAY_GROUP");
+
+ try {
+ bs.createVirtualDisplay(builder.build(), mMockAppToken /* callback */,
+ null /* projection */, null /* virtualDeviceToken */, PACKAGE_NAME);
+ fail("Creating virtual display with VIRTUAL_DISPLAY_FLAG_OWN_DISPLAY_GROUP without "
+ + "ADD_TRUSTED_DISPLAY permission should throw SecurityException.");
+ } catch (SecurityException e) {
+ // SecurityException is expected
+ }
+ }
+
+ /**
+ * Tests that specifying VIRTUAL_DISPLAY_FLAG_OWN_DISPLAY_GROUP is allowed when called with
+ * a virtual device, even if ADD_TRUSTED_DISPLAY is not granted.
+ */
+ @Test
+ public void testOwnDisplayGroup_allowCreationWithVirtualDevice() {
+ DisplayManagerService displayManager =
+ new DisplayManagerService(mContext, mBasicInjector);
+ registerDefaultDisplays(displayManager);
+
+ DisplayManagerService.BinderService bs = displayManager.new BinderService();
+ when(mMockAppToken.asBinder()).thenReturn(mMockAppToken);
+
+ when(mContext.checkCallingPermission(ADD_TRUSTED_DISPLAY)).thenReturn(
+ PackageManager.PERMISSION_DENIED);
+
+ final VirtualDisplayConfig.Builder builder = new VirtualDisplayConfig.Builder(
+ VIRTUAL_DISPLAY_NAME, 600, 800, 320);
+ builder.setFlags(DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_DISPLAY_GROUP);
+ builder.setUniqueId("uniqueId --- OWN_DISPLAY_GROUP");
+
+ IVirtualDevice virtualDevice = mock(IVirtualDevice.class);
+ when(mMockVirtualDeviceManagerInternal.isValidVirtualDevice(virtualDevice))
+ .thenReturn(true);
+
+ int displayId = bs.createVirtualDisplay(builder.build(), mMockAppToken /* callback */,
+ null /* projection */, virtualDevice /* virtualDeviceToken */, PACKAGE_NAME);
+ displayManager.performTraversalInternal(mock(SurfaceControl.Transaction.class));
+ displayManager.getDisplayHandler().runWithScissors(() -> {}, 0 /* now */);
+ DisplayDeviceInfo ddi = displayManager.getDisplayDeviceInfoInternal(displayId);
+ assertNotNull(ddi);
+ assertNotEquals(0, ddi.flags & DisplayDeviceInfo.FLAG_OWN_DISPLAY_GROUP);
+ }
+
+ /**
* Tests that there is a display change notification if the frame rate override
* list is updated.
*/
diff --git a/services/tests/servicestests/src/com/android/server/display/whitebalance/AmbientLuxTest.java b/services/tests/servicestests/src/com/android/server/display/whitebalance/AmbientLuxTest.java
index 2565ae3..0f3742f 100644
--- a/services/tests/servicestests/src/com/android/server/display/whitebalance/AmbientLuxTest.java
+++ b/services/tests/servicestests/src/com/android/server/display/whitebalance/AmbientLuxTest.java
@@ -21,6 +21,7 @@
import static org.mockito.Matchers.anyLong;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
@@ -37,7 +38,9 @@
import androidx.test.InstrumentationRegistry;
import com.android.internal.R;
+import com.android.server.LocalServices;
import com.android.server.display.TestUtils;
+import com.android.server.display.color.ColorDisplayService;
import com.android.server.display.utils.AmbientFilter;
import com.android.server.display.utils.AmbientFilterStubber;
@@ -75,6 +78,7 @@
@Mock private TypedArray mHighLightBiases;
@Mock private TypedArray mAmbientColorTemperatures;
@Mock private TypedArray mDisplayColorTemperatures;
+ @Mock private ColorDisplayService.ColorDisplayServiceInternal mColorDisplayServiceInternalMock;
@Before
public void setUp() throws Exception {
@@ -120,6 +124,18 @@
R.array.config_displayWhiteBalanceHighLightAmbientBiases))
.thenReturn(mHighLightBiases);
mockThrottler();
+ LocalServices.removeServiceForTest(ColorDisplayService.ColorDisplayServiceInternal.class);
+ LocalServices.addService(ColorDisplayService.ColorDisplayServiceInternal.class,
+ mColorDisplayServiceInternalMock);
+ }
+
+ @Test
+ public void testCalculateAdjustedBrightnessNits() {
+ doReturn(0.9f).when(mColorDisplayServiceInternalMock).getDisplayWhiteBalanceLuminance();
+ DisplayWhiteBalanceController controller =
+ DisplayWhiteBalanceFactory.create(mHandler, mSensorManagerMock, mResourcesSpy);
+ final float adjustedNits = controller.calculateAdjustedBrightnessNits(500f);
+ assertEquals(/* expected= */ 550f, adjustedNits, /* delta= */ 0.001);
}
@Test
diff --git a/services/tests/servicestests/src/com/android/server/power/PowerGroupTest.java b/services/tests/servicestests/src/com/android/server/power/PowerGroupTest.java
new file mode 100644
index 0000000..c59b58d
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/power/PowerGroupTest.java
@@ -0,0 +1,129 @@
+/*
+ * 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.server.power;
+
+
+import static android.os.PowerManager.GO_TO_SLEEP_REASON_APPLICATION;
+import static android.os.PowerManager.GO_TO_SLEEP_REASON_DEVICE_ADMIN;
+import static android.os.PowerManager.GO_TO_SLEEP_REASON_TIMEOUT;
+import static android.os.PowerManager.WAKE_REASON_GESTURE;
+import static android.os.PowerManagerInternal.WAKEFULNESS_ASLEEP;
+import static android.os.PowerManagerInternal.WAKEFULNESS_AWAKE;
+import static android.os.PowerManagerInternal.WAKEFULNESS_DOZING;
+import static android.os.PowerManagerInternal.WAKEFULNESS_DREAMING;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isNull;
+import static org.mockito.Mockito.verify;
+
+import android.hardware.display.DisplayManagerInternal.DisplayPowerRequest;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+/**
+ * Tests for {@link com.android.server.power.PowerGroup}.
+ *
+ * Build/Install/Run:
+ * atest FrameworksServicesTests:PowerManagerServiceTest
+ */
+public class PowerGroupTest {
+
+ private static final int GROUP_ID = 0;
+ private static final long TIMESTAMP_CREATE = 1;
+ private static final long TIMESTAMP1 = 999;
+ private static final long TIMESTAMP2 = TIMESTAMP1 + 10;
+ private static final long TIMESTAMP3 = TIMESTAMP2 + 10;
+ private static final int UID = 11;
+
+ private PowerGroup mPowerGroup;
+ @Mock
+ private PowerGroup.PowerGroupListener mWakefulnessCallbackMock;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ mPowerGroup = new PowerGroup(GROUP_ID, mWakefulnessCallbackMock, new DisplayPowerRequest(),
+ WAKEFULNESS_AWAKE, /* ready= */ true, /* supportsSandman= */true, TIMESTAMP_CREATE);
+ }
+
+ @Test
+ public void testDreamPowerGroupTriggersOnWakefulnessChangedCallback() {
+ mPowerGroup.dreamLocked(TIMESTAMP1, UID);
+ verify(mWakefulnessCallbackMock).onWakefulnessChangedLocked(eq(GROUP_ID),
+ eq(WAKEFULNESS_DREAMING), eq(TIMESTAMP1), eq(GO_TO_SLEEP_REASON_APPLICATION),
+ eq(UID), /* opUid= */anyInt(), /* opPackageName= */ isNull(), /* details= */
+ isNull());
+ }
+
+ @Test
+ public void testLastWakeAndSleepTimeIsUpdated() {
+ assertThat(mPowerGroup.getLastWakeTimeLocked()).isEqualTo(TIMESTAMP_CREATE);
+ assertThat(mPowerGroup.getLastSleepTimeLocked()).isEqualTo(TIMESTAMP_CREATE);
+
+ // Verify that the transition to WAKEFULNESS_DOZING updates the last sleep time
+ String details = "PowerGroup1 Timeout";
+ mPowerGroup.setWakefulnessLocked(WAKEFULNESS_DOZING, TIMESTAMP1, UID,
+ GO_TO_SLEEP_REASON_TIMEOUT, /* opUid= */ 0, /* opPackageName= */ null, details);
+ assertThat(mPowerGroup.getLastSleepTimeLocked()).isEqualTo(TIMESTAMP1);
+ assertThat(mPowerGroup.getLastWakeTimeLocked()).isEqualTo(TIMESTAMP_CREATE);
+ assertThat(mPowerGroup.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_DOZING);
+ verify(mWakefulnessCallbackMock).onWakefulnessChangedLocked(eq(GROUP_ID),
+ eq(WAKEFULNESS_DOZING), eq(TIMESTAMP1), eq(GO_TO_SLEEP_REASON_TIMEOUT),
+ eq(UID), /* opUid= */anyInt(), /* opPackageName= */ isNull(), eq(details));
+
+ // Verify that the transition to WAKEFULNESS_ASLEEP after dozing does not update the last
+ // wake or sleep time
+ mPowerGroup.setWakefulnessLocked(WAKEFULNESS_ASLEEP, TIMESTAMP2, UID,
+ GO_TO_SLEEP_REASON_DEVICE_ADMIN, /* opUid= */ 0, /* opPackageName= */ null,
+ details);
+ assertThat(mPowerGroup.getLastSleepTimeLocked()).isEqualTo(TIMESTAMP1);
+ assertThat(mPowerGroup.getLastWakeTimeLocked()).isEqualTo(TIMESTAMP_CREATE);
+ assertThat(mPowerGroup.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ verify(mWakefulnessCallbackMock).onWakefulnessChangedLocked(eq(GROUP_ID),
+ eq(WAKEFULNESS_ASLEEP), eq(TIMESTAMP2), eq(GO_TO_SLEEP_REASON_DEVICE_ADMIN),
+ eq(UID), /* opUid= */anyInt(), /* opPackageName= */ isNull(), eq(details));
+
+ // Verify that waking up the power group only updates the last wake time
+ details = "PowerGroup1 Gesture";
+ mPowerGroup.setWakefulnessLocked(WAKEFULNESS_AWAKE, TIMESTAMP2, UID,
+ WAKE_REASON_GESTURE, /* opUid= */ 0, /* opPackageName= */ null, details);
+ assertThat(mPowerGroup.getLastWakeTimeLocked()).isEqualTo(TIMESTAMP2);
+ assertThat(mPowerGroup.getLastSleepTimeLocked()).isEqualTo(TIMESTAMP1);
+ assertThat(mPowerGroup.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ verify(mWakefulnessCallbackMock).onWakefulnessChangedLocked(eq(GROUP_ID),
+ eq(WAKEFULNESS_AWAKE), eq(TIMESTAMP2), eq(WAKE_REASON_GESTURE),
+ eq(UID), /* opUid= */ anyInt(), /* opPackageName= */ isNull(), eq(details));
+
+ // Verify that a transition to WAKEFULNESS_ASLEEP from an interactive state updates the last
+ // sleep time
+ mPowerGroup.setWakefulnessLocked(WAKEFULNESS_ASLEEP, TIMESTAMP3, UID,
+ GO_TO_SLEEP_REASON_DEVICE_ADMIN, /* opUid= */ 0, /* opPackageName= */ null,
+ details);
+ assertThat(mPowerGroup.getLastSleepTimeLocked()).isEqualTo(TIMESTAMP3);
+ assertThat(mPowerGroup.getLastWakeTimeLocked()).isEqualTo(TIMESTAMP2);
+ assertThat(mPowerGroup.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ verify(mWakefulnessCallbackMock).onWakefulnessChangedLocked(eq(GROUP_ID),
+ eq(WAKEFULNESS_ASLEEP), eq(TIMESTAMP3), eq(GO_TO_SLEEP_REASON_DEVICE_ADMIN),
+ eq(UID), /* opUid= */anyInt(), /* opPackageName= */ isNull(), eq(details));
+ }
+}
diff --git a/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java
index c832a3e..d35c679 100644
--- a/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java
@@ -111,6 +111,7 @@
* Build/Install/Run:
* atest FrameworksServicesTests:PowerManagerServiceTest
*/
+@SuppressWarnings("GuardedBy")
public class PowerManagerServiceTest {
private static final String SYSTEM_PROPERTY_QUIESCENT = "ro.boot.quiescent";
private static final String SYSTEM_PROPERTY_REBOOT_REASON = "sys.boot.reason";
@@ -437,7 +438,7 @@
@Test
public void testWakefulnessAwake_InitialValue() {
createService();
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
}
@Test
@@ -445,12 +446,12 @@
createService();
// Start with AWAKE state
startSystem();
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
// Take a nap and verify.
mService.getBinderServiceInstance().goToSleep(mClock.now(),
PowerManager.GO_TO_SLEEP_REASON_APPLICATION, PowerManager.GO_TO_SLEEP_FLAG_NO_DOZE);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
}
@Test
@@ -467,21 +468,21 @@
int flags = PowerManager.FULL_WAKE_LOCK;
mService.getBinderServiceInstance().acquireWakeLock(token, flags, tag, packageName,
null /* workSource */, null /* historyTag */, Display.INVALID_DISPLAY);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
mService.getBinderServiceInstance().releaseWakeLock(token, 0 /* flags */);
// Ensure that the flag does *NOT* work with a partial wake lock.
flags = PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP;
mService.getBinderServiceInstance().acquireWakeLock(token, flags, tag, packageName,
null /* workSource */, null /* historyTag */, Display.INVALID_DISPLAY);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
mService.getBinderServiceInstance().releaseWakeLock(token, 0 /* flags */);
// Verify that flag forces a wakeup when paired to a FULL_WAKE_LOCK
flags = PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP;
mService.getBinderServiceInstance().acquireWakeLock(token, flags, tag, packageName,
null /* workSource */, null /* historyTag */, Display.INVALID_DISPLAY);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
mService.getBinderServiceInstance().releaseWakeLock(token, 0 /* flags */);
}
@@ -492,7 +493,7 @@
forceSleep();
mService.getBinderServiceInstance().wakeUp(mClock.now(),
PowerManager.WAKE_REASON_UNKNOWN, "testing IPowerManager.wakeUp()", "pkg.name");
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
}
/**
@@ -511,7 +512,7 @@
.thenReturn(false);
mService.readConfigurationLocked();
setPluggedIn(true);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
when(mResourcesSpy.getBoolean(com.android.internal.R.bool.config_unplugTurnsOnScreen))
.thenReturn(true);
mService.readConfigurationLocked();
@@ -526,20 +527,20 @@
when(mWirelessChargerDetectorMock.update(true /* isPowered */,
BatteryManager.BATTERY_PLUGGED_WIRELESS)).thenReturn(false);
setPluggedIn(true);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
// Test 3:
// Do not wake up if the phone is being REMOVED from a wireless charger
when(mBatteryManagerInternalMock.getPlugType()).thenReturn(0);
setPluggedIn(false);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
// Test 4:
// Do not wake if we are dreaming.
forceAwake(); // Needs to be awake first before it can dream.
forceDream();
setPluggedIn(true);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_DREAMING);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_DREAMING);
forceSleep();
// Test 5:
@@ -552,7 +553,7 @@
com.android.internal.R.bool.config_allowTheaterModeWakeFromUnplug))
.thenReturn(false);
setPluggedIn(false);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
Settings.Global.putInt(
mContextSpy.getContentResolver(), Settings.Global.THEATER_MODE_ON, 0);
mUserSwitchedReceiver.onReceive(mContextSpy, new Intent(Intent.ACTION_USER_SWITCHED));
@@ -565,14 +566,14 @@
forceAwake();
forceDozing();
setPluggedIn(true);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_DOZING);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_DOZING);
// Test 7:
// Finally, take away all the factors above and ensure the device wakes up!
forceAwake();
forceSleep();
setPluggedIn(false);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
}
@Test
@@ -580,12 +581,12 @@
createService();
// Start with AWAKE state
startSystem();
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
// Take a nap and verify.
mService.getBinderServiceInstance().goToSleep(mClock.now(),
PowerManager.GO_TO_SLEEP_REASON_APPLICATION, 0);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_DOZING);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_DOZING);
}
@Test
@@ -616,12 +617,12 @@
mService.onBootPhase(SystemService.PHASE_BOOT_COMPLETED);
// Verify that we start awake
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
// Grab the wakefulness value when PowerManager finally calls into the
// native component to actually perform the suspend.
when(mNativeWrapperMock.nativeForceSuspend()).then(inv -> {
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
return true;
});
@@ -629,7 +630,7 @@
assertThat(retval).isTrue();
// Still asleep when the function returns.
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
}
@Test
@@ -662,7 +663,7 @@
mService.onBootPhase(SystemService.PHASE_BOOT_COMPLETED);
// Verify that we start awake
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
// Create a wakelock
mService.getBinderServiceInstance().acquireWakeLock(new Binder(), flags, tag, pkg,
@@ -718,7 +719,7 @@
// Start with AWAKE state
startSystem();
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
assertTrue(isAcquired[0]);
// Take a nap and verify we no longer hold the blocker
@@ -728,7 +729,7 @@
when(mDreamManagerInternalMock.isDreaming()).thenReturn(true);
mService.getBinderServiceInstance().goToSleep(mClock.now(),
PowerManager.GO_TO_SLEEP_REASON_APPLICATION, 0);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_DOZING);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_DOZING);
assertFalse(isAcquired[0]);
// Override the display state by DreamManager and verify is reacquires the blocker.
@@ -841,9 +842,9 @@
verify(mInattentiveSleepWarningControllerMock, atLeastOnce()).show();
when(mInattentiveSleepWarningControllerMock.isShown()).thenReturn(true);
advanceTime(70);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
forceAwake();
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
verify(mInattentiveSleepWarningControllerMock, atLeastOnce()).dismiss(false);
}
@@ -862,7 +863,7 @@
createService();
startSystem();
advanceTime(20);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
assertThat(mService.getBinderServiceInstance().getLastSleepReason()).isEqualTo(
PowerManager.GO_TO_SLEEP_REASON_INATTENTIVE);
}
@@ -882,9 +883,9 @@
PowerManager.SCREEN_BRIGHT_WAKE_LOCK, tag, pkg,
null /* workSource */, null /* historyTag */, Display.INVALID_DISPLAY);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
advanceTime(60);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
assertThat(mService.getBinderServiceInstance().getLastSleepReason()).isEqualTo(
PowerManager.GO_TO_SLEEP_REASON_INATTENTIVE);
}
@@ -912,7 +913,7 @@
mService.getBinderServiceInstance().releaseWakeLock(token, 0 /* flags */);
advanceTime(520);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
assertThat(mService.getBinderServiceInstance().getLastSleepReason()).isEqualTo(
PowerManager.GO_TO_SLEEP_REASON_INATTENTIVE);
}
@@ -934,7 +935,7 @@
PowerManager.USER_ACTIVITY_FLAG_NO_CHANGE_LIGHTS);
advanceTime(520);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
assertThat(mService.getBinderServiceInstance().getLastSleepReason()).isEqualTo(
PowerManager.GO_TO_SLEEP_REASON_INATTENTIVE);
}
@@ -955,7 +956,7 @@
PowerManager.USER_ACTIVITY_EVENT_OTHER, 0 /* flags */);
advanceTime(520);
- assertThat(mService.getWakefulnessLocked()).isNotEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isNotEqualTo(WAKEFULNESS_ASLEEP);
}
@Test
@@ -984,14 +985,14 @@
PowerManager.SCREEN_BRIGHT_WAKE_LOCK, tag, pkg,
null /* workSource */, null /* historyTag */, Display.DEFAULT_DISPLAY);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
assertThat(mService.getWakefulnessLocked(Display.DEFAULT_DISPLAY_GROUP)).isEqualTo(
WAKEFULNESS_AWAKE);
assertThat(mService.getWakefulnessLocked(nonDefaultDisplayGroupId)).isEqualTo(
WAKEFULNESS_AWAKE);
advanceTime(15000);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
assertThat(mService.getWakefulnessLocked(Display.DEFAULT_DISPLAY_GROUP)).isEqualTo(
WAKEFULNESS_AWAKE);
assertThat(mService.getWakefulnessLocked(nonDefaultDisplayGroupId)).isEqualTo(
@@ -1024,14 +1025,14 @@
PowerManager.SCREEN_BRIGHT_WAKE_LOCK, tag, pkg,
null /* workSource */, null /* historyTag */, Display.INVALID_DISPLAY);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
assertThat(mService.getWakefulnessLocked(Display.DEFAULT_DISPLAY_GROUP)).isEqualTo(
WAKEFULNESS_AWAKE);
assertThat(mService.getWakefulnessLocked(nonDefaultDisplayGroupId)).isEqualTo(
WAKEFULNESS_AWAKE);
advanceTime(15000);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
assertThat(mService.getWakefulnessLocked(Display.DEFAULT_DISPLAY_GROUP)).isEqualTo(
WAKEFULNESS_AWAKE);
assertThat(mService.getWakefulnessLocked(nonDefaultDisplayGroupId)).isEqualTo(
@@ -1069,14 +1070,14 @@
WAKEFULNESS_AWAKE);
assertThat(mService.getWakefulnessLocked(nonDefaultDisplayGroupId)).isEqualTo(
WAKEFULNESS_AWAKE);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
listener.get().onDisplayGroupRemoved(nonDefaultDisplayGroupId);
advanceTime(15000);
assertThat(mService.getWakefulnessLocked(Display.DEFAULT_DISPLAY_GROUP)).isEqualTo(
WAKEFULNESS_DOZING);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_DOZING);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_DOZING);
}
@Test
@@ -1084,7 +1085,7 @@
createService();
startSystem();
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
verify(mNotifierMock, never()).onWakefulnessChangeStarted(anyInt(), anyInt(), anyLong());
}
@@ -1103,7 +1104,7 @@
createService();
startSystem();
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
verify(mNotifierMock).onWakefulnessChangeStarted(eq(WAKEFULNESS_ASLEEP), anyInt(),
anyLong());
}
@@ -1137,7 +1138,7 @@
PowerManager.WAKE_REASON_UNKNOWN, "testing IPowerManager.wakeUp()", "pkg.name");
mService.onBootPhase(SystemService.PHASE_BOOT_COMPLETED);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
assertThat(mService.getDesiredScreenPolicyLocked(Display.DEFAULT_DISPLAY_GROUP)).isEqualTo(
DisplayPowerRequest.POLICY_BRIGHT);
}
@@ -1418,23 +1419,23 @@
startSystem();
listener.get().onDisplayGroupAdded(nonDefaultDisplayGroupId);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
mService.setWakefulnessLocked(Display.DEFAULT_DISPLAY_GROUP, WAKEFULNESS_ASLEEP, 0, 0, 0, 0,
null, null);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
mService.setWakefulnessLocked(nonDefaultDisplayGroupId, WAKEFULNESS_ASLEEP, 0, 0, 0, 0,
null, null);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
mService.setWakefulnessLocked(Display.DEFAULT_DISPLAY_GROUP, WAKEFULNESS_AWAKE, 0, 0, 0, 0,
null, null);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
}
@Test
- public void testMultiDisplay_addDisplayGroup_preservesWakefulness() {
+ public void testMultiDisplay_addDisplayGroup_wakesDeviceUp() {
final int nonDefaultDisplayGroupId = Display.DEFAULT_DISPLAY_GROUP + 1;
final AtomicReference<DisplayManagerInternal.DisplayGroupListener> listener =
new AtomicReference<>();
@@ -1446,15 +1447,15 @@
createService();
startSystem();
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
mService.setWakefulnessLocked(Display.DEFAULT_DISPLAY_GROUP, WAKEFULNESS_ASLEEP, 0, 0, 0, 0,
null, null);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
listener.get().onDisplayGroupAdded(nonDefaultDisplayGroupId);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
}
@Test
@@ -1471,18 +1472,79 @@
startSystem();
listener.get().onDisplayGroupAdded(nonDefaultDisplayGroupId);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
mService.setWakefulnessLocked(Display.DEFAULT_DISPLAY_GROUP, WAKEFULNESS_ASLEEP, 0, 0, 0, 0,
null, null);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
listener.get().onDisplayGroupRemoved(nonDefaultDisplayGroupId);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_ASLEEP);
mService.setWakefulnessLocked(Display.DEFAULT_DISPLAY_GROUP, WAKEFULNESS_AWAKE, 0, 0, 0, 0,
null, null);
- assertThat(mService.getWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ }
+
+ @Test
+ public void testMultiDisplay_updatesLastGlobalWakeTime() {
+ final int nonDefaultPowerGroupId = Display.DEFAULT_DISPLAY_GROUP + 1;
+ final AtomicReference<DisplayManagerInternal.DisplayGroupListener> listener =
+ new AtomicReference<>();
+ long eventTime1 = 10;
+ long eventTime2 = eventTime1 + 1;
+ long eventTime3 = eventTime2 + 1;
+ long eventTime4 = eventTime3 + 1;
+ doAnswer((Answer<Void>) invocation -> {
+ listener.set(invocation.getArgument(0));
+ return null;
+ }).when(mDisplayManagerInternalMock).registerDisplayGroupListener(any());
+
+ createService();
+ startSystem();
+ listener.get().onDisplayGroupAdded(nonDefaultPowerGroupId);
+
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+
+ mService.setWakefulnessLocked(Display.DEFAULT_DISPLAY_GROUP, WAKEFULNESS_DOZING, eventTime1,
+ 0, PowerManager.GO_TO_SLEEP_REASON_INATTENTIVE, 0, null, null);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+
+ mService.setWakefulnessLocked(nonDefaultPowerGroupId, WAKEFULNESS_DOZING, eventTime2,
+ 0, PowerManager.GO_TO_SLEEP_REASON_APPLICATION, 0, null, null);
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_DOZING);
+ assertThat(mService.getBinderServiceInstance().getLastSleepReason()).isEqualTo(
+ PowerManager.GO_TO_SLEEP_REASON_APPLICATION);
+
+ mService.setWakefulnessLocked(Display.DEFAULT_DISPLAY_GROUP, WAKEFULNESS_AWAKE,
+ eventTime3, /* uid= */ 0, PowerManager.WAKE_REASON_PLUGGED_IN, /* opUid= */
+ 0, /* opPackageName= */ null, /* details= */ null);
+ PowerManager.WakeData wakeData = mService.getLocalServiceInstance().getLastWakeup();
+ assertThat(wakeData.wakeTime).isEqualTo(eventTime3);
+ assertThat(wakeData.wakeReason).isEqualTo(PowerManager.WAKE_REASON_PLUGGED_IN);
+ assertThat(wakeData.sleepDuration).isEqualTo(eventTime3 - eventTime2);
+
+ // The global wake time and reason as well as sleep duration shouldn't change when another
+ // PowerGroup wakes up.
+ mService.setWakefulnessLocked(nonDefaultPowerGroupId, WAKEFULNESS_AWAKE,
+ eventTime4, /* uid= */ 0, PowerManager.WAKE_REASON_CAMERA_LAUNCH, /* opUid= */
+ 0, /* opPackageName= */ null, /* details= */ null);
+ assertThat(wakeData.wakeTime).isEqualTo(eventTime3);
+ assertThat(wakeData.wakeReason).isEqualTo(PowerManager.WAKE_REASON_PLUGGED_IN);
+ assertThat(wakeData.sleepDuration).isEqualTo(eventTime3 - eventTime2);
+ }
+
+ @Test
+ public void testLastSleepTime_notUpdatedWhenDreaming() {
+ createService();
+ startSystem();
+
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_AWAKE);
+ PowerManager.WakeData initialWakeData = mService.getLocalServiceInstance().getLastWakeup();
+
+ forceDream();
+ assertThat(mService.getGlobalWakefulnessLocked()).isEqualTo(WAKEFULNESS_DREAMING);
+ assertThat(mService.getLocalServiceInstance().getLastWakeup()).isEqualTo(initialWakeData);
}
@Test
diff --git a/services/tests/servicestests/src/com/android/server/vibrator/VibrationThreadTest.java b/services/tests/servicestests/src/com/android/server/vibrator/VibrationThreadTest.java
index 5dd44ff..020d9f8 100644
--- a/services/tests/servicestests/src/com/android/server/vibrator/VibrationThreadTest.java
+++ b/services/tests/servicestests/src/com/android/server/vibrator/VibrationThreadTest.java
@@ -16,6 +16,9 @@
package com.android.server.vibrator;
+import static android.os.VibrationEffect.VibrationParameter.targetAmplitude;
+import static android.os.VibrationEffect.VibrationParameter.targetFrequency;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -69,6 +72,7 @@
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
+import java.time.Duration;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -525,7 +529,8 @@
.addPrimitive(VibrationEffect.Composition.PRIMITIVE_CLICK, 1f)
.addPrimitive(VibrationEffect.Composition.PRIMITIVE_TICK, 0.5f)
.addEffect(VibrationEffect.get(VibrationEffect.EFFECT_CLICK))
- .addEffect(VibrationEffect.get(VibrationEffect.EFFECT_CLICK), /* delay= */ 100)
+ .addOffDuration(Duration.ofMillis(100))
+ .addEffect(VibrationEffect.get(VibrationEffect.EFFECT_CLICK))
.compose();
VibrationThread thread = startThreadAndDispatcher(vibrationId, effect);
waitForCompletion(thread);
@@ -558,11 +563,12 @@
0.5f /* 100Hz*/, 1 /* 150Hz */, 0.6f /* 200Hz */);
long vibrationId = 1;
- VibrationEffect effect = VibrationEffect.startWaveform()
- .addStep(1, 10)
- .addRamp(0, 20)
- .addStep(0.8f, 100, 30)
- .addRamp(0.6f, 200, 40)
+ VibrationEffect effect = VibrationEffect.startWaveform(targetAmplitude(1))
+ .addSustain(Duration.ofMillis(10))
+ .addTransition(Duration.ofMillis(20), targetAmplitude(0))
+ .addTransition(Duration.ZERO, targetAmplitude(0.8f), targetFrequency(100))
+ .addSustain(Duration.ofMillis(30))
+ .addTransition(Duration.ofMillis(40), targetAmplitude(0.6f), targetFrequency(200))
.build();
VibrationThread thread = startThreadAndDispatcher(vibrationId, effect);
waitForCompletion(thread);
@@ -595,11 +601,12 @@
fakeVibrator.setPwleSizeMax(2);
long vibrationId = 1;
- VibrationEffect effect = VibrationEffect.startWaveform()
- .addStep(1, 10)
- .addRamp(0, 20)
- .addStep(0.8f, 10, 30)
- .addRamp(0.6f, 100, 40)
+ VibrationEffect effect = VibrationEffect.startWaveform(targetAmplitude(1))
+ .addSustain(Duration.ofMillis(10))
+ .addTransition(Duration.ofMillis(20), targetAmplitude(0))
+ .addTransition(Duration.ZERO, targetAmplitude(0.8f), targetFrequency(100))
+ .addSustain(Duration.ofMillis(30))
+ .addTransition(Duration.ofMillis(40), targetAmplitude(0.6f), targetFrequency(200))
.build();
VibrationThread thread = startThreadAndDispatcher(vibrationId, effect);
waitForCompletion(thread);
@@ -1261,7 +1268,9 @@
fakeVibrator.setPwleSizeMax(2);
long vibrationId = 1;
- VibrationEffect effect = VibrationEffect.startWaveform().addRamp(1, 1).build();
+ VibrationEffect effect = VibrationEffect.startWaveform()
+ .addTransition(Duration.ofMillis(1), targetAmplitude(1))
+ .build();
VibrationThread thread = startThreadAndDispatcher(vibrationId, effect);
waitForCompletion(thread);
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
index fdc8982..c58bf3b 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
@@ -340,7 +340,7 @@
doReturn(stack).when(mRootWindowContainer)
.getLaunchRootTask(any(), any(), any(), anyBoolean());
doReturn(stack).when(mRootWindowContainer).getLaunchRootTask(any(), any(), any(), any(),
- anyBoolean(), any(), anyInt(), anyInt(), anyInt());
+ anyBoolean(), any(), anyInt());
}
// Set up mock package manager internal and make sure no unmocked methods are called
diff --git a/services/tests/wmtests/src/com/android/server/wm/InputMethodDialogWindowContextTest.java b/services/tests/wmtests/src/com/android/server/wm/InputMethodDialogWindowContextTest.java
index 670eb75..d487113 100644
--- a/services/tests/wmtests/src/com/android/server/wm/InputMethodDialogWindowContextTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/InputMethodDialogWindowContextTest.java
@@ -30,8 +30,9 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.atLeastOnce;
+import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
import android.app.ActivityThread;
@@ -71,6 +72,8 @@
private IWindowManager mIWindowManager;
private DisplayManagerGlobal mDisplayManagerGlobal;
+ private static final int WAIT_TIMEOUT_MS = 1000;
+
@Before
public void setUp() throws Exception {
// Let the Display be created with the DualDisplay policy.
@@ -142,19 +145,22 @@
mSecondaryDisplay.mFirstRoot.placeImeContainer(imeContainer);
- verify(imeContainer, atLeastOnce()).onConfigurationChanged(
+ verify(imeContainer, timeout(WAIT_TIMEOUT_MS)).onConfigurationChanged(
eq(mSecondaryDisplay.mFirstRoot.getConfiguration()));
- verify(tokenClient, atLeastOnce()).onConfigurationChanged(
+ verify(tokenClient, timeout(WAIT_TIMEOUT_MS)).onConfigurationChanged(
eq(mSecondaryDisplay.mFirstRoot.getConfiguration()),
eq(mSecondaryDisplay.mDisplayId));
assertThat(imeContainer.getRootDisplayArea()).isEqualTo(mSecondaryDisplay.mFirstRoot);
assertImeSwitchContextMetricsValidity(context, mSecondaryDisplay);
+ // Clear the previous invocation histories in case we may count the previous
+ // onConfigurationChanged invocation into the next verification.
+ clearInvocations(tokenClient, imeContainer);
mSecondaryDisplay.mSecondRoot.placeImeContainer(imeContainer);
- verify(imeContainer, atLeastOnce()).onConfigurationChanged(
+ verify(imeContainer, timeout(WAIT_TIMEOUT_MS)).onConfigurationChanged(
eq(mSecondaryDisplay.mSecondRoot.getConfiguration()));
- verify(tokenClient, atLeastOnce()).onConfigurationChanged(
+ verify(tokenClient, timeout(WAIT_TIMEOUT_MS)).onConfigurationChanged(
eq(mSecondaryDisplay.mSecondRoot.getConfiguration()),
eq(mSecondaryDisplay.mDisplayId));
assertThat(imeContainer.getRootDisplayArea()).isEqualTo(mSecondaryDisplay.mSecondRoot);
diff --git a/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java b/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
index f4abf88..ee17f52 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
@@ -25,7 +25,6 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.content.pm.ActivityInfo.FLAG_ALWAYS_FOCUSABLE;
import static android.view.Display.DEFAULT_DISPLAY;
-import static android.view.Display.TYPE_VIRTUAL;
import static android.window.DisplayAreaOrganizer.FEATURE_VENDOR_FIRST;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doNothing;
@@ -935,39 +934,6 @@
assertEquals(infoFake1.activityInfo.name, resolvedInfo.first.name);
}
- /**
- * Test that {@link RootWindowContainer#getLaunchRootTask} with the real caller id will get the
- * expected root task when requesting the activity launch on the secondary display.
- */
- @Test
- public void testGetLaunchRootTaskWithRealCallerId() {
- // Create a non-system owned virtual display.
- final TestDisplayContent secondaryDisplay =
- new TestDisplayContent.Builder(mAtm, 1000, 1500)
- .setType(TYPE_VIRTUAL).setOwnerUid(100).build();
-
- // Create an activity with specify the original launch pid / uid.
- final ActivityRecord r = new ActivityBuilder(mAtm).setLaunchedFromPid(200)
- .setLaunchedFromUid(200).build();
-
- // Simulate ActivityStarter to find a launch root task for requesting the activity to launch
- // on the secondary display with realCallerId.
- final ActivityOptions options = ActivityOptions.makeBasic();
- options.setLaunchDisplayId(secondaryDisplay.mDisplayId);
- options.setLaunchWindowingMode(WINDOWING_MODE_FULLSCREEN);
- doReturn(true).when(mSupervisor).canPlaceEntityOnDisplay(secondaryDisplay.mDisplayId,
- 300 /* test realCallerPid */, 300 /* test realCallerUid */, r.info);
- final Task result = mRootWindowContainer.getLaunchRootTask(r, options,
- null /* task */, null /* sourceTask */, true /* onTop */, null /* launchParams */,
- 0 /* launchFlags */, 300 /* test realCallerPid */,
- 300 /* test realCallerUid */);
-
- // Assert that the root task is returned as expected.
- assertNotNull(result);
- assertEquals("The display ID of the root task should same as secondary display ",
- secondaryDisplay.mDisplayId, result.getDisplayId());
- }
-
@Test
public void testGetValidLaunchRootTaskOnDisplayWithCandidateRootTask() {
// Create a root task with an activity on secondary display.
diff --git a/services/usb/java/com/android/server/usb/UsbPortManager.java b/services/usb/java/com/android/server/usb/UsbPortManager.java
index 65b79bf..d0825ba 100644
--- a/services/usb/java/com/android/server/usb/UsbPortManager.java
+++ b/services/usb/java/com/android/server/usb/UsbPortManager.java
@@ -503,6 +503,49 @@
return HAL_MODE_DFP;
}
+ /**
+ * Reset USB port.
+ *
+ * @param portId port identifier.
+ */
+ public boolean resetUsbPort(@NonNull String portId, int transactionId,
+ @NonNull IUsbOperationInternal callback, IndentingPrintWriter pw) {
+ synchronized (mLock) {
+ Objects.requireNonNull(callback);
+ Objects.requireNonNull(portId);
+ final PortInfo portInfo = mPorts.get(portId);
+ if (portInfo == null) {
+ logAndPrint(Log.ERROR, pw, "resetUsbPort: No such port: " + portId
+ + " opId:" + transactionId);
+ try {
+ callback.onOperationComplete(
+ USB_OPERATION_ERROR_PORT_MISMATCH);
+ } catch (RemoteException e) {
+ logAndPrintException(pw,
+ "resetUsbPort: Failed to call OperationComplete. opId:"
+ + transactionId, e);
+ }
+ return false;
+ }
+
+ try {
+ try {
+ return mUsbPortHal.resetUsbPort(portId, transactionId, callback);
+ } catch (Exception e) {
+ logAndPrintException(pw,
+ "reseetUsbPort: Failed to resetUsbPort. opId:"
+ + transactionId , e);
+ callback.onOperationComplete(USB_OPERATION_ERROR_INTERNAL);
+ }
+ } catch (RemoteException e) {
+ logAndPrintException(pw,
+ "resetUsbPort: Failed to call onOperationComplete. opId:"
+ + transactionId, e);
+ }
+ return false;
+ }
+ }
+
public void setPortRoles(String portId, int newPowerRole, int newDataRole,
IndentingPrintWriter pw) {
synchronized (mLock) {
diff --git a/services/usb/java/com/android/server/usb/UsbService.java b/services/usb/java/com/android/server/usb/UsbService.java
index 88ffc7d61..f3308bb 100644
--- a/services/usb/java/com/android/server/usb/UsbService.java
+++ b/services/usb/java/com/android/server/usb/UsbService.java
@@ -680,6 +680,35 @@
}
@Override
+ public boolean resetUsbPort(String portId, int operationId,
+ IUsbOperationInternal callback) {
+ Objects.requireNonNull(portId, "resetUsbPort: portId must not be null. opId:"
+ + operationId);
+ Objects.requireNonNull(callback, "resetUsbPort: callback must not be null. opId:"
+ + operationId);
+ mContext.enforceCallingOrSelfPermission(android.Manifest.permission.MANAGE_USB, null);
+
+ final long ident = Binder.clearCallingIdentity();
+ boolean wait;
+
+ try {
+ if (mPortManager != null) {
+ wait = mPortManager.resetUsbPort(portId, operationId, callback, null);
+ } else {
+ wait = false;
+ try {
+ callback.onOperationComplete(USB_OPERATION_ERROR_INTERNAL);
+ } catch (RemoteException e) {
+ Slog.e(TAG, "resetUsbPort: Failed to call onOperationComplete", e);
+ }
+ }
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
+ return wait;
+ }
+
+ @Override
public List<ParcelableUsbPort> getPorts() {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.MANAGE_USB, null);
diff --git a/services/usb/java/com/android/server/usb/hal/port/UsbPortAidl.java b/services/usb/java/com/android/server/usb/hal/port/UsbPortAidl.java
index 5582600..f468db3 100644
--- a/services/usb/java/com/android/server/usb/hal/port/UsbPortAidl.java
+++ b/services/usb/java/com/android/server/usb/hal/port/UsbPortAidl.java
@@ -238,6 +238,50 @@
}
@Override
+ public boolean resetUsbPort(String portName, long operationID,
+ IUsbOperationInternal callback) {
+ Objects.requireNonNull(portName);
+ Objects.requireNonNull(callback);
+ long key = operationID;
+ synchronized (mLock) {
+ try {
+ if (mProxy == null) {
+ logAndPrint(Log.ERROR, mPw,
+ "resetUsbPort: Proxy is null. Retry !opID:"
+ + operationID);
+ callback.onOperationComplete(USB_OPERATION_ERROR_INTERNAL);
+ return false;
+ }
+ while (sCallbacks.get(key) != null) {
+ key = ThreadLocalRandom.current().nextInt();
+ }
+ if (key != operationID) {
+ logAndPrint(Log.INFO, mPw, "resetUsbPort: operationID exists ! opID:"
+ + operationID + " key:" + key);
+ }
+ try {
+ sCallbacks.put(operationID, callback);
+ mProxy.resetUsbPort(portName, operationID);
+ } catch (RemoteException e) {
+ logAndPrintException(mPw,
+ "resetUsbPort: Failed to resetUsbPort: portID="
+ + portName + "opId:" + operationID, e);
+ callback.onOperationComplete(USB_OPERATION_ERROR_INTERNAL);
+ sCallbacks.remove(key);
+ return false;
+ }
+ } catch (RemoteException e) {
+ logAndPrintException(mPw,
+ "resetUsbPort: Failed to call onOperationComplete portID="
+ + portName + "opID:" + operationID, e);
+ sCallbacks.remove(key);
+ return false;
+ }
+ return true;
+ }
+ }
+
+ @Override
public boolean enableUsbData(String portName, boolean enable, long operationID,
IUsbOperationInternal callback) {
Objects.requireNonNull(portName);
@@ -605,5 +649,27 @@
e);
}
}
+
+ @Override
+ public void notifyResetUsbPortStatus(String portName, int retval,
+ long operationID) {
+ if (retval == Status.SUCCESS) {
+ UsbPortManager.logAndPrint(Log.INFO, mPw, "notifyResetUsbPortStatus:"
+ + portName + ": opID:" + operationID);
+ } else {
+ UsbPortManager.logAndPrint(Log.ERROR, mPw, portName
+ + "notifyEnableUsbDataStatus: opID:"
+ + operationID + " failed. err:" + retval);
+ }
+ try {
+ sCallbacks.get(operationID).onOperationComplete(retval == Status.SUCCESS
+ ? USB_OPERATION_SUCCESS
+ : USB_OPERATION_ERROR_INTERNAL);
+ } catch (RemoteException e) {
+ logAndPrintException(mPw,
+ "notifyResetUsbPortStatus: Failed to call onOperationComplete",
+ e);
+ }
+ }
}
}
diff --git a/services/usb/java/com/android/server/usb/hal/port/UsbPortHal.java b/services/usb/java/com/android/server/usb/hal/port/UsbPortHal.java
index abfdd6f..4fa296d 100644
--- a/services/usb/java/com/android/server/usb/hal/port/UsbPortHal.java
+++ b/services/usb/java/com/android/server/usb/hal/port/UsbPortHal.java
@@ -193,4 +193,18 @@
*/
public void enableLimitPowerTransfer(String portName, boolean limit, long transactionId,
IUsbOperationInternal callback);
+
+ /**
+ * Invoked to reset UsbData on the specified port.
+ *
+ * @param portName Port Identifier.
+ * @param transactionId Used for tracking the current request and is passed down to the HAL
+ * implementation as needed.
+ * @param callback callback object to be invoked to invoke the status of the operation upon
+ * completion.
+ * @param callback callback object to be invoked to invoke the status of the operation upon
+ * completion.
+ */
+ public boolean resetUsbPort(String portName, long transactionId,
+ IUsbOperationInternal callback);
}
diff --git a/services/usb/java/com/android/server/usb/hal/port/UsbPortHidl.java b/services/usb/java/com/android/server/usb/hal/port/UsbPortHidl.java
index c1d7635..64e8adc 100644
--- a/services/usb/java/com/android/server/usb/hal/port/UsbPortHidl.java
+++ b/services/usb/java/com/android/server/usb/hal/port/UsbPortHidl.java
@@ -318,6 +318,19 @@
}
@Override
+ public boolean resetUsbPort(String portName, long transactionId,
+ IUsbOperationInternal callback) {
+ try {
+ callback.onOperationComplete(USB_OPERATION_ERROR_NOT_SUPPORTED);
+ } catch (RemoteException e) {
+ logAndPrintException(mPw, "Failed to call onOperationComplete. opID:"
+ + transactionId
+ + " portId:" + portName, e);
+ }
+ return false;
+ }
+
+ @Override
public boolean enableUsbData(String portName, boolean enable, long transactionId,
IUsbOperationInternal callback) {
int halVersion;
diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java
index e332d3f..ec18c6a 100644
--- a/telecomm/java/android/telecom/PhoneAccount.java
+++ b/telecomm/java/android/telecom/PhoneAccount.java
@@ -380,7 +380,45 @@
*/
public static final int CAPABILITY_CALL_COMPOSER = 0x8000;
- /* NEXT CAPABILITY: 0x10000 */
+ /**
+ * Flag indicating that this {@link PhoneAccount} provides SIM-based voice calls, potentially as
+ * an over-the-top solution such as wi-fi calling.
+ *
+ * <p>Similar to {@link #CAPABILITY_SUPPORTS_VIDEO_CALLING}, this capability indicates this
+ * {@link PhoneAccount} has the ability to make voice calls (but not necessarily at this time).
+ * Whether this {@link PhoneAccount} can make a voice call is ultimately controlled by {@link
+ * #CAPABILITY_VOICE_CALLING_AVAILABLE}, which indicates whether this {@link PhoneAccount} is
+ * currently capable of making a voice call. Consider a case where, for example, a {@link
+ * PhoneAccount} supports making voice calls (e.g. {@link
+ * #CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS}), but a current lack of network connectivity
+ * prevents voice calls from being made (e.g. {@link #CAPABILITY_VOICE_CALLING_AVAILABLE}).
+ *
+ * <p>In order to declare this capability, this {@link PhoneAccount} must also declare {@link
+ * #CAPABILITY_SIM_SUBSCRIPTION} or {@link #CAPABILITY_CONNECTION_MANAGER} and satisfy the
+ * associated requirements.
+ *
+ * @see #CAPABILITY_VOICE_CALLING_AVAILABLE
+ * @see #getCapabilities
+ */
+ public static final int CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS = 0x10000;
+
+ /**
+ * Flag indicating that this {@link PhoneAccount} is <em>currently</em> able to place SIM-based
+ * voice calls, similar to {@link #CAPABILITY_VIDEO_CALLING}.
+ *
+ * <p>See also {@link #CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS}, which indicates whether
+ * the {@code PhoneAccount} supports placing SIM-based voice calls or not.
+ *
+ * <p>In order to declare this capability, this {@link PhoneAccount} must also declare {@link
+ * #CAPABILITY_SIM_SUBSCRIPTION} or {@link #CAPABILITY_CONNECTION_MANAGER} and satisfy the
+ * associated requirements.
+ *
+ * @see #CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS
+ * @see #getCapabilities
+ */
+ public static final int CAPABILITY_VOICE_CALLING_AVAILABLE = 0x20000;
+
+ /* NEXT CAPABILITY: 0x40000 */
/**
* URI scheme for telephone number URIs.
@@ -1102,14 +1140,20 @@
sb.append("SimSub ");
}
if (hasCapabilities(CAPABILITY_RTT)) {
- sb.append("Rtt");
+ sb.append("Rtt ");
}
if (hasCapabilities(CAPABILITY_ADHOC_CONFERENCE_CALLING)) {
- sb.append("AdhocConf");
+ sb.append("AdhocConf ");
}
if (hasCapabilities(CAPABILITY_CALL_COMPOSER)) {
sb.append("CallComposer ");
}
+ if (hasCapabilities(CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS)) {
+ sb.append("SuppVoice ");
+ }
+ if (hasCapabilities(CAPABILITY_VOICE_CALLING_AVAILABLE)) {
+ sb.append("Voice ");
+ }
return sb.toString();
}
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index d5c846d..7ba4b11 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -5186,6 +5186,20 @@
public static final int E911_RTP_INACTIVITY_ON_CONNECTED = 4;
/**
+ * List of different RAT technologies on which IMS
+ * is supported.
+ *
+ * <p>Possible values are,
+ * {@link AccessNetworkConstants.AccessNetworkType#NGRAN}
+ * {@link AccessNetworkConstants.AccessNetworkType#EUTRAN}
+ * {@link AccessNetworkConstants.AccessNetworkType#IWLAN}
+ * {@link AccessNetworkConstants.AccessNetworkType#UTRAN}
+ * {@link AccessNetworkConstants.AccessNetworkType#GERAN}
+ */
+ public static final String KEY_SUPPORTED_RATS_INT_ARRAY =
+ KEY_PREFIX + "supported_rats_int_array";
+
+ /**
* A bundle which specifies the MMTEL capability and registration technology
* that requires provisioning. If a tuple is not present, the
* framework will not require that the tuple requires provisioning before
@@ -5375,6 +5389,13 @@
new int[] {
GEOLOCATION_PIDF_FOR_EMERGENCY_ON_WIFI
});
+ defaults.putIntArray(
+ KEY_SUPPORTED_RATS_INT_ARRAY,
+ new int[] {
+ AccessNetworkType.NGRAN,
+ AccessNetworkType.EUTRAN,
+ AccessNetworkType.IWLAN
+ });
defaults.putString(KEY_PHONE_CONTEXT_DOMAIN_NAME_STRING, "");
defaults.putString(KEY_IMS_USER_AGENT_STRING,
@@ -5499,6 +5520,44 @@
public static final String KEY_SESSION_REFRESHER_TYPE_INT =
KEY_PREFIX + "session_refresher_type_int";
+
+ /** @hide */
+ @IntDef({
+ SESSION_PRIVACY_TYPE_HEADER,
+ SESSION_PRIVACY_TYPE_NONE,
+ SESSION_PRIVACY_TYPE_ID
+ })
+
+ public @interface SessionPrivacyType {}
+
+ /**
+ * Session privacy type is HEADER as per RFC 3323 Section 4.2.
+ */
+ public static final int SESSION_PRIVACY_TYPE_HEADER = 0;
+
+ /**
+ * Session privacy type is NONE as per RFC 3323 Section 4.2.
+ */
+ public static final int SESSION_PRIVACY_TYPE_NONE = 1;
+
+ /**
+ * Session privacy type is ID as per RFC 3325 Section 9.3.
+ */
+ public static final int SESSION_PRIVACY_TYPE_ID = 2;
+
+ /**
+ * Specify the session privacy type.
+ *
+ * <p>Reference: RFC 3323 Section 4.2, RFC 3325 Section 9.3.
+ *
+ * <p>Possible values are,
+ * {@link #SESSION_PRIVACY_TYPE_HEADER},
+ * {@link #SESSION_PRIVACY_TYPE_NONE},
+ * {@link #SESSION_PRIVACY_TYPE_ID}
+ */
+ public static final String KEY_SESSION_PRIVACY_TYPE_INT =
+ KEY_PREFIX + "session_privacy_type_int";
+
/**
* Flag indicating whether PRACK must be enabled for all 18x messages.
*
@@ -6320,6 +6379,7 @@
defaults.putBoolean(KEY_VOICE_ON_DEFAULT_BEARER_SUPPORTED_BOOL, false);
defaults.putInt(KEY_SESSION_REFRESHER_TYPE_INT, SESSION_REFRESHER_TYPE_UNKNOWN);
+ defaults.putInt(KEY_SESSION_PRIVACY_TYPE_INT, SESSION_PRIVACY_TYPE_HEADER);
defaults.putInt(KEY_SESSION_REFRESH_METHOD_INT,
SESSION_REFRESH_METHOD_UPDATE_PREFERRED);
defaults.putInt(KEY_CONFERENCE_SUBSCRIBE_TYPE_INT,
@@ -6567,22 +6627,6 @@
KEY_PREFIX + "text_rr_bandwidth_bps_int";
/**
- * List of various reasons for RTT call to end due to
- * media inactivity.
- *
- * <p>Possible values are,
- * <UL>
- * <LI>{@link Ims#RTCP_INACTIVITY_ON_HOLD}</LI>
- * <LI>{@link Ims#RTCP_INACTIVITY_ON_CONNECTED}</LI>
- * <LI>{@link Ims#RTP_INACTIVITY_ON_CONNECTED}</LI>
- * <LI>{@link Ims#E911_RTCP_INACTIVITY_ON_CONNECTED}</LI>
- * <LI>{@link Ims#E911_RTP_INACTIVITY_ON_CONNECTED}</LI>
- * </UL>
- */
- public static final String KEY_TEXT_INACTIVITY_CALL_END_REASONS_INT_ARRAY =
- KEY_PREFIX + "text_inactivity_call_end_reasons_int_array";
-
- /**
* Specifies the Text Codec capability.
*
* <p>Possible keys in this bundle are,
@@ -6617,13 +6661,6 @@
defaults.putInt(KEY_TEXT_RS_BANDWIDTH_BPS_INT, 100);
defaults.putInt(KEY_TEXT_RR_BANDWIDTH_BPS_INT, 300);
- defaults.putIntArray(
- KEY_TEXT_INACTIVITY_CALL_END_REASONS_INT_ARRAY,
- new int[] {
- Ims.RTCP_INACTIVITY_ON_CONNECTED,
- Ims.RTP_INACTIVITY_ON_CONNECTED
- });
-
PersistableBundle text_codec_capability_payload_types = new PersistableBundle();
text_codec_capability_payload_types.putInt(
@@ -6707,6 +6744,13 @@
public static final String KEY_EMERGENCY_REGISTRATION_TIMER_MILLIS_INT =
KEY_PREFIX + "emergency_registration_timer_millis_int";
+ /**
+ * This setting will be specify the wait time for refreshing
+ * geolocation information before dialing emergency call.
+ */
+ public static final String KEY_REFRESH_GEOLOCATION_TIMEOUT_MILLIS_INT =
+ KEY_PREFIX + "refresh_geolocation_timeout_millis_int";
+
private static PersistableBundle getDefaults() {
PersistableBundle defaults = new PersistableBundle();
defaults.putBoolean(KEY_RETRY_EMERGENCY_ON_IMS_PDN_BOOL, false);
@@ -6721,6 +6765,7 @@
});
defaults.putInt(KEY_EMERGENCY_REGISTRATION_TIMER_MILLIS_INT, 20000);
+ defaults.putInt(KEY_REFRESH_GEOLOCATION_TIMEOUT_MILLIS_INT, 5000);
return defaults;
}
@@ -7035,6 +7080,17 @@
KEY_PREFIX + "ut_requires_ims_registration_bool";
/**
+ * Flag that controls whether XCAP over UT is supported
+ * when on roaming network.
+ *
+ * <p>If {@code true}: XCAP over UT is supported when on
+ * roaming network.
+ * {@code false} otherwise.
+ */
+ public static final String KEY_UT_SUPPORTED_WHEN_ROAMING_BOOL =
+ KEY_PREFIX + "ut_supported_when_roaming_bool";
+
+ /**
* Flag that controls whether Circuit Switched Fallback (CSFB)
* option is available when XCAP over UT fails.
*
@@ -7385,6 +7441,7 @@
defaults.putBoolean(KEY_USE_CSFB_ON_XCAP_OVER_UT_FAILURE_BOOL, true);
defaults.putBoolean(KEY_UT_SUPPORTED_WHEN_PS_DATA_OFF_BOOL, true);
defaults.putBoolean(KEY_NETWORK_INITIATED_USSD_OVER_IMS_SUPPORTED_BOOL, true);
+ defaults.putBoolean(KEY_UT_SUPPORTED_WHEN_ROAMING_BOOL, true);
defaults.putInt(KEY_UT_IPTYPE_HOME_INT, ApnSetting.PROTOCOL_IPV4V6);
defaults.putInt(KEY_UT_IPTYPE_ROAMING_INT, ApnSetting.PROTOCOL_IPV4V6);
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 536517c..baccb26 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -150,7 +150,6 @@
import java.util.stream.Collectors;
import java.util.stream.IntStream;
-
/**
* Provides access to information about the telephony services on
* the device. Applications can use the methods in this class to
@@ -11966,7 +11965,11 @@
private final int mErrorCode;
- /** @hide */
+ /**
+ * An exception with ModemActivityInfo specific error codes.
+ *
+ * @param errorCode a ModemActivityInfoError code.
+ */
public ModemActivityInfoException(@ModemActivityInfoError int errorCode) {
mErrorCode = errorCode;
}
@@ -16805,4 +16808,37 @@
}
mTelephonyRegistryMgr.removeCarrierPrivilegesListener(listener);
}
+
+ /**
+ * Sets a voice service state override from telecom based on the current {@link PhoneAccount}s
+ * registered. See {@link PhoneAccount#CAPABILITY_VOICE_CALLING_AVAILABLE}.
+ *
+ * <p>Currently, this API is only called to indicate over-the-top voice calling capability of
+ * the SIM call manager, which will get merged into {@link ServiceState#getState} and propagated
+ * to interested callers via {@link #getServiceState} and {@link
+ * TelephonyCallback.ServiceStateListener}.
+ *
+ * <p>If callers are truly interested in the actual device <-> tower connection status and not
+ * an overall "device can make voice calls" boolean, they can use {@link
+ * ServiceState#getNetworkRegistrationInfo} to check CS registration state.
+ *
+ * <p>TODO(b/215240050) In the future, this API will be removed and replaced with a new superset
+ * API to disentangle the "true" {@link ServiceState} meaning of "this is the connection status
+ * to the tower" from IMS registration state and over-the-top voice calling capabilities.
+ *
+ * @hide
+ */
+ @TestApi
+ @RequiresPermission(Manifest.permission.BIND_TELECOM_CONNECTION_SERVICE)
+ public void setVoiceServiceStateOverride(boolean hasService) {
+ try {
+ ITelephony telephony = getITelephony();
+ if (telephony == null) {
+ throw new IllegalStateException("Telephony service is null");
+ }
+ telephony.setVoiceServiceStateOverride(getSubId(), hasService, getOpPackageName());
+ } catch (RemoteException ex) {
+ ex.rethrowAsRuntimeException();
+ }
+ }
}
diff --git a/telephony/java/com/android/internal/telephony/DctConstants.java b/telephony/java/com/android/internal/telephony/DctConstants.java
index 409c838..2470887 100644
--- a/telephony/java/com/android/internal/telephony/DctConstants.java
+++ b/telephony/java/com/android/internal/telephony/DctConstants.java
@@ -114,6 +114,7 @@
public static final int EVENT_CARRIER_CONFIG_CHANGED = BASE + 54;
public static final int EVENT_SIM_STATE_UPDATED = BASE + 55;
public static final int EVENT_APN_UNTHROTTLED = BASE + 56;
+ public static final int EVENT_TRAFFIC_DESCRIPTORS_UPDATED = BASE + 57;
/***** Constants *****/
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index bce7a24..dc96b35 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -2543,4 +2543,10 @@
* registration technology specified, false if it is not required.
*/
boolean isRcsProvisioningRequiredForCapability(int subId, int capability, int tech);
+
+ /**
+ * Sets a voice service state from telecom based on the current PhoneAccounts registered. See
+ * PhoneAccount#CAPABILITY_VOICE_CALLING_AVAILABLE.
+ */
+ void setVoiceServiceStateOverride(int subId, boolean hasService, String callingPackage);
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppBackButtonTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppBackButtonTest.kt
index 8de38f6..294a220 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppBackButtonTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppBackButtonTest.kt
@@ -27,6 +27,7 @@
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume.assumeFalse
+import org.junit.Assume.assumeTrue
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -91,6 +92,13 @@
super.statusBarLayerRotatesScales()
}
+ @FlakyTest(bugId = 214452854)
+ @Test
+ fun statusBarLayerRotatesScales_shellTransit() {
+ assumeTrue(isShellTransitionsEnabled)
+ super.statusBarLayerRotatesScales()
+ }
+
/** {@inheritDoc} */
@Presubmit
@Test
@@ -100,6 +108,13 @@
super.launcherLayerReplacesApp()
}
+ @FlakyTest(bugId = 214452854)
+ @Test
+ fun launcherLayerReplacesApp_shellTransit() {
+ assumeTrue(isShellTransitionsEnabled)
+ super.launcherLayerReplacesApp()
+ }
+
/** {@inheritDoc} */
@Presubmit
@Test
@@ -109,6 +124,13 @@
super.entireScreenCovered()
}
+ @FlakyTest(bugId = 214452854)
+ @Test
+ fun entireScreenCovered_shellTransit() {
+ assumeTrue(isShellTransitionsEnabled)
+ super.entireScreenCovered()
+ }
+
companion object {
/**
* Creates the test configurations.
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppHomeButtonTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppHomeButtonTest.kt
index d960e94..519bd56 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppHomeButtonTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/close/CloseAppHomeButtonTest.kt
@@ -26,6 +26,7 @@
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
import org.junit.Assume.assumeFalse
+import org.junit.Assume.assumeTrue
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -90,6 +91,13 @@
super.statusBarLayerRotatesScales()
}
+ @FlakyTest(bugId = 214452854)
+ @Test
+ fun statusBarLayerRotatesScales_shellTransit() {
+ assumeTrue(isShellTransitionsEnabled)
+ super.statusBarLayerRotatesScales()
+ }
+
/** {@inheritDoc} */
@Presubmit
@Test
@@ -99,6 +107,13 @@
super.launcherLayerReplacesApp()
}
+ @FlakyTest(bugId = 214452854)
+ @Test
+ fun launcherLayerReplacesApp_shellTransit() {
+ assumeTrue(isShellTransitionsEnabled)
+ super.launcherLayerReplacesApp()
+ }
+
/** {@inheritDoc} */
@Presubmit
@Test
@@ -108,6 +123,13 @@
super.entireScreenCovered()
}
+ @FlakyTest(bugId = 214452854)
+ @Test
+ fun entireScreenCovered_shellTransit() {
+ assumeTrue(isShellTransitionsEnabled)
+ super.entireScreenCovered()
+ }
+
/** {@inheritDoc} */
@Presubmit
@Test
@@ -117,6 +139,13 @@
super.visibleLayersShownMoreThanOneConsecutiveEntry()
}
+ @FlakyTest(bugId = 214452854)
+ @Test
+ fun visibleLayersShownMoreThanOneConsecutiveEntry_shellTransit() {
+ assumeTrue(isShellTransitionsEnabled)
+ super.visibleLayersShownMoreThanOneConsecutiveEntry()
+ }
+
companion object {
/**
* Creates the test configurations.
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest.kt
index 01fce05..42941c2 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTest.kt
@@ -40,6 +40,7 @@
import com.android.server.wm.traces.common.FlickerComponentName
import com.android.server.wm.traces.common.Rect
import org.junit.Assume
+import org.junit.Before
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -62,7 +63,7 @@
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@Group1
-class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestParameter) {
+open class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestParameter) {
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
private val testApp1 = SimpleAppHelper(instrumentation)
@@ -85,9 +86,9 @@
?: error("Display not found")
// Swipe right from bottom to quick switch back
- // NOTE: We don't perform an edge-to-edge swipe but instead only swipe in the middle
- // as to not accidentally trigger a swipe back or forward action which would result
- // in the same behavior but not testing quick swap.
+ // NOTE: We don't perform an edge-to-edge swipe but instead only swipe in the
+ // middle as to not accidentally trigger a swipe back or forward action which
+ // would result in the same behavior but not testing quick swap.
device.swipe(
startDisplayBounds.right / 3,
startDisplayBounds.bottom,
@@ -126,15 +127,19 @@
}
}
+ @Before
+ open fun setup() {
+ // This test doesn't work in shell transitions because of b/213867585
+ Assume.assumeFalse(isShellTransitionsEnabled)
+ }
+
/**
* Checks that the transition starts with [testApp1]'s windows filling/covering exactly the
* entirety of the display.
*/
@Presubmit
@Test
- fun startsWithApp1WindowsCoverFullScreen() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun startsWithApp1WindowsCoverFullScreen() {
testSpec.assertWmStart {
this.frameRegion(testApp1.component, FlickerComponentName.LETTERBOX)
.coversExactly(startDisplayBounds)
@@ -147,9 +152,7 @@
*/
@Presubmit
@Test
- fun startsWithApp1LayersCoverFullScreen() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun startsWithApp1LayersCoverFullScreen() {
testSpec.assertLayersStart {
this.visibleRegion(testApp1.component).coversExactly(startDisplayBounds)
}
@@ -160,23 +163,19 @@
*/
@Presubmit
@Test
- fun startsWithApp1WindowBeingOnTop() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun startsWithApp1WindowBeingOnTop() {
testSpec.assertWmStart {
this.isAppWindowOnTop(testApp1.component)
}
}
/**
- * Checks that [testApp2] windows fill the entire screen (i.e. is "fullscreen") at the end of the
- * transition once we have fully quick switched from [testApp1] back to the [testApp2].
+ * Checks that [testApp2] windows fill the entire screen (i.e. is "fullscreen") at the end of
+ * the transition once we have fully quick switched from [testApp1] back to the [testApp2].
*/
@Presubmit
@Test
- fun endsWithApp2WindowsCoveringFullScreen() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun endsWithApp2WindowsCoveringFullScreen() {
testSpec.assertWmEnd {
this.frameRegion(testApp2.component).coversExactly(startDisplayBounds)
}
@@ -188,9 +187,7 @@
*/
@Presubmit
@Test
- fun endsWithApp2LayersCoveringFullScreen() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun endsWithApp2LayersCoveringFullScreen() {
testSpec.assertLayersEnd {
this.visibleRegion(testApp2.component, FlickerComponentName.LETTERBOX)
.coversExactly(startDisplayBounds)
@@ -198,14 +195,12 @@
}
/**
- * Checks that [testApp2] is the top window at the end of the transition once we have fully quick
- * switched from [testApp1] back to the [testApp2].
+ * Checks that [testApp2] is the top window at the end of the transition once we have fully
+ * quick switched from [testApp1] back to the [testApp2].
*/
@Presubmit
@Test
- fun endsWithApp2BeingOnTop() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun endsWithApp2BeingOnTop() {
testSpec.assertWmEnd {
this.isAppWindowOnTop(testApp2.component)
}
@@ -217,9 +212,7 @@
*/
@Presubmit
@Test
- fun app2WindowBecomesAndStaysVisible() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun app2WindowBecomesAndStaysVisible() {
testSpec.assertWm {
this.isAppWindowInvisible(testApp2.component)
.then()
@@ -235,9 +228,7 @@
*/
@Presubmit
@Test
- fun app2LayerBecomesAndStaysVisible() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun app2LayerBecomesAndStaysVisible() {
testSpec.assertLayers {
this.isInvisible(testApp2.component)
.then()
@@ -251,9 +242,7 @@
*/
@Presubmit
@Test
- fun app1WindowBecomesAndStaysInvisible() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun app1WindowBecomesAndStaysInvisible() {
testSpec.assertWm {
this.isAppWindowVisible(testApp1.component)
.then()
@@ -267,9 +256,7 @@
*/
@Presubmit
@Test
- fun app1LayerBecomesAndStaysInvisible() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun app1LayerBecomesAndStaysInvisible() {
testSpec.assertLayers {
this.isVisible(testApp1.component)
.then()
@@ -284,9 +271,7 @@
*/
@Presubmit
@Test
- fun app2WindowIsVisibleOnceApp1WindowIsInvisible() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun app2WindowIsVisibleOnceApp1WindowIsInvisible() {
testSpec.assertWm {
this.isAppWindowVisible(testApp1.component)
.then()
@@ -305,9 +290,7 @@
*/
@Presubmit
@Test
- fun app2LayerIsVisibleOnceApp1LayerIsInvisible() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun app2LayerIsVisibleOnceApp1LayerIsInvisible() {
testSpec.assertLayers {
this.isVisible(testApp1.component)
.then()
@@ -324,9 +307,7 @@
*/
@Presubmit
@Test
- fun navBarWindowIsAlwaysVisible() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun navBarWindowIsAlwaysVisible() {
testSpec.navBarWindowIsVisible()
}
@@ -335,9 +316,7 @@
*/
@Presubmit
@Test
- fun navBarLayerAlwaysIsVisible() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun navBarLayerAlwaysIsVisible() {
testSpec.navBarLayerIsVisible()
}
@@ -348,9 +327,7 @@
*/
@Presubmit
@Test
- fun navbarIsAlwaysInRightPosition() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun navbarIsAlwaysInRightPosition() {
testSpec.navBarLayerRotatesAndScales()
}
@@ -359,9 +336,7 @@
*/
@Presubmit
@Test
- fun statusBarWindowIsAlwaysVisible() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun statusBarWindowIsAlwaysVisible() {
testSpec.statusBarWindowIsVisible()
}
@@ -370,9 +345,7 @@
*/
@Presubmit
@Test
- fun statusBarLayerIsAlwaysVisible() {
- // This test doesn't work in shell transitions because of b/209936664
- Assume.assumeFalse(isShellTransitionsEnabled)
+ open fun statusBarLayerIsAlwaysVisible() {
testSpec.statusBarLayerIsVisible()
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTestShellTransit.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTestShellTransit.kt
new file mode 100644
index 0000000..49b9733
--- /dev/null
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/quickswitch/QuickSwitchBetweenTwoAppsForwardTestShellTransit.kt
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.wm.flicker.quickswitch
+
+import android.platform.test.annotations.RequiresDevice
+import androidx.test.filters.FlakyTest
+import com.android.server.wm.flicker.FlickerParametersRunnerFactory
+import com.android.server.wm.flicker.FlickerTestParameter
+import com.android.server.wm.flicker.annotation.Group1
+import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled
+import org.junit.Assume
+import org.junit.Before
+import org.junit.FixMethodOrder
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.MethodSorters
+import org.junit.runners.Parameterized
+
+/**
+ * Test quick switching back to previous app from last opened app
+ *
+ * To run this test: `atest FlickerTests:QuickSwitchBetweenTwoAppsForwardTestShellTransit`
+ *
+ * Actions:
+ * Launch an app [testApp1]
+ * Launch another app [testApp2]
+ * Swipe right from the bottom of the screen to quick switch back to the first app [testApp1]
+ * Swipe left from the bottom of the screen to quick switch forward to the second app [testApp2]
+ */
+@RequiresDevice
+@RunWith(Parameterized::class)
+@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+@Group1
+class QuickSwitchBetweenTwoAppsForwardTestShellTransit(private val testSpec: FlickerTestParameter)
+ : QuickSwitchBetweenTwoAppsForwardTest(testSpec) {
+
+ @Before
+ override fun setup() {
+ // This test class should be removed after b/213867585 is fixed.
+ Assume.assumeTrue(isShellTransitionsEnabled)
+ }
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun startsWithApp1WindowsCoverFullScreen() =
+ super.startsWithApp1WindowsCoverFullScreen()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun startsWithApp1LayersCoverFullScreen() = super.startsWithApp1LayersCoverFullScreen()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun startsWithApp1WindowBeingOnTop() = super.startsWithApp1WindowBeingOnTop()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun endsWithApp2WindowsCoveringFullScreen() =
+ super.endsWithApp2WindowsCoveringFullScreen()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun endsWithApp2LayersCoveringFullScreen() =
+ super.endsWithApp2LayersCoveringFullScreen()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun endsWithApp2BeingOnTop() = super.endsWithApp2BeingOnTop()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun app2WindowBecomesAndStaysVisible() = super.app2WindowBecomesAndStaysVisible()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun app2LayerBecomesAndStaysVisible() = super.app2LayerBecomesAndStaysVisible()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun app1WindowBecomesAndStaysInvisible() = super.app1WindowBecomesAndStaysInvisible()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun app1LayerBecomesAndStaysInvisible() = super.app1LayerBecomesAndStaysInvisible()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun app2WindowIsVisibleOnceApp1WindowIsInvisible() =
+ super.app2WindowIsVisibleOnceApp1WindowIsInvisible()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun app2LayerIsVisibleOnceApp1LayerIsInvisible() =
+ super.app2LayerIsVisibleOnceApp1LayerIsInvisible()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun navBarWindowIsAlwaysVisible() = super.navBarWindowIsAlwaysVisible()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun navBarLayerAlwaysIsVisible() = super.navBarLayerAlwaysIsVisible()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun navbarIsAlwaysInRightPosition() = super.navbarIsAlwaysInRightPosition()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun statusBarWindowIsAlwaysVisible() = super.statusBarWindowIsAlwaysVisible()
+
+ /** {@inheritDoc} */
+ @FlakyTest(bugId = 214452854)
+ @Test
+ override fun statusBarLayerIsAlwaysVisible() = super.statusBarLayerIsAlwaysVisible()
+}
\ No newline at end of file
diff --git a/wifi/java/src/android/net/wifi/nl80211/DeviceWiphyCapabilities.java b/wifi/java/src/android/net/wifi/nl80211/DeviceWiphyCapabilities.java
index bb0cc97..21700d5 100644
--- a/wifi/java/src/android/net/wifi/nl80211/DeviceWiphyCapabilities.java
+++ b/wifi/java/src/android/net/wifi/nl80211/DeviceWiphyCapabilities.java
@@ -42,8 +42,10 @@
private boolean m80211nSupported;
private boolean m80211acSupported;
private boolean m80211axSupported;
+ private boolean m80211beSupported;
private boolean mChannelWidth160MhzSupported;
private boolean mChannelWidth80p80MhzSupported;
+ private boolean mChannelWidth320MhzSupported;
private int mMaxNumberTxSpatialStreams;
private int mMaxNumberRxSpatialStreams;
@@ -53,8 +55,10 @@
m80211nSupported = false;
m80211acSupported = false;
m80211axSupported = false;
+ m80211beSupported = false;
mChannelWidth160MhzSupported = false;
mChannelWidth80p80MhzSupported = false;
+ mChannelWidth320MhzSupported = false;
mMaxNumberTxSpatialStreams = 1;
mMaxNumberRxSpatialStreams = 1;
}
@@ -76,6 +80,8 @@
return m80211acSupported;
case ScanResult.WIFI_STANDARD_11AX:
return m80211axSupported;
+ case ScanResult.WIFI_STANDARD_11BE:
+ return m80211beSupported;
default:
Log.e(TAG, "isWifiStandardSupported called with invalid standard: " + standard);
return false;
@@ -100,6 +106,9 @@
case ScanResult.WIFI_STANDARD_11AX:
m80211axSupported = support;
break;
+ case ScanResult.WIFI_STANDARD_11BE:
+ m80211beSupported = support;
+ break;
default:
Log.e(TAG, "setWifiStandardSupport called with invalid standard: " + standard);
}
@@ -117,13 +126,16 @@
case ScanResult.CHANNEL_WIDTH_20MHZ:
return true;
case ScanResult.CHANNEL_WIDTH_40MHZ:
- return (m80211nSupported || m80211acSupported || m80211axSupported);
+ return (m80211nSupported || m80211acSupported || m80211axSupported
+ || m80211beSupported);
case ScanResult.CHANNEL_WIDTH_80MHZ:
- return (m80211acSupported || m80211axSupported);
+ return (m80211acSupported || m80211axSupported || m80211beSupported);
case ScanResult.CHANNEL_WIDTH_160MHZ:
return mChannelWidth160MhzSupported;
case ScanResult.CHANNEL_WIDTH_80MHZ_PLUS_MHZ:
return mChannelWidth80p80MhzSupported;
+ case ScanResult.CHANNEL_WIDTH_320MHZ:
+ return mChannelWidth320MhzSupported;
default:
Log.e(TAG, "isChannelWidthSupported called with invalid channel width: " + chWidth);
}
@@ -133,8 +145,9 @@
/**
* Set support for channel bandwidth
*
- * @param chWidth valid values are {@link ScanResult#CHANNEL_WIDTH_160MHZ} and
- * {@link ScanResult#CHANNEL_WIDTH_80MHZ_PLUS_MHZ}
+ * @param chWidth valid values are {@link ScanResult#CHANNEL_WIDTH_160MHZ},
+ * {@link ScanResult#CHANNEL_WIDTH_80MHZ_PLUS_MHZ} and
+ * {@link ScanResult#CHANNEL_WIDTH_320MHZ}
* @param support {@code true} if supported, {@code false} otherwise.
*
* @hide
@@ -147,6 +160,9 @@
case ScanResult.CHANNEL_WIDTH_80MHZ_PLUS_MHZ:
mChannelWidth80p80MhzSupported = support;
break;
+ case ScanResult.CHANNEL_WIDTH_320MHZ:
+ mChannelWidth320MhzSupported = support;
+ break;
default:
Log.e(TAG, "setChannelWidthSupported called with Invalid channel width: "
+ chWidth);
@@ -205,8 +221,10 @@
return m80211nSupported == capa.m80211nSupported
&& m80211acSupported == capa.m80211acSupported
&& m80211axSupported == capa.m80211axSupported
+ && m80211beSupported == capa.m80211beSupported
&& mChannelWidth160MhzSupported == capa.mChannelWidth160MhzSupported
&& mChannelWidth80p80MhzSupported == capa.mChannelWidth80p80MhzSupported
+ && mChannelWidth320MhzSupported == capa.mChannelWidth320MhzSupported
&& mMaxNumberTxSpatialStreams == capa.mMaxNumberTxSpatialStreams
&& mMaxNumberRxSpatialStreams == capa.mMaxNumberRxSpatialStreams;
}
@@ -215,8 +233,9 @@
@Override
public int hashCode() {
return Objects.hash(m80211nSupported, m80211acSupported, m80211axSupported,
- mChannelWidth160MhzSupported, mChannelWidth80p80MhzSupported,
- mMaxNumberTxSpatialStreams, mMaxNumberRxSpatialStreams);
+ m80211beSupported, mChannelWidth160MhzSupported, mChannelWidth80p80MhzSupported,
+ mChannelWidth320MhzSupported, mMaxNumberTxSpatialStreams,
+ mMaxNumberRxSpatialStreams);
}
/** implement Parcelable interface */
@@ -234,8 +253,10 @@
out.writeBoolean(m80211nSupported);
out.writeBoolean(m80211acSupported);
out.writeBoolean(m80211axSupported);
+ out.writeBoolean(m80211beSupported);
out.writeBoolean(mChannelWidth160MhzSupported);
out.writeBoolean(mChannelWidth80p80MhzSupported);
+ out.writeBoolean(mChannelWidth320MhzSupported);
out.writeInt(mMaxNumberTxSpatialStreams);
out.writeInt(mMaxNumberRxSpatialStreams);
}
@@ -246,10 +267,13 @@
sb.append("m80211nSupported:").append(m80211nSupported ? "Yes" : "No");
sb.append("m80211acSupported:").append(m80211acSupported ? "Yes" : "No");
sb.append("m80211axSupported:").append(m80211axSupported ? "Yes" : "No");
+ sb.append("m80211beSupported:").append(m80211beSupported ? "Yes" : "No");
sb.append("mChannelWidth160MhzSupported: ")
.append(mChannelWidth160MhzSupported ? "Yes" : "No");
sb.append("mChannelWidth80p80MhzSupported: ")
.append(mChannelWidth80p80MhzSupported ? "Yes" : "No");
+ sb.append("mChannelWidth320MhzSupported: ")
+ .append(mChannelWidth320MhzSupported ? "Yes" : "No");
sb.append("mMaxNumberTxSpatialStreams: ").append(mMaxNumberTxSpatialStreams);
sb.append("mMaxNumberRxSpatialStreams: ").append(mMaxNumberRxSpatialStreams);
@@ -268,8 +292,10 @@
capabilities.m80211nSupported = in.readBoolean();
capabilities.m80211acSupported = in.readBoolean();
capabilities.m80211axSupported = in.readBoolean();
+ capabilities.m80211beSupported = in.readBoolean();
capabilities.mChannelWidth160MhzSupported = in.readBoolean();
capabilities.mChannelWidth80p80MhzSupported = in.readBoolean();
+ capabilities.mChannelWidth320MhzSupported = in.readBoolean();
capabilities.mMaxNumberTxSpatialStreams = in.readInt();
capabilities.mMaxNumberRxSpatialStreams = in.readInt();
return capabilities;
diff --git a/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java b/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java
index 459696e..d3eb8e0 100644
--- a/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java
+++ b/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java
@@ -493,6 +493,8 @@
return SoftApInfo.CHANNEL_WIDTH_80MHZ_PLUS_MHZ;
case IApInterfaceEventCallback.BANDWIDTH_160:
return SoftApInfo.CHANNEL_WIDTH_160MHZ;
+ case IApInterfaceEventCallback.BANDWIDTH_320:
+ return SoftApInfo.CHANNEL_WIDTH_320MHZ;
default:
return SoftApInfo.CHANNEL_WIDTH_INVALID;
}